@xarc/app-dev 11.0.10-beta.9 → 12.0.0
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/config/babel/babelrc-client.js +5 -26
- package/config/babel/babelrc-client.js.map +1 -1
- package/config/babel/babelrc-server.js +10 -10
- package/config/babel/babelrc-server.js.map +1 -1
- package/config/babel/babelrc.js +6 -51
- package/config/babel/babelrc.js.map +1 -1
- package/config/opt2/babel-options.d.ts +1 -1
- package/lib/dev-admin/redbird-spawn.js +12 -7
- package/lib/dev-admin/redbird-spawn.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/package.json +194 -196
- package/scripts/l10n/flatten-messages.js +14 -4
- package/src/config/babel/babelrc-client.ts +10 -27
- package/src/config/babel/babelrc-server.ts +10 -10
- package/src/config/babel/babelrc.ts +15 -56
- package/src/config/opt2/babel-options.ts +1 -1
- package/src/lib/dev-admin/redbird-spawn.ts +24 -18
|
@@ -23,7 +23,7 @@ const basePlugins = [
|
|
|
23
23
|
},
|
|
24
24
|
],
|
|
25
25
|
// allow decorators on class and method
|
|
26
|
-
// Note: This must go before @babel/plugin-proposal-
|
|
26
|
+
// Note: This must go before @babel/plugin-proposal-transform-properties
|
|
27
27
|
(enableTypeScript || proposalDecorators) && [
|
|
28
28
|
"@babel/plugin-proposal-decorators",
|
|
29
29
|
{ legacy: legacyDecorators, ...proposalDecorators },
|
|
@@ -34,7 +34,7 @@ const basePlugins = [
|
|
|
34
34
|
// Note: This must go before @babel/plugin-transform-classes
|
|
35
35
|
//
|
|
36
36
|
(enableTypeScript || transformClassProps) && [
|
|
37
|
-
"@babel/plugin-proposal-
|
|
37
|
+
"@babel/plugin-proposal-transform-properties",
|
|
38
38
|
{ loose: looseClassProps, ...transformClassProps },
|
|
39
39
|
],
|
|
40
40
|
//
|
|
@@ -63,7 +63,6 @@ const basePlugins = [
|
|
|
63
63
|
],
|
|
64
64
|
];
|
|
65
65
|
const { BABEL_ENV, NODE_ENV, ENABLE_KARMA_COV } = process.env;
|
|
66
|
-
const enableCssModule = Boolean(lodash_1.default.get(xOptions, "webpack.cssModuleSupport"));
|
|
67
66
|
const enableKarmaCov = ENABLE_KARMA_COV === "true";
|
|
68
67
|
const isProduction = (BABEL_ENV || NODE_ENV) === "production";
|
|
69
68
|
// const isTest = (BABEL_ENV || NODE_ENV) === "test";
|
|
@@ -78,34 +77,14 @@ isProduction && [
|
|
|
78
77
|
removeImport: true,
|
|
79
78
|
},
|
|
80
79
|
],
|
|
81
|
-
],
|
|
82
|
-
// css module support
|
|
83
|
-
enableCssModule && [
|
|
84
|
-
[
|
|
85
|
-
"babel-plugin-react-css-modules",
|
|
86
|
-
{
|
|
87
|
-
context: "./src",
|
|
88
|
-
generateScopedName: `${isProduction ? "" : "[name]__[local]___"}[hash:base64:5]`,
|
|
89
|
-
filetypes: {
|
|
90
|
-
".scss": {
|
|
91
|
-
syntax: "postcss-scss",
|
|
92
|
-
plugins: ["postcss-nested"],
|
|
93
|
-
},
|
|
94
|
-
".styl": {
|
|
95
|
-
syntax: "sugarss",
|
|
96
|
-
},
|
|
97
|
-
".less": {
|
|
98
|
-
syntax: "postcss-less",
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
],
|
|
103
80
|
], enableKarmaCov && [
|
|
104
81
|
(0, common_1.getPluginFrom)(["@xarc/opt-karma", "electrode-archetype-opt-karma"], "babel-plugin-istanbul"),
|
|
105
82
|
]);
|
|
106
83
|
const targets = envTargets[babelTarget];
|
|
107
84
|
const coreJsVersion = require("core-js/package.json").version.split(".")[0];
|
|
108
|
-
const useBuiltIns = hasMultiTargets
|
|
85
|
+
const useBuiltIns = hasMultiTargets
|
|
86
|
+
? { useBuiltIns: "entry", corejs: coreJsVersion }
|
|
87
|
+
: {};
|
|
109
88
|
const presets = [
|
|
110
89
|
//
|
|
111
90
|
// webpack 4 can handle ES modules now so turn off babel module transformation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babelrc-client.js","sourceRoot":"","sources":["../../src/config/babel/babelrc-client.ts"],"names":[],"mappings":";AAAA,sGAAsG;;AAEtG,uDAAuD;AACvD,qCAA0D;AAC1D,4DAAuB;AAEvB,MAAM,eAAe,GAAG,IAAA,sCAAmB,EAAC,OAAO,CAAC,CAAC;AACrD,MAAM,OAAO,GAAG,eAAe,CAAC,8BAA8B,CAAC,CAAC;AAChE,MAAM,QAAQ,GAAG,IAAA,wBAAe,EAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAEvD,MAAM,EACJ,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,MAAM,EAAE,WAAW,EACnB,UAAU,GAAG,EAAE,GAChB,GAAG,gBAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;AAEjC,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,CAAC;AAErD,MAAM,WAAW,GAAG;IAClB,6CAA6C;IAC7C;QACE,mBAAmB;QACnB;YACE,QAAQ,EAAE;gBACR,QAAQ,EAAE,IAAI;gBACd,UAAU,EAAE,KAAK;aAClB;YACD,cAAc,EAAE,IAAI;YACpB,gBAAgB,EAAE,IAAI;SACvB;KACF;IACD,uCAAuC;IACvC,
|
|
1
|
+
{"version":3,"file":"babelrc-client.js","sourceRoot":"","sources":["../../src/config/babel/babelrc-client.ts"],"names":[],"mappings":";AAAA,sGAAsG;;AAEtG,uDAAuD;AACvD,qCAA0D;AAC1D,4DAAuB;AAEvB,MAAM,eAAe,GAAG,IAAA,sCAAmB,EAAC,OAAO,CAAC,CAAC;AACrD,MAAM,OAAO,GAAG,eAAe,CAAC,8BAA8B,CAAC,CAAC;AAChE,MAAM,QAAQ,GAAG,IAAA,wBAAe,EAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC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AC;AAEF,iBAAS;IACP,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;CAClC,CAAC"}
|
|
@@ -5,7 +5,7 @@ const optFlow = optionalRequire("electrode-archetype-opt-flow");
|
|
|
5
5
|
const common_1 = require("./common");
|
|
6
6
|
const xOptions = (0, common_1.loadXarcOptions)(process.env.XARC_CWD);
|
|
7
7
|
const _ = require("lodash");
|
|
8
|
-
const { enableTypeScript, flowRequireDirective, enableFlow, transformClassProps, looseClassProps, envTargets = {} } = _.get(xOptions, "babel", {});
|
|
8
|
+
const { enableTypeScript, flowRequireDirective, enableFlow, transformClassProps, looseClassProps, envTargets = {}, } = _.get(xOptions, "babel", {});
|
|
9
9
|
const addFlowPlugin = Boolean(enableFlow && optFlow);
|
|
10
10
|
const { node } = envTargets;
|
|
11
11
|
module.exports = {
|
|
@@ -13,22 +13,22 @@ module.exports = {
|
|
|
13
13
|
[
|
|
14
14
|
"@babel/preset-env",
|
|
15
15
|
{
|
|
16
|
-
targets: node
|
|
17
|
-
}
|
|
16
|
+
targets: node,
|
|
17
|
+
},
|
|
18
18
|
],
|
|
19
19
|
enableTypeScript && "@babel/preset-typescript",
|
|
20
|
-
"@babel/preset-react"
|
|
21
|
-
].filter(x => x),
|
|
20
|
+
"@babel/preset-react",
|
|
21
|
+
].filter((x) => x),
|
|
22
22
|
plugins: [
|
|
23
23
|
addFlowPlugin && [
|
|
24
24
|
"@babel/plugin-transform-flow-strip-types",
|
|
25
|
-
{ requireDirective: flowRequireDirective }
|
|
25
|
+
{ requireDirective: flowRequireDirective },
|
|
26
26
|
],
|
|
27
27
|
(enableTypeScript || transformClassProps) && [
|
|
28
|
-
"@babel/plugin-
|
|
29
|
-
{ loose: looseClassProps }
|
|
28
|
+
"@babel/plugin-transform-class-properties",
|
|
29
|
+
{ loose: looseClassProps },
|
|
30
30
|
],
|
|
31
|
-
enableTypeScript && "@babel/proposal-object-rest-spread"
|
|
32
|
-
].filter(x => x)
|
|
31
|
+
enableTypeScript && "@babel/proposal-object-rest-spread",
|
|
32
|
+
].filter((x) => x),
|
|
33
33
|
};
|
|
34
34
|
//# sourceMappingURL=babelrc-server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babelrc-server.js","sourceRoot":"","sources":["../../src/config/babel/babelrc-server.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,MAAM,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,CAAC;AAC7D,MAAM,OAAO,GAAG,eAAe,CAAC,8BAA8B,CAAC,CAAC;AAChE,qCAA2C;AAC3C,MAAM,QAAQ,GAAG,IAAA,wBAAe,EAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACvD,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE5B,MAAM,EACJ,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,mBAAmB,EACnB,eAAe,EACf,UAAU,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"babelrc-server.js","sourceRoot":"","sources":["../../src/config/babel/babelrc-server.ts"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,MAAM,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,CAAC;AAC7D,MAAM,OAAO,GAAG,eAAe,CAAC,8BAA8B,CAAC,CAAC;AAChE,qCAA2C;AAC3C,MAAM,QAAQ,GAAG,IAAA,wBAAe,EAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACvD,MAAM,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE5B,MAAM,EACJ,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,mBAAmB,EACnB,eAAe,EACf,UAAU,GAAG,EAAE,GAChB,GAAG,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;AAEjC,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,CAAC;AAErD,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC;AAE5B,iBAAS;IACP,OAAO,EAAE;QACP;YACE,mBAAmB;YACnB;gBACE,OAAO,EAAE,IAAI;aACd;SACF;QACD,gBAAgB,IAAI,0BAA0B;QAC9C,qBAAqB;KACtB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAClB,OAAO,EAAE;QACP,aAAa,IAAI;YACf,0CAA0C;YAC1C,EAAE,gBAAgB,EAAE,oBAAoB,EAAE;SAC3C;QACD,CAAC,gBAAgB,IAAI,mBAAmB,CAAC,IAAI;YAC3C,0CAA0C;YAC1C,EAAE,KAAK,EAAE,eAAe,EAAE;SAC3B;QACD,gBAAgB,IAAI,oCAAoC;KACzD,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;CACnB,CAAC"}
|
package/config/babel/babelrc.js
CHANGED
|
@@ -17,54 +17,10 @@ const isJest = Boolean(process.env.JEST_WORKER_ID);
|
|
|
17
17
|
const { enableTypeScript, flowRequireDirective, enableFlow, proposalDecorators, legacyDecorators, transformClassProps, looseClassProps, hasMultiTargets, target: babelTarget, envTargets = {}, } = lodash_1.default.get(xOptions, "babel", {});
|
|
18
18
|
const addFlowPlugin = Boolean(enableFlow && optFlow);
|
|
19
19
|
const { BABEL_ENV, NODE_ENV, XARC_BABEL_TARGET, ENABLE_KARMA_COV } = process.env;
|
|
20
|
-
const enableCssModule = (0, common_1.detectCSSModule)(xOptions);
|
|
21
20
|
const enableKarmaCov = ENABLE_KARMA_COV === "true";
|
|
22
21
|
const isProduction = (BABEL_ENV || NODE_ENV) === "production";
|
|
23
22
|
// const isTest = (BABEL_ENV || NODE_ENV) === "test";
|
|
24
23
|
const isNodeTarget = XARC_BABEL_TARGET === "node";
|
|
25
|
-
/**
|
|
26
|
-
* https://www.npmjs.com/package/babel-plugin-react-css-modules
|
|
27
|
-
*
|
|
28
|
-
* This plugin enhances the CSS module support from css-loader. It adds a new
|
|
29
|
-
* prop styleName in addition to the className prop. This also automatically
|
|
30
|
-
* make it work for SSR.
|
|
31
|
-
*
|
|
32
|
-
* Currently, looks like the author has been inactive on maintaining this plugin
|
|
33
|
-
* and there's some compatibility issue with css-loader 4.x.
|
|
34
|
-
* https://github.com/gajus/babel-plugin-react-css-modules/issues/291
|
|
35
|
-
*
|
|
36
|
-
* Resolution: TBD
|
|
37
|
-
*
|
|
38
|
-
* @returns null or settings for babel-plugin-react-css-modules
|
|
39
|
-
*/
|
|
40
|
-
const getReactCssModulePlugin = () => {
|
|
41
|
-
if (!enableCssModule) {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
const enableShortenCSSNames = xOptions.webpack.enableShortenCSSNames;
|
|
45
|
-
const enableShortHash = isProduction && enableShortenCSSNames;
|
|
46
|
-
return [
|
|
47
|
-
[
|
|
48
|
-
"babel-plugin-react-css-modules",
|
|
49
|
-
{
|
|
50
|
-
context: "./src",
|
|
51
|
-
generateScopedName: `${enableShortHash ? "" : "[name]__[local]___"}[hash:base64:5]`,
|
|
52
|
-
filetypes: {
|
|
53
|
-
".scss": {
|
|
54
|
-
syntax: "postcss-scss",
|
|
55
|
-
plugins: ["postcss-nested"],
|
|
56
|
-
},
|
|
57
|
-
".styl": {
|
|
58
|
-
syntax: "sugarss",
|
|
59
|
-
},
|
|
60
|
-
".less": {
|
|
61
|
-
syntax: "postcss-less",
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
];
|
|
67
|
-
};
|
|
68
24
|
const basePlugins = [
|
|
69
25
|
// plugin to transpile async/await to Promise
|
|
70
26
|
// not for node.js because it has native async/await
|
|
@@ -80,7 +36,7 @@ const basePlugins = [
|
|
|
80
36
|
},
|
|
81
37
|
],
|
|
82
38
|
// allow decorators on class and method
|
|
83
|
-
// Note: This must go before @babel/plugin-
|
|
39
|
+
// Note: This must go before @babel/plugin-transform-class-properties
|
|
84
40
|
(enableTypeScript || proposalDecorators) && [
|
|
85
41
|
"@babel/plugin-proposal-decorators",
|
|
86
42
|
{ legacy: legacyDecorators, ...proposalDecorators },
|
|
@@ -91,7 +47,7 @@ const basePlugins = [
|
|
|
91
47
|
// Note: This must go before @babel/plugin-transform-classes
|
|
92
48
|
//
|
|
93
49
|
(enableTypeScript || transformClassProps) && [
|
|
94
|
-
"@babel/plugin-
|
|
50
|
+
"@babel/plugin-transform-class-properties",
|
|
95
51
|
{ loose: looseClassProps, ...transformClassProps },
|
|
96
52
|
],
|
|
97
53
|
//
|
|
@@ -131,17 +87,16 @@ const plugins = basePlugins.concat(
|
|
|
131
87
|
removeImport: true,
|
|
132
88
|
},
|
|
133
89
|
],
|
|
134
|
-
],
|
|
135
|
-
// css module support
|
|
136
|
-
// Note: this is needed for server side (node.js) also.
|
|
137
|
-
getReactCssModulePlugin(), !isNodeTarget &&
|
|
90
|
+
], !isNodeTarget &&
|
|
138
91
|
enableKarmaCov && [
|
|
139
92
|
(0, common_1.getPluginFrom)(["@xarc/opt-karma", "electrode-archetype-opt-karma"], "babel-plugin-istanbul"),
|
|
140
93
|
]);
|
|
141
94
|
const target = isNodeTarget ? "node" : babelTarget;
|
|
142
95
|
const targets = envTargets[target];
|
|
143
96
|
if (!isJest) {
|
|
144
|
-
const srcMsg = lodash_1.default.isEmpty(targets)
|
|
97
|
+
const srcMsg = lodash_1.default.isEmpty(targets)
|
|
98
|
+
? " (will read from '.browserslistrc')"
|
|
99
|
+
: "";
|
|
145
100
|
console.log((0, chalker_1.default) `<orange>Babel preset-env compile targets: </><cyan>${JSON.stringify(targets)}</>${srcMsg}`);
|
|
146
101
|
}
|
|
147
102
|
const useBuiltIns = !isNodeTarget && hasMultiTargets
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babelrc.js","sourceRoot":"","sources":["../../src/config/babel/babelrc.ts"],"names":[],"mappings":";AAAA,kEAAkE;;AAElE;;;;GAIG;AACH,8DAAyB;AACzB,uDAAuD;AACvD,4DAAuB;AACvB,
|
|
1
|
+
{"version":3,"file":"babelrc.js","sourceRoot":"","sources":["../../src/config/babel/babelrc.ts"],"names":[],"mappings":";AAAA,kEAAkE;;AAElE;;;;GAIG;AACH,8DAAyB;AACzB,uDAAuD;AACvD,4DAAuB;AACvB,qCAA0D;AAE1D,MAAM,eAAe,GAAG,IAAA,sCAAmB,EAAC,OAAO,CAAC,CAAC;AAErD,MAAM,OAAO,GAAG,eAAe,CAAC,8BAA8B,CAAC,CAAC;AAEhE,MAAM,QAAQ,GAAG,IAAA,wBAAe,EAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAEvD,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AAEnD,MAAM,EACJ,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,MAAM,EAAE,WAAW,EACnB,UAAU,GAAG,EAAE,GAChB,GAAG,gBAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;AAEjC,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,CAAC;AAErD,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,GAChE,OAAO,CAAC,GAAG,CAAC;AAEd,MAAM,cAAc,GAAG,gBAAgB,KAAK,MAAM,CAAC;AACnD,MAAM,YAAY,GAAG,CAAC,SAAS,IAAI,QAAQ,CAAC,KAAK,YAAY,CAAC;AAC9D,qDAAqD;AACrD,MAAM,YAAY,GAAG,iBAAiB,KAAK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M,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;CAClC,CAAC"}
|
|
@@ -43,7 +43,7 @@ export type BabelOptions = {
|
|
|
43
43
|
legacy: boolean;
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
|
-
* Add `@babel/plugin-
|
|
46
|
+
* Add `@babel/plugin-transform-class-properties` for class properties support
|
|
47
47
|
* - **Default: `false`**
|
|
48
48
|
* - if not set, then we check env `BABEL_CLASS_PROPS`
|
|
49
49
|
*
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const sudo_prompt_1 = tslib_1.__importDefault(require("sudo-prompt"));
|
|
7
|
-
const request_1 = tslib_1.__importDefault(require("request"));
|
|
8
7
|
const http_1 = tslib_1.__importDefault(require("http"));
|
|
9
8
|
const util_1 = tslib_1.__importDefault(require("util"));
|
|
10
9
|
const utils_1 = require("../utils");
|
|
@@ -35,7 +34,10 @@ const isProxyRunning = async () => {
|
|
|
35
34
|
path: controlPaths.status,
|
|
36
35
|
});
|
|
37
36
|
try {
|
|
38
|
-
await
|
|
37
|
+
const response = await fetch(statusUrl);
|
|
38
|
+
if (!response.ok) {
|
|
39
|
+
throw new Error("Failed to fetch status");
|
|
40
|
+
}
|
|
39
41
|
return true;
|
|
40
42
|
}
|
|
41
43
|
catch (_a) {
|
|
@@ -54,10 +56,8 @@ const handleRestart = (type) => {
|
|
|
54
56
|
.map((k) => `${k}=${options[k]}`)
|
|
55
57
|
.join("&"),
|
|
56
58
|
});
|
|
57
|
-
(
|
|
58
|
-
|
|
59
|
-
console.error("Restarting failed, body:", body, "Error", err, "\nrestart URL", restartUrl);
|
|
60
|
-
}
|
|
59
|
+
fetch(restartUrl).catch((err) => {
|
|
60
|
+
console.error("Restarting failed. Error:", err, "\nrestart URL", restartUrl);
|
|
61
61
|
});
|
|
62
62
|
};
|
|
63
63
|
process.on("SIGHUP", restart);
|
|
@@ -101,9 +101,14 @@ async function mainSpawn() {
|
|
|
101
101
|
};
|
|
102
102
|
const handleElevatedProxy = () => {
|
|
103
103
|
process.on("SIGINT", () => {
|
|
104
|
-
(
|
|
104
|
+
fetch(exitUrl)
|
|
105
|
+
.then(() => {
|
|
105
106
|
console.log("Elevated Electrode dev proxy terminating");
|
|
106
107
|
process.nextTick(() => process.exit(0));
|
|
108
|
+
})
|
|
109
|
+
.catch((err) => {
|
|
110
|
+
console.error("Failed to terminate Elevated Electrode dev proxy. Error:", err);
|
|
111
|
+
process.nextTick(() => process.exit(1));
|
|
107
112
|
});
|
|
108
113
|
});
|
|
109
114
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redbird-spawn.js","sourceRoot":"","sources":["../../src/lib/dev-admin/redbird-spawn.ts"],"names":[],"mappings":";AAAA,6FAA6F;AAC7F,kGAAkG;;;AAElG,sEAAqC;AACrC,
|
|
1
|
+
{"version":3,"file":"redbird-spawn.js","sourceRoot":"","sources":["../../src/lib/dev-admin/redbird-spawn.ts"],"names":[],"mappings":";AAAA,6FAA6F;AAC7F,kGAAkG;;;AAElG,sEAAqC;AACrC,wDAAwB;AACxB,wDAAwB;AACxB,oCAAmC;AACnC,sDAAkD;AAClD,4DAAuB;AAEvB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEnD,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,oBAAQ,CAAC;AAE3D,MAAM,aAAa,GAAG,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,SAAS,EAAE,EAAE;IACrD,MAAM,MAAM,GAAG,cAAI,CAAC,YAAY,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAE3C,IAAI,CAAC;QACH,MAAM,cAAI,C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EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC1C,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QAEF,mBAAmB,EAAE,CAAC;QACtB,aAAa,CAAC,WAAW,CAAC,CAAC;QAE3B,OAAO,EAAE,CAAC;IACZ,CAAC;SAAM,CAAC;QACN,aAAa,CAAC,EAAE,CAAC,CAAC;QAClB,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC;AAED,SAAS,EAAE,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { loadXarcDevTasks } from "./dev-tasks";
|
|
|
2
2
|
export { loadXarcDevTasks, loadXarcDevTasks as loadDevTasks };
|
|
3
3
|
export { xrun, xclap } from "./dev-tasks";
|
|
4
4
|
/** The require from @xarc/app-dev's directory */
|
|
5
|
-
export declare const devRequire:
|
|
5
|
+
export declare const devRequire: NodeJS.Require;
|
|
6
6
|
export { register as hapiPlugin } from "./webpack-dev-hapi";
|
|
7
7
|
export { hapi17Plugin } from "./webpack-dev-hapi17";
|
|
8
8
|
export { fastifyPlugin } from "./webpack-dev-fastify";
|
package/package.json
CHANGED
|
@@ -1,198 +1,196 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
"recursive": true
|
|
197
|
-
}
|
|
2
|
+
"name": "@xarc/app-dev",
|
|
3
|
+
"version": "12.0.0",
|
|
4
|
+
"description": "Electrode X application development support",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"homepage": "http://www.electrode.io",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/electrode-io/electrode.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/electrode-io/electrode/issues"
|
|
13
|
+
},
|
|
14
|
+
"license": "Apache-2.0",
|
|
15
|
+
"bin": {
|
|
16
|
+
"xrun": "bin/xrun.js"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"config",
|
|
20
|
+
"dist",
|
|
21
|
+
"lib",
|
|
22
|
+
"require.js",
|
|
23
|
+
"scripts",
|
|
24
|
+
"src"
|
|
25
|
+
],
|
|
26
|
+
"author": "Electrode (http://www.electrode.io/)",
|
|
27
|
+
"contributors": [
|
|
28
|
+
"Joel Chen <xchen@walmartlabs.com>"
|
|
29
|
+
],
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"@xarc/app": "^12.0.0"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@babel/cli": "^7.17.10",
|
|
35
|
+
"@babel/core": "^7.17.12",
|
|
36
|
+
"@babel/plugin-proposal-decorators": "^7.17.12",
|
|
37
|
+
"@babel/plugin-transform-class-properties": "^7.24.1",
|
|
38
|
+
"@babel/plugin-transform-object-rest-spread": "^7.24.7",
|
|
39
|
+
"@babel/plugin-transform-react-constant-elements": "^7.17.12",
|
|
40
|
+
"@babel/plugin-transform-react-inline-elements": "^7.16.7",
|
|
41
|
+
"@babel/plugin-transform-runtime": "^7.17.12",
|
|
42
|
+
"@babel/preset-env": "^7.17.12",
|
|
43
|
+
"@babel/preset-react": "^7.17.12",
|
|
44
|
+
"@babel/preset-typescript": "^7.17.12",
|
|
45
|
+
"@babel/register": "^7.17.7",
|
|
46
|
+
"@jchip/redbird": "^1.3.0",
|
|
47
|
+
"@xarc/dev-base": "^0.1.3",
|
|
48
|
+
"@xarc/run": "^1.0.5",
|
|
49
|
+
"@xarc/subapp": "^0.4.2",
|
|
50
|
+
"@xarc/webpack": "^12.0.0",
|
|
51
|
+
"ansi-to-html": "^0.7.2",
|
|
52
|
+
"babel-plugin-lodash": "^3.3.4",
|
|
53
|
+
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
|
|
54
|
+
"babel-plugin-transform-node-env-inline": "^0.4.3",
|
|
55
|
+
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
|
56
|
+
"boxen": "^5.0.0",
|
|
57
|
+
"chalker": "^1.2.0",
|
|
58
|
+
"chokidar": "^3.5.3",
|
|
59
|
+
"core-js": "^3.22.5",
|
|
60
|
+
"electrode-node-resolver": "^2.0.2",
|
|
61
|
+
"fast-async": "^7.0.5",
|
|
62
|
+
"filter-scan-dir": "1.5.5",
|
|
63
|
+
"fs-extra": "^10.1.0",
|
|
64
|
+
"glob": "^9.0.0",
|
|
65
|
+
"identity-obj-proxy": "^3.0.0",
|
|
66
|
+
"is-ci": "^2.0.0",
|
|
67
|
+
"lodash": "^4.17.21",
|
|
68
|
+
"log-update": "^5.0.1",
|
|
69
|
+
"mime": "^3.0.0",
|
|
70
|
+
"mkdirp": "^1.0.4",
|
|
71
|
+
"nix-clap": "^1.3.13",
|
|
72
|
+
"nyc": "^15.1.0",
|
|
73
|
+
"open": "^8.4.0",
|
|
74
|
+
"optional-require": "^1.1.8",
|
|
75
|
+
"pkg-up": "^3.1.0",
|
|
76
|
+
"prompts": "^2.4.2",
|
|
77
|
+
"ps-get": "^1.1.0",
|
|
78
|
+
"read-pkg-up": "^7.0.1",
|
|
79
|
+
"regenerator-runtime": "^0.13.9",
|
|
80
|
+
"require-at": "^1.0.6",
|
|
81
|
+
"semver": "^7.3.7",
|
|
82
|
+
"serve-index-fs": "^1.10.1",
|
|
83
|
+
"subapp-util": "^1.1.5",
|
|
84
|
+
"sudo-prompt": "^9.2.1",
|
|
85
|
+
"tslib": "^2.4.0",
|
|
86
|
+
"visual-logger": "^1.1.3",
|
|
87
|
+
"webpack-dev-middleware": "^4.1.0",
|
|
88
|
+
"webpack-hot-middleware": "^2.25.1",
|
|
89
|
+
"winston": "^3.7.2",
|
|
90
|
+
"xaa": "^1.7.3",
|
|
91
|
+
"xenv-config": "^1.3.1",
|
|
92
|
+
"xsh": "^0.4.5"
|
|
93
|
+
},
|
|
94
|
+
"devDependencies": {
|
|
95
|
+
"@babel/core": "^7.11.0",
|
|
96
|
+
"@babel/eslint-parser": "^7.25.1",
|
|
97
|
+
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
98
|
+
"@types/chai": "^4.3.1",
|
|
99
|
+
"@types/mocha": "^10.0.1",
|
|
100
|
+
"@types/node": "^20.14.10",
|
|
101
|
+
"@types/sinon": "^9.0.10",
|
|
102
|
+
"@types/sinon-chai": "^3.2.8",
|
|
103
|
+
"@types/webpack": "5.28.0",
|
|
104
|
+
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
105
|
+
"@typescript-eslint/parser": "^5.0.0",
|
|
106
|
+
"@xarc/app": "^12.0.0",
|
|
107
|
+
"@xarc/module-dev": "^4.1.0",
|
|
108
|
+
"@xarc/run": "^1.1.1",
|
|
109
|
+
"chai": "^4.3.6",
|
|
110
|
+
"electrode-server": "^3.3.0",
|
|
111
|
+
"electrode-server1": "npm:electrode-server@^1.0.0",
|
|
112
|
+
"eslint": "^7.16.0",
|
|
113
|
+
"eslint-config-walmart": "^2.2.1",
|
|
114
|
+
"eslint-plugin-filenames": "^1.3.2",
|
|
115
|
+
"eslint-plugin-jsdoc": "^48.2.7",
|
|
116
|
+
"eslint-plugin-tsdoc": "^0.3.0",
|
|
117
|
+
"mocha": "^10.2.0",
|
|
118
|
+
"mock-require": "^3.0.3",
|
|
119
|
+
"nyc": "^15.1.0",
|
|
120
|
+
"prettier": "^2.6.2",
|
|
121
|
+
"run-verify": "^1.2.6",
|
|
122
|
+
"shx": "^0.3.4",
|
|
123
|
+
"sinon": "^9.2.2",
|
|
124
|
+
"sinon-chai": "^3.7.0",
|
|
125
|
+
"source-map-support": "^0.5.21",
|
|
126
|
+
"ts-node": "^10.9.1",
|
|
127
|
+
"typedoc": "^0.25.13",
|
|
128
|
+
"typescript": "^5.4.5"
|
|
129
|
+
},
|
|
130
|
+
"engines": {
|
|
131
|
+
"node": ">= 14",
|
|
132
|
+
"npm": ">= 6"
|
|
133
|
+
},
|
|
134
|
+
"nyc": {
|
|
135
|
+
"all": true,
|
|
136
|
+
"reporter": [
|
|
137
|
+
"lcov",
|
|
138
|
+
"text",
|
|
139
|
+
"text-summary"
|
|
140
|
+
],
|
|
141
|
+
"exclude": [
|
|
142
|
+
"*clap.js",
|
|
143
|
+
"*clap.ts",
|
|
144
|
+
"config",
|
|
145
|
+
"coverage",
|
|
146
|
+
"dist",
|
|
147
|
+
"docs",
|
|
148
|
+
"gulpfile.js",
|
|
149
|
+
"lib",
|
|
150
|
+
"test",
|
|
151
|
+
"xrun*.js",
|
|
152
|
+
"xrun*.ts"
|
|
153
|
+
],
|
|
154
|
+
"check-coverage": false,
|
|
155
|
+
"statements": 0,
|
|
156
|
+
"branches": 0,
|
|
157
|
+
"functions": 0,
|
|
158
|
+
"lines": 0,
|
|
159
|
+
"cache": true,
|
|
160
|
+
"extends": [
|
|
161
|
+
"@istanbuljs/nyc-config-typescript"
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"@xarc/module-dev": {
|
|
165
|
+
"srcDir": [
|
|
166
|
+
"src",
|
|
167
|
+
"test",
|
|
168
|
+
"scripts"
|
|
169
|
+
],
|
|
170
|
+
"features": [
|
|
171
|
+
"eslint",
|
|
172
|
+
"eslintTS",
|
|
173
|
+
"mocha",
|
|
174
|
+
"typedoc",
|
|
175
|
+
"typescript"
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
"mocha": {
|
|
179
|
+
"require": [
|
|
180
|
+
"ts-node/register",
|
|
181
|
+
"source-map-support/register",
|
|
182
|
+
"@xarc/module-dev/config/test/setup.js"
|
|
183
|
+
],
|
|
184
|
+
"recursive": true
|
|
185
|
+
},
|
|
186
|
+
"scripts": {
|
|
187
|
+
"compile": "tsc",
|
|
188
|
+
"build": "xrun -s compile user/moveDist",
|
|
189
|
+
"lint": "xrun xarc/lint",
|
|
190
|
+
"test": "xrun xarc/test-only",
|
|
191
|
+
"coverage": "xrun xarc/test-cov",
|
|
192
|
+
"check": "xrun xarc/check",
|
|
193
|
+
"format": "prettier --write --print-width 100 *.{js,jsx} `find . -type d -d 1 -exec echo '{}/**/*.{js,jsx}' \\; | egrep -v '(/node_modules/|/dist/|/coverage/)'`",
|
|
194
|
+
"docs": "xrun xarc/docs"
|
|
195
|
+
}
|
|
198
196
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const _ = require("lodash");
|
|
7
7
|
const Util = require("util");
|
|
8
8
|
const Fs = require("fs-extra");
|
|
9
|
-
const getFilePaths = Util.promisify(require("glob"));
|
|
9
|
+
const { glob: getFilePaths } = Util.promisify(require("glob"));
|
|
10
10
|
const MESSAGES_PATTERN = "./tmp/messages/**/*.json";
|
|
11
11
|
const RAW_MESSAGES_DIR = "./dist/";
|
|
12
12
|
const RAW_MESSAGES_NAME = "raw-messages.json";
|
|
@@ -39,7 +39,10 @@ function readFileAsJSON(filePath) {
|
|
|
39
39
|
* from all files
|
|
40
40
|
*/
|
|
41
41
|
async function getAllDefaultMessages(messageFilesPathPattern) {
|
|
42
|
-
const fileJsons = await xaa.map(
|
|
42
|
+
const fileJsons = await xaa.map(
|
|
43
|
+
await getFilePaths(messageFilesPathPattern),
|
|
44
|
+
readFileAsJSON
|
|
45
|
+
);
|
|
43
46
|
return fileJsons.reduce((previousValue, defaultMessageDescriptors) => {
|
|
44
47
|
defaultMessageDescriptors.forEach((descriptor) => {
|
|
45
48
|
previousValue[descriptor.id] = descriptor;
|
|
@@ -48,12 +51,19 @@ async function getAllDefaultMessages(messageFilesPathPattern) {
|
|
|
48
51
|
}, {});
|
|
49
52
|
}
|
|
50
53
|
|
|
51
|
-
const writeRawMessages = _.partial(
|
|
54
|
+
const writeRawMessages = _.partial(
|
|
55
|
+
writeFileAsJSON,
|
|
56
|
+
RAW_MESSAGES_DIR,
|
|
57
|
+
RAW_MESSAGES_NAME
|
|
58
|
+
);
|
|
52
59
|
|
|
53
60
|
const isMain = require.main === module;
|
|
54
61
|
|
|
55
62
|
function flattenMessagesL10n() {
|
|
56
|
-
return Promise.all([
|
|
63
|
+
return Promise.all([
|
|
64
|
+
getAllDefaultMessages(MESSAGES_PATTERN),
|
|
65
|
+
Fs.ensureDir(RAW_MESSAGES_DIR),
|
|
66
|
+
])
|
|
57
67
|
.then(_.first)
|
|
58
68
|
.then(writeRawMessages)
|
|
59
69
|
.then(() => {
|
|
@@ -37,7 +37,7 @@ const basePlugins = [
|
|
|
37
37
|
},
|
|
38
38
|
],
|
|
39
39
|
// allow decorators on class and method
|
|
40
|
-
// Note: This must go before @babel/plugin-proposal-
|
|
40
|
+
// Note: This must go before @babel/plugin-proposal-transform-properties
|
|
41
41
|
(enableTypeScript || proposalDecorators) && [
|
|
42
42
|
"@babel/plugin-proposal-decorators",
|
|
43
43
|
{ legacy: legacyDecorators, ...proposalDecorators },
|
|
@@ -48,7 +48,7 @@ const basePlugins = [
|
|
|
48
48
|
// Note: This must go before @babel/plugin-transform-classes
|
|
49
49
|
//
|
|
50
50
|
(enableTypeScript || transformClassProps) && [
|
|
51
|
-
"@babel/plugin-proposal-
|
|
51
|
+
"@babel/plugin-proposal-transform-properties",
|
|
52
52
|
{ loose: looseClassProps, ...transformClassProps },
|
|
53
53
|
],
|
|
54
54
|
//
|
|
@@ -79,7 +79,6 @@ const basePlugins = [
|
|
|
79
79
|
|
|
80
80
|
const { BABEL_ENV, NODE_ENV, ENABLE_KARMA_COV } = process.env;
|
|
81
81
|
|
|
82
|
-
const enableCssModule = Boolean(_.get(xOptions, "webpack.cssModuleSupport"));
|
|
83
82
|
const enableKarmaCov = ENABLE_KARMA_COV === "true";
|
|
84
83
|
const isProduction = (BABEL_ENV || NODE_ENV) === "production";
|
|
85
84
|
// const isTest = (BABEL_ENV || NODE_ENV) === "test";
|
|
@@ -96,36 +95,20 @@ const plugins = basePlugins.concat(
|
|
|
96
95
|
},
|
|
97
96
|
],
|
|
98
97
|
],
|
|
99
|
-
|
|
100
|
-
enableCssModule && [
|
|
101
|
-
[
|
|
102
|
-
"babel-plugin-react-css-modules",
|
|
103
|
-
{
|
|
104
|
-
context: "./src",
|
|
105
|
-
generateScopedName: `${isProduction ? "" : "[name]__[local]___"}[hash:base64:5]`,
|
|
106
|
-
filetypes: {
|
|
107
|
-
".scss": {
|
|
108
|
-
syntax: "postcss-scss",
|
|
109
|
-
plugins: ["postcss-nested"],
|
|
110
|
-
},
|
|
111
|
-
".styl": {
|
|
112
|
-
syntax: "sugarss",
|
|
113
|
-
},
|
|
114
|
-
".less": {
|
|
115
|
-
syntax: "postcss-less",
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
],
|
|
98
|
+
|
|
121
99
|
enableKarmaCov && [
|
|
122
|
-
getPluginFrom(
|
|
100
|
+
getPluginFrom(
|
|
101
|
+
["@xarc/opt-karma", "electrode-archetype-opt-karma"],
|
|
102
|
+
"babel-plugin-istanbul"
|
|
103
|
+
),
|
|
123
104
|
]
|
|
124
105
|
);
|
|
125
106
|
|
|
126
107
|
const targets = envTargets[babelTarget];
|
|
127
108
|
const coreJsVersion = require("core-js/package.json").version.split(".")[0];
|
|
128
|
-
const useBuiltIns = hasMultiTargets
|
|
109
|
+
const useBuiltIns = hasMultiTargets
|
|
110
|
+
? { useBuiltIns: "entry", corejs: coreJsVersion }
|
|
111
|
+
: {};
|
|
129
112
|
|
|
130
113
|
const presets = [
|
|
131
114
|
//
|
|
@@ -11,7 +11,7 @@ const {
|
|
|
11
11
|
enableFlow,
|
|
12
12
|
transformClassProps,
|
|
13
13
|
looseClassProps,
|
|
14
|
-
envTargets = {}
|
|
14
|
+
envTargets = {},
|
|
15
15
|
} = _.get(xOptions, "babel", {});
|
|
16
16
|
|
|
17
17
|
const addFlowPlugin = Boolean(enableFlow && optFlow);
|
|
@@ -23,21 +23,21 @@ export = {
|
|
|
23
23
|
[
|
|
24
24
|
"@babel/preset-env",
|
|
25
25
|
{
|
|
26
|
-
targets: node
|
|
27
|
-
}
|
|
26
|
+
targets: node,
|
|
27
|
+
},
|
|
28
28
|
],
|
|
29
29
|
enableTypeScript && "@babel/preset-typescript",
|
|
30
|
-
"@babel/preset-react"
|
|
31
|
-
].filter(x => x),
|
|
30
|
+
"@babel/preset-react",
|
|
31
|
+
].filter((x) => x),
|
|
32
32
|
plugins: [
|
|
33
33
|
addFlowPlugin && [
|
|
34
34
|
"@babel/plugin-transform-flow-strip-types",
|
|
35
|
-
{ requireDirective: flowRequireDirective }
|
|
35
|
+
{ requireDirective: flowRequireDirective },
|
|
36
36
|
],
|
|
37
37
|
(enableTypeScript || transformClassProps) && [
|
|
38
|
-
"@babel/plugin-
|
|
39
|
-
{ loose: looseClassProps }
|
|
38
|
+
"@babel/plugin-transform-class-properties",
|
|
39
|
+
{ loose: looseClassProps },
|
|
40
40
|
],
|
|
41
|
-
enableTypeScript && "@babel/proposal-object-rest-spread"
|
|
42
|
-
].filter(x => x)
|
|
41
|
+
enableTypeScript && "@babel/proposal-object-rest-spread",
|
|
42
|
+
].filter((x) => x),
|
|
43
43
|
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import ck from "chalker";
|
|
9
9
|
import { makeOptionalRequire } from "optional-require";
|
|
10
10
|
import _ from "lodash";
|
|
11
|
-
import { getPluginFrom, loadXarcOptions
|
|
11
|
+
import { getPluginFrom, loadXarcOptions } from "./common";
|
|
12
12
|
|
|
13
13
|
const optionalRequire = makeOptionalRequire(require);
|
|
14
14
|
|
|
@@ -33,59 +33,14 @@ const {
|
|
|
33
33
|
|
|
34
34
|
const addFlowPlugin = Boolean(enableFlow && optFlow);
|
|
35
35
|
|
|
36
|
-
const { BABEL_ENV, NODE_ENV, XARC_BABEL_TARGET, ENABLE_KARMA_COV } =
|
|
36
|
+
const { BABEL_ENV, NODE_ENV, XARC_BABEL_TARGET, ENABLE_KARMA_COV } =
|
|
37
|
+
process.env;
|
|
37
38
|
|
|
38
|
-
const enableCssModule = detectCSSModule(xOptions);
|
|
39
39
|
const enableKarmaCov = ENABLE_KARMA_COV === "true";
|
|
40
40
|
const isProduction = (BABEL_ENV || NODE_ENV) === "production";
|
|
41
41
|
// const isTest = (BABEL_ENV || NODE_ENV) === "test";
|
|
42
42
|
const isNodeTarget = XARC_BABEL_TARGET === "node";
|
|
43
43
|
|
|
44
|
-
/**
|
|
45
|
-
* https://www.npmjs.com/package/babel-plugin-react-css-modules
|
|
46
|
-
*
|
|
47
|
-
* This plugin enhances the CSS module support from css-loader. It adds a new
|
|
48
|
-
* prop styleName in addition to the className prop. This also automatically
|
|
49
|
-
* make it work for SSR.
|
|
50
|
-
*
|
|
51
|
-
* Currently, looks like the author has been inactive on maintaining this plugin
|
|
52
|
-
* and there's some compatibility issue with css-loader 4.x.
|
|
53
|
-
* https://github.com/gajus/babel-plugin-react-css-modules/issues/291
|
|
54
|
-
*
|
|
55
|
-
* Resolution: TBD
|
|
56
|
-
*
|
|
57
|
-
* @returns null or settings for babel-plugin-react-css-modules
|
|
58
|
-
*/
|
|
59
|
-
const getReactCssModulePlugin = (): any => {
|
|
60
|
-
if (!enableCssModule) {
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const enableShortenCSSNames = xOptions.webpack.enableShortenCSSNames;
|
|
65
|
-
const enableShortHash = isProduction && enableShortenCSSNames;
|
|
66
|
-
return [
|
|
67
|
-
[
|
|
68
|
-
"babel-plugin-react-css-modules",
|
|
69
|
-
{
|
|
70
|
-
context: "./src",
|
|
71
|
-
generateScopedName: `${enableShortHash ? "" : "[name]__[local]___"}[hash:base64:5]`,
|
|
72
|
-
filetypes: {
|
|
73
|
-
".scss": {
|
|
74
|
-
syntax: "postcss-scss",
|
|
75
|
-
plugins: ["postcss-nested"],
|
|
76
|
-
},
|
|
77
|
-
".styl": {
|
|
78
|
-
syntax: "sugarss",
|
|
79
|
-
},
|
|
80
|
-
".less": {
|
|
81
|
-
syntax: "postcss-less",
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
];
|
|
87
|
-
};
|
|
88
|
-
|
|
89
44
|
const basePlugins = [
|
|
90
45
|
// plugin to transpile async/await to Promise
|
|
91
46
|
// not for node.js because it has native async/await
|
|
@@ -101,7 +56,7 @@ const basePlugins = [
|
|
|
101
56
|
},
|
|
102
57
|
],
|
|
103
58
|
// allow decorators on class and method
|
|
104
|
-
// Note: This must go before @babel/plugin-
|
|
59
|
+
// Note: This must go before @babel/plugin-transform-class-properties
|
|
105
60
|
(enableTypeScript || proposalDecorators) && [
|
|
106
61
|
"@babel/plugin-proposal-decorators",
|
|
107
62
|
{ legacy: legacyDecorators, ...proposalDecorators },
|
|
@@ -112,7 +67,7 @@ const basePlugins = [
|
|
|
112
67
|
// Note: This must go before @babel/plugin-transform-classes
|
|
113
68
|
//
|
|
114
69
|
(enableTypeScript || transformClassProps) && [
|
|
115
|
-
"@babel/plugin-
|
|
70
|
+
"@babel/plugin-transform-class-properties",
|
|
116
71
|
{ loose: looseClassProps, ...transformClassProps },
|
|
117
72
|
],
|
|
118
73
|
//
|
|
@@ -154,12 +109,12 @@ const plugins = basePlugins.concat(
|
|
|
154
109
|
},
|
|
155
110
|
],
|
|
156
111
|
],
|
|
157
|
-
// css module support
|
|
158
|
-
// Note: this is needed for server side (node.js) also.
|
|
159
|
-
getReactCssModulePlugin(),
|
|
160
112
|
!isNodeTarget &&
|
|
161
113
|
enableKarmaCov && [
|
|
162
|
-
getPluginFrom(
|
|
114
|
+
getPluginFrom(
|
|
115
|
+
["@xarc/opt-karma", "electrode-archetype-opt-karma"],
|
|
116
|
+
"babel-plugin-istanbul"
|
|
117
|
+
),
|
|
163
118
|
]
|
|
164
119
|
);
|
|
165
120
|
|
|
@@ -167,9 +122,13 @@ const target = isNodeTarget ? "node" : babelTarget;
|
|
|
167
122
|
|
|
168
123
|
const targets = envTargets[target];
|
|
169
124
|
if (!isJest) {
|
|
170
|
-
const srcMsg = _.isEmpty(targets)
|
|
125
|
+
const srcMsg = _.isEmpty(targets)
|
|
126
|
+
? " (will read from '.browserslistrc')"
|
|
127
|
+
: "";
|
|
171
128
|
console.log(
|
|
172
|
-
ck`<orange>Babel preset-env compile targets: </><cyan>${JSON.stringify(
|
|
129
|
+
ck`<orange>Babel preset-env compile targets: </><cyan>${JSON.stringify(
|
|
130
|
+
targets
|
|
131
|
+
)}</>${srcMsg}`
|
|
173
132
|
);
|
|
174
133
|
}
|
|
175
134
|
|
|
@@ -48,7 +48,7 @@ export type BabelOptions = {
|
|
|
48
48
|
// DEPRECATE: legacyDecorators?: boolean;
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
|
-
* Add `@babel/plugin-
|
|
51
|
+
* Add `@babel/plugin-transform-class-properties` for class properties support
|
|
52
52
|
* - **Default: `false`**
|
|
53
53
|
* - if not set, then we check env `BABEL_CLASS_PROPS`
|
|
54
54
|
*
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
/* eslint-disable no-magic-numbers, no-process-exit, global-require, no-console, max-statements */
|
|
3
3
|
|
|
4
4
|
import sudoPrompt from "sudo-prompt";
|
|
5
|
-
import request from "request";
|
|
6
5
|
import http from "http";
|
|
7
6
|
import Util from "util";
|
|
8
7
|
import { formUrl } from "../utils";
|
|
@@ -37,9 +36,11 @@ const isProxyRunning = async () => {
|
|
|
37
36
|
port: httpPort,
|
|
38
37
|
path: controlPaths.status,
|
|
39
38
|
});
|
|
40
|
-
|
|
41
39
|
try {
|
|
42
|
-
await
|
|
40
|
+
const response = await fetch(statusUrl);
|
|
41
|
+
if (!response.ok) {
|
|
42
|
+
throw new Error("Failed to fetch status");
|
|
43
|
+
}
|
|
43
44
|
return true;
|
|
44
45
|
} catch {
|
|
45
46
|
return false;
|
|
@@ -58,17 +59,14 @@ const handleRestart = (type) => {
|
|
|
58
59
|
.map((k) => `${k}=${options[k]}`)
|
|
59
60
|
.join("&"),
|
|
60
61
|
});
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
restartUrl
|
|
70
|
-
);
|
|
71
|
-
}
|
|
62
|
+
|
|
63
|
+
fetch(restartUrl).catch((err) => {
|
|
64
|
+
console.error(
|
|
65
|
+
"Restarting failed. Error:",
|
|
66
|
+
err,
|
|
67
|
+
"\nrestart URL",
|
|
68
|
+
restartUrl
|
|
69
|
+
);
|
|
72
70
|
});
|
|
73
71
|
};
|
|
74
72
|
|
|
@@ -123,10 +121,18 @@ async function mainSpawn() {
|
|
|
123
121
|
|
|
124
122
|
const handleElevatedProxy = () => {
|
|
125
123
|
process.on("SIGINT", () => {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
fetch(exitUrl)
|
|
125
|
+
.then(() => {
|
|
126
|
+
console.log("Elevated Electrode dev proxy terminating");
|
|
127
|
+
process.nextTick(() => process.exit(0));
|
|
128
|
+
})
|
|
129
|
+
.catch((err) => {
|
|
130
|
+
console.error(
|
|
131
|
+
"Failed to terminate Elevated Electrode dev proxy. Error:",
|
|
132
|
+
err
|
|
133
|
+
);
|
|
134
|
+
process.nextTick(() => process.exit(1));
|
|
135
|
+
});
|
|
130
136
|
});
|
|
131
137
|
};
|
|
132
138
|
|