Skip to content

Commit 2ef21dc

Browse files
committed
npx ember-apply typescript
1 parent e44c34c commit 2ef21dc

7 files changed

Lines changed: 250 additions & 87 deletions

File tree

docs/app/config/environment.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Type declarations for
3+
* import config from 'docs/config/environment'
4+
*/
5+
declare const config: {
6+
environment: string;
7+
modulePrefix: string;
8+
podModulePrefix: string;
9+
locationType: 'history' | 'hash' | 'none';
10+
rootURL: string;
11+
APP: Record<string, unknown>;
12+
};
13+
14+
export default config;

docs/ember-cli-build.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ module.exports = function (defaults) {
99

1010
let app = new EmberApp(defaults, {
1111
'ember-cli-babel': {
12-
includePolyfill: true,
12+
enableTypeScriptTransform: true,
13+
includePolyfill: true
1314
},
1415
autoImport: isDeploying
1516
? {

docs/package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"release": "standard-version",
2525
"start": "ember serve",
2626
"test": "npm-run-all lint test:*",
27-
"test:ember": "ember test"
27+
"test:ember": "ember test",
28+
"lint:types": "glint"
2829
},
2930
"devDependencies": {
3031
"@babel/eslint-parser": "^7.23.3",
@@ -33,8 +34,15 @@
3334
"@ember/test-helpers": "^3.2.1",
3435
"@glimmer/component": "^1.0.4",
3536
"@glimmer/tracking": "^1.0.4",
36-
"@typescript-eslint/eslint-plugin": "^6.15.0",
37-
"@typescript-eslint/parser": "^6.15.0",
37+
"@glint/core": "^1.2.1",
38+
"@glint/environment-ember-loose": "^1.2.1",
39+
"@glint/environment-ember-template-imports": "^1.2.1",
40+
"@glint/template": "^1.2.1",
41+
"@tsconfig/ember": "^3.0.3",
42+
"@types/qunit": "^2.19.9",
43+
"@types/rsvp": "^4.0.8",
44+
"@typescript-eslint/eslint-plugin": "^6.16.0",
45+
"@typescript-eslint/parser": "^6.16.0",
3846
"broccoli-asset-rev": "^3.0.0",
3947
"ember-auto-import": "^2.7.2",
4048
"ember-cli": "~4.12.1",
@@ -71,6 +79,7 @@
7179
"qunit": "^2.16.0",
7280
"sass": "^1.43.3",
7381
"standard-version": "^9.3.2",
82+
"typescript": "^5.3.3",
7483
"webpack": "^5.0.0"
7584
},
7685
"engines": {

docs/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/tsconfig.json",
3+
"compilerOptions": {
4+
// The combination of `baseUrl` with `paths` allows Ember's classic package
5+
// layout, which is not resolvable with the Node resolution algorithm, to
6+
// work with TypeScript.
7+
"baseUrl": ".",
8+
"paths": {
9+
"docs/tests/*": ["tests/*"],
10+
"docs/*": ["app/*"],
11+
"*": ["types/*"]
12+
}
13+
},
14+
"glint": {
15+
"environment": ["ember-loose", "ember-template-imports"]
16+
}
17+
}

docs/types/glint.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Setup Glint Globals
2+
import '@glint/environment-ember-loose';
3+
import '@glint/environment-ember-template-imports';
4+
5+
declare module '@glint/environment-ember-loose/registry' {
6+
// Remove this once entries have been added! 👇
7+
// eslint-disable-next-line @typescript-eslint/no-empty-interface
8+
export default interface Registry {
9+
// Add any registry entries from other addons here that your addon itself uses (in non-strict mode templates)
10+
// See https://typed-ember.gitbook.io/glint/using-glint/ember/using-addons
11+
}
12+
}

docs/types/global.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Declare the @ember/* packages brought in from ember-source
2+
import 'ember-source/types';

0 commit comments

Comments
 (0)