@embroider/macros 0.21.0 → 0.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +22 -17
- package/src/ember-addon-main.js +6 -4
- package/src/ember-addon-main.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,43 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embroider/macros",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.1",
|
|
4
|
+
"private": false,
|
|
4
5
|
"description": "Standardized build-time macros for ember apps.",
|
|
5
6
|
"keywords": [
|
|
6
7
|
"ember-addon"
|
|
7
8
|
],
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"scripts": {
|
|
13
|
-
"prepare": "tsc",
|
|
14
|
-
"test": "jest"
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/embroider-build/embroider.git",
|
|
12
|
+
"directory": "packages/macros"
|
|
15
13
|
},
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"author": "Edward Faulkner",
|
|
16
|
+
"main": "src/index.js",
|
|
16
17
|
"files": [
|
|
17
18
|
"src/**/*.js",
|
|
18
19
|
"src/**/*.d.ts",
|
|
19
20
|
"src/**/*.js.map"
|
|
20
21
|
],
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"@types/babel__generator": "^7.0.1",
|
|
25
|
-
"@types/babel__template": "^7.0.1",
|
|
26
|
-
"@types/node": "^10.5.2",
|
|
27
|
-
"@types/resolve": "^0.0.8",
|
|
28
|
-
"typescript": "~3.4.0"
|
|
22
|
+
"scripts": {
|
|
23
|
+
"prepare": "tsc",
|
|
24
|
+
"test": "jest"
|
|
29
25
|
},
|
|
30
26
|
"dependencies": {
|
|
31
27
|
"@babel/core": "^7.8.7",
|
|
32
28
|
"@babel/traverse": "^7.8.6",
|
|
33
29
|
"@babel/types": "^7.8.7",
|
|
34
|
-
"@embroider/core": "0.
|
|
30
|
+
"@embroider/core": "0.24.1",
|
|
35
31
|
"assert-never": "^1.1.0",
|
|
36
32
|
"ember-cli-babel": "^7.20.5",
|
|
37
33
|
"lodash": "^4.17.10",
|
|
38
34
|
"resolve": "^1.8.1",
|
|
39
35
|
"semver": "^5.6.0"
|
|
40
36
|
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@embroider/test-support": "0.24.1",
|
|
39
|
+
"@types/babel__core": "^7.0.4",
|
|
40
|
+
"@types/babel__generator": "^7.0.1",
|
|
41
|
+
"@types/babel__template": "^7.0.1",
|
|
42
|
+
"@types/node": "^10.5.2",
|
|
43
|
+
"@types/resolve": "^0.0.8",
|
|
44
|
+
"typescript": "~3.4.0"
|
|
45
|
+
},
|
|
41
46
|
"ember-addon": {
|
|
42
47
|
"main": "src/ember-addon-main.js"
|
|
43
48
|
},
|
package/src/ember-addon-main.js
CHANGED
|
@@ -35,7 +35,7 @@ module.exports = {
|
|
|
35
35
|
this.installBabelPlugin(parent);
|
|
36
36
|
// and to our own babel, because we may need to inline runtime config into
|
|
37
37
|
// our source code
|
|
38
|
-
this.
|
|
38
|
+
this.installBabelPlugin(this);
|
|
39
39
|
appInstance.import('vendor/embroider-macros-test-support.js', { type: 'test' });
|
|
40
40
|
// When we're used inside the traditional ember-cli build pipeline without
|
|
41
41
|
// Embroider, we unfortunately need to hook into here uncleanly because we
|
|
@@ -55,11 +55,13 @@ module.exports = {
|
|
|
55
55
|
// available everywhere, we don't scope them so narrowly so this probably
|
|
56
56
|
// doesn't come up.
|
|
57
57
|
installBabelPlugin(appOrAddonInstance) {
|
|
58
|
-
let source = appOrAddonInstance.root || appOrAddonInstance.project.root;
|
|
59
58
|
let babelOptions = (appOrAddonInstance.options.babel = appOrAddonInstance.options.babel || {});
|
|
60
59
|
let babelPlugins = (babelOptions.plugins = babelOptions.plugins || []);
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
if (!babelPlugins.some(_1.isEmbroiderMacrosPlugin)) {
|
|
61
|
+
let appInstance = this._findHost();
|
|
62
|
+
let source = appOrAddonInstance.root || appOrAddonInstance.project.root;
|
|
63
|
+
babelPlugins.unshift(_1.MacrosConfig.for(appInstance).babelPluginConfig(source));
|
|
64
|
+
}
|
|
63
65
|
},
|
|
64
66
|
setupPreprocessorRegistry(type, registry) {
|
|
65
67
|
if (type === 'parent') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ember-addon-main.js","sourceRoot":"","sources":["ember-addon-main.ts"],"names":[],"mappings":";AAAA,+BAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"ember-addon-main.js","sourceRoot":"","sources":["ember-addon-main.ts"],"names":[],"mappings":";AAAA,+BAA4B;AAC5B,wBAA0D;AAE1D,iBAAS;IACP,IAAI,EAAE,mBAAmB;IACzB,QAAQ,CAAY,MAAW;QAC7B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAC5C,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QACrC,IAAI,aAAa,GAAG,CAAC,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QAC5D,IAAI,UAAU,GAAG,CAAC,aAAa,CAAC,mBAAmB,CAAC,GAAG,aAAa,CAAC,mBAAmB,CAAC,IAAI,EAAE,CAAC,CAAC;QAEjG,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QACrC,IAAI,CAAC,eAAe,CAAC,eAAY,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;QACpD,yEAAyE;QACzE,IAAI,MAAM,GAAG,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;QAEhD,IAAI,UAAU,CAAC,YAAY,EAAE;YAC3B,eAAY,CAAC,GAAG,CAA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