Skip to content

Commit 511d7af

Browse files
committed
Warn when not running from within /ts in development
1 parent 9cbb681 commit 511d7af

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ts/addon.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ const IncrementalTypescriptCompiler = require('./lib/incremental-typescript-comp
44
const Funnel = require('broccoli-funnel');
55
const MergeTrees = require('broccoli-merge-trees');
66
const stew = require('broccoli-stew');
7+
const path = require('path');
78

89
module.exports = {
910
name: 'ember-cli-typescript',
1011

1112
included(includer) {
1213
this._super.included.apply(this, arguments);
1314

15+
this._checkDevelopment();
16+
1417
if (includer === this.app) {
1518
this.compiler = new IncrementalTypescriptCompiler(this.app, this.project);
1619
this.compiler.launch();
@@ -46,6 +49,15 @@ module.exports = {
4649
return !['in-repo-a', 'in-repo-b', 'in-repo-c'].includes(addon.name);
4750
},
4851

52+
_checkDevelopment() {
53+
if (this.isDevelopingAddon() && !process.env.CI && path.basename(__dirname) !== 'ts') {
54+
this.ui.writeWarnLine(
55+
'ember-cli-typescript is in development but not being loaded from `/ts` — ' +
56+
'do you have compiled artifacts lingering in `/js`?'
57+
);
58+
}
59+
},
60+
4961
setupPreprocessorRegistry(type, registry) {
5062
if (type !== 'parent') {
5163
return;

0 commit comments

Comments
 (0)