Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for TS < v5 -- Setup CI for type-checking all test apps #473

Merged
merged 6 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,42 @@ jobs:
- run: pnpm test:ember
working-directory: test-apps/base-tests

typecheck:
name: '${{ matrix.typescript-scenario }}'
runs-on: ubuntu-latest
timeout-minutes: 5
continue-on-error: true
strategy:
fail-fast: true
matrix:
typescript-scenario:
- typescript@5.0
- typescript@5.1
- typescript@5.2
- typescript@5.3
- typescript@5.4

steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- run: pnpm prepack
working-directory: ./addon/

- name: 'Change base tests TS to ${{ matrix.typescript-scenario }}'
run: 'pnpm add --save-dev ${{ matrix.typescript-scenario}}'
working-directory: ./test-apps/base-tests/

- name: 'Change ember-concurrency TS to ${{ matrix.typescript-scenario }}'
run: 'pnpm add --save-dev ${{ matrix.typescript-scenario}}'
working-directory: ./test-apps/ember-concurrency-v2

- name: 'Change ember-fetch TS to ${{ matrix.typescript-scenario }}'
run: 'pnpm add --save-dev ${{ matrix.typescript-scenario}}'
working-directory: ./test-apps/ember-fetch-v8

- run: pnpm --filter "*" test:ts;


try-scenarios:
timeout-minutes: 10
name: "Try: ${{ matrix.ember-try-scenario }} @ ${{ matrix.app }}"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ package.json.ember-try
addon/addon/**/*.js

*.d.ts
!test-apps/**/*.d.ts
!addon/types/**/*.d.ts
*.tgz
6 changes: 3 additions & 3 deletions addon/addon/build-waiter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class TestWaiterImpl<T extends object | Primitive = Token> implements TestWaiter
this._register();

if (this.items.has(token)) {
throw new Error(`beginAsync called for ${token} but it is already pending.`);
throw new Error(`beginAsync called for ${token as string} but it is already pending.`);
}

let error = new Error();
Expand Down Expand Up @@ -112,7 +112,7 @@ class NoopTestWaiter implements TestWaiter {
return this;
}

endAsync(): void {}
endAsync(): void { }

waitUntil(): boolean {
return true;
Expand All @@ -122,7 +122,7 @@ class NoopTestWaiter implements TestWaiter {
return [];
}

reset(): void {}
reset(): void { }
}

/**
Expand Down
19 changes: 7 additions & 12 deletions addon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
"postpack": "ember ts:clean"
},
"dependencies": {
"@babel/core": "^7.24.0",
"@babel/core": "^7.24.5",
"@glimmer/env": "^0.1.7",
"ember-auto-import": "^2.6.3",
"ember-auto-import": "^2.7.2",
"ember-cli-babel": "^8.2.0",
"ember-cli-typescript": "^5.0.0",
"ember-cli-typescript": "^5.3.0",
"ember-cli-version-checker": "^5.1.2",
"semver": "^7.3.5"
},
Expand All @@ -42,29 +42,24 @@
"@babel/preset-typescript": "^7.15.0",
"@ember/optional-features": "^2.0.0",
"@ember/string": "^3.0.1",
"@types/ember": "^3.16.5",
"@types/ember-test-helpers": "^1.0.10",
"@types/ember-testing-helpers": "^0.0.4",
"@types/ember__test-helpers": "^2.6.1",
"@types/qunit": "^2.19.9",
"@types/rsvp": "^4.0.4",
"@typescript-eslint/eslint-plugin": "^4.29.2",
"@typescript-eslint/parser": "^4.30.0",
"co": "^4.6.0",
"ember-cli": "^4.10.0",
"ember-cli-dependency-checker": "^3.2.0",
"ember-cli-htmlbars": "^5.7.1",
"ember-cli-htmlbars": "^6.3.0",
"ember-cli-inject-live-reload": "^2.1.0",
"ember-cli-uglify": "^3.0.0",
"ember-concurrency": "^2.1.2",
"ember-concurrency-decorators": "^2.0.3",
"ember-concurrency-ts": "^0.3.1",
"ember-decorators-polyfill": "^1.1.5",
"ember-disable-prototype-extensions": "^1.1.3",
"ember-load-initializers": "^2.1.2",
"ember-maybe-import-regenerator-for-testing": "^1.0.0",
"ember-resolver": "^8.0.2",
"ember-source": "~3.26.1",
"ember-resolver": "^11.0.1",
"ember-source": "^5.0.0",
"ember-source-channel-url": "^3.0.0",
"ember-try": "^3.0.0",
"eslint": "^7.32.0",
Expand All @@ -76,7 +71,7 @@
"npm-run-all": "^4.1.5",
"prettier": "^2.5.1",
"qunit": "^2.20.0",
"typescript": "~4.9.0",
"typescript": "~5.0.0",
"webpack": "^5.0.0"
},
"engines": {
Expand Down
9 changes: 7 additions & 2 deletions addon/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"allowJs": true,
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
// have to use this, because the current TS setup errors with ember's own types
// this will be fixed during v2 addon conversion
"skipLibCheck": true,
"noImplicitAny": true,
"noImplicitThis": true,
"alwaysStrict": true,
Expand All @@ -26,14 +29,16 @@
"@ember/test-waiters": ["addon"],
"@ember/test-waiters/*": ["addon/*"],
"*": ["types/*"]
}
},
"types": ["ember-source/types"]
},
"include": [
"app/**/*",
"addon/**/*",
"tests/**/*",
"types/**/*",
"test-support/**/*",
"addon-test-support/**/*"
"addon-test-support/**/*",
"unpublished-development-types/**/*"
]
}
6 changes: 0 additions & 6 deletions addon/types/global.d.ts

This file was deleted.

11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
"concurrently": "^8.2.1",
"release-plan": "^0.8.0"
},
"pnpm": {
"overrides_notes": {
"@glimmer/*": "https://github.com/glimmerjs/glimmer.js/issues/413"
},
"overrides": {
"@glimmer/validator": ">= 0.86.0",
"@glimmer/manager": ">= 0.86.0",
"@glimmer/runtime": ">= 0.86.0",
"@glimmer/syntax": ">= 0.86.0"
}
},
"volta": {
"node": "18.16.0",
"pnpm": "8.7.6"
Expand Down
Loading
Loading