From c8f621c88a121016118a5008104e09c93a4a8922 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Sun, 29 Dec 2024 18:59:03 -0500 Subject: [PATCH 01/19] Update ember-try config (support unchanged) --- test-app/config/ember-try.js | 44 ++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/test-app/config/ember-try.js b/test-app/config/ember-try.js index db0352f5..bc225fea 100644 --- a/test-app/config/ember-try.js +++ b/test-app/config/ember-try.js @@ -4,6 +4,35 @@ const getChannelURL = require('ember-source-channel-url'); const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup'); module.exports = async function () { + const ember4Deps = { + 'ember-cli': '~4.12.0', + 'ember-qunit': '^9.0.1', + 'ember-maybe-import-regenerator': '^1.0.0', + }; + + const ember5Deps = { + '@glimmer/component': '^1.1.2', + '@ember/string': '^3.1.1', + 'ember-resolver': '^11.0.0', + 'ember-auto-import': '^2.3.0', + 'ember-template-lint': '^6.0.0', + 'ember-cli': '^5.12.0', + 'ember-maybe-import-regenerator': null, + 'ember-cli-dependency-checker': null, + 'qunit-dom': '^3.4.0', + }; + + const ember6Deps = { + ...ember5Deps, + '@ember/string': '^4.0.0', + '@ember/test-waiters': '^4.0.0', + '@ember/test-helpers': '^4.0.4', + 'ember-cli': '^6.1.0', + 'ember-load-initializers': '^3.0.1', + 'ember-resolver': '^13.1.0', + typescript: '^5.7.0', + }; + return { usePnpm: true, scenarios: [ @@ -11,8 +40,7 @@ module.exports = async function () { name: 'ember-3.28', npm: { devDependencies: { - // Max ember-cli - 'ember-cli': '~4.12.0', + ...ember4Deps, // close enough, really 'ember-source': '~3.28.0', }, }, @@ -21,6 +49,7 @@ module.exports = async function () { name: 'ember-4.0.0', npm: { devDependencies: { + ...ember4Deps, 'ember-source': '~4.0.0', }, }, @@ -29,6 +58,7 @@ module.exports = async function () { name: 'ember-4.4', npm: { devDependencies: { + ...ember4Deps, 'ember-source': '~4.4.0', }, }, @@ -37,6 +67,7 @@ module.exports = async function () { name: 'ember-4.8', npm: { devDependencies: { + ...ember4Deps, 'ember-source': '~4.8.0', }, }, @@ -45,6 +76,7 @@ module.exports = async function () { name: 'ember-4.12', npm: { devDependencies: { + ...ember4Deps, 'ember-source': '~4.12.0', }, }, @@ -53,6 +85,7 @@ module.exports = async function () { name: 'ember-5.4', npm: { devDependencies: { + ...ember5Deps, 'ember-source': '~5.4.0', }, }, @@ -61,6 +94,7 @@ module.exports = async function () { name: 'ember-5.8', npm: { devDependencies: { + ...ember5Deps, 'ember-source': '~5.8.0', }, }, @@ -69,6 +103,7 @@ module.exports = async function () { name: 'ember-5.12', npm: { devDependencies: { + ...ember5Deps, 'ember-source': '~5.12.0', }, }, @@ -77,6 +112,7 @@ module.exports = async function () { name: 'ember-release', npm: { devDependencies: { + ...ember6Deps, 'ember-source': await getChannelURL('release'), }, }, @@ -85,6 +121,7 @@ module.exports = async function () { name: 'ember-beta', npm: { devDependencies: { + ...ember6Deps, 'ember-source': await getChannelURL('beta'), }, }, @@ -93,6 +130,7 @@ module.exports = async function () { name: 'ember-canary', npm: { devDependencies: { + ...ember6Deps, 'ember-source': await getChannelURL('canary'), }, }, @@ -100,6 +138,7 @@ module.exports = async function () { embroiderSafe({ npm: { devDependencies: { + ...ember6Deps, 'ember-source': await getChannelURL('release'), }, }, @@ -107,6 +146,7 @@ module.exports = async function () { embroiderOptimized({ npm: { devDependencies: { + ...ember6Deps, 'ember-source': await getChannelURL('release'), }, }, From 5c668b58d6b76aaf0d8e0f2100ada246d432ca38 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Wed, 1 Jan 2025 12:28:04 -0500 Subject: [PATCH 02/19] Updates --- test-app/config/ember-try.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/test-app/config/ember-try.js b/test-app/config/ember-try.js index bc225fea..108ac8c3 100644 --- a/test-app/config/ember-try.js +++ b/test-app/config/ember-try.js @@ -4,13 +4,27 @@ const getChannelURL = require('ember-source-channel-url'); const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup'); module.exports = async function () { - const ember4Deps = { + const ember3Deps = { + 'ember-maybe-import-regenerator': '^1.0.0', + 'ember-qunit': '^5.1.5', + '@ember/test-waiters': '^2.4.5', + '@ember/test-helpers': '^2.6.0', + 'ember-resolver': '^8.0.3', + // Compat Upgrades 'ember-cli': '~4.12.0', + 'ember-auto-import': '^2.10.0', + // Not needed + 'ember-fetch': null, + 'ember-cli-app-version': null, + }; + + const ember4Deps = { + ...ember3Deps, 'ember-qunit': '^9.0.1', - 'ember-maybe-import-regenerator': '^1.0.0', }; const ember5Deps = { + ...ember4Deps, '@glimmer/component': '^1.1.2', '@ember/string': '^3.1.1', 'ember-resolver': '^11.0.0', From f31fd960fe616eb1ab9a9de6e24f0ab12227cd20 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Wed, 1 Jan 2025 12:54:39 -0500 Subject: [PATCH 03/19] Updates --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48df86c7..ab6ffe95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,6 +91,8 @@ jobs: pnpm --filter "test-app*" exec glint --version; - name: 'Type checking (built in types)' + # Types of newer versions are not compatible with TS < v5 + run: pnpm add --save-dev "@ember/test-helpers@^3.0.0" run: pnpm --filter "test-app" exec glint; - name: 'Type checking (DefinitelyTyped types)' From e5f5989a0e8f93c780d6e0e77c5044d56c609590 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Wed, 1 Jan 2025 12:56:31 -0500 Subject: [PATCH 04/19] Updates --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab6ffe95..5deed5e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,9 +90,10 @@ jobs: pnpm --filter "test-app*" exec tsc -v; pnpm --filter "test-app*" exec glint --version; - - name: 'Type checking (built in types)' # Types of newer versions are not compatible with TS < v5 - run: pnpm add --save-dev "@ember/test-helpers@^3.0.0" + - run: pnpm add --save-dev "@ember/test-helpers@^3.0.0" + working-directory: 'test-app' + - name: 'Type checking (built in types)' run: pnpm --filter "test-app" exec glint; - name: 'Type checking (DefinitelyTyped types)' From 27ae757601d8025ca1d4aa8eab426814ba07d27c Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Wed, 1 Jan 2025 13:27:18 -0500 Subject: [PATCH 05/19] Add separate test app for testing old TS types (TS < 5.1) --- .github/workflows/ci.yml | 46 +- pnpm-workspace.yaml | 1 + test-app-old-ts/.editorconfig | 19 + test-app-old-ts/.ember-cli | 9 + test-app-old-ts/.eslintignore | 23 + test-app-old-ts/.eslintrc.js | 54 + test-app-old-ts/.gitignore | 26 + test-app-old-ts/.prettierignore | 26 + test-app-old-ts/.prettierrc.js | 30 + test-app-old-ts/.template-lintrc.js | 14 + test-app-old-ts/.watchmanconfig | 3 + test-app-old-ts/app | 1 + test-app-old-ts/config/dependency-lint.js | 3 + .../config/deprecation-workflow.js | 6 + test-app-old-ts/config/ember-cli-update.json | 18 + test-app-old-ts/config/ember-try.js | 170 + test-app-old-ts/config/environment.js | 52 + test-app-old-ts/config/optional-features.json | 6 + test-app-old-ts/config/targets.js | 22 + test-app-old-ts/ember-cli-build.js | 56 + test-app-old-ts/package.json | 124 + test-app-old-ts/pnpm-lock.yaml | 16231 ++++++++++++++++ test-app-old-ts/public/robots.txt | 3 + test-app-old-ts/testem.js | 23 + test-app-old-ts/tests | 1 + test-app-old-ts/tsconfig.json | 15 + test-app-old-ts/types/glint-registry.d.ts | 13 + test-app-old-ts/types/index.d.ts | 2 + 28 files changed, 16993 insertions(+), 4 deletions(-) create mode 100644 test-app-old-ts/.editorconfig create mode 100644 test-app-old-ts/.ember-cli create mode 100644 test-app-old-ts/.eslintignore create mode 100644 test-app-old-ts/.eslintrc.js create mode 100644 test-app-old-ts/.gitignore create mode 100644 test-app-old-ts/.prettierignore create mode 100644 test-app-old-ts/.prettierrc.js create mode 100644 test-app-old-ts/.template-lintrc.js create mode 100644 test-app-old-ts/.watchmanconfig create mode 120000 test-app-old-ts/app create mode 100644 test-app-old-ts/config/dependency-lint.js create mode 100644 test-app-old-ts/config/deprecation-workflow.js create mode 100644 test-app-old-ts/config/ember-cli-update.json create mode 100644 test-app-old-ts/config/ember-try.js create mode 100644 test-app-old-ts/config/environment.js create mode 100644 test-app-old-ts/config/optional-features.json create mode 100644 test-app-old-ts/config/targets.js create mode 100644 test-app-old-ts/ember-cli-build.js create mode 100644 test-app-old-ts/package.json create mode 100644 test-app-old-ts/pnpm-lock.yaml create mode 100644 test-app-old-ts/public/robots.txt create mode 100644 test-app-old-ts/testem.js create mode 120000 test-app-old-ts/tests create mode 100644 test-app-old-ts/tsconfig.json create mode 100644 test-app-old-ts/types/glint-registry.d.ts create mode 100644 test-app-old-ts/types/index.d.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5deed5e9..cb0c93e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: - uses: ./.github/actions/assert-build - typecheck: + typecheck_legacy: name: '${{ matrix.typescript-scenario }}' runs-on: ubuntu-latest timeout-minutes: 5 @@ -66,9 +66,50 @@ jobs: - typescript@4.8 - typescript@4.9 - typescript@5.0 + + steps: + - uses: actions/checkout@v4 + - uses: wyvox/action-setup-pnpm@v3 + with: + node-version: 18.18.1 + - name: 'Build' + run: pnpm build + - name: 'Change TS to ${{ matrix.typescript-scenario }}' + run: 'pnpm add --save-dev ${{ matrix.typescript-scenario}}' + working-directory: ./test-app + + # This has been really annoying + # due to injected dependencies :( + - name: 'Re-sync injected dependencies' + run: pnpm i -f + - name: 'Print Versions' + run: | + pnpm --filter "test-app*" exec tsc -v; + pnpm --filter "test-app*" exec glint --version; + + - name: 'Type checking (built in types)' + run: pnpm --filter "test-app-old-ts" exec glint; + + # - name: 'Type checking (DefinitelyTyped types)' + # run: pnpm --filter "test-app-definitely-typed" exec glint; + + typecheck: + name: '${{ matrix.typescript-scenario }}' + runs-on: ubuntu-latest + timeout-minutes: 5 + needs: [build] + continue-on-error: true + strategy: + fail-fast: true + matrix: + typescript-scenario: - typescript@5.1 - typescript@5.2 - typescript@5.3 + - typescript@5.4 + - typescript@5.5 + - typescript@5.6 + - typescript@5.7 steps: - uses: actions/checkout@v4 @@ -90,9 +131,6 @@ jobs: pnpm --filter "test-app*" exec tsc -v; pnpm --filter "test-app*" exec glint --version; - # Types of newer versions are not compatible with TS < v5 - - run: pnpm add --save-dev "@ember/test-helpers@^3.0.0" - working-directory: 'test-app' - name: 'Type checking (built in types)' run: pnpm --filter "test-app" exec glint; diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 719e9012..258a393c 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -3,5 +3,6 @@ packages: - "codemod" - "docs" - "test-app" + - "test-app-old-ts" - "test-app-definitely-typed" - "dev/*" diff --git a/test-app-old-ts/.editorconfig b/test-app-old-ts/.editorconfig new file mode 100644 index 00000000..c35a0024 --- /dev/null +++ b/test-app-old-ts/.editorconfig @@ -0,0 +1,19 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 2 + +[*.hbs] +insert_final_newline = false + +[*.{diff,md}] +trim_trailing_whitespace = false diff --git a/test-app-old-ts/.ember-cli b/test-app-old-ts/.ember-cli new file mode 100644 index 00000000..ee64cfed --- /dev/null +++ b/test-app-old-ts/.ember-cli @@ -0,0 +1,9 @@ +{ + /** + Ember CLI sends analytics information by default. The data is completely + anonymous, but there are times when you might want to disable this behavior. + + Setting `disableAnalytics` to true will prevent any data from being sent. + */ + "disableAnalytics": false +} diff --git a/test-app-old-ts/.eslintignore b/test-app-old-ts/.eslintignore new file mode 100644 index 00000000..57c38661 --- /dev/null +++ b/test-app-old-ts/.eslintignore @@ -0,0 +1,23 @@ +# unconventional js +/blueprints/*/files/ +/vendor/ +/public/ + +# compiled output +/dist/ +/tmp/ + +# dependencies +/bower_components/ +/node_modules/ + +# misc +/coverage/ +!.* +.*/ +.eslintcache + +# ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/package.json.ember-try diff --git a/test-app-old-ts/.eslintrc.js b/test-app-old-ts/.eslintrc.js new file mode 100644 index 00000000..8a1183c1 --- /dev/null +++ b/test-app-old-ts/.eslintrc.js @@ -0,0 +1,54 @@ +'use strict'; + +const { configs } = require('@nullvoxpopuli/eslint-configs'); + +const config = configs.ember(); + +module.exports = { + ...config, + overrides: [ + ...config.overrides, + { + files: ['**/*.gts'], + plugins: ['ember'], + parser: 'ember-eslint-parser', + globals: { + // used in testing as a shorthand for + out: true, + }, + }, + { + files: ['**/*.gjs'], + plugins: ['ember'], + parser: 'ember-eslint-parser', + }, + { + files: ['**/*.{ts,gts}'], + rules: { + /** + * This one is incorrectly parsed for now, because + * the rule doesn't understand decorators + */ + '@typescript-eslint/no-unused-vars': 'off', + + /** + * any can be useful + */ + '@typescript-eslint/no-explicit-any': 'off', + + /** + * Some compiler errors are not helpful + */ + '@typescript-eslint/ban-ts-comment': [ + 'error', + { + 'ts-ignore': 'allow-with-description', + 'ts-nocheck': 'allow-with-description', + 'ts-check': 'allow-with-description', + 'ts-expect-error': 'allow-with-description', + }, + ], + }, + }, + ], +}; diff --git a/test-app-old-ts/.gitignore b/test-app-old-ts/.gitignore new file mode 100644 index 00000000..7e0f7ddc --- /dev/null +++ b/test-app-old-ts/.gitignore @@ -0,0 +1,26 @@ +# See https://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist/ +/tmp/ + +# dependencies +/bower_components/ +/node_modules/ + +# misc +/.env* +/.pnp* +/.sass-cache +/.eslintcache +/connect.lock +/coverage/ +/libpeerconnection.log +/npm-debug.log* +/testem.log +/yarn-error.log + +# ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/package.json.ember-try diff --git a/test-app-old-ts/.prettierignore b/test-app-old-ts/.prettierignore new file mode 100644 index 00000000..1225afa9 --- /dev/null +++ b/test-app-old-ts/.prettierignore @@ -0,0 +1,26 @@ +# unconventional js +/blueprints/*/files/ +/vendor/ +/public/ +*.yaml +*.md +*.yml + +# compiled output +/dist/ +/tmp/ +CHANGELOG.md + +# dependencies +/bower_components/ +/node_modules/ + +# misc +/coverage/ +!.* +.eslintcache + +# ember-try +/.node_modules.ember-try/ +/bower.json.ember-try +/package.json.ember-try diff --git a/test-app-old-ts/.prettierrc.js b/test-app-old-ts/.prettierrc.js new file mode 100644 index 00000000..7665b070 --- /dev/null +++ b/test-app-old-ts/.prettierrc.js @@ -0,0 +1,30 @@ +'use strict'; + +module.exports = { + plugins: ['prettier-plugin-ember-template-tag'], + printWidth: 100, + singleQuote: true, + templateSingleQuote: false, + // this was required to make the VSCode + Prettier work correctly with