From 54e3c3cfef4128d043d2dc9f1d5d61839e347346 Mon Sep 17 00:00:00 2001 From: p4535992 Date: Sat, 15 Jun 2024 11:16:40 +0200 Subject: [PATCH] version 1.10.4 --- .editorconfig | 22 +- .eslintrc.json | 691 +++++++++++----------- .gitattributes | 14 +- .github/FUNDING.yml | 4 +- .github/ISSUE_TEMPLATE/bug_report.md | 88 +-- .github/ISSUE_TEMPLATE/feature_request.md | 20 +- .github/ISSUE_TEMPLATE/styling.md | 20 +- .github/workflows/main.yml | 197 ++---- .gitignore | 2 - CHANGELOG.md | 4 +- src/module.json | 9 +- utils/packs.mjs | 7 + 12 files changed, 509 insertions(+), 569 deletions(-) diff --git a/.editorconfig b/.editorconfig index 3afd20d..28e442a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,11 +1,11 @@ -root = true - -[*] -indent_style = space -indent_size = 4 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -[*.yml] -indent_size = 2 +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +[*.yml] +indent_size = 2 diff --git a/.eslintrc.json b/.eslintrc.json index 40d6cef..cc7550f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,344 +1,347 @@ -{ - "env": { - "browser": true, - "es6": true, - "node": true, - "jquery": true - }, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "prettier" - ], - "parser": "@babel/eslint-parser", - "parserOptions": { - "requireConfigFile": false, - "ecmaVersion": 2018, - "sourceType": "module" - }, - "ignorePatterns": [ - "dist/" - ], - "rules": { - "prettier/prettier": "error", - "no-console": "off", - "no-plusplus": [ - "error", - { - "allowForLoopAfterthoughts": true - } - ], - "array-bracket-spacing": ["warn", "never"], - "array-callback-return": "warn", - "arrow-spacing": "warn", - "comma-dangle": ["warn", "always-multiline"], - "comma-style": "warn", - "computed-property-spacing": "warn", - "constructor-super": "error", - "default-param-last": "warn", - "dot-location": ["warn", "property"], - "eol-last": ["error", "always"], - "eqeqeq": "error", - "func-call-spacing": "warn", - "func-names": ["warn", "never"], - "getter-return": "warn", - "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": "off", - "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": "warn", - "no-unreachable": "warn", - "no-unreachable-loop": "warn", - "no-unsafe-negation": ["warn", {"enforceForOrderingRelations": true}], - "no-unsafe-optional-chaining": ["warn", {"disallowArithmeticOperators": true}], - "no-unused-expressions": [ - "error", - { - "allowShortCircuit": true - } - ], - "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": ["warn", "always", { - "ignoreConsecutiveComments": true, - "ignorePattern": "noinspection" - }], - "comma-spacing": "warn", - "dot-notation": "warn", - "indent": ["warn", 4, {"SwitchCase": 1}], - "key-spacing": "warn", - "keyword-spacing": ["warn", {"overrides": {"catch": {"before": true, "after": false}}}], - "max-len": ["warn", { - "code": 120, - "ignoreTrailingComments": true, - "ignoreUrls": true, - "ignoreStrings": true, - "ignoreTemplateLiterals": true - }], - "no-extra-boolean-cast": ["warn", {"enforceForLogicalOperands": true}], - "no-extra-semi": "warn", - "no-multi-spaces": ["warn", {"ignoreEOLComments": true}], - "no-tabs": "warn", - "no-throw-literal": "error", - "no-trailing-spaces": "warn", - "no-useless-escape": "warn", - "nonblock-statement-body-position": ["warn", "beside"], - "one-var": ["warn", "never"], - "operator-linebreak": ["warn", "before", { - "overrides": {"=": "after", "+=": "after", "-=": "after"} - }], - "prefer-template": "warn", - "quote-props": ["warn", "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": [ - "error", - "always", - { - "markers": [ - "/" - ] - } - ], - "@typescript-eslint/ban-ts-comment": "error", - "@typescript-eslint/ban-types": "off", - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/lines-between-class-members": [ - "error", - "always", - { - "exceptAfterSingleLine": true - } - ], - "@typescript-eslint/prefer-namespace-keyword": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-explicit-any": "error", - "@typescript-eslint/no-namespace": [ - "error", - { - "allowDeclarations": true - } - ], - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/no-unsafe-declaration-merging": "off", - "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/array-type": [ - "error", - { - "default": "array" - } - ], - "jsdoc/check-access": "warn", - "jsdoc/check-alignment": "warn", - "jsdoc/check-examples": "off", - "jsdoc/check-indentation": "off", - "jsdoc/check-line-alignment": "off", - "jsdoc/check-param-names": "warn", - "jsdoc/check-property-names": "warn", - "jsdoc/check-syntax": "off", - "jsdoc/check-tag-names": ["warn", { "definedTags": ["category"] }], - "jsdoc/check-types": "warn", - "jsdoc/check-values": "warn", - "jsdoc/empty-tags": "warn", - "jsdoc/implements-on-classes": "warn", - "jsdoc/match-description": "off", - "jsdoc/newline-after-description": "off", - "jsdoc/no-bad-blocks": "warn", - "jsdoc/no-defaults": "off", - "jsdoc/no-types": "off", - "jsdoc/no-undefined-types": "off", - "jsdoc/require-description": "warn", - "jsdoc/require-description-complete-sentence": "off", - "jsdoc/require-example": "off", - "jsdoc/require-file-overview": "off", - "jsdoc/require-hyphen-before-param-description": ["warn", "never"], - "jsdoc/require-jsdoc": "warn", - "jsdoc/require-param": "warn", - "jsdoc/require-param-description": "off", - "jsdoc/require-param-name": "warn", - "jsdoc/require-param-type": "warn", - "jsdoc/require-property": "warn", - "jsdoc/require-property-description": "off", - "jsdoc/require-property-name": "warn", - "jsdoc/require-property-type": "warn", - "jsdoc/require-returns": "off", - "jsdoc/require-returns-check": "warn", - "jsdoc/require-returns-description": "off", - "jsdoc/require-returns-type": "warn", - "jsdoc/require-throws": "off", - "jsdoc/require-yields": "warn", - "jsdoc/require-yields-check": "warn", - "jsdoc/valid-types": "off" - }, - "plugins": [ - "jsdoc", - "prettier", - "@typescript-eslint" - ], - "settings": { - "jsdoc": { - "preferredTypes": { - ".<>": "<>", - "object": "Object", - "Object": "object" - }, - "mode": "typescript", - "tagNamePreference": { - "augments": "extends" - } - } - }, - "overrides": [ - { - "files": "tests/**/*", - "rules": { - "global-require": "off" - } - } - ], - "globals": { - "globalThis": true, - "canvas": true, - "Hooks": true, - "game": true, - "Handlebars": true, - "Babele": true, - "foundry": true, - "CONFIG": true, - "libWrapper": true, - "socketlib": true, - "DatabaseBackend": true, - "Actor": true, - "Adventure": true, - "Cards": true, - "ChatMessage": true, - "Combat": true, - "Dice": true, - "FogExploration": true, - "Folder": true, - "Item": true, - "JournalEntry": true, - "Macro": true, - "Playlist": true, - "RollTable": true, - "Scene": true, - "Setting": true, - "User": true, - "Canvas": true, - "canvasTextStyle": true, - "weatherEffects": true, - "controlIcons": true, - "fontDefinitions": true, - "_fontFamilies": true, - "defaultFontFamily": true, - "statusEffects": true, - "specialStatusEffects": true, - "sounds": true, - "supportedLanguages": true, - "i18n": true, - "time": true, - "ActiveEffect": true, - "ActorDelta": true, - "Card": true, - "TableResult": true, - "JournalEntryPage": true, - "PlaylistSound": true, - "AmbientLight": true, - "AmbientSound": true, - "Combatant": true, - "Drawing": true, - "MeasuredTemplate": true, - "Note": true, - "Tile": true, - "Token": true, - "Wall": true, - "TinyMCE": true, - "TextEditor": true, - "WebRTC": true, - "ui": true, - "DND5E": true - } -} - +{ + "env": { + "browser": true, + "es6": true, + "node": true, + "jquery": true + }, + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "prettier" + ], + "parser": "@babel/eslint-parser", + "parserOptions": { + "requireConfigFile": false, + "ecmaVersion": 2018, + "sourceType": "module" + }, + "ignorePatterns": [ + "dist/" + ], + "rules": { + "prettier/prettier": "error", + "no-console": "off", + "no-plusplus": [ + "error", + { + "allowForLoopAfterthoughts": true + } + ], + "array-bracket-spacing": ["warn", "never"], + "array-callback-return": "warn", + "arrow-spacing": "warn", + "comma-dangle": ["warn", "always-multiline"], + "comma-style": "warn", + "computed-property-spacing": "warn", + "constructor-super": "error", + "default-param-last": "warn", + "dot-location": ["warn", "property"], + "eol-last": ["error", "always"], + "eqeqeq": "error", + "func-call-spacing": "warn", + "func-names": ["warn", "never"], + "getter-return": "warn", + "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": "off", + "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": "warn", + "no-unreachable": "warn", + "no-unreachable-loop": "warn", + "no-unsafe-negation": ["warn", {"enforceForOrderingRelations": true}], + "no-unsafe-optional-chaining": ["warn", {"disallowArithmeticOperators": true}], + "no-unused-expressions": [ + "error", + { + "allowShortCircuit": true + } + ], + "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": ["warn", "always", { + "ignoreConsecutiveComments": true, + "ignorePattern": "noinspection" + }], + "comma-spacing": "warn", + "dot-notation": "warn", + "indent": ["warn", 4, {"SwitchCase": 1}], + "key-spacing": "warn", + "keyword-spacing": ["warn", {"overrides": {"catch": {"before": true, "after": false}}}], + "max-len": ["warn", { + "code": 120, + "ignoreTrailingComments": true, + "ignoreUrls": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true + }], + "no-extra-boolean-cast": ["warn", {"enforceForLogicalOperands": true}], + "no-extra-semi": "warn", + "no-multi-spaces": ["warn", {"ignoreEOLComments": true}], + "no-tabs": "warn", + "no-throw-literal": "error", + "no-trailing-spaces": "warn", + "no-useless-escape": "warn", + "nonblock-statement-body-position": ["warn", "beside"], + "one-var": ["warn", "never"], + "operator-linebreak": ["warn", "before", { + "overrides": {"=": "after", "+=": "after", "-=": "after"} + }], + "prefer-template": "warn", + "quote-props": ["warn", "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": [ + "error", + "always", + { + "markers": [ + "/" + ] + } + ], + "@typescript-eslint/ban-ts-comment": "error", + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/lines-between-class-members": [ + "error", + "always", + { + "exceptAfterSingleLine": true + } + ], + "@typescript-eslint/prefer-namespace-keyword": "off", + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "error", + "@typescript-eslint/no-namespace": [ + "error", + { + "allowDeclarations": true + } + ], + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-unsafe-declaration-merging": "off", + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/array-type": [ + "error", + { + "default": "array" + } + ], + "jsdoc/check-access": "warn", + "jsdoc/check-alignment": "warn", + "jsdoc/check-examples": "off", + "jsdoc/check-indentation": "off", + "jsdoc/check-line-alignment": "off", + "jsdoc/check-param-names": "warn", + "jsdoc/check-property-names": "warn", + "jsdoc/check-syntax": "off", + "jsdoc/check-tag-names": ["warn", { "definedTags": ["category"] }], + "jsdoc/check-types": "warn", + "jsdoc/check-values": "warn", + "jsdoc/empty-tags": "warn", + "jsdoc/implements-on-classes": "warn", + "jsdoc/match-description": "off", + "jsdoc/newline-after-description": "off", + "jsdoc/no-bad-blocks": "warn", + "jsdoc/no-defaults": "off", + "jsdoc/no-types": "off", + "jsdoc/no-undefined-types": "off", + "jsdoc/require-description": "warn", + "jsdoc/require-description-complete-sentence": "off", + "jsdoc/require-example": "off", + "jsdoc/require-file-overview": "off", + "jsdoc/require-hyphen-before-param-description": ["warn", "never"], + "jsdoc/require-jsdoc": "warn", + "jsdoc/require-param": "warn", + "jsdoc/require-param-description": "off", + "jsdoc/require-param-name": "warn", + "jsdoc/require-param-type": "warn", + "jsdoc/require-property": "warn", + "jsdoc/require-property-description": "off", + "jsdoc/require-property-name": "warn", + "jsdoc/require-property-type": "warn", + "jsdoc/require-returns": "off", + "jsdoc/require-returns-check": "warn", + "jsdoc/require-returns-description": "off", + "jsdoc/require-returns-type": "warn", + "jsdoc/require-throws": "off", + "jsdoc/require-yields": "warn", + "jsdoc/require-yields-check": "warn", + "jsdoc/valid-types": "off" + }, + "plugins": [ + "jsdoc", + "prettier", + "@typescript-eslint" + ], + "settings": { + "jsdoc": { + "preferredTypes": { + ".<>": "<>", + "object": "Object", + "Object": "object" + }, + "mode": "typescript", + "tagNamePreference": { + "augments": "extends" + } + } + }, + "overrides": [ + { + "files": "tests/**/*", + "rules": { + "global-require": "off" + } + } + ], + "globals": { + "gsap": true, + "ScrollToPlugin": true, + "TextPlugin": true, + "globalThis": true, + "canvas": true, + "Hooks": true, + "game": true, + "Handlebars": true, + "Babele": true, + "foundry": true, + "CONFIG": true, + "libWrapper": true, + "socketlib": true, + "DatabaseBackend": true, + "Actor": true, + "Adventure": true, + "Cards": true, + "ChatMessage": true, + "Combat": true, + "Dice": true, + "FogExploration": true, + "Folder": true, + "Item": true, + "JournalEntry": true, + "Macro": true, + "Playlist": true, + "RollTable": true, + "Scene": true, + "Setting": true, + "User": true, + "Canvas": true, + "canvasTextStyle": true, + "weatherEffects": true, + "controlIcons": true, + "fontDefinitions": true, + "_fontFamilies": true, + "defaultFontFamily": true, + "statusEffects": true, + "specialStatusEffects": true, + "sounds": true, + "supportedLanguages": true, + "i18n": true, + "time": true, + "ActiveEffect": true, + "ActorDelta": true, + "Card": true, + "TableResult": true, + "JournalEntryPage": true, + "PlaylistSound": true, + "AmbientLight": true, + "AmbientSound": true, + "Combatant": true, + "Drawing": true, + "MeasuredTemplate": true, + "Note": true, + "Tile": true, + "Token": true, + "Wall": true, + "TinyMCE": true, + "TextEditor": true, + "WebRTC": true, + "ui": true, + "DND5E": true + } +} + diff --git a/.gitattributes b/.gitattributes index 2376a0d..815a562 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,7 @@ -.github export-ignore -FUNDING.yml export-ignore - -.gitattributes export-ignore -README.md export-ignore -preview.jpg export-ignore -patchnotes.md export-ignore +.github export-ignore +FUNDING.yml export-ignore + +.gitattributes export-ignore +README.md export-ignore +preview.jpg export-ignore +patchnotes.md export-ignore diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 4116439..6cdb8f8 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,2 +1,2 @@ -github: p4535992 -custom: ["https://www.patreon.com/p4535992"] +github: p4535992 +custom: ["https://www.patreon.com/p4535992"] diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index d8ed97e..0cc8d45 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,44 +1,44 @@ ---- -name: Bug report -about: Create a report to help us improve -title: "[BUG]" -labels: bug -assignees: '' - ---- - -**Module Version:** v0.0.0 - -**Before open any issue** - -1) Enable the module setting _"Enable debugging"_ -2) Click F12 go to the _console_ tab -3) make the test you want and replicate the error -4) Go to the tab console open on point 2) and just right click and click 'Save as' and 'Save' or send a screenshot of the exception on the console. -5) Attach the text file on the github issue with all the logs related tot he module, or send a screenshot of the messages on the console. - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Browser:** - - - -**Foundry Version:** - -**Game System:** - -**Additional context** -Add any other context (like other modules installed) about the problem here. +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG]" +labels: bug +assignees: '' + +--- + +**Module Version:** v0.0.0 + +**Before open any issue** + +1) Enable the module setting _"Enable debugging"_ +2) Click F12 go to the _console_ tab +3) make the test you want and replicate the error +4) Go to the tab console open on point 2) and just right click and click 'Save as' and 'Save' or send a screenshot of the exception on the console. +5) Attach the text file on the github issue with all the logs related tot he module, or send a screenshot of the messages on the console. + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Browser:** + - + +**Foundry Version:** + +**Game System:** + +**Additional context** +Add any other context (like other modules installed) about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 809b7b0..017320a 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,10 +1,10 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: enhancement -assignees: '' - ---- - - +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' + +--- + + diff --git a/.github/ISSUE_TEMPLATE/styling.md b/.github/ISSUE_TEMPLATE/styling.md index 914837c..43706ab 100644 --- a/.github/ISSUE_TEMPLATE/styling.md +++ b/.github/ISSUE_TEMPLATE/styling.md @@ -1,10 +1,10 @@ ---- -name: Styling -about: Request a change or bug related to styles -title: '' -labels: styling -assignees: '' - ---- - - +--- +name: Styling +about: Request a change or bug related to styles +title: '' +labels: styling +assignees: '' + +--- + + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3429c88..33d4bba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,133 +1,64 @@ -name: Release Creation - -on: - release: - types: [ published ] - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v2 - - # Substitute the Manifest and Download URLs in the module.json - - - name: Substitute Manifest and Download Links For Versioned Ones - id: sub_release_manifest_version - uses: microsoft/variable-substitution@v1 - with: - files: 'src/module.json' - env: - version: ${{github.event.release.tag_name}} - url: https://github.com/${{github.repository}} - manifest: https://github.com/${{github.repository}}/releases/latest/download/module.json - download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip - - # for a FULL RELEASE - # - name: Substitute Manifest and Download Links For Versioned Ones - # if: "!github.event.release.prerelease" - # id: sub_release_manifest_version - # uses: microsoft/variable-substitution@v1 - # with: - # files: 'module.json' - # env: - # version: ${{github.event.release.tag_name}} - # url: https://github.com/${{github.repository}} - # manifest: https://github.com/${{github.repository}}/releases/latest/download/module.json - # download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip - - # Substitute the Manifest and Download URLs in the module.json - # for a PRE RELEASE. Manifest pointing to live module.json on branch, - # which is updated after tag. - # - name: Substitute Manifest and Download Links For Versioned Ones - # if: "github.event.release.prerelease" - # id: sub_prerelease_manifest_version - # uses: microsoft/variable-substitution@v1 - # with: - # files: 'module.json' - # env: - # version: ${{github.event.release.tag_name}} - # url: https://github.com/${{github.repository}} - # manifest: https://raw.githubusercontent.com/${{github.repository}}/next/module.json - # download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip - - # Install packages. - - run: npm install - - # Build distribution. - - run: npm run build - - - run: mkdir package - - - run: mv -v ./dist/* ./package/ - - # Create a zip file with all files required by the module to add to the release - #- run: zip -r ./module.zip module.json LICENSE module.js module.js.map style.css templates/ languages/ packs/ assets/ - # - run: zip -r ./package/module.zip ./package/* - - # && ensures that zip only runs if the directory was correctly changed, - # and the parentheses run everything in a subshell, so the current directory - # is restored at the end. Using OLDPWD avoids having to calculate the relative path to package.zip. - # https://unix.stackexchange.com/questions/385405/zip-all-files-and-subfolder-in-directory-without-parent-directory - - run: (cd package && zip -r "$OLDPWD/module.zip" .) - - - name: Update Release with Files - 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: ${{ github.event.release.name }} - draft: false - prerelease: false - token: ${{ secrets.GITHUB_TOKEN }} - artifacts: './src/module.json, ./module.zip' - tag: ${{ github.event.release.tag_name }} - body: ${{ github.event.release.body }} - - # Create a release for this specific version - # - name: Update Release with Files - # if: "!github.event.release.prerelease" - # 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: ${{ github.event.release.name }} - # draft: false - # prerelease: false - # token: ${{ secrets.GITHUB_TOKEN }} - # artifacts: './module.json, ./module.zip' - # tag: ${{ github.event.release.tag_name }} - # body: ${{ github.event.release.body }} - - # OR create a pre-release for this specific version - # - name: Update Release with Files - # if: "github.event.release.prerelease" - # id: create_version_prerelease - # uses: ncipollo/release-action@v1 - # with: - # allowUpdates: true # Set this to false if you want to prevent updating existing releases - # name: ${{ github.event.release.name }} - # draft: false - # prerelease: true - # token: ${{ secrets.GITHUB_TOKEN }} - # artifacts: './module.json, ./module.zip' - # tag: ${{ github.event.release.tag_name }} - # body: ${{ github.event.release.body }} - - #update next branch - # - name: Prepare repository - # if: "github.event.release.prerelease" - # run: | - # git config --global user.name '${{github.actor}}' - # git config --global user.email '${{github.actor}}@users.noreply.github.com' - # git add module.json - # git stash - # git clean -f - # git remote set-url origin "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY" - # git fetch origin "next" - # git switch -c "next" "origin/next" - # git checkout stash module.json - # git commit -m "${{github.event.release.tag_name}} manifest" - # git push -f +name: Create Module Files For GitHub Release + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + # Substitute the Manifest and Download URLs in the module.json + - name: Extract Version From Tag + id: get_version + uses: battila7/get-version-action@v2 + + - name: Modify Module Manifest With Release-Specific Values + id: sub_manifest_link_version + uses: microsoft/variable-substitution@v1 + with: + files: 'src/module.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/module.json + download: https://github.com/${{github.repository}}/releases/download/${{github.event.release.tag_name}}/module.zip + + # Install packages. + - run: npm install + + # Build distribution. + - run: npm run build + + - run: mkdir package + + - run: mv -v ./dist/* ./package/ + + # Create a zip file with all files required by the module to add to the release + #- run: zip -r ./module.zip module.json LICENSE module.js module.js.map style.css templates/ languages/ packs/ assets/ + # - run: zip -r ./package/module.zip ./package/* + + # && ensures that zip only runs if the directory was correctly changed, + # and the parentheses run everything in a subshell, so the current directory + # is restored at the end. Using OLDPWD avoids having to calculate the relative path to package.zip. + # https://unix.stackexchange.com/questions/385405/zip-all-files-and-subfolder-in-directory-without-parent-directory + - run: (cd package && zip -r "$OLDPWD/module.zip" .) + + - name: Update Release with Files + 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: ${{ github.event.release.name }} + draft: ${{ github.event.release.unpublished }} + prerelease: ${{ github.event.release.prerelease }} + token: ${{ secrets.GITHUB_TOKEN }} + artifacts: './src/module.json, ./module.zip' + tag: ${{ github.event.release.tag_name }} + body: ${{ github.event.release.body }} diff --git a/.gitignore b/.gitignore index c03f7a0..a99f3df 100644 --- a/.gitignore +++ b/.gitignore @@ -120,5 +120,3 @@ foundry.js /package /.vite-cache /package-lock.json -/package-lock.json -/wiki/backups/FoundryVTT-ItemPiles_2024-03-03 diff --git a/CHANGELOG.md b/CHANGELOG.md index b4fad3d..9761fe7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ -# Changelog +### 1.10.4 + +- Update manifest for v12 ### 1.10.0-1-2-3 [BREAKING CHANGES] diff --git a/src/module.json b/src/module.json index fd63c2d..95a4c26 100644 --- a/src/module.json +++ b/src/module.json @@ -2,7 +2,7 @@ "id": "pin-cushion", "title": "Pin Cushion", "description": "Adds additional functionality on Journal Note/Scene Note and Journal directory", - "version": "1.10.3", + "version": "1.10.4", "authors": [ { "name": "Cole Schultz", @@ -118,15 +118,14 @@ "compatibility": { "minimum": 11, "verified": 11, - "maximum": 11 + "maximum": 12 }, "url": "https://github.com/p4535992/foundryvtt-pin-cushion", - "manifest": "https://github.com/p4535992/foundryvtt-pin-cushion/releases/download/1.10.3/module.json", - "download": "https://github.com/p4535992/foundryvtt-pin-cushion/releases/download/1.10.3/module.zip", + "manifest": "https://github.com/p4535992/foundryvtt-pin-cushion/releases/download/1.10.4/module.json", + "download": "https://github.com/p4535992/foundryvtt-pin-cushion/releases/download/1.10.4/module.zip", "readme": "https://github.com/p4535992/foundryvtt-pin-cushion/blob/master/README.md", "changelog": "https://github.com/p4535992/foundryvtt-pin-cushion/blob/master/CHANGELOG.md", "bugs": "https://github.com/p4535992/foundryvtt-pin-cushion/issues", - "allowBugReporter": true, "relationships": { "systems": [], "requires": [ diff --git a/utils/packs.mjs b/utils/packs.mjs index 2fc7550..2e7d0fd 100644 --- a/utils/packs.mjs +++ b/utils/packs.mjs @@ -105,6 +105,13 @@ function cleanPackEntry(data, { clearSourceId=true, ownership=0 }={}) { if ( data.system?.save?.dc === 0 ) data.system.save.dc = null; if ( data.system?.capacity?.value === 0 ) data.system.capacity.value = null; if ( data.system?.strength === 0 ) data.system.strength = null; + // BREAKING CHANGES Dnd5e 3.2.X + if ((data.system?.weight || data.system?.weight === 0) && !data.system?.weight?.units) { + data.system.weight = { + value: typeof data.system.weight === 'number' ? data.system.weight : 0, + units: "lb" + }; + } // Remove mystery-man.svg from Actors if ( ["character", "npc"].includes(data.type) && data.img === "icons/svg/mystery-man.svg" ) {