Skip to content

Commit

Permalink
Merge pull request #12 from Muttley/develop
Browse files Browse the repository at this point in the history
Release 11.1.2
  • Loading branch information
Muttley authored Nov 24, 2023
2 parents 036e5a4 + 755ed61 commit 03d887a
Show file tree
Hide file tree
Showing 94 changed files with 4,930 additions and 4,597 deletions.
163 changes: 163 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
{
"env": {
"browser": true,
"es2022": true,
"node": true,
"jquery": true
},
"ignorePatterns": ["**/*compiled.mjs"],
"parserOptions": {
"requireConfigFile": false,
"sourceType": "module",
"ecmaVersion": 2022
},
"rules": {
"array-bracket-spacing": ["warn", "never"],
"array-callback-return": "warn",
"arrow-spacing": "warn",
"brace-style": ["error", "stroustrup"],
"comma-dangle": ["warn", {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "never"
}],
"comma-style": "warn",
"computed-property-spacing": "warn",
"constructor-super": "error",
"default-param-last": "warn",
"disallowTabs": 0,
"dot-location": ["warn", "property"],
"eol-last": ["error", "always"],
"eqeqeq": ["warn", "smart"],
"func-call-spacing": "warn",
"func-names": ["warn", "never"],
"getter-return": "warn",
"linebreak-style": ["warn", "unix"],
"lines-between-class-members": "warn",
"new-parens": ["warn", "always"],
"no-alert": "warn",
"no-array-constructor": "warn",
"no-class-assign": "warn",
"no-compare-neg-zero": "warn",
"no-cond-assign": "warn",
"no-const-assign": "error",
"no-constant-condition": "warn",
"no-constructor-return": "warn",
"no-delete-var": "warn",
"no-dupe-args": "warn",
"no-dupe-class-members": "warn",
"no-dupe-keys": "warn",
"no-duplicate-case": "warn",
"no-duplicate-imports": ["warn", {"includeExports": true}],
"no-empty": ["warn", {"allowEmptyCatch": true}],
"no-empty-character-class": "warn",
"no-empty-pattern": "warn",
"no-func-assign": "warn",
"no-global-assign": "warn",
"no-implicit-coercion": ["warn", {"allow": ["!!"]}],
"no-implied-eval": "warn",
"no-import-assign": "warn",
"no-invalid-regexp": "warn",
"no-irregular-whitespace": "warn",
"no-iterator": "warn",
"no-lone-blocks": "warn",
"no-lonely-if": "warn",
"no-loop-func": "warn",
"no-misleading-character-class": "warn",
"no-mixed-operators": "warn",
"no-multi-str": "warn",
"no-multiple-empty-lines": "warn",
"no-new-func": "warn",
"no-new-object": "warn",
"no-new-symbol": "warn",
"no-new-wrappers": "warn",
"no-nonoctal-decimal-escape": "warn",
"no-obj-calls": "warn",
"no-octal": "warn",
"no-octal-escape": "warn",
"no-promise-executor-return": "warn",
"no-proto": "warn",
"no-regex-spaces": "warn",
"no-script-url": "warn",
"no-self-assign": "warn",
"no-self-compare": "warn",
"no-setter-return": "warn",
"no-sequences": "warn",
"no-template-curly-in-string": "warn",
"no-this-before-super": "error",
"no-unexpected-multiline": "warn",
"no-unmodified-loop-condition": "warn",
"no-unneeded-ternary": "off",
"no-unreachable": "warn",
"no-unreachable-loop": "warn",
"no-unsafe-negation": ["warn", {"enforceForOrderingRelations": true}],
"no-unsafe-optional-chaining": ["warn", {"disallowArithmeticOperators": true}],
"no-unused-expressions": "warn",
"no-useless-backreference": "warn",
"no-useless-call": "warn",
"no-useless-catch": "warn",
"no-useless-computed-key": ["warn", {"enforceForClassMembers": true}],
"no-useless-concat": "warn",
"no-useless-constructor": "warn",
"no-useless-rename": "warn",
"no-useless-return": "warn",
"no-var": "warn",
"no-void": "warn",
"no-whitespace-before-property": "warn",
"prefer-numeric-literals": "warn",
"prefer-object-spread": "warn",
"prefer-regex-literals": "warn",
"prefer-spread": "warn",
"rest-spread-spacing": ["warn", "never"],
"semi-spacing": "warn",
"semi-style": ["warn", "last"],
"space-unary-ops": ["warn", {"words": true, "nonwords": false}],
"switch-colon-spacing": "warn",
"symbol-description": "warn",
"template-curly-spacing": ["warn", "never"],
"unicode-bom": ["warn", "never"],
"use-isnan": ["warn", {"enforceForSwitchCase": true, "enforceForIndexOf": true}],
"valid-typeof": ["warn", {"requireStringLiterals": true}],
"wrap-iife": ["warn", "inside"],
"arrow-parens": ["warn", "as-needed", {"requireForBlockBody": false}],
"capitalized-comments": "off",
"comma-spacing": "warn",
"dot-notation": "warn",
"indent": ["error", "tab", {"SwitchCase": 1}],
"key-spacing": "warn",
"keyword-spacing": ["warn", {"overrides": {"catch": {"before": true, "after": false}}}],
"max-len": ["warn", {
"code": 100,
"ignoreTrailingComments": false,
"ignoreUrls": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true
}],
"no-extra-boolean-cast": ["warn", {"enforceForLogicalOperands": true}],
"no-extra-semi": "warn",
"no-multi-spaces": "off",
"no-tabs": "off",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-useless-escape": "warn",
"no-unused-vars": ["warn", {"args": "none"}],
"nonblock-statement-body-position": ["warn", "beside"],
"one-var": ["warn", "never"],
"operator-linebreak": ["warn", "before", {
"overrides": {"=": "after", "+=": "after", "-=": "after"}
}],
"prefer-template": "warn",
"quote-props": ["warn", "consistent-as-needed", {"keywords": false}],
"quotes": ["warn", "double", {"avoidEscape": true, "allowTemplateLiterals": false}],
"semi": "warn",
"space-before-blocks": ["warn", "always"],
"space-before-function-paren": ["warn", {
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}],
"spaced-comment": "warn"
}
}
4 changes: 3 additions & 1 deletion .github/workflows/npm-gulp.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: NodeJS with Gulp
name: Build CI

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
workflow_dispatch:
branches: [ "develop" ]

