diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7aa81e130..e00d37c1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -178,7 +178,7 @@ jobs: path: ${{ env.dist }} - run: pnpm --filter ember-app run ember:test try-scenarios: - name: "Compat: ${{ matrix.ember-try-scenario }}" + name: ${{ matrix.ember-try-scenario }} timeout-minutes: 10 runs-on: ubuntu-latest needs: tests @@ -223,7 +223,7 @@ jobs: node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup typescript-compatibility: - name: Type checking - ${{ matrix.typescript-scenario }} + name: ${{ matrix.typescript-scenario }} timeout-minutes: 5 runs-on: ubuntu-latest continue-on-error: true @@ -265,7 +265,9 @@ jobs: run: pnpm add --save-dev ${{ matrix.typescript-scenario }} working-directory: testing/ember-app - name: Type checking - run: pnpm --filter ember-app exec tsc --build + run: | + pnpm --filter ember-app exec tsc -v + pnpm --filter ember-app exec tsc --build publish: name: Release timeout-minutes: 5 diff --git a/.npmrc b/.npmrc index c0cc4f7f0..da85db1e2 100644 --- a/.npmrc +++ b/.npmrc @@ -1,5 +1,3 @@ -public-hoist-pattern[]=*@types* - # Required because broccoli has hard-coded paths to *all* packages # not just relevant ones.......... public-hoist-pattern[]=eslint-plugin* diff --git a/build/github-workflows/workflows/ci.yaml b/build/github-workflows/workflows/ci.yaml index 538581a80..f4e1f84b3 100644 --- a/build/github-workflows/workflows/ci.yaml +++ b/build/github-workflows/workflows/ci.yaml @@ -146,7 +146,7 @@ jobs: - run: pnpm --filter ember-app run ember:test try-scenarios: - name: "Compat: ${{ matrix.ember-try-scenario }}" + name: "${{ matrix.ember-try-scenario }}" <<: *ubuntu timeout-minutes: 10 needs: tests @@ -179,7 +179,7 @@ jobs: node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup typescript-compatibility: - name: Type checking - ${{ matrix.typescript-scenario }} + name: ${{ matrix.typescript-scenario }} <<: *ubuntu continue-on-error: true needs: build_test @@ -193,6 +193,7 @@ jobs: - typescript@4.4 - typescript@4.5 - typescript@4.6 + - typescript@4.7 - typescript@next steps: @@ -209,8 +210,9 @@ jobs: run: pnpm add --save-dev ${{ matrix.typescript-scenario }} working-directory: testing/ember-app - name: Type checking - run: pnpm --filter ember-app exec tsc --build - + run: | + pnpm --filter ember-app exec tsc -v + pnpm --filter ember-app exec tsc --build publish: diff --git a/ember-resources/.gitignore b/ember-resources/.gitignore index da87af5db..a48e16002 100644 --- a/ember-resources/.gitignore +++ b/ember-resources/.gitignore @@ -4,3 +4,6 @@ # output dist/ declarations/ +src/**/*.d.ts +src/**/*.d.ts.map +src/**/*.js diff --git a/ember-resources/package.json b/ember-resources/package.json index 0796cd3ed..605599b7f 100644 --- a/ember-resources/package.json +++ b/ember-resources/package.json @@ -109,10 +109,13 @@ "@nullvoxpopuli/eslint-configs": "^2.1.1", "@semantic-release/changelog": "^6.0.1", "@semantic-release/git": "^10.0.1", + "@types/ember__application": "^4.0.0", "@types/ember__component": "^4.0.0", "@types/ember__debug": "^4.0.0", "@types/ember__destroyable": "^4.0.0", "@types/ember__helper": "^4.0.0", + "@types/ember__object": "^4.0.0", + "@types/ember__runloop": "^4.0.0", "@types/ember__test-helpers": "^2.0.0", "babel-eslint": "10.1.0", "ember-async-data": "^0.6.0", diff --git a/ember-resources/src/util/helper.ts b/ember-resources/src/util/helper.ts index 6f2bb3426..f051dfb0a 100644 --- a/ember-resources/src/util/helper.ts +++ b/ember-resources/src/util/helper.ts @@ -8,7 +8,6 @@ import { DEFAULT_THUNK, normalizeThunk } from '../core/utils'; import type { Cache, Thunk } from '../core/types'; // @ts-ignore import type { helper as emberHelper } from '@ember/component/helper'; -import type EmberHelper from '@ember/component/helper'; /** * @utility implemented with raw `invokeHelper` API, no classes from `ember-resources` used. @@ -53,7 +52,7 @@ import type EmberHelper from '@ember/component/helper'; */ export function helper( context: object, - helper: EmberHelper | ReturnType, + helper: unknown, thunk: Thunk = DEFAULT_THUNK ): { value: unknown } { let resource: Cache; diff --git a/package.json b/package.json index f5641f089..5fe643f97 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,13 @@ "pnpm": { "overrides": { "@embroider/addon-shim": "1.6.0", - "@types/eslint": "7.29.0" + "@types/eslint": "7.29.0", + "mustache": "^4.2.0" + }, + "overrides-notes": { + "@embroider/addon-shim": "some addons from the test-app are not using ^1.0.0", + "@types/eslint": "webpack brings in @types/eslint@8, which breaks our type checking", + "mustache": "ember-cli -> testem -> consolidate -> mustache is ancient" }, "peerDependencyRules": { "ignoreMissing": ["msw"], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e21e51df6..28024d226 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3,6 +3,7 @@ lockfileVersion: 5.4 overrides: '@embroider/addon-shim': 1.6.0 '@types/eslint': 7.29.0 + mustache: ^4.2.0 importers: @@ -90,10 +91,13 @@ importers: '@nullvoxpopuli/eslint-configs': ^2.1.1 '@semantic-release/changelog': ^6.0.1 '@semantic-release/git': ^10.0.1 + '@types/ember__application': ^4.0.0 '@types/ember__component': ^4.0.0 '@types/ember__debug': ^4.0.0 '@types/ember__destroyable': ^4.0.0 '@types/ember__helper': ^4.0.0 + '@types/ember__object': ^4.0.0 + '@types/ember__runloop': ^4.0.0 '@types/ember__test-helpers': ^2.0.0 babel-eslint: 10.1.0 ember-async-data: ^0.6.0 @@ -124,10 +128,13 @@ importers: '@nullvoxpopuli/eslint-configs': 2.2.0_typescript@4.2.4 '@semantic-release/changelog': 6.0.1_semantic-release@19.0.2 '@semantic-release/git': 10.0.1_semantic-release@19.0.2 + '@types/ember__application': 4.0.0 '@types/ember__component': 4.0.5 '@types/ember__debug': 4.0.1 '@types/ember__destroyable': 4.0.0 '@types/ember__helper': 4.0.0 + '@types/ember__object': 4.0.1 + '@types/ember__runloop': 4.0.0 '@types/ember__test-helpers': 2.6.1 babel-eslint: 10.1.0_eslint@7.32.0 ember-async-data: 0.6.0_@babel+core@7.18.2 @@ -163,11 +170,13 @@ importers: '@glimmer/component': ^1.0.4 '@glimmer/tracking': ^1.0.4 '@nullvoxpopuli/eslint-configs': ^2.1.1 + '@types/ember': ^4.0.0 '@types/ember__application': ^4.0.0 '@types/ember__array': ^4.0.1 '@types/ember__component': ^4.0.5 '@types/ember__controller': ^4.0.0 '@types/ember__debug': ^4.0.1 + '@types/ember__destroyable': ^4.0.0 '@types/ember__engine': ^4.0.0 '@types/ember__error': ^4.0.0 '@types/ember__helper': ^4.0.0 @@ -199,7 +208,6 @@ importers: ember-cli-sri: ^2.1.1 ember-cli-terser: ^4.0.2 ember-cli-typescript: ^4.2.1 - ember-cli-typescript-blueprints: ^3.0.0 ember-concurrency: ^2.0.0 ember-concurrency-ts: ^0.3.1 ember-export-application-global: ^2.0.1 @@ -228,7 +236,7 @@ importers: prettier: ^2.3.2 qunit: ^2.16.0 qunit-dom: ^2.0.0 - typescript: ^4.4.4 + typescript: '4.2' webpack: ^5.72.1 dependencies: '@ember/test-waiters': 3.0.1 @@ -248,12 +256,14 @@ importers: '@embroider/webpack': 1.6.0_xcawtvs4pwa7koczjjpyrnvpqq '@glimmer/component': 1.0.4_@babel+core@7.18.0 '@glimmer/tracking': 1.0.4 - '@nullvoxpopuli/eslint-configs': 2.2.0_typescript@4.5.5 + '@nullvoxpopuli/eslint-configs': 2.2.0_typescript@4.2.4 + '@types/ember': 4.0.0 '@types/ember__application': 4.0.0 '@types/ember__array': 4.0.1 '@types/ember__component': 4.0.5 '@types/ember__controller': 4.0.0 '@types/ember__debug': 4.0.1 + '@types/ember__destroyable': 4.0.0 '@types/ember__engine': 4.0.0 '@types/ember__error': 4.0.0 '@types/ember__helper': 4.0.0 @@ -284,7 +294,6 @@ importers: ember-cli-sri: 2.1.1 ember-cli-terser: 4.0.2 ember-cli-typescript: 4.2.1 - ember-cli-typescript-blueprints: 3.0.0 ember-export-application-global: 2.0.1 ember-fetch: 8.1.1 ember-load-initializers: 2.1.2_@babel+core@7.18.0 @@ -304,12 +313,12 @@ importers: eslint-plugin-prettier: 4.0.0_z7eskpggz6hgh3lpmotlmahgxe eslint-plugin-qunit: 7.2.0_eslint@7.32.0 loader.js: 4.7.0 - msw: 0.40.2_typescript@4.5.5 + msw: 0.40.2_typescript@4.2.4 npm-run-all: 4.1.5 prettier: 2.5.1 qunit: 2.18.0 qunit-dom: 2.0.0 - typescript: 4.5.5 + typescript: 4.2.4 webpack: 5.72.1 testing/ember-concurrency-v1: @@ -7565,7 +7574,7 @@ packages: resolution: {integrity: sha512-k9Sl/Qal3xQPnjAFZaRpl7jlCh0hDEhVaxyiTMfiHKC/w5TYn4Nds+7340X/v1OrAQC5xGBtaD2JpWgPhXWaAw==} engines: {node: '>=10.0.0'} peerDependencies: - typescript: '>=3.x || >= 4.x' + typescript: '*' dependencies: helpertypes: 0.0.18 typescript: 4.2.4 @@ -13389,13 +13398,13 @@ packages: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} dev: true - /msw/0.40.2_typescript@4.5.5: + /msw/0.40.2_typescript@4.2.4: resolution: {integrity: sha512-8MymevYPIniUhk3W/xxWmhaMAeZHD9uhI37fik31i4JSToDhPWFg9hO6v/8IfTEPCD2Y1r4npDUxHmNbIeaOsg==} engines: {node: '>=14'} hasBin: true requiresBuild: true peerDependencies: - typescript: '>= 4.2.x <= 4.6.x' + typescript: '*' peerDependenciesMeta: typescript: optional: true @@ -13418,16 +13427,15 @@ packages: statuses: 2.0.1 strict-event-emitter: 0.2.4 type-fest: 1.4.0 - typescript: 4.5.5 + typescript: 4.2.4 yargs: 17.3.1 transitivePeerDependencies: - encoding - supports-color dev: true - /mustache/3.2.1: - resolution: {integrity: sha512-RERvMFdLpaFfSRIEe632yDm5nsd0SDKn8hGmcUwswnyiE5mtdZLDybtHAz6hjJhawokF0hXvGLtx9mrQfm6FkA==} - engines: {npm: '>=1.4.0'} + /mustache/4.2.0: + resolution: {integrity: sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==} hasBin: true dev: true @@ -15090,7 +15098,7 @@ packages: '@swc/core': '>=1.x' '@swc/helpers': '>=0.2' rollup: '>=1.x || >=2.x' - typescript: '>=3.2.x || >= 4.x' + typescript: '*' peerDependenciesMeta: '@babel/core': optional: true @@ -16299,7 +16307,7 @@ packages: lodash.find: 4.6.0 lodash.uniqby: 4.7.0 mkdirp: 0.5.5 - mustache: 3.2.1 + mustache: 4.2.0 node-notifier: 9.0.1 npmlog: 4.1.2 printf: 0.6.1 @@ -16546,7 +16554,7 @@ packages: resolution: {integrity: sha512-YYGvoWy2Ba98/YC/0leD7IRsU/q5pu/KRg9dD8omzkbgoZ8g7gfYfED9mWMTyNp7J3CQiiKyvM62B7mXXHKU7Q==} engines: {node: '>=10.0.0'} peerDependencies: - typescript: ^3.x || ^4.x + typescript: '*' dependencies: compatfactory: 0.0.13_typescript@4.2.4 typescript: 4.2.4 @@ -16557,7 +16565,7 @@ packages: engines: {node: '>=10.0.0'} hasBin: true peerDependencies: - typescript: '>=2.7' + typescript: '*' dependencies: arg: 4.1.3 create-require: 1.1.1 @@ -16602,7 +16610,7 @@ packages: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: - typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + typescript: '*' dependencies: tslib: 1.14.1 typescript: 4.2.4 @@ -16612,7 +16620,7 @@ packages: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: - typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + typescript: '*' dependencies: tslib: 1.14.1 typescript: 4.5.5 @@ -16622,7 +16630,7 @@ packages: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: - typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + typescript: '*' dependencies: tslib: 1.14.1 typescript: 4.6.4 @@ -16755,7 +16763,7 @@ packages: engines: {node: '>= 12.10.0'} hasBin: true peerDependencies: - typescript: 4.0.x || 4.1.x || 4.2.x || 4.3.x || 4.4.x || 4.5.x + typescript: '*' dependencies: glob: 7.2.0 lunr: 2.3.9 diff --git a/testing/ember-app/package.json b/testing/ember-app/package.json index d40375c23..c062f7a29 100644 --- a/testing/ember-app/package.json +++ b/testing/ember-app/package.json @@ -46,6 +46,7 @@ "@glimmer/component": "^1.0.4", "@glimmer/tracking": "^1.0.4", "@nullvoxpopuli/eslint-configs": "^2.1.1", + "@types/ember": "^4.0.0", "@types/ember-qunit": "^5.0.0", "@types/ember-resolver": "^5.0.10", "@types/ember__application": "^4.0.0", @@ -53,6 +54,7 @@ "@types/ember__component": "^4.0.5", "@types/ember__controller": "^4.0.0", "@types/ember__debug": "^4.0.1", + "@types/ember__destroyable": "^4.0.0", "@types/ember__engine": "^4.0.0", "@types/ember__error": "^4.0.0", "@types/ember__helper": "^4.0.0", @@ -81,7 +83,6 @@ "ember-cli-sri": "^2.1.1", "ember-cli-terser": "^4.0.2", "ember-cli-typescript": "^4.2.1", - "ember-cli-typescript-blueprints": "^3.0.0", "ember-export-application-global": "^2.0.1", "ember-fetch": "^8.1.1", "ember-load-initializers": "^2.1.2", @@ -106,7 +107,7 @@ "prettier": "^2.3.2", "qunit": "^2.16.0", "qunit-dom": "^2.0.0", - "typescript": "^4.4.4", + "typescript": "4.2", "webpack": "^5.72.1" }, "engines": {