From 77c690e5bc1ed246e8714ebc1fed30ab5cb3c4e4 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:12:33 -0400 Subject: [PATCH 1/8] Don't build @glimmer/debug, as no package should be using it during publish-time --- packages/@glimmer/debug/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/@glimmer/debug/package.json b/packages/@glimmer/debug/package.json index 868c12f6e3..1fcd396a3a 100644 --- a/packages/@glimmer/debug/package.json +++ b/packages/@glimmer/debug/package.json @@ -30,7 +30,6 @@ "dist" ], "scripts": { - "build": "rollup -c rollup.config.mjs", "test:lint": "eslint .", "test:publint": "publint", "test:types": "tsc --noEmit -p ../tsconfig.json" From 43a9d30b68584488de5d79373c36fbc4e81ed1ec Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:08:41 -0400 Subject: [PATCH 2/8] Fix lints --- .eslintrc.cjs | 1 + .../@glimmer-workspace/eslint-plugin/index.js | 5 +++ packages/@glimmer/manager/package.json | 1 - .../@glimmer/opcode-compiler/package.json | 1 - packages/@glimmer/runtime/package.json | 1 - pnpm-lock.yaml | 38 ++++++++----------- 6 files changed, 21 insertions(+), 26 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index ac18684401..fe7c574d24 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -28,6 +28,7 @@ module.exports = { 'import/parsers': { '@typescript-eslint/parser': ['.js', '.cjs', '.mjs', '.mts', '.ts', '.d.ts'], }, + 'import/core-modules': ['@glimmer/debug'], 'import/resolver': { typescript: {}, }, diff --git a/packages/@glimmer-workspace/eslint-plugin/index.js b/packages/@glimmer-workspace/eslint-plugin/index.js index 261d098c52..227254036b 100644 --- a/packages/@glimmer-workspace/eslint-plugin/index.js +++ b/packages/@glimmer-workspace/eslint-plugin/index.js @@ -1,4 +1,5 @@ // @ts-check +const path = require('path'); /** @type {import("eslint").ESLint.Plugin} */ module.exports = { @@ -44,6 +45,10 @@ module.exports = { 'no-fallthrough': 'off', 'import/no-relative-packages': 'error', 'import/default': 'off', + 'import/no-extraneous-dependencies': [ + 'error', + { packageDir: [path.join(__dirname, '../../@glimmer/debug')] }, + ], 'qunit/require-expect': ['error', 'never-except-zero'], // we're using assert.step instead of this sort of thing 'qunit/no-conditional-assertions': 'off', diff --git a/packages/@glimmer/manager/package.json b/packages/@glimmer/manager/package.json index eaca0b2756..6c2bd3ff3d 100644 --- a/packages/@glimmer/manager/package.json +++ b/packages/@glimmer/manager/package.json @@ -33,7 +33,6 @@ "test:types": "tsc --noEmit -p ../tsconfig.json" }, "dependencies": { - "@glimmer/debug": "workspace:*", "@glimmer/destroyable": "workspace:*", "@glimmer/env": "0.1.7", "@glimmer/global-context": "workspace:*", diff --git a/packages/@glimmer/opcode-compiler/package.json b/packages/@glimmer/opcode-compiler/package.json index bed7cbeb9e..355b004a1a 100644 --- a/packages/@glimmer/opcode-compiler/package.json +++ b/packages/@glimmer/opcode-compiler/package.json @@ -33,7 +33,6 @@ "test:types": "tsc --noEmit -p ../tsconfig.json" }, "dependencies": { - "@glimmer/debug": "workspace:*", "@glimmer/encoder": "workspace:*", "@glimmer/env": "0.1.7", "@glimmer/global-context": "workspace:*", diff --git a/packages/@glimmer/runtime/package.json b/packages/@glimmer/runtime/package.json index 29e1356e00..5a0cb8531a 100644 --- a/packages/@glimmer/runtime/package.json +++ b/packages/@glimmer/runtime/package.json @@ -47,7 +47,6 @@ }, "devDependencies": { "@glimmer-workspace/build-support": "workspace:*", - "@glimmer/debug": "workspace:*", "@glimmer/local-debug-flags": "workspace:*", "@glimmer/opcode-compiler": "workspace:*", "@types/qunit": "^2.19.9", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a92992112f..65f5337641 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -773,9 +773,6 @@ importers: packages/@glimmer/manager: dependencies: - '@glimmer/debug': - specifier: workspace:* - version: link:../debug '@glimmer/destroyable': specifier: workspace:* version: link:../destroyable @@ -877,9 +874,6 @@ importers: packages/@glimmer/opcode-compiler: dependencies: - '@glimmer/debug': - specifier: workspace:* - version: link:../debug '@glimmer/encoder': specifier: workspace:* version: link:../encoder @@ -1104,9 +1098,6 @@ importers: '@glimmer-workspace/build-support': specifier: workspace:* version: link:../../@glimmer-workspace/build - '@glimmer/debug': - specifier: workspace:* - version: link:../debug '@glimmer/local-debug-flags': specifier: workspace:* version: link:../local-debug-flags @@ -4703,7 +4694,7 @@ packages: dependencies: '@typescript-eslint/typescript-estree': 6.12.0(typescript@5.0.4) '@typescript-eslint/utils': 6.12.0(eslint@8.54.0)(typescript@5.0.4) - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) eslint: 8.54.0 ts-api-utils: 1.0.3(typescript@5.0.4) typescript: 5.0.4 @@ -4723,7 +4714,7 @@ packages: dependencies: '@typescript-eslint/typescript-estree': 6.12.0(typescript@5.2.2) '@typescript-eslint/utils': 6.12.0(eslint@8.54.0)(typescript@5.2.2) - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) eslint: 8.54.0 ts-api-utils: 1.0.3(typescript@5.2.2) typescript: 5.2.2 @@ -4771,10 +4762,10 @@ packages: dependencies: '@typescript-eslint/types': 6.12.0 '@typescript-eslint/visitor-keys': 6.12.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.4 + semver: 7.6.3 ts-api-utils: 1.0.3(typescript@5.0.4) typescript: 5.0.4 transitivePeerDependencies: @@ -4792,10 +4783,10 @@ packages: dependencies: '@typescript-eslint/types': 6.12.0 '@typescript-eslint/visitor-keys': 6.12.0 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.4 + semver: 7.6.3 ts-api-utils: 1.0.3(typescript@5.2.2) typescript: 5.2.2 transitivePeerDependencies: @@ -4834,7 +4825,7 @@ packages: '@typescript-eslint/types': 6.12.0 '@typescript-eslint/typescript-estree': 6.12.0(typescript@5.0.4) eslint: 8.54.0 - semver: 7.5.4 + semver: 7.6.3 transitivePeerDependencies: - supports-color - typescript @@ -4853,7 +4844,7 @@ packages: '@typescript-eslint/types': 6.12.0 '@typescript-eslint/typescript-estree': 6.12.0(typescript@5.2.2) eslint: 8.54.0 - semver: 7.5.4 + semver: 7.6.3 transitivePeerDependencies: - supports-color - typescript @@ -6314,7 +6305,7 @@ packages: /builtins@5.0.1: resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==} dependencies: - semver: 7.5.2 + semver: 7.6.3 /bundle-name@3.0.0: resolution: {integrity: sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==} @@ -8712,7 +8703,7 @@ packages: find-root: 1.1.0 has: 1.0.4 interpret: 1.4.0 - is-core-module: 2.13.1 + is-core-module: 2.15.1 is-regex: 1.1.4 lodash: 4.17.21 resolve: 1.22.8 @@ -8970,7 +8961,7 @@ packages: eslint-plugin-es: 4.1.0(eslint@8.54.0) eslint-utils: 3.0.0(eslint@8.54.0) ignore: 5.3.0 - is-core-module: 2.13.1 + is-core-module: 2.15.1 minimatch: 3.1.2 resolve: 1.22.8 semver: 7.6.3 @@ -15379,7 +15370,7 @@ packages: resolution: {integrity: sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==} hasBin: true dependencies: - is-core-module: 2.13.1 + is-core-module: 2.15.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 @@ -15791,6 +15782,7 @@ packages: hasBin: true dependencies: lru-cache: 6.0.0 + dev: true /semver@7.5.4: resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} @@ -17772,7 +17764,7 @@ packages: resolution: {integrity: sha512-nd2HUpKc6RWblPZQ2GDuI65sxJ2n/UqZwSBVtj64xlWjMx0m7ZB2m9b2JS3v1f+n9VWH/dd1CMhkHfP6pIdckA==} dependencies: resolve-package-path: 3.1.0 - semver: 7.5.4 + semver: 7.6.3 dev: true /validate-peer-dependencies@2.2.0: @@ -17780,7 +17772,7 @@ packages: engines: {node: '>= 12'} dependencies: resolve-package-path: 4.0.3 - semver: 7.5.4 + semver: 7.6.3 dev: true /vary@1.1.2: From fb4b4a94e854f2d25f1cb5c986a132f5cee67a83 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:10:54 -0400 Subject: [PATCH 3/8] Fix types --- packages/@glimmer/tsconfig.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/@glimmer/tsconfig.json b/packages/@glimmer/tsconfig.json index d478d6443c..ad7e801993 100644 --- a/packages/@glimmer/tsconfig.json +++ b/packages/@glimmer/tsconfig.json @@ -28,7 +28,10 @@ "noPropertyAccessFromIndexSignature": true, "noUncheckedIndexedAccess": true, - "types": ["qunit", "node", "vite/client"] + "types": ["qunit", "node", "vite/client"], + "paths": { + "@glimmer/debug": ["./debug/index.ts"] + } }, "include": ["./**/*", "./**/*.d.ts"], "exclude": ["*/dist", "*/node_modules", "**/fixtures", "*/test"] From ae6ada2c2f61b8f04552e7635b884047d7320541 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:20:05 -0400 Subject: [PATCH 4/8] Fix lints --- packages/@glimmer-workspace/eslint-plugin/index.js | 4 ---- packages/@glimmer/syntax/test/plugin-node-test.ts | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/@glimmer-workspace/eslint-plugin/index.js b/packages/@glimmer-workspace/eslint-plugin/index.js index 227254036b..b5c280d3ef 100644 --- a/packages/@glimmer-workspace/eslint-plugin/index.js +++ b/packages/@glimmer-workspace/eslint-plugin/index.js @@ -45,10 +45,6 @@ module.exports = { 'no-fallthrough': 'off', 'import/no-relative-packages': 'error', 'import/default': 'off', - 'import/no-extraneous-dependencies': [ - 'error', - { packageDir: [path.join(__dirname, '../../@glimmer/debug')] }, - ], 'qunit/require-expect': ['error', 'never-except-zero'], // we're using assert.step instead of this sort of thing 'qunit/no-conditional-assertions': 'off', diff --git a/packages/@glimmer/syntax/test/plugin-node-test.ts b/packages/@glimmer/syntax/test/plugin-node-test.ts index e4cf8f7fc4..8d725f157f 100644 --- a/packages/@glimmer/syntax/test/plugin-node-test.ts +++ b/packages/@glimmer/syntax/test/plugin-node-test.ts @@ -48,6 +48,7 @@ test('deprecated program visitor', (assert) => { return { name: 'plugin', visitor: { + // eslint-disable-next-line deprecation/deprecation Program(node: AST.Program) { assert.step(node.type); }, From 149fd18ff6d91f444c57a202f4606e799ba93de1 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Tue, 1 Oct 2024 17:54:15 -0400 Subject: [PATCH 5/8] Re-add @glimmer/debug, but as a devDep --- packages/@glimmer-workspace/eslint-plugin/index.js | 1 - packages/@glimmer/manager/package.json | 1 + packages/@glimmer/opcode-compiler/package.json | 1 + packages/@glimmer/runtime/package.json | 1 + packages/@glimmer/tsconfig.json | 3 --- pnpm-lock.yaml | 13 +++++++++++-- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/@glimmer-workspace/eslint-plugin/index.js b/packages/@glimmer-workspace/eslint-plugin/index.js index b5c280d3ef..261d098c52 100644 --- a/packages/@glimmer-workspace/eslint-plugin/index.js +++ b/packages/@glimmer-workspace/eslint-plugin/index.js @@ -1,5 +1,4 @@ // @ts-check -const path = require('path'); /** @type {import("eslint").ESLint.Plugin} */ module.exports = { diff --git a/packages/@glimmer/manager/package.json b/packages/@glimmer/manager/package.json index 6c2bd3ff3d..d5b1bee0b3 100644 --- a/packages/@glimmer/manager/package.json +++ b/packages/@glimmer/manager/package.json @@ -44,6 +44,7 @@ }, "devDependencies": { "@glimmer-workspace/build-support": "workspace:*", + "@glimmer/debug": "workspace:*", "@glimmer/local-debug-flags": "workspace:*", "eslint": "^8.52.0", "publint": "^0.2.5", diff --git a/packages/@glimmer/opcode-compiler/package.json b/packages/@glimmer/opcode-compiler/package.json index 355b004a1a..039212e2bd 100644 --- a/packages/@glimmer/opcode-compiler/package.json +++ b/packages/@glimmer/opcode-compiler/package.json @@ -45,6 +45,7 @@ }, "devDependencies": { "@glimmer-workspace/build-support": "workspace:*", + "@glimmer/debug": "workspace:*", "@glimmer/local-debug-flags": "workspace:*", "eslint": "^8.52.0", "publint": "^0.2.5", diff --git a/packages/@glimmer/runtime/package.json b/packages/@glimmer/runtime/package.json index 5a0cb8531a..29e1356e00 100644 --- a/packages/@glimmer/runtime/package.json +++ b/packages/@glimmer/runtime/package.json @@ -47,6 +47,7 @@ }, "devDependencies": { "@glimmer-workspace/build-support": "workspace:*", + "@glimmer/debug": "workspace:*", "@glimmer/local-debug-flags": "workspace:*", "@glimmer/opcode-compiler": "workspace:*", "@types/qunit": "^2.19.9", diff --git a/packages/@glimmer/tsconfig.json b/packages/@glimmer/tsconfig.json index ad7e801993..e0860c4562 100644 --- a/packages/@glimmer/tsconfig.json +++ b/packages/@glimmer/tsconfig.json @@ -29,9 +29,6 @@ "noUncheckedIndexedAccess": true, "types": ["qunit", "node", "vite/client"], - "paths": { - "@glimmer/debug": ["./debug/index.ts"] - } }, "include": ["./**/*", "./**/*.d.ts"], "exclude": ["*/dist", "*/node_modules", "**/fixtures", "*/test"] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 65f5337641..8ec1a0a344 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -801,6 +801,9 @@ importers: '@glimmer-workspace/build-support': specifier: workspace:* version: link:../../@glimmer-workspace/build + '@glimmer/debug': + specifier: workspace:* + version: link:../debug '@glimmer/local-debug-flags': specifier: workspace:* version: link:../local-debug-flags @@ -905,6 +908,9 @@ importers: '@glimmer-workspace/build-support': specifier: workspace:* version: link:../../@glimmer-workspace/build + '@glimmer/debug': + specifier: workspace:* + version: link:../debug '@glimmer/local-debug-flags': specifier: workspace:* version: link:../local-debug-flags @@ -1098,6 +1104,9 @@ importers: '@glimmer-workspace/build-support': specifier: workspace:* version: link:../../@glimmer-workspace/build + '@glimmer/debug': + specifier: workspace:* + version: link:../debug '@glimmer/local-debug-flags': specifier: workspace:* version: link:../local-debug-flags @@ -3182,7 +3191,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) espree: 9.6.1 globals: 13.23.0 ignore: 5.3.0 @@ -3213,7 +3222,7 @@ packages: engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 2.0.1 - debug: 4.3.4(supports-color@8.1.1) + debug: 4.3.7(supports-color@8.1.1) minimatch: 3.1.2 transitivePeerDependencies: - supports-color From 1c5157620c72bdf851308aac2b701e0516f1fe36 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Tue, 1 Oct 2024 17:58:49 -0400 Subject: [PATCH 6/8] Remove publint from @glimmer/debug --- packages/@glimmer/debug/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/@glimmer/debug/package.json b/packages/@glimmer/debug/package.json index 1fcd396a3a..2ab7320ea5 100644 --- a/packages/@glimmer/debug/package.json +++ b/packages/@glimmer/debug/package.json @@ -31,7 +31,6 @@ ], "scripts": { "test:lint": "eslint .", - "test:publint": "publint", "test:types": "tsc --noEmit -p ../tsconfig.json" }, "dependencies": { From 228b68b74c2acb0a1a1db885aa41bf73571e500f Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:08:48 -0400 Subject: [PATCH 7/8] Rename lintfix to lint:fix --- package.json | 2 +- packages/@glimmer/tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b1ab594556..3fbc16887f 100644 --- a/package.json +++ b/package.json @@ -24,9 +24,9 @@ "link:all": "esyes ./bin/link-all.mts", "lint": "npm-run-all lint:*", "lint:files": "turbo lint", + "lint:fix": "pnpm turbo test:lint -- --fix && prettier -w .", "lint:format": "prettier -c .", "lint:types": "tsc -b", - "lintfix": "pnpm turbo test:lint -- --fix && prettier -w .", "start": "vite", "test": "node bin/run-tests.mjs", "test:babel-plugins": "yarn workspace @glimmer/vm-babel-plugins test", diff --git a/packages/@glimmer/tsconfig.json b/packages/@glimmer/tsconfig.json index e0860c4562..d478d6443c 100644 --- a/packages/@glimmer/tsconfig.json +++ b/packages/@glimmer/tsconfig.json @@ -28,7 +28,7 @@ "noPropertyAccessFromIndexSignature": true, "noUncheckedIndexedAccess": true, - "types": ["qunit", "node", "vite/client"], + "types": ["qunit", "node", "vite/client"] }, "include": ["./**/*", "./**/*.d.ts"], "exclude": ["*/dist", "*/node_modules", "**/fixtures", "*/test"] From ffa3b2c608d4a244f94b3bdb3e2f19c1add5f1b8 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Tue, 1 Oct 2024 18:24:34 -0400 Subject: [PATCH 8/8] test:types --- bin/run-types-tests.mjs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/run-types-tests.mjs b/bin/run-types-tests.mjs index ba3f085466..33bb335819 100755 --- a/bin/run-types-tests.mjs +++ b/bin/run-types-tests.mjs @@ -9,8 +9,10 @@ import { fileURLToPath } from 'url'; const __dirname = fileURLToPath(new URL('.', import.meta.url)); const root = resolve(__dirname, '..'); +const PACKAGES_WITH_NO_PUBLISHED_TYPES = new Set(['@glimmer/vm-babel-plugins', '@glimmer/debug']); + async function main() { - const packages = getPackages().filter((pkg) => pkg.name !== '@glimmer/vm-babel-plugins'); + const packages = getPackages().filter((pkg) => !PACKAGES_WITH_NO_PUBLISHED_TYPES.has(pkg.name)); /** * Runs a smoke test of the generated type definitions by importing every module