Skip to content

Commit 209fa80

Browse files
authored
Merge pull request #464 from typed-ember/isolated-modules-and-cli-version-warning
[v2] Check off a couple remaining todo items
2 parents 1d3f3df + 2452a7d commit 209fa80

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

blueprint-files/ember-cli-typescript/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"target": "es2017",
44
"allowJs": true,
55
"moduleResolution": "node",
6+
"isolatedModules": true,
67
"allowSyntheticDefaultImports": true,
78
"noImplicitAny": true,
89
"noImplicitThis": true,

ts/addon.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default addon({
1414
included() {
1515
this._super.included.apply(this, arguments);
1616
this._checkDevelopment();
17-
this._checkBabelVersion();
17+
this._checkPeerVersions();
1818

1919
// If we're a direct dependency of the host app, go ahead and start up the
2020
// typecheck worker so we don't wait until the end of the build to check
@@ -87,7 +87,7 @@ export default addon({
8787
return !['in-repo-a', 'in-repo-b'].includes(addon.name);
8888
},
8989

90-
_checkBabelVersion() {
90+
_checkPeerVersions() {
9191
let babel = this.parent.addons.find(addon => addon.name === 'ember-cli-babel');
9292
let version = babel && babel.pkg.version;
9393
if (!babel || !(semver.gte(version!, '7.1.0') && semver.lt(version!, '8.0.0'))) {
@@ -97,6 +97,15 @@ export default addon({
9797
'your TypeScript files may not be transpiled correctly.'
9898
);
9999
}
100+
101+
let cliPackage = this.project.require('ember-cli/package.json') as { version: string };
102+
if (semver.lt(cliPackage.version, '3.5.0')) {
103+
this.ui.writeWarnLine(
104+
'ember-cli-typescript works best with ember-cli >= 3.5, which uses the system temporary directory ' +
105+
'by default rather than a project-local one, minimizing file system events the TypeScript ' +
106+
'compiler needs to keep track of.'
107+
);
108+
}
100109
},
101110

102111
_checkDevelopment() {

ts/tests/blueprints/ember-cli-typescript-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ describe('Acceptance: ember-cli-typescript generator', function() {
7272

7373
expect(tsconfigJson.compilerOptions.inlineSourceMap).to.equal(true);
7474
expect(tsconfigJson.compilerOptions.inlineSources).to.equal(true);
75+
expect(tsconfigJson.compilerOptions.isolatedModules).to.equal(true);
7576

7677
expect(tsconfigJson.include).to.deep.equal(['app/**/*', 'tests/**/*', 'types/**/*']);
7778

0 commit comments

Comments
 (0)