diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 00000000..25a76ab4 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,15 @@ +// SPDX-FileCopyrightText: 2021 Johannes Loher +// +// SPDX-License-Identifier: MIT + +module.exports = { + parser: "@typescript-eslint/parser", + parserOptions: { ecmaVersion: 2020, sourceType: "module" }, + env: { browser: true }, + extends: ["plugin:@typescript-eslint/recommended", "prettier"], + plugins: ["@typescript-eslint"], + overrides: [ + { files: ["./*.cjs"], rules: { "@typescript-eslint/no-var-requires": "off" } }, + { files: ["./spec/**/*"], env: { browser: false } }, + ], +}; diff --git a/prettier.config.js b/.prettierrc.js similarity index 76% rename from prettier.config.js rename to .prettierrc.js index c75da361..d6ceb41d 100644 --- a/prettier.config.js +++ b/.prettierrc.js @@ -2,11 +2,6 @@ // // SPDX-License-Identifier: MIT -// @ts-check - -/** - * @type {import("prettier").Config} - */ export default { semi: true, trailingComma: "all", diff --git a/.woodpecker/publish.yaml b/.woodpecker/publish.yaml index 5cdef92e..cb9ac480 100644 --- a/.woodpecker/publish.yaml +++ b/.woodpecker/publish.yaml @@ -23,17 +23,6 @@ variables: - ${CI_REPO_NAME}/system.json api_key: from_secret: forge_token - - &publish_manifest_base - image: alpine:latest - environment: - FORGE_TOKEN: - from_secret: forge_token - commands: - - apk update - - apk add curl - - export RELEASE_CHANNEL=$(cat .RELEASE_CHANNEL) - - 'curl --header "Authorization: token $${FORGE_TOKEN}" -X "DELETE" "${CI_FORGE_URL}/api/packages/${CI_REPO_OWNER}/generic/${CI_REPO_NAME}/$${RELEASE_CHANNEL}/system.json"' - - 'curl --fail --header "Authorization: token $${FORGE_TOKEN}" --upload-file ${CI_REPO_NAME}/system.json "${CI_FORGE_URL}/api/packages/${CI_REPO_OWNER}/generic/${CI_REPO_NAME}/$${RELEASE_CHANNEL}/system.json"' when: event: tag @@ -49,7 +38,6 @@ steps: - <<: *enable_pnpm - pnpm install --frozen-lockfile build: - depends_on: install image: *node_image environment: NODE_ENV: production @@ -58,7 +46,7 @@ steps: - <<: *enable_pnpm - pnpm build package: - depends_on: build + group: prepare-release image: alpine:latest commands: - apk update @@ -66,67 +54,61 @@ steps: - mv dist ${CI_REPO_NAME} - zip -r ${CI_REPO_NAME}.zip ${CI_REPO_NAME}/* changelog: - depends_on: build + group: prepare-release image: *node_image commands: - <<: *enable_pnpm - pnpm changelog choose-latest-channel: - depends_on: build + group: prepare-release image: alpine:latest commands: - echo latest > .RELEASE_CHANNEL when: <<: *is_latest_channel choose-beta-channel: - depends_on: build + group: prepare-release image: alpine:latest commands: - echo beta > .RELEASE_CHANNEL when: <<: *is_beta_channel release-latest: - depends_on: - - package - - changelog - - choose-latest-channel image: *release_plugin settings: <<: *release_base_settings when: <<: *is_latest_channel release-beta: - depends_on: - - package - - changelog - - choose-beta-channel image: *release_plugin settings: <<: *release_base_settings prerelease: true when: <<: *is_beta_channel - publish-manifest-latest: - <<: *publish_manifest_base - depends_on: release-latest - when: - <<: *is_latest_channel - publish-manifest-beta: - <<: *publish_manifest_base - depends_on: release-beta - when: - <<: *is_beta_channel + publish-manifest: + group: publish + image: alpine:latest + commands: + - apk update + - apk add curl + - export RELEASE_CHANNEL=$(cat .RELEASE_CHANNEL) + - 'curl --header "Authorization: token $${FORGE_TOKEN}" -X "DELETE" "${CI_FORGE_URL}/api/packages/${CI_REPO_OWNER}/generic/${CI_REPO_NAME}/$${RELEASE_CHANNEL}/system.json"' + - 'curl --fail --header "Authorization: token $${FORGE_TOKEN}" --upload-file ${CI_REPO_NAME}/system.json "${CI_FORGE_URL}/api/packages/${CI_REPO_OWNER}/generic/${CI_REPO_NAME}/$${RELEASE_CHANNEL}/system.json"' + secrets: + - forge_token publish-to-foundry-admin: - depends_on: release-latest - image: johannesloher/foundry-publish:v4.0.0 + group: publish + image: johannesloher/foundry-publish environment: - FVTT_PACKAGE_ID: - from_secret: fvtt_package_id - FVTT_TOKEN: - from_secret: fvtt_token + FVTT_DELETE_OBSOLETE_VERSIONS: "true" commands: - export FVTT_MANIFEST_PATH=${CI_REPO_NAME}/system.json - export FVTT_MANIFEST_URL=${CI_REPO_URL}/releases/download/${CI_COMMIT_TAG}/system.json - foundry-publish + secrets: + - fvtt_package_id + - fvtt_username + - fvtt_password when: <<: *is_latest_channel diff --git a/.woodpecker/release.yaml b/.woodpecker/release.yaml index 17966857..fce1dbdb 100644 --- a/.woodpecker/release.yaml +++ b/.woodpecker/release.yaml @@ -25,11 +25,6 @@ steps: - pnpm install --frozen-lockfile release: image: *node_image - environment: - FORGE_TOKEN_NAME: - from_secret: forge_token_name - FORGE_TOKEN: - from_secret: forge_token commands: - <<: *enable_pnpm - apt-get update @@ -47,3 +42,6 @@ steps: - git tag -f $${RELEASE_VERSION} - git push origin ${CI_COMMIT_BRANCH} - git push origin $${RELEASE_VERSION} + secrets: + - forge_token_name + - forge_token diff --git a/commitlint.config.cjs b/commitlint.config.cjs new file mode 100644 index 00000000..c52644d5 --- /dev/null +++ b/commitlint.config.cjs @@ -0,0 +1,5 @@ +// SPDX-FileCopyrightText: 2021 Johannes Loher +// +// SPDX-License-Identifier: MIT + +module.exports = { extends: ["@commitlint/config-conventional"] }; diff --git a/commitlint.config.js b/commitlint.config.js deleted file mode 100644 index 7401f777..00000000 --- a/commitlint.config.js +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Johannes Loher -// -// SPDX-License-Identifier: MIT - -/** - * @type {import("@commitlint/types").UserConfig} - */ -export default { extends: ["@commitlint/config-conventional"] }; diff --git a/package.json b/package.json index e58b8862..7bc8aca9 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": true, "name": "dungeonslayers4", "description": "An implementation of the Dungeonslayers 4 game system for Foundry Virtual Tabletop.", - "version": "2.0.5", + "version": "2.0.0", "license": "https://git.f3l.de/dungeonslayers/ds4#licensing", "homepage": "https://git.f3l.de/dungeonslayers/ds4", "repository": { @@ -93,10 +93,5 @@ "vitest": "3.0.6", "yargs": "17.7.2" }, - "packageManager": "pnpm@10.4.1", - "pnpm": { - "onlyBuiltDependencies": [ - "@swc/core" - ] - } + "packageManager": "pnpm@10.4.1" } diff --git a/system.json b/system.json index 36245e6f..0a99c901 100644 --- a/system.json +++ b/system.json @@ -28,11 +28,11 @@ "name": "Sascha Martens" } ], - "license": "https://git.f3l.de/dungeonslayers/ds4/raw/tag/2.0.5/LICENSE.md", - "readme": "https://git.f3l.de/dungeonslayers/ds4/raw/tag/2.0.5/README.md", + "license": "https://git.f3l.de/dungeonslayers/ds4/raw/tag/2.0.0/LICENSE.md", + "readme": "https://git.f3l.de/dungeonslayers/ds4/raw/tag/2.0.0/README.md", "bugs": "https://git.f3l.de/dungeonslayers/ds4/issues", - "changelog": "https://git.f3l.de/dungeonslayers/ds4/releases/tag/2.0.5", - "version": "2.0.5", + "changelog": "https://git.f3l.de/dungeonslayers/ds4/releases/tag/2.0.0", + "version": "2.0.0", "flags": { "hotReload": { "extensions": ["css", "hbs", "json"], @@ -116,7 +116,7 @@ } ], "manifest": "https://git.f3l.de/api/packages/dungeonslayers/generic/ds4/latest/system.json", - "download": "https://git.f3l.de/dungeonslayers/ds4/releases/download/2.0.5/ds4.zip", + "download": "https://git.f3l.de/dungeonslayers/ds4/releases/download/2.0.0/ds4.zip", "initiative": "@combatValues.initiative.total", "grid": { "distance": 1,