diff --git a/docs/development.md b/docs/development.md index 64f03d0..3911816 100644 --- a/docs/development.md +++ b/docs/development.md @@ -1,5 +1,26 @@ # Development +## Verification + +Run the repository checks through mise after installing dependencies. + +```bash +mise run install +mise run typecheck +mise run lint +mise run test +mise run build +``` + +`mise run typecheck` checks the source in every workspace without emitting files +or using an incremental cache. `mise run lint` runs the same compiler check before +ESLint, so the pull request workflow catches type errors as well as lint errors. +The compiler inherits Backstage's defaults from `@backstage/cli/config/tsconfig.json`. +Keep the root and GitHub theme TypeScript versions aligned with the app template +for the installed Backstage release when upgrading. + +`mise run build` builds the Docker image locally. It does not publish an image. + ## Creating a New Plugin On the command line, run the following command to create a new plugin. diff --git a/mise.toml b/mise.toml index 9776ab1..5959b68 100644 --- a/mise.toml +++ b/mise.toml @@ -51,6 +51,10 @@ run = 'bash -c "set -euo pipefail; git fetch --tags --force; echo version=$(./sc description = "Run linting and type checking" run = './scripts/lint' +[tasks.typecheck] +description = "Check TypeScript across all workspaces without emitting files" +run = 'yarn typecheck' + [tasks.test] description = "Run the test suite" run = 'yarn test --watchAll=false' diff --git a/package.json b/package.json index c67d3ba..258e67a 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "build-image": "yarn workspace backend build-image", "tsc": "tsc", "tsc:full": "tsc --skipLibCheck false --incremental false", + "typecheck": "tsc --noEmit --emitDeclarationOnly false --incremental false", "clean": "backstage-cli repo clean", "test": "backstage-cli repo test", "test:all": "backstage-cli repo test --coverage", @@ -42,7 +43,7 @@ "lerna": "^7.3.0", "node-gyp": "^9.0.0", "prettier": "^2.3.2", - "typescript": "~5.3.0" + "typescript": "~5.8.0" }, "resolutions": { "@yarnpkg/core": "4.9.1", diff --git a/packages/backstage-theme-github/package.json b/packages/backstage-theme-github/package.json index 7047e6b..54413ec 100644 --- a/packages/backstage-theme-github/package.json +++ b/packages/backstage-theme-github/package.json @@ -29,7 +29,7 @@ "react": "^18.0.0", "react-dom": "^18.0.0", "react-router-dom": "^6.0.0", - "typescript": "~5.3.0" + "typescript": "~5.8.0" }, "eslintConfig": { "root": false, diff --git a/scripts/lint b/scripts/lint index 6ed1b3e..1bf380c 100755 --- a/scripts/lint +++ b/scripts/lint @@ -1,3 +1,4 @@ #!/usr/bin/env bash set -euo pipefail -yarn lint:all \ No newline at end of file +yarn typecheck +yarn lint:all diff --git a/yarn.lock b/yarn.lock index 39c2721..36644ff 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7372,7 +7372,7 @@ __metadata: react: "npm:^18.0.0" react-dom: "npm:^18.0.0" react-router-dom: "npm:^6.0.0" - typescript: "npm:~5.3.0" + typescript: "npm:~5.8.0" languageName: unknown linkType: soft @@ -33695,7 +33695,7 @@ __metadata: lerna: "npm:^7.3.0" node-gyp: "npm:^9.0.0" prettier: "npm:^2.3.2" - typescript: "npm:~5.3.0" + typescript: "npm:~5.8.0" languageName: unknown linkType: soft @@ -36756,23 +36756,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:~5.3.0": - version: 5.3.3 - resolution: "typescript@npm:5.3.3" +"typescript@npm:~5.5.0": + version: 5.5.4 + resolution: "typescript@npm:5.5.4" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/e33cef99d82573624fc0f854a2980322714986bc35b9cb4d1ce736ed182aeab78e2cb32b385efa493b2a976ef52c53e20d6c6918312353a91850e2b76f1ea44f + checksum: 10c0/422be60f89e661eab29ac488c974b6cc0a660fb2228003b297c3d10c32c90f3bcffc1009b43876a082515a3c376b1eefcce823d6e78982e6878408b9a923199c languageName: node linkType: hard -"typescript@npm:~5.5.0": - version: 5.5.4 - resolution: "typescript@npm:5.5.4" +"typescript@npm:~5.8.0": + version: 5.8.3 + resolution: "typescript@npm:5.8.3" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/422be60f89e661eab29ac488c974b6cc0a660fb2228003b297c3d10c32c90f3bcffc1009b43876a082515a3c376b1eefcce823d6e78982e6878408b9a923199c + checksum: 10c0/5f8bb01196e542e64d44db3d16ee0e4063ce4f3e3966df6005f2588e86d91c03e1fb131c2581baf0fb65ee79669eea6e161cd448178986587e9f6844446dbb48 languageName: node linkType: hard @@ -36806,23 +36806,23 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@npm%3A~5.3.0#optional!builtin": - version: 5.3.3 - resolution: "typescript@patch:typescript@npm%3A5.3.3#optional!builtin::version=5.3.3&hash=e012d7" +"typescript@patch:typescript@npm%3A~5.5.0#optional!builtin": + version: 5.5.4 + resolution: "typescript@patch:typescript@npm%3A5.5.4#optional!builtin::version=5.5.4&hash=379a07" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/1d0a5f4ce496c42caa9a30e659c467c5686eae15d54b027ee7866744952547f1be1262f2d40de911618c242b510029d51d43ff605dba8fb740ec85ca2d3f9500 + checksum: 10c0/73409d7b9196a5a1217b3aaad929bf76294d3ce7d6e9766dd880ece296ee91cf7d7db6b16c6c6c630ee5096eccde726c0ef17c7dfa52b01a243e57ae1f09ef07 languageName: node linkType: hard -"typescript@patch:typescript@npm%3A~5.5.0#optional!builtin": - version: 5.5.4 - resolution: "typescript@patch:typescript@npm%3A5.5.4#optional!builtin::version=5.5.4&hash=379a07" +"typescript@patch:typescript@npm%3A~5.8.0#optional!builtin": + version: 5.8.3 + resolution: "typescript@patch:typescript@npm%3A5.8.3#optional!builtin::version=5.8.3&hash=379a07" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 10c0/73409d7b9196a5a1217b3aaad929bf76294d3ce7d6e9766dd880ece296ee91cf7d7db6b16c6c6c630ee5096eccde726c0ef17c7dfa52b01a243e57ae1f09ef07 + checksum: 10c0/92ea03509e06598948559ddcdd8a4ae5a7ab475766d5589f1b796f5731b3d631a4c7ddfb86a3bd44d58d10102b132cd4b4994dda9b63e6273c66d77d6a271dbd languageName: node linkType: hard