Skip to content

Commit

Permalink
Merge pull request #10432 from bendemboski/ts-addon-declarations
Browse files Browse the repository at this point in the history
Filter out tsconfig.declarations.json correctly
  • Loading branch information
ef4 committed Feb 6, 2024
2 parents 134a252 + 2004db8 commit d0e892a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion blueprints/addon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ module.exports = {
}

if (!options.typescript) {
addonFiles = addonFiles.filter((file) => file !== 'tsconfig.json' && !file.endsWith('.d.ts'));
addonFiles = addonFiles.filter((file) => !file.startsWith('tsconfig.') && !file.endsWith('.d.ts'));
}

return uniq(appFiles.concat(addonFiles));
Expand Down
8 changes: 7 additions & 1 deletion tests/acceptance/new-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ describe('Acceptance: ember new', function () {
// no TypeScript files
[
'tsconfig.json',
'tsconfig.declarations.json',
'app/config/environment.d.ts',
'types/global.d.ts',
'types/foo/index.d.ts',
Expand Down Expand Up @@ -511,7 +512,12 @@ describe('Acceptance: ember new', function () {
expect(file('tests/dummy/app/index.html')).to.contain('<html>');

// no TypeScript files
['tsconfig.json', 'tests/dummy/app/config/environment.d.ts', 'types/global.d.ts'].forEach((filePath) => {
[
'tsconfig.json',
'tsconfig.declarations.json',
'tests/dummy/app/config/environment.d.ts',
'types/global.d.ts',
].forEach((filePath) => {
expect(file(filePath)).to.not.exist;
});
});
Expand Down

0 comments on commit d0e892a

Please sign in to comment.