Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for fvtt10 #37

Merged
merged 12 commits into from
May 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +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
288 changes: 245 additions & 43 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,48 +1,250 @@
{
"env": {
"jquery": true,
"node": true,
"browser": true,
"es2020": true,
"es6": true
},
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"extends": [
"env": {
"browser": true,
"es2021": true,
"node": true,
"jquery": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"requireConfigFile": false,
"sourceType": "module",
"project": "./tsconfig.json",
},
"plugins": [
"jsdoc"
],
"extends": [
"prettier",
"plugin:import/errors",
"eslint:recommended",
"@typhonjs-fvtt/eslint-config-foundry.js/0.8.0",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"plugins": [
"@typescript-eslint",
"eslint-plugin-tsdoc"
"plugin:json/recommended"
],
"rules": {
"eqeqeq": ["error", "always"],
"tsdoc/syntax": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"prettier/prettier": [
"off",
{},
{
"usePrettierrc": true
}
],
"no-underscore-dangle": "off",
"import/extensions": "off",
"class-methods-use-this": [
"off",
{
"exceptMethods": ["getData", "_updateObject"]
}
],
"@typescript-eslint/consistent-type-assertions": "off",
"@typescript-eslint/ban-ts-comment": "off"
}
"ignorePatterns": ["dist/"],
"rules": {
"array-bracket-spacing": ["warn", "never"],
"array-callback-return": "warn",
"arrow-spacing": "warn",
"comma-dangle": ["warn", "never"],
"comma-style": "warn",
"computed-property-spacing": "warn",
"constructor-super": "error",
"default-param-last": "warn",
"dot-location": ["warn", "property"],
"eol-last": ["error", "always"],
// "eqeqeq": ["warn", "smart"],
"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": "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": "warn",
"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": ["warn", "always", {"ignoreConsecutiveComments": true}],
"comma-spacing": "warn",
"dot-notation": "warn",
"indent": ["warn", 2, {"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",
"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", "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",

"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",
"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": "warn",
"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",

"eqeqeq": ["error", "always"],
"import/named": "off",
"import/no-default-export": "error",
"prettier/prettier": "error",
"no-console": "off",
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
"spaced-comment": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-comment": "off",
"@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-namespace": ["error", { "allowDeclarations": true }],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "off", // Handled by tsconfig
"@typescript-eslint/array-type": ["error", { "default": "array" }],
},
"settings": {
"jsdoc": {
"preferredTypes": {
".<>": "<>"
},
"tagNamePreference": {
"auguments": "extends"
}
},
"import/resolver": {
"node": {
"paths": ["src", "types", "", "dist"],
"extensions": [".css", ".js", ".mjs", ".json", ".jsx", ".scss", ".ts", ".tsx"],
},
"eslint-import-resolver-typescript": true,
"typescript": {
"alwaysTryTypes": true,
},
},
"import/parsers": { "@typescript-eslint/parser": [".ts"] },
}
}
54 changes: 54 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release Creation

on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
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_manifest_link_version
uses: microsoft/variable-substitution@v1
with:
files: 'src/module.json'
env:
version: ${{github.event.release.tag_name}}
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

# create a zip file with all files required by the module to add to the release
- run: cd src; zip -r ./module.zip *

# Create a release for this specific version
- 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, src/module.zip'
tag: ${{ github.event.release.tag_name }}
body: ${{ github.event.release.body }}

# Update the 'latest' release
- name: Create Release
id: create_latest_release
uses: ncipollo/release-action@v1
if: endsWith(github.ref, 'master')
with:
allowUpdates: true
name: Latest
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: 'src/module.json,src/module.zip'
tag: latest
body: ${{ github.event.release.body }}
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,22 @@ jobs:
uses: ncipollo/release-action@238505795d6d58d49b78980f271f70dfcd8efb35
with:
allowUpdates: true
name: ${{steps.get_version.outputs.version}}
name: ${{ env.RELEASE_VERSION }}
body: |
${{ steps.Changelog.outputs.changelog }}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './src/module.json,./package/module.zip'
tag: ${{steps.get_version.outputs.version}}
tag: ${{ env.RELEASE_VERSION }}


# Publish the release to FoundryVTT's package repository.
Publish the release to FoundryVTT's package repository.
- name: FoundryVTT AutoPublish
uses: Varriount/[email protected]
with:
username: ${{ secrets.FOUNDRY_ADMIN_USER }}
password: ${{ secrets.FOUNDRY_ADMIN_PW }}
module-id: 288
manifest-url: https://github.com/${{ github.repository }}/releases/download/${{steps.get_version.outputs.version}}/module.json
manifest-url: https://github.com/${{ github.repository }}/releases/download/${{ env.RELEASE_VERSION }}/module.json
manifest-file: ./src/module.json
Loading