From 48435a3e375c40cc7415348f6b957ea407e1fe39 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Wed, 2 Oct 2024 10:54:56 -0400 Subject: [PATCH] Don't build @glimmer/debug, as no package should be using it during publish-time (#1625) * Don't build @glimmer/debug, as no package should be using it during publish-time * Fix lints * Fix types * Fix lints * Re-add @glimmer/debug, but as a devDep * Remove publint from @glimmer/debug * Rename lintfix to lint:fix * test:types --- .eslintrc.cjs | 1 + bin/run-types-tests.mjs | 4 +- package.json | 2 +- packages/@glimmer/debug/package.json | 2 - packages/@glimmer/manager/package.json | 2 +- .../@glimmer/opcode-compiler/package.json | 2 +- .../@glimmer/syntax/test/plugin-node-test.ts | 1 + pnpm-lock.yaml | 45 ++++++++++--------- 8 files changed, 31 insertions(+), 28 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/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 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/debug/package.json b/packages/@glimmer/debug/package.json index 868c12f6e3..2ab7320ea5 100644 --- a/packages/@glimmer/debug/package.json +++ b/packages/@glimmer/debug/package.json @@ -30,9 +30,7 @@ "dist" ], "scripts": { - "build": "rollup -c rollup.config.mjs", "test:lint": "eslint .", - "test:publint": "publint", "test:types": "tsc --noEmit -p ../tsconfig.json" }, "dependencies": { diff --git a/packages/@glimmer/manager/package.json b/packages/@glimmer/manager/package.json index eaca0b2756..d5b1bee0b3 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:*", @@ -45,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 bed7cbeb9e..039212e2bd 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:*", @@ -46,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/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); }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a92992112f..8ec1a0a344 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 @@ -804,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 @@ -877,9 +877,6 @@ importers: packages/@glimmer/opcode-compiler: dependencies: - '@glimmer/debug': - specifier: workspace:* - version: link:../debug '@glimmer/encoder': specifier: workspace:* version: link:../encoder @@ -911,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 @@ -3191,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 @@ -3222,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 @@ -4703,7 +4703,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 +4723,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 +4771,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 +4792,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 +4834,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 +4853,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 +6314,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 +8712,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 +8970,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 +15379,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 +15791,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 +17773,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 +17781,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: