Skip to content

Commit

Permalink
Use separate tsconfig.json project, like the ember.js projcet does
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Jul 15, 2023
1 parent f0a67e5 commit e280e7a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
1 change: 1 addition & 0 deletions files/__addonLocation__/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
"lint:js:fix": "eslint . --fix",<% if (typescript) { %>
"lint:types": "glint",
"lint:types-tests": "glint --project type-tests",
"start": "concurrently 'npm:start:*'",
"start:js": "rollup --config --watch --no-watch.clearScreen",
"start:types": "glint --declaration --watch",<% } else { %>
Expand Down
5 changes: 2 additions & 3 deletions files/__addonLocation__/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
"extends": "@tsconfig/ember/tsconfig.json",
"include": [
"src/**/*",
"unpublished-development-types/**/*",
"type-tests/**/*"
"unpublished-development-types/**/*"
],
"glint": {
"environment": "ember-loose"
},
"compilerOptions": {
"declarationDir": "declarations"
"declarationDir": "declarations",
}
}
3 changes: 3 additions & 0 deletions files/__addonLocation__/type-tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@tsconfig/ember/tsconfig.json"
}
8 changes: 1 addition & 7 deletions tests/smoke-tests/--typescript.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,14 @@ for (let packageManager of SUPPORTED_PACKAGE_MANAGERS) {
'unpublished-development-types',
]);

await matchesFixture(path.join(typeTests, 'index.test.ts'), {
cwd,
scenario: 'addon-only-ts',
file: 'type-tests/index.test.ts',
});
expect(await dirContents(typeTests)).to.deep.equal(['index.test.ts', 'tsconfig.json']);
});

it('builds the addon', async () => {
let { exitCode } = await runScript({ cwd, script: 'build', packageManager: 'pnpm' });

expect(exitCode).toEqual(0);

console.log({ distDir, declarationsDir });

let distContents = await dirContents(distDir);
let declarationsContents = await dirContents(declarationsDir);

Expand Down

0 comments on commit e280e7a

Please sign in to comment.