diff --git a/.gitea/ISSUE_TEMPLATE/bug_report.yaml b/.gitea/ISSUE_TEMPLATE/bug_report.yaml index 7589e1ea..fc0fbaa0 100644 --- a/.gitea/ISSUE_TEMPLATE/bug_report.yaml +++ b/.gitea/ISSUE_TEMPLATE/bug_report.yaml @@ -6,94 +6,94 @@ name: Bug Report about: File a bug report labels: ["bug", "to be confirmed"] body: - - type: markdown - attributes: - value: | - Your issue may already have been reported! Please search on the [issue tracker](https://git.f3l.de/dungeonslayers/ds4/issues) before submitting a new one. + - type: markdown + attributes: + value: | + Your issue may already have been reported! Please search on the [issue tracker](https://git.f3l.de/dungeonslayers/ds4/issues) before submitting a new one. - Thanks for taking the time to fill out this bug report! In order to make it effective, please provide the following information. - - type: markdown - attributes: - value: | - ## Issue Description - - type: textarea - id: expected - attributes: - label: Expected Behavior - description: What is the behavior that you expected? - validations: - required: true - - type: textarea - id: current - attributes: - label: Current Behavior - description: What is the current behavior, i.e., what happens actually? - validations: - required: true - - type: textarea - id: steps - attributes: - label: Steps to Reproduce - description: What are the steps to reproduce the problem? - placeholder: | - 1. - 2. - 3. - 4. - validations: - required: true - - type: textarea - id: context - attributes: - label: Context - description: Please provide any additional context that might be helpful, e.g. log messages, screenshots, videos, or exports of problematic scenes or worlds. - validations: - required: false - - type: markdown - attributes: - value: | - ## Environment Details - - type: input - id: version - attributes: - label: Version - description: Which version(s) of DS4 are you seeing the problem on? - validations: - required: true - - type: input - id: foundry-version - attributes: - label: Foundry VTT Version - description: Which version(s) and build of Foundry VTT are you seeing the problem on? - validations: - required: true - - type: input - id: os - attributes: - label: Operating System - description: Which operating system are you using? (Windows, OS X, Linux (which distro)) - placeholder: Windows - validations: - required: true - - type: dropdown - id: browser - attributes: - label: Browser / App - description: Are you using a Browser or the native Electron application? (Select all that apply) - multiple: true - options: - - Native Electron App - - Chrome - - Firefox - - Microsoft Edge - - Safari - - Other - validations: - required: true - - type: input - id: modules - attributes: - label: Relevant Modules - description: Please list any other active modules (including their versions) that you think might be relevant. - validations: - required: false + Thanks for taking the time to fill out this bug report! In order to make it effective, please provide the following information. + - type: markdown + attributes: + value: | + ## Issue Description + - type: textarea + id: expected + attributes: + label: Expected Behavior + description: What is the behavior that you expected? + validations: + required: true + - type: textarea + id: current + attributes: + label: Current Behavior + description: What is the current behavior, i.e., what happens actually? + validations: + required: true + - type: textarea + id: steps + attributes: + label: Steps to Reproduce + description: What are the steps to reproduce the problem? + placeholder: | + 1. + 2. + 3. + 4. + validations: + required: true + - type: textarea + id: context + attributes: + label: Context + description: Please provide any additional context that might be helpful, e.g. log messages, screenshots, videos, or exports of problematic scenes or worlds. + validations: + required: false + - type: markdown + attributes: + value: | + ## Environment Details + - type: input + id: version + attributes: + label: Version + description: Which version(s) of DS4 are you seeing the problem on? + validations: + required: true + - type: input + id: foundry-version + attributes: + label: Foundry VTT Version + description: Which version(s) and build of Foundry VTT are you seeing the problem on? + validations: + required: true + - type: input + id: os + attributes: + label: Operating System + description: Which operating system are you using? (Windows, OS X, Linux (which distro)) + placeholder: Windows + validations: + required: true + - type: dropdown + id: browser + attributes: + label: Browser / App + description: Are you using a Browser or the native Electron application? (Select all that apply) + multiple: true + options: + - Native Electron App + - Chrome + - Firefox + - Microsoft Edge + - Safari + - Other + validations: + required: true + - type: input + id: modules + attributes: + label: Relevant Modules + description: Please list any other active modules (including their versions) that you think might be relevant. + validations: + required: false diff --git a/.gitea/ISSUE_TEMPLATE/feature_request.yaml b/.gitea/ISSUE_TEMPLATE/feature_request.yaml index 2609dcce..83816387 100644 --- a/.gitea/ISSUE_TEMPLATE/feature_request.yaml +++ b/.gitea/ISSUE_TEMPLATE/feature_request.yaml @@ -6,23 +6,23 @@ name: Feature Request description: Submit a feature request labels: ["feature"] body: - - type: markdown - attributes: - value: | - Your issue may already have been reported! Please search on the [issue tracker](https://git.f3l.de/dungeonslayers/ds4/issues) before submitting a new one. + - type: markdown + attributes: + value: | + Your issue may already have been reported! Please search on the [issue tracker](https://git.f3l.de/dungeonslayers/ds4/issues) before submitting a new one. - In order to submit an effective feature request, please provide the following information. - - type: textarea - id: description - attributes: - label: Description - description: Please describe the proposal in as much detail as you feel is necessary. - validations: - required: true - - type: textarea - id: context - attributes: - label: Context - description: Is there anything else you can add about the proposal? You might want to link to related issues here if you haven't already. - validations: - required: false + In order to submit an effective feature request, please provide the following information. + - type: textarea + id: description + attributes: + label: Description + description: Please describe the proposal in as much detail as you feel is necessary. + validations: + required: true + - type: textarea + id: context + attributes: + label: Context + description: Is there anything else you can add about the proposal? You might want to link to related issues here if you haven't already. + validations: + required: false diff --git a/.prettierignore b/.prettierignore index 33965402..3c545cf4 100644 --- a/.prettierignore +++ b/.prettierignore @@ -8,3 +8,4 @@ /.vscode/ client common +pnpm-lock.yaml diff --git a/.woodpecker/checks.yaml b/.woodpecker/checks.yaml index a46f3116..44f07456 100644 --- a/.woodpecker/checks.yaml +++ b/.woodpecker/checks.yaml @@ -5,66 +5,66 @@ $schema: https://raw.githubusercontent.com/woodpecker-ci/woodpecker/master/pipeline/schema/schema.json variables: - - &node_image node:lts - - &enable_pnpm - - corepack enable - - corepack prepare pnpm@latest --activate + - &node_image node:lts + - &enable_pnpm + - corepack enable + - corepack prepare pnpm@latest --activate when: - - event: push - branch: ${CI_REPO_DEFAULT_BRANCH} - - event: pull_request - - event: tag - - event: manual + - event: push + branch: ${CI_REPO_DEFAULT_BRANCH} + - event: pull_request + - event: tag + - event: manual steps: - install: - image: *node_image - commands: - - <<: *enable_pnpm - - pnpm install --frozen-lockfile - lint: - group: check - image: *node_image - commands: - - <<: *enable_pnpm - - pnpm lint - formatcheck: - group: check - image: *node_image - commands: - - <<: *enable_pnpm - - pnpm format:check - typecheck: - group: check - image: *node_image - commands: - - <<: *enable_pnpm - - pnpm typecheck - test: - group: check - image: *node_image - commands: - - <<: *enable_pnpm - - pnpm test - reuse: - group: check - image: fsfe/reuse:latest - commands: - - reuse lint - commitlint: - group: check - image: *node_image - commands: - - <<: *enable_pnpm - - git fetch - - pnpm exec commitlint --from origin/${CI_COMMIT_TARGET_BRANCH} - when: - event: pull_request - build: - group: build - image: *node_image - commands: - - export APPDATA=$(pwd) - - <<: *enable_pnpm - - pnpm build + install: + image: *node_image + commands: + - <<: *enable_pnpm + - pnpm install --frozen-lockfile + lint: + group: check + image: *node_image + commands: + - <<: *enable_pnpm + - pnpm lint + formatcheck: + group: check + image: *node_image + commands: + - <<: *enable_pnpm + - pnpm format:check + typecheck: + group: check + image: *node_image + commands: + - <<: *enable_pnpm + - pnpm typecheck + test: + group: check + image: *node_image + commands: + - <<: *enable_pnpm + - pnpm test + reuse: + group: check + image: fsfe/reuse:latest + commands: + - reuse lint + commitlint: + group: check + image: *node_image + commands: + - <<: *enable_pnpm + - git fetch origin ${CI_COMMIT_TARGET_BRANCH} + - pnpm exec commitlint --from origin/${CI_COMMIT_TARGET_BRANCH} + when: + event: pull_request + build: + group: build + image: *node_image + commands: + - export APPDATA=$(pwd) + - <<: *enable_pnpm + - pnpm build diff --git a/.woodpecker/publish.yaml b/.woodpecker/publish.yaml index b4e6e096..f313687b 100644 --- a/.woodpecker/publish.yaml +++ b/.woodpecker/publish.yaml @@ -5,94 +5,110 @@ $schema: https://raw.githubusercontent.com/woodpecker-ci/woodpecker/master/pipeline/schema/schema.json variables: - - &node_image node:lts - - &enable_pnpm - - corepack enable - - corepack prepare pnpm@latest --activate + - &node_image node:lts + - &enable_pnpm + - corepack enable + - corepack prepare pnpm@latest --activate + - &is_latest_channel + evaluate: CI_COMMIT_TAG matches "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+$" + - &is_beta_channel + evaluate: CI_COMMIT_TAG matches "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+-[0-9]+$" + - &release_plugin woodpeckerci/plugin-gitea-release + - &release_base_settings + base_url: ${CI_FORGE_URL} + title: ${CI_COMMIT_TAG} + note: CHANGELOG.md + files: + - ${CI_REPO_NAME}.zip + - ${CI_REPO_NAME}/system.json + api_key: + from_secret: forge_token when: - event: tag - evaluate: CI_COMMIT_TAG matches "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9]+)?$" + event: tag + evaluate: CI_COMMIT_TAG matches "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+(-[0-9]+)?$" depends_on: - - checks + - checks steps: - install: - image: *node_image - commands: - - <<: *enable_pnpm - - pnpm install --frozen-lockfile - build: - image: *node_image - environment: - NODE_ENV: production - commands: - - export APPDATA=$(pwd) - - <<: *enable_pnpm - - pnpm build - package: - group: prepare-release - image: alpine:latest - commands: - - apk update - - apk add zip curl - - mv dist ${CI_REPO_NAME} - - zip -r ${CI_REPO_NAME}.zip ${CI_REPO_NAME}/* - changelog: - group: prepare-release - image: *node_image - commands: - - <<: *enable_pnpm - - pnpm changelog - choose-latest-channel: - group: prepare-release - image: alpine:latest - commands: - - echo latest > .RELEASE_CHANNEL - when: - evaluate: CI_COMMIT_TAG matches "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+$" - choose-beta-channel: - group: prepare-release - image: alpine:latest - commands: - - echo beta > .RELEASE_CHANNEL - when: - evaluate: CI_COMMIT_TAG matches "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+-[0-9]+$" - release: - image: woodpeckerci/plugin-gitea-release - settings: - base_url: ${CI_FORGE_URL} - title: ${CI_COMMIT_TAG} - note: CHANGELOG.md - files: - - ${CI_REPO_NAME}.zip - - ${CI_REPO_NAME}/system.json - api_key: - from_secret: forge_token - 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: - group: publish - image: johannesloher/foundry-publish - environment: - 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: - evaluate: CI_COMMIT_TAG matches "^[0-9]+\\\\.[0-9]+\\\\.[0-9]+$" + install: + image: *node_image + commands: + - <<: *enable_pnpm + - pnpm install --frozen-lockfile + build: + image: *node_image + environment: + NODE_ENV: production + commands: + - export APPDATA=$(pwd) + - <<: *enable_pnpm + - pnpm build + package: + group: prepare-release + image: alpine:latest + commands: + - apk update + - apk add zip curl + - mv dist ${CI_REPO_NAME} + - zip -r ${CI_REPO_NAME}.zip ${CI_REPO_NAME}/* + changelog: + group: prepare-release + image: *node_image + commands: + - <<: *enable_pnpm + - pnpm changelog + choose-latest-channel: + group: prepare-release + image: alpine:latest + commands: + - echo latest > .RELEASE_CHANNEL + when: + <<: *is_latest_channel + choose-beta-channel: + group: prepare-release + image: alpine:latest + commands: + - echo beta > .RELEASE_CHANNEL + when: + <<: *is_beta_channel + release-latest: + image: *release_plugin + settings: + <<: *release_base_settings + when: + <<: *is_latest_channel + release-beta: + image: *release_plugin + settings: + <<: *release_base_settings + prerelease: true + 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: + group: publish + image: johannesloher/foundry-publish + environment: + 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 598014d6..41792cb0 100644 --- a/.woodpecker/release.yaml +++ b/.woodpecker/release.yaml @@ -5,43 +5,43 @@ $schema: https://raw.githubusercontent.com/woodpecker-ci/woodpecker/master/pipeline/schema/schema.json variables: - - &node_image node:lts - - &enable_pnpm - - corepack enable - - corepack prepare pnpm@latest --activate + - &node_image node:lts + - &enable_pnpm + - corepack enable + - corepack prepare pnpm@latest --activate when: - event: manual - branch: ${CI_REPO_DEFAULT_BRANCH} + event: manual + branch: ${CI_REPO_DEFAULT_BRANCH} depends_on: - - checks + - checks steps: - install: - image: *node_image - commands: - - <<: *enable_pnpm - - pnpm install --frozen-lockfile - release: - image: *node_image - commands: - - <<: *enable_pnpm - - apt-get update - - apt-get install --yes jq - - export REPOSITORY_URL=$(echo "${CI_REPO_CLONE_URL}" | sed -e "s|://|://$${FORGE_TOKEN_NAME}:$${FORGE_TOKEN}@|g") - - git remote set-url origin $${REPOSITORY_URL} - - git config user.name woodpecker[bot] - - git config user.email woodpecker[bot]@${CI_SYSTEM_HOST} - - pnpm bump-version --release=${RELEASE_TYPE} - - pnpm exec prettier package.json system.json - - export RELEASE_VERSION=$(jq -r '.version' < package.json) - - git --no-pager diff - - git add package.json system.json - - 'git commit -m "chore(release): $${RELEASE_VERSION}"' - - git tag -f $${RELEASE_VERSION} - - git push origin ${CI_COMMIT_BRANCH} - - git push origin $${RELEASE_VERSION} - secrets: - - forge_token_name - - forge_token + install: + image: *node_image + commands: + - <<: *enable_pnpm + - pnpm install --frozen-lockfile + release: + image: *node_image + commands: + - <<: *enable_pnpm + - apt-get update + - apt-get install --yes jq + - export REPOSITORY_URL=$(echo "${CI_REPO_CLONE_URL}" | sed -e "s|://|://$${FORGE_TOKEN_NAME}:$${FORGE_TOKEN}@|g") + - git remote set-url origin $${REPOSITORY_URL} + - git config user.name woodpecker[bot] + - git config user.email woodpecker[bot]@${CI_SYSTEM_HOST} + - pnpm bump-version --release=${RELEASE_TYPE} + - pnpm exec prettier package.json system.json + - export RELEASE_VERSION=$(jq -r '.version' < package.json) + - git --no-pager diff + - git add package.json system.json + - 'git commit -m "chore(release): $${RELEASE_VERSION}"' + - 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/package.json b/package.json index e180a237..06507d68 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "eslint": "eslint --ext .ts,.js,.cjs,.mjs .", "format": "pnpm prettier --write", "format:check": "pnpm prettier --check", - "prettier": "prettier \"./**/*.(ts|js|cjs|mjs|json|scss|yml)\"", + "prettier": "prettier \"./**/*.(ts|js|cjs|mjs|json|scss|yml|yaml)\"", "test": "run-p test:vitest test:typecheck", "test:vitest": "vitest run", "test:typecheck": "tsc --noEmit --project spec/tsconfig.json",