Skip to content

Commit 326bb38

Browse files
committed
Fix CI by fixing TS dependencies *and* types
CI for Embroider Safe has been failing for a bit because we are using new TS versions and need an updated combination of Babel and related compilation deps. Accordingly: - Bump to latest versions of all compilation dependencies, including: - `ember-cli-babel` - `ember-cli-htmlbars` - `@babel/*` - `@embroider/*` - Fix type errors exposed by running `tsc` with the changes in place. - Remove the type tests from the normal build graph. - Add running the type tests directly to the `lint:ts` job.
1 parent 412a4ba commit 326bb38

6 files changed

Lines changed: 978 additions & 1608 deletions

File tree

addon-test-support/@ember/test-helpers/setup-application-context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import hasEmberVersion from './has-ember-version';
1111
import settled from './settled';
1212
import getTestMetadata from './test-metadata';
1313
import { runHooks } from './-internal/helper-hooks';
14-
import type { Router } from '@ember/routing';
14+
import type Router from '@ember/routing/router';
1515
import type RouterService from '@ember/routing/router-service';
1616
import { assert } from '@ember/debug';
1717

addon-test-support/@ember/test-helpers/setup-rendering-context.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function isRenderingTestContext(
5454
@param {string} templateFullName the fill template name
5555
@returns {Template} the template representing `templateFullName`
5656
*/
57-
function lookupTemplate(owner: Owner, templateFullName: string) {
57+
function lookupTemplate(owner: Owner, templateFullName: `${string}:${string}`) {
5858
let template = owner.lookup(templateFullName);
5959
if (typeof template === 'function') return template(owner);
6060
return template;
@@ -139,7 +139,7 @@ export function render(
139139
}
140140

141141
templateId += 1;
142-
let templateFullName = `template:-undertest-${templateId}`;
142+
let templateFullName = `template:-undertest-${templateId}` as const;
143143
ownerToRenderFrom.register(templateFullName, templateOrComponent);
144144
templateOrComponent = lookupTemplate(
145145
ownerToRenderFrom,
@@ -172,7 +172,7 @@ export function render(
172172
templateOrComponent = INVOKE_PROVIDED_COMPONENT;
173173
} else {
174174
templateId += 1;
175-
let templateFullName = `template:-undertest-${templateId}`;
175+
let templateFullName = `template:-undertest-${templateId}` as const;
176176
ownerToRenderFrom.register(templateFullName, templateOrComponent);
177177
templateOrComponent = lookupTemplate(
178178
ownerToRenderFrom,

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"docs": "documentation build --document-exported \"addon-test-support/@ember/test-helpers/index.js\" --config documentation.yml --markdown-toc-max-depth 3 -f md -o API.md",
3333
"lint": "npm-run-all lint:*",
3434
"lint:js": "eslint --cache .",
35-
"lint:ts": "tsc -p tsconfig.json --noEmit",
35+
"lint:ts": "tsc --noEmit && tsc --noEmit --project type-tests",
3636
"postpublish": "npm-run-all clean",
3737
"release": "release-it",
3838
"start": "ember serve",
@@ -44,12 +44,12 @@
4444
},
4545
"dependencies": {
4646
"@ember/test-waiters": "^3.0.0",
47-
"@embroider/macros": "^1.6.0",
48-
"@embroider/util": "^1.6.0",
47+
"@embroider/macros": "^1.10.0",
48+
"@embroider/util": "^1.9.0",
4949
"broccoli-debug": "^0.6.5",
5050
"broccoli-funnel": "^3.0.8",
51-
"ember-cli-babel": "^7.26.6",
52-
"ember-cli-htmlbars": "^5.7.1",
51+
"ember-cli-babel": "^7.26.11",
52+
"ember-cli-htmlbars": "^6.1.1",
5353
"ember-destroyable-polyfill": "^2.0.3"
5454
},
5555
"devDependencies": {
@@ -61,18 +61,19 @@
6161
"@glimmer/reference": "^0.84.1",
6262
"@tsconfig/ember": "^1.0.1",
6363
"@types/ember": "~4.0.0",
64+
"@types/ember-resolver": "^5.0.13",
65+
"@types/ember-testing-helpers": "^0.0.4",
6466
"@types/ember__application": "~4.0.0",
6567
"@types/ember__component": "~4.0.8",
6668
"@types/ember__debug": "~4.0.1",
6769
"@types/ember__destroyable": "~4.0.0",
6870
"@types/ember__engine": "~4.0.0",
6971
"@types/ember__object": "~4.0.2",
70-
"@types/ember__routing": "~4.0.7",
7172
"@types/ember__polyfills": "~4.0.0",
73+
"@types/ember__routing": "~4.0.7",
7274
"@types/ember__runloop": "~4.0.1",
7375
"@types/ember__service": "~4.0.0",
7476
"@types/ember__test": "~4.0.0",
75-
"@types/ember-testing-helpers": "^0.0.4",
7677
"@types/rsvp": "^4.0.4",
7778
"@typescript-eslint/eslint-plugin": "^4.29.0",
7879
"@typescript-eslint/parser": "^4.29.0",
File renamed without changes.

type-tests/tsconfig.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"extends": "@tsconfig/ember",
3+
"compilerOptions": {
4+
"baseUrl": "..",
5+
"paths": {
6+
"@ember/test-helpers": [
7+
"./addon-test-support/@ember/test-helpers"
8+
],
9+
"@ember/test-helpers/*": [
10+
"./addon-test-support/@ember/test-helpers/*"
11+
],
12+
"*": [
13+
"types/*"
14+
]
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)