Skip to content

Commit 01c9323

Browse files
authored
Merge pull request #46 from yappbox/feature/config-exports
Add support for configuration to suppress exports of components to app directory
2 parents 5347e4f + 76d02ad commit 01c9323

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
'use strict';
2+
const stew = require('broccoli-stew');
23

34
module.exports = {
45
name: require('./package').name,
56
isDevelopingAddon() {
67
return true;
78
},
89

10+
treeForApp() {
11+
let tree = this._super.treeForApp.apply(this, arguments);
12+
if (this.doNotExportComponents) {
13+
tree = stew.rm(tree, 'components/*');
14+
}
15+
return tree;
16+
},
17+
918
included(app) {
1019
// see: https://github.com/ember-cli/ember-cli/issues/3718
1120
if (typeof app.import !== 'function' && app.app) {
@@ -16,6 +25,10 @@ module.exports = {
1625

1726
this._super.included.apply(this, arguments);
1827

28+
if (app.options.yappScrollView && app.options.yappScrollView.doNotExportComponents) {
29+
this.doNotExportComponents = true;
30+
}
31+
1932
app.import('vendor/zynga-scroller/Animate.js');
2033
app.import('vendor/zynga-scroller/Scroller.js');
2134
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"dependencies": {
2929
"@ember/render-modifiers": "^1.0.2",
3030
"@glimmer/tracking": "^1.0.0",
31+
"broccoli-stew": "^2.1.0",
3132
"ember-auto-import": "^1.5.3",
3233
"ember-cli-babel": "7.20.5",
3334
"ember-cli-htmlbars": "^5.1.2",

yarn.lock

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4418,7 +4418,7 @@ broccoli-persistent-filter@^1.1.6, broccoli-persistent-filter@^1.4.3:
44184418
symlink-or-copy "^1.0.1"
44194419
walk-sync "^0.3.1"
44204420

4421-
broccoli-persistent-filter@^2.2.1, broccoli-persistent-filter@^2.2.2, broccoli-persistent-filter@^2.3.0, broccoli-persistent-filter@^2.3.1:
4421+
broccoli-persistent-filter@^2.1.1, broccoli-persistent-filter@^2.2.1, broccoli-persistent-filter@^2.2.2, broccoli-persistent-filter@^2.3.0, broccoli-persistent-filter@^2.3.1:
44224422
version "2.3.1"
44234423
resolved "https://registry.yarnpkg.com/broccoli-persistent-filter/-/broccoli-persistent-filter-2.3.1.tgz#4a052e0e0868b344c3a2977e35a3d497aa9eca72"
44244424
integrity sha512-hVsmIgCDrl2NFM+3Gs4Cr2TA6UPaIZip99hN8mtkaUPgM8UeVnCbxelCvBjUBHo0oaaqP5jzqqnRVvb568Yu5g==
@@ -4448,7 +4448,7 @@ [email protected]:
44484448
rimraf "^2.3.4"
44494449
symlink-or-copy "^1.0.1"
44504450

4451-
broccoli-plugin@^1.0.0, broccoli-plugin@^1.1.0, broccoli-plugin@^1.2.0, broccoli-plugin@^1.2.1, broccoli-plugin@^1.3.0:
4451+
broccoli-plugin@^1.0.0, broccoli-plugin@^1.1.0, broccoli-plugin@^1.2.0, broccoli-plugin@^1.2.1, broccoli-plugin@^1.3.0, broccoli-plugin@^1.3.1:
44524452
version "1.3.1"
44534453
resolved "https://registry.yarnpkg.com/broccoli-plugin/-/broccoli-plugin-1.3.1.tgz#a26315732fb99ed2d9fb58f12a1e14e986b4fabd"
44544454
integrity sha512-DW8XASZkmorp+q7J4EeDEZz+LoyKLAd2XZULXyD9l4m9/hAKV3vjHmB1kiUshcWAYMgTP1m2i4NnqCE/23h6AQ==
@@ -4548,6 +4548,26 @@ broccoli-sri-hash@^2.1.0:
45484548
sri-toolbox "^0.2.0"
45494549
symlink-or-copy "^1.0.1"
45504550

4551+
broccoli-stew@^2.1.0:
4552+
version "2.1.0"
4553+
resolved "https://registry.yarnpkg.com/broccoli-stew/-/broccoli-stew-2.1.0.tgz#ba73add17fda3b9b01d8cfb343a8b613b7136a0a"
4554+
integrity sha512-tgCkuTWYl4uf7k7ib2D79KFEj2hCgnTUNPMnrCoAha0/4bywcNccmaZVWtL9Ex37yX5h5eAbnM/ak2ULoMwSSw==
4555+
dependencies:
4556+
broccoli-debug "^0.6.5"
4557+
broccoli-funnel "^2.0.0"
4558+
broccoli-merge-trees "^3.0.1"
4559+
broccoli-persistent-filter "^2.1.1"
4560+
broccoli-plugin "^1.3.1"
4561+
chalk "^2.4.1"
4562+
debug "^3.1.0"
4563+
ensure-posix-path "^1.0.1"
4564+
fs-extra "^6.0.1"
4565+
minimatch "^3.0.4"
4566+
resolve "^1.8.1"
4567+
rsvp "^4.8.4"
4568+
symlink-or-copy "^1.2.0"
4569+
walk-sync "^0.3.3"
4570+
45514571
broccoli-stew@^3.0.0:
45524572
version "3.0.0"
45534573
resolved "https://registry.yarnpkg.com/broccoli-stew/-/broccoli-stew-3.0.0.tgz#fd1d19d162ad9490b42e5c563b78c26eb1e80b95"

0 commit comments

Comments
 (0)