From 06d3eabbedd5c512b7828f3cfa0eb68297108102 Mon Sep 17 00:00:00 2001 From: Raido Kuli Date: Fri, 31 Mar 2017 23:27:16 +0300 Subject: [PATCH 1/3] Switch to treeForAddonTestSupport --- {addon => addon-test-support}/.eslintrc.js | 0 {addon => addon-test-support}/index.js | 0 .../utils/bind-data-test-attributes.js | 0 addon/.gitkeep | 0 index.js | 20 ++++++++++++++----- 5 files changed, 15 insertions(+), 5 deletions(-) rename {addon => addon-test-support}/.eslintrc.js (100%) rename {addon => addon-test-support}/index.js (100%) rename {addon => addon-test-support}/utils/bind-data-test-attributes.js (100%) create mode 100644 addon/.gitkeep diff --git a/addon/.eslintrc.js b/addon-test-support/.eslintrc.js similarity index 100% rename from addon/.eslintrc.js rename to addon-test-support/.eslintrc.js diff --git a/addon/index.js b/addon-test-support/index.js similarity index 100% rename from addon/index.js rename to addon-test-support/index.js diff --git a/addon/utils/bind-data-test-attributes.js b/addon-test-support/utils/bind-data-test-attributes.js similarity index 100% rename from addon/utils/bind-data-test-attributes.js rename to addon-test-support/utils/bind-data-test-attributes.js diff --git a/addon/.gitkeep b/addon/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/index.js b/index.js index 85cc1628..9997386d 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,7 @@ /* eslint-env node */ const VersionChecker = require('ember-cli-version-checker'); +const Funnel = require('broccoli-funnel'); module.exports = { name: 'ember-test-selectors', @@ -79,11 +80,20 @@ module.exports = { } }, - treeForAddon() { - // remove our "addon" folder from the build if we're stripping test selectors - if (!this._stripTestSelectors) { - return this._super.treeForAddon.apply(this, arguments); - } + treeForAddonTestSupport(tree) { + // intentionally not calling _super here + // so that can have our `import`'s be + // import testSelector from 'ember-test-selectors'; + + let namespacedTree = new Funnel(tree, { + srcDir: '/', + destDir: `/${this.moduleName()}`, + annotation: `Addon#treeForTestSupport (${this.name})`, + }); + + return this.preprocessJs(namespacedTree, '/', this.name, { + registry: this.registry, + }); }, preprocessTree(type, tree) { From 15d55c5eee7ed551f7b2391743843ae01da799f0 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Fri, 7 Apr 2017 14:10:58 +0200 Subject: [PATCH 2/3] addon: Remove ".gitkeep" file --- addon/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 addon/.gitkeep diff --git a/addon/.gitkeep b/addon/.gitkeep deleted file mode 100644 index e69de29b..00000000 From b77fc1c82e8a6f6676003db78e2b10611fe7ce71 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Fri, 7 Apr 2017 14:21:33 +0200 Subject: [PATCH 3/3] Explicitly declare missing dependencies --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index 8b6e12c6..ab2a0b3a 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,8 @@ "test:strip": "STRIP_TEST_SELECTORS=true ember test" }, "dependencies": { + "broccoli-funnel": "^1.1.0", + "broccoli-stew": "^1.4.0", "ember-cli-babel": "^5.1.7", "ember-cli-version-checker": "^1.2.0" },