jobs:
build:
Expand Down
62 changes: 11 additions & 51 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Create Release

on:
push:
tags:
- 'release-*'
workflow_dispatch:
branches: [main]

jobs:
build:
Expand All @@ -16,46 +15,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up variables
id: get_vars
run: |
TAG=${GITHUB_REF/refs\/tags\//}
echo ::set-output name=TAG_NAME::$TAG
echo ::set-output name=ZIP_NAME::ac2d20.zip
echo ::set-output name=RELEASE_DOWNLOAD_URL::https://github.com/${{github.repository}}/releases/latest/download/ac2d20.zip
echo ::set-output name=RELEASE_INSTALL_URL::https://github.com/${{github.repository}}/releases/download/$TAG/system.json
JSON=$(cat ./system/system.json)
echo ::set-output name=SYSTEM_JSON::${JSON//'%'/'%25'}
# Run some tests to make sure our `system.json` is correct
# Exit before setting up node if not
- name: Verify Naming
env:
TAG_NAME: ${{ steps.get_vars.outputs.TAG_NAME }}
RELEASE_DOWNLOAD: ${{steps.get_vars.outputs.RELEASE_DOWNLOAD_URL}}
# Extract version and download url from system.json
# https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson
PACKAGE_VERSION: ${{fromJSON(steps.get_vars.outputs.SYSTEM_JSON).version}}
PACKAGE_DOWNLOAD: ${{fromJSON(steps.get_vars.outputs.SYSTEM_JSON).download}}
run: |
# Validate that the tag being released matches the package version.
if [[ ! $TAG_NAME == release-$PACKAGE_VERSION ]]; then
echo "The system.json version does not match tag name."
echo "system.json: $PACKAGE_VERSION"
echo "tag name: $TAG_NAME"
echo "Please fix this and push the tag again."
exit 1
fi
# Validate that the package download url matches the release asset that will be created.
if [[ ! $RELEASE_DOWNLOAD == $PACKAGE_DOWNLOAD ]]; then
echo "The system.json download url does not match the created release asset url."
echo "system.json: $PACKAGE_DOWNLOAD"
echo "release asset url: $RELEASE_DOWNLOAD"
echo "Please fix this and push the tag again."
exit 1
fi
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand All @@ -70,19 +29,20 @@ jobs:
npm run build
cp --force LICENSE.txt system/.
cp --force README.md system/.
SYSTEM_VERSION=$(grep -oP '(?<="version": ")[^"]+' system/system.json | tr -d '\n')
perl -pi -E "s|latest/download/ac2d20\\.zip|download/$SYSTEM_VERSION/ac2d20.zip|" system/system.json
echo "systemVersion=$SYSTEM_VERSION" >> $GITHUB_ENV
- run: cd system && zip ../${{steps.get_vars.outputs.ZIP_NAME}} -r assets css fonts lang packs src templates ac2d20.mjs ac2d20-compiled.mjs ac2d20-compiled.mjs.map LICENSE.txt README.md system.json template.json
- run: cd system && zip -r ../ac2d20.zip ./*

# Create a release for this specific version
- name: Update Release with Files
- name: Create Version Release
id: create_version_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true # Set this to false if you want to prevent updating existing releases
name: ${{steps.get_vars.outputs.TAG_NAME}}
allowUpdates: false
name: ${{ env.systemVersion }}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './system/system.json, ./${{steps.get_vars.outputs.ZIP_NAME}}'
tag: ${{steps.get_vars.outputs.TAG_NAME}}
body: '**Installation:** To manually install this release, please use the following manifest URL: ${{steps.get_vars.outputs.RELEASE_INSTALL_URL}}'
artifacts: './system/system.json, ./ac2d20.zip'
tag: ${{ env.systemVersion }}
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
{
"type": "chrome",
"request": "launch",
"name": "Achtung! Cthulhu 2d20 System",
"url": "http://localhost:30000",
"name": "Achtung! Cthulhu 2d20",
"url": "http://localhost:31000",
"webRoot": "${workspaceFolder}/system"
}
]
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## v11.1.2

### Bugfix
- [#8] Weapon sizes not correctly displayed on Gear tab of character sheet
- [#9] Gear category labels for Skill Kits and Equipment not translated
- [#10] Spellcasting type always shows as Traditional when posted to chat
- [#11] Don't show brackets on spell display unless it has a Focus set

## v11.1.1

### Bugfix
- [#3] Actor skills being overwritten when an Actor is duplicated

### Chore
- Translation updates are now all handled via Crowdin to simplify the process of contributing translations. See here for more details: https://github.com/Muttley/foundryvtt-ac2d20/wiki/Other-ways-to-contribute#translation

## v11.1.0

- System migrated to new home and build process
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
![GitHub Release](https://img.shields.io/github/release-date/Muttley/foundryvtt-ac2d20)
![All Versions](https://img.shields.io/github/downloads/Muttley/foundryvtt-ac2d20/total)
![Latest Version](https://img.shields.io/github/downloads/Muttley/foundryvtt-ac2d20/latest/total)
![Latest Version](https://img.shields.io/github/downloads/Muttley/foundryvtt-ac2d20/latest/ac2d20.zip)
[![Crowdin](https://badges.crowdin.net/foundryvtt-ac2d20/localized.svg)](https://crowdin.com/project/foundryvtt-ac2d20)
![Forge Installs](https://img.shields.io/badge/dynamic/json?label=Forge%20Installs&query=package.installs&suffix=%25&url=https%3A%2F%2Fforge-vtt.com%2Fapi%2Fbazaar%2Fpackage%2Fac2d20)

# Achtung! Cthulhu 2d20 System for Foundry VTT
Expand All @@ -19,5 +20,5 @@ This is the unofficial Achtung Cthulhu 2d20 system for Foundry VTT.

## Featuring

- The system supports Dice-So-Nice module and introduces its own stress dice shortcut ("s") that you can use in chat or in journals (example: "`/r 1ds`", "`[[/r 1ds]]`", "`[[1ds]]`"
- The system supports Dice-So-Nice module and introduces its own stress dice shortcut ("s") that you can use in chat or in journals (example: "`/r 1ds`", "`[[/r 1ds]]`", "`[[1ds]]`")
- IMPORTANT: The system doesn't provide any pre-populated content.
3 changes: 3 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
files:
- source: i18n/en.yaml
translation: /i18n/%two_letters_code%.yaml
14 changes: 7 additions & 7 deletions gulpfile.mjs
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
import gulp from "gulp";

import * as css from "./utils/css.mjs";
// import * as lang from "./utils/lang.mjs";
import * as lang from "./utils/lang.mjs";
import * as javascript from "./utils/javascript.mjs";
import * as packs from "./utils/packs.mjs";

export default gulp.series(
gulp.parallel(
css.compile,
// lang.compile,
// javascript.lint,
lang.compile,
javascript.lint,
javascript.compile
),

gulp.parallel(
css.watchUpdates,
// lang.watchUpdates,
lang.watchUpdates,
javascript.watchUpdates
)
);

export const build = gulp.parallel(
css.compile,
// lang.compile,
// javascript.lint,
lang.compile,
javascript.lint,
javascript.compile,
packs.compile
);

// export const clean = gulp.parallel(css.clean, lang.clean, packs.clean);
export const clean = gulp.parallel(css.clean, packs.clean);
export const compileCss = gulp.series(css.compile);
// export const compileLang = gulp.series(lang.compile);
export const compileLang = gulp.series(lang.compile);
export const compilePacks = gulp.series(packs.compile);
export const lintJs = gulp.series(javascript.lint);
Loading

0 comments on commit 03d887a

Please sign in to comment.