-
-
Notifications
You must be signed in to change notification settings - Fork 10
Fix TS support, allowing type-checking in tests #55
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
Changes from all commits
3de2ce4
13686db
e3ea6ea
2755fc0
2bda45e
aafffb4
dc1ebc6
3414f2f
a5827d5
73974ca
3cc821b
93a2d47
eefe3de
6e0d2a6
a1ce714
0dcbfa2
5187b05
adc57b2
86296ab
7772395
fdff098
2d1cbe1
8d9416c
dd3a0bd
7378a8a
43aa024
30291c6
30540e6
4cf6fd1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,19 +38,22 @@ | |
| "@babel/plugin-transform-typescript": "^7.25.2",<% } %> | ||
| "@babel/runtime": "^7.25.6", | ||
| "@ember/test-helpers": "^5.2.1", | ||
| "@embroider/addon-dev": "^8.0.1", | ||
| "@embroider/addon-dev": "^8.1.0", | ||
| "@embroider/core": "^4.1.0", | ||
| "@embroider/compat": "^4.1.0", | ||
| "@embroider/macros": "^1.18.0", | ||
| "@embroider/vite": "^1.1.5", | ||
| "@eslint/js": "^9.17.0", | ||
| "@glimmer/component": "^2.0.0",<% if (typescript) { %> | ||
| "@glint/core": "^1.4.0", | ||
| "@glint/environment-ember-loose": "^1.4.0", | ||
| "@glint/environment-ember-template-imports": "^1.4.0", | ||
| "@glint/template": "^1.4.0", | ||
| "@glint/core": "^2.0.0-alpha.2", | ||
| "@glint/environment-ember-loose": "^2.0.0-alpha.2", | ||
| "@glint/environment-ember-template-imports": "^2.0.0-alpha.2", | ||
| "@glint/tsserver-plugin": "^2.0.0-alpha.2", | ||
| "@glint/template": "^1.6.0-alpha.1", | ||
| "@ember/app-tsconfig": "^1.0.0", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. used for the main tsconfig / test app library tsconfig is now only for publish |
||
| "@ember/library-tsconfig": "^1.0.0",<% } %> | ||
| "@rollup/plugin-babel": "^6.0.4", | ||
| "@rollup/plugin-babel": "^6.0.4",<% if (typescript) { %> | ||
| "@types/qunit": "^2.19.12",<% } %> | ||
| "babel-plugin-ember-template-compilation": "^2.2.5", | ||
| "concurrently": "^9.0.1", | ||
| "ember-qunit": "^9.0.2", | ||
|
|
@@ -70,7 +73,7 @@ | |
| "rollup": "^4.22.5", | ||
| "testem": "^3.15.1",<% if (typescript) { %> | ||
| "typescript-eslint": "^8.19.1", | ||
| "typescript": "~5.6.0",<% } %> | ||
| "typescript": "~5.8.3",<% } %> | ||
| "vite": "^6.2.4" | ||
| }, | ||
| "ember": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,16 @@ | ||
| /** | ||
| * This tsconfig is not used for publishing. | ||
|
mansona marked this conversation as resolved.
|
||
| * It's only for the local editing experience | ||
| * (and linting) | ||
| */ | ||
| { | ||
| "extends": "@ember/library-tsconfig", | ||
| "include": ["src/**/*", "unpublished-development-types/**/*"], | ||
| "extends": "@ember/app-tsconfig", | ||
| "glint": { | ||
| "environment": ["ember-loose", "ember-template-imports"] | ||
| }, | ||
| "include": ["src/**/*", "tests/**/*", "unpublished-development-types/**/*"], | ||
| "compilerOptions": { | ||
| "allowJs": true, | ||
| "declarationDir": "declarations", | ||
|
|
||
| /** | ||
| https://www.typescriptlang.org/tsconfig#rootDir | ||
| "Default: The longest common path of all non-declaration input files." | ||
|
|
||
| Because we want our declarations' structure to match our rollup output, | ||
| we need this "rootDir" to match the "srcDir" in the rollup.config.mjs. | ||
|
|
||
| This way, we can have simpler `package.json#exports` that matches | ||
| imports to files on disk | ||
| */ | ||
| "rootDir": "./src", | ||
|
|
||
| "types": ["ember-source/types"] | ||
| "rootDir": ".", | ||
| "types": ["ember-source/types", "vite/client", "@embroider/core/virtual"] | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /** | ||
| * This tsconfig is only used for publishing. | ||
| * | ||
| * For local dev experience, see the tsconfig.json | ||
| */ | ||
| { | ||
|
NullVoxPopuli marked this conversation as resolved.
|
||
| "extends": "@ember/library-tsconfig", | ||
| "include": ["./src/**/*", "./unpublished-development-types/**/*"], | ||
| "glint": { | ||
| "environment": ["ember-loose", "ember-template-imports"] | ||
| }, | ||
| "compilerOptions": { | ||
| "allowJs": true, | ||
| "declarationDir": "declarations", | ||
|
|
||
| /** | ||
| https://www.typescriptlang.org/tsconfig#rootDir | ||
| "Default: The longest common path of all non-declaration input files." | ||
|
|
||
| Because we want our declarations' structure to match our rollup output, | ||
| we need this "rootDir" to match the "srcDir" in the rollup.config.mjs. | ||
|
|
||
| This way, we can have simpler `package.json#exports` that matches | ||
| imports to files on disk | ||
| */ | ||
| "rootDir": "./src", | ||
|
|
||
| "types": ["ember-source/types"] | ||
| } | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,15 @@ | ||
| import { module, test } from 'qunit'; | ||
| import { setupRenderingTest } from 'ember-qunit'; | ||
| import { render } from '@ember/test-helpers'; | ||
| import { hbs } from 'ember-cli-htmlbars'; | ||
|
|
||
| import TemplateImport from '#src/components/template-import.gts'; | ||
|
|
||
| module('Rendering | template-import', function(hooks) { | ||
| setupRenderingTest(hooks); | ||
|
|
||
| test('it renders', async function(assert) { | ||
| await render(hbs`<TemplateImport @saying="what" />`); | ||
| await render(<template><TemplateImport @saying="what" /></template>); | ||
|
|
||
| assert.dom().hasText('Hello from a GTS file but also Hello from a template-only component and Hello from another GTS file!'); | ||
| assert.dom().hasText('Hello from a GTS file but also Hello from another GTS file!'); | ||
| }) | ||
| }); |
Uh oh!
There was an error while loading. Please reload this page.