Skip to content

Commit

Permalink
Fixed problem with setting nation and age. Fixed tests. Updated GHA w…
Browse files Browse the repository at this point in the history
…orkflow. Misc cleanup.
  • Loading branch information
mattraykowski committed Dec 29, 2023
1 parent b0d697c commit abdf3df
Show file tree
Hide file tree
Showing 8 changed files with 79 additions and 15 deletions.
35 changes: 31 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,33 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout repo
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v3

- name: Install dependencies
uses: borales/actions-yarn@v4
with:
cmd: install

- name: Run Tests
run: yarn test:ci

- name: Export Tests
uses: dorny/test-reporter@v1
if: success() || failure()
with:
name: JEST Tests
path: ./reports/*.xml
reporter: jest-junit
list-tests: 'failed'

- name: Build System
uses: borales/actions-yarn@v4
with:
cmd: build

# get part of the tag after the `v`
- name: Extract tag version number
Expand All @@ -20,15 +46,16 @@ jobs:
id: sub_manifest_link_version
uses: microsoft/variable-substitution@v1
with:
files: 'system.json'
files: 'dist/system.json'
env:
version: ${{steps.get_version.outputs.version-without-v}}
url: https://github.com/${{github.repository}}
manifest: https://github.com/${{github.repository}}/releases/latest/download/system.json
download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/system.zip

- run: cp LICENSE dist/
# Create a zip file with all files required by the system to add to the release
- run: zip -r ./system.zip system.json template.json LICENSE css/ module/ templates/ lang/ imgs/ icons/
- run: zip -r ./system.zip dist/*

# Create a release for this specific version
- name: Update Release with Files
Expand All @@ -37,7 +64,7 @@ jobs:
with:
allowUpdates: true # Set this to false if you want to prevent updating existing releases
name: ${{ github.event.release.name }}
draft: ${{ github.event.release.unpublished }}
draft: ${{ github.event.release.draft }}
prerelease: ${{ github.event.release.prerelease }}
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './system.json, ./system.zip'
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# IDE
.idea/
.vs/
.vscode/

# Node Modules
node_modules/
npm-debug.log
coverage
dist/
reports/
# The user's actual Foundry configuration.
foundryconfig.json
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"prepare": "husky install",
"format": "prettier --write \"**\"",
"test": "jest",
"test:ci": "cross-env CI=true jest --reporters=jest-junit",
"test:watch": "jest --watch",
"link-package": "node ./tools/link-package.mjs"
},
Expand All @@ -17,8 +18,7 @@
"author": "Psychoph03",
"license": "MIT",
"private": true,
"dependencies": {
},
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.17.12",
"@babel/eslint-parser": "^7.15.7",
Expand All @@ -30,16 +30,22 @@
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.34.0",
"babel-plugin-transform-runtime": "^6.23.0",
"cross-env": "^7.0.3",
"dart-sass": "^1.25.0",
"eslint": "^8.41.0",
"eslint-plugin-jsdoc": "^32.3.0",
"fs-extra": "^11.1.1",
"husky": "^7.0.0",
"jest": "^28.1.0",
"jest-junit": "^16.0.0",
"prettier": "^2.4.1",
"pretty-quick": "^3.1.2",
"sass": "^1.69.5",
"vite": "^4.5.0",
"yargs": "^17.7.2"
},
"jest-junit": {
"outputDirectory": "reports",
"outputName": "jest-junit.xml"
}
}
2 changes: 1 addition & 1 deletion public/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "svnsea2e",
"title": "7th Sea Second Edition (Unofficial)",
"description": "The 7th Sea Second Edition (Unofficial) system for FoundryVTT!",
"version": "THIS IS GENERATED",
"version": "3.3.1",
"compatibility": {
"minimum": "10",
"verified": "11.299"
Expand Down
4 changes: 2 additions & 2 deletions public/templates/actors/parts/actor-concept.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="nation grid grid-2col">
<div class="form-group flex-group">
<label for="data.nation">{{localize "SVNSEA2E.Nation"}}</label>
<select class="nation" name="data.nation" id="data.nation">
<select class="nation" name="system.nation" id="system.nation">
{{#select nation}}
<option value="none"></option>
{{#each config.nations as |label nation|}}
Expand All @@ -13,7 +13,7 @@
</div>
<div class="form-group flex-group twodigit">
<label for="data.age">{{localize "SVNSEA2E.Age"}}</label>
<input type="text" name="data.age" value="{{age}}" id="data.age" />
<input type="text" name="system.age" value="{{age}}" id="system.age" />
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/roll/roll.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { roll } from './roll';
import { SVNSEA2E } from '../config';

const actor = { update: jest.fn(), data: { data: { heropts: 2 } } };
const actor = { update: jest.fn(), system: { heropts: 2 } };

let standardRollConfiguration = {
rolldata: {
Expand Down
4 changes: 0 additions & 4 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ const config = {
},
}
},
// optimizeDeps: {
// exclude: ['machine-mind'], // machine-mind triggers https://github.com/evanw/esbuild/issues/1433
// include: ['lancer-data', 'jszip', 'axios'], // machine-mind's cjs dependencies
// },
build: {
outDir: path.resolve(__dirname, 'dist'),
emptyOutDir: true,
Expand Down
34 changes: 33 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2369,7 +2369,14 @@ core-js@^3.26.0:
resolved "https://registry.npmjs.org/core-js/-/core-js-3.30.2.tgz"
integrity sha512-uBJiDmwqsbJCWHAwjrx3cvjbMXP7xD72Dmsn5LOJpiRmE3WbBbN5rCqQ2Qh6Ek6/eOrjlWngEynBWo4VxerQhg==

cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
cross-env@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.3.tgz#865264b29677dc015ba8418918965dd232fc54cf"
integrity sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==
dependencies:
cross-spawn "^7.0.1"

cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
version "7.0.3"
resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz"
integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==
Expand Down Expand Up @@ -3571,6 +3578,16 @@ jest-haste-map@^28.1.3:
optionalDependencies:
fsevents "^2.3.2"

jest-junit@^16.0.0:
version "16.0.0"
resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-16.0.0.tgz#d838e8c561cf9fdd7eb54f63020777eee4136785"
integrity sha512-A94mmw6NfJab4Fg/BlvVOUXzXgF0XIH6EmTgJ5NDPp4xoKq0Kr7sErb+4Xs9nZvu58pJojz5RFGpqnZYJTrRfQ==
dependencies:
mkdirp "^1.0.4"
strip-ansi "^6.0.1"
uuid "^8.3.2"
xml "^1.0.1"

jest-leak-detector@^28.1.3:
version "28.1.3"
resolved "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-28.1.3.tgz"
Expand Down Expand Up @@ -3996,6 +4013,11 @@ minimist@^1.2.5:
resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz"
integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==

mkdirp@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==

mri@^1.1.5:
version "1.2.0"
resolved "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz"
Expand Down Expand Up @@ -4967,6 +4989,11 @@ url@^0.11.0:
punycode "1.3.2"
querystring "0.2.0"

uuid@^8.3.2:
version "8.3.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==

v8-to-istanbul@^9.0.1:
version "9.1.0"
resolved "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz"
Expand Down Expand Up @@ -5068,6 +5095,11 @@ ws@~8.2.3:
resolved "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz"
integrity sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==

xml@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
integrity sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==

xmlhttprequest-ssl@~2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz"
Expand Down

0 comments on commit abdf3df

Please sign in to comment.