Skip to content

Commit 802479c

Browse files
committed
Fix declaration generation, working around multiple glint bugs
1 parent fc870dd commit 802479c

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
"lint:errors": "eslint . --quiet",
4242
"lint:js:fix": "eslint . --fix",
4343
"lint:types": "glint",
44-
"prepack": "tsc --project tsconfig.declarations.json",
44+
"prepack": "glint --declaration && rimraf declarations/app declarations/tests declarations/playwright.config.d.ts declarations/playwright.config.d.ts.map",
4545
"postpack": "rimraf declarations",
4646
"start": "concurrently -c \"auto\" -P \"npm:serve -- {@}\" \"npm:typecheck\" --",
47-
"typecheck": "tsc --noEmit --watch",
47+
"typecheck": "glint --watch",
4848
"serve": "ember serve",
4949
"test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"",
5050
"test:ember": "ember test",

playwright.config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/// <reference types="node" />
12
import { defineConfig, devices } from '@playwright/test';
23

34
/**

tsconfig.json

+16-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,22 @@
1515
"@lblod/ember-rdfa-editor/test-support": ["addon-test-support"],
1616
"@lblod/ember-rdfa-editor/test-support/*": ["addon-test-support/*"],
1717
"*": ["types/*"]
18-
}
18+
},
19+
// These settings copied over from tsconfig.declarations.json as glint seems to ignore
20+
// the --project argument. This is also why the --project has been replaced with a
21+
// rimraf of the extra files in the npm script.
22+
"declarationDir": "declarations",
23+
// glint has a bug that leads to inconsistent behaviour in watch mode
24+
// See https://github.com/typed-ember/glint/issues/649
25+
// If you want to use it, comment out the declarationDir and uncomment the allowJs
26+
// "allowJs": true,
27+
"emitDeclarationOnly": true,
28+
"noEmit": false,
29+
"rootDir": ".",
30+
// glint has another bug which means that glint directive comments cause an internal error,
31+
// so to get declarations we need to also emit when we get an error (which is every time)
32+
// See https://github.com/typed-ember/glint/issues/599
33+
"noEmitOnError": false,
1934
},
2035
"include": [
2136
"app/**/*",

0 commit comments

Comments
 (0)