@teams-max/mwsp 2.0.1 → 2.0.3
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/es/utils/defineConfig.js +9 -2
- package/lib/utils/defineConfig.js +8 -2
- package/lib/utils/index.js +14 -2
- package/package.json +1 -1
package/es/utils/defineConfig.js
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
var path = require('path');
|
|
2
2
|
var _require = require("./index"),
|
|
3
3
|
logStep = _require.logStep,
|
|
4
|
-
printErrorAndExit = _require.printErrorAndExit
|
|
4
|
+
printErrorAndExit = _require.printErrorAndExit,
|
|
5
|
+
getCfg = _require.getCfg;
|
|
5
6
|
function defineConfig(config) {
|
|
7
|
+
var cfg = getCfg();
|
|
8
|
+
var ASG_DIR = cfg.ASG_DIR;
|
|
9
|
+
var nextAsgEnv = process.env.ASG_DIR || ASG_DIR;
|
|
6
10
|
if (!process.env.ASG_DIR) {
|
|
11
|
+
logStep('Process ASG_DIR not set, and use scoped environment');
|
|
12
|
+
}
|
|
13
|
+
if (!nextAsgEnv) {
|
|
7
14
|
logStep('The Asgard directory does not exist, using default config...');
|
|
8
15
|
return config;
|
|
9
16
|
}
|
|
10
17
|
var iConfigFromPlugins = null;
|
|
11
18
|
try {
|
|
12
|
-
iConfigFromPlugins = require(path.join(
|
|
19
|
+
iConfigFromPlugins = require(path.join(nextAsgEnv, 'base', 'pluginConfig.js'));
|
|
13
20
|
} catch (error) {
|
|
14
21
|
printErrorAndExit('The Asgard directory does not exist.', "Reason: ".concat(error.message));
|
|
15
22
|
return;
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
// src/utils/defineConfig.js
|
|
2
2
|
var path = require("path");
|
|
3
|
-
var { logStep, printErrorAndExit } = require("./index");
|
|
3
|
+
var { logStep, printErrorAndExit, getCfg } = require("./index");
|
|
4
4
|
function defineConfig(config) {
|
|
5
|
+
const cfg = getCfg();
|
|
6
|
+
const { ASG_DIR } = cfg;
|
|
7
|
+
const nextAsgEnv = process.env.ASG_DIR || ASG_DIR;
|
|
5
8
|
if (!process.env.ASG_DIR) {
|
|
9
|
+
logStep("Process ASG_DIR not set, and use scoped environment");
|
|
10
|
+
}
|
|
11
|
+
if (!nextAsgEnv) {
|
|
6
12
|
logStep("The Asgard directory does not exist, using default config...");
|
|
7
13
|
return config;
|
|
8
14
|
}
|
|
9
15
|
let iConfigFromPlugins = null;
|
|
10
16
|
try {
|
|
11
17
|
iConfigFromPlugins = require(path.join(
|
|
12
|
-
|
|
18
|
+
nextAsgEnv,
|
|
13
19
|
"base",
|
|
14
20
|
"pluginConfig.js"
|
|
15
21
|
));
|
package/lib/utils/index.js
CHANGED
|
@@ -89,14 +89,26 @@ async function fetchRemoteRepository() {
|
|
|
89
89
|
logStep("Cloning completed.");
|
|
90
90
|
logStep("Installing dependencies...");
|
|
91
91
|
if ((infra == null ? void 0 : infra.arch) === "PRO") {
|
|
92
|
-
const proDevDeps = pickDependencies(
|
|
92
|
+
const proDevDeps = pickDependencies(
|
|
93
|
+
["snb-mock-middleware", "lodash-webpack-plugin"],
|
|
94
|
+
true
|
|
95
|
+
);
|
|
93
96
|
!!proDevDeps.length && await exec("yarn", ["add", ...proDevDeps, "-D"]);
|
|
94
97
|
const proDeps = pickDependencies(["@teams-max/skynet", "history"]);
|
|
95
98
|
!!proDeps.length && await exec("yarn", ["add", ...proDeps]);
|
|
96
99
|
} else if ((infra == null ? void 0 : infra.arch) === "MAX") {
|
|
97
100
|
const maxDevDeps = pickDependencies(["axios"], true);
|
|
98
101
|
!!maxDevDeps.length && await exec("pnpm", ["add", ...maxDevDeps, "-D"]);
|
|
99
|
-
const maxDeps = pickDependencies([
|
|
102
|
+
const maxDeps = pickDependencies([
|
|
103
|
+
"@teams-max/skynet",
|
|
104
|
+
"classnames",
|
|
105
|
+
"qs",
|
|
106
|
+
"uuid",
|
|
107
|
+
"react-draggable",
|
|
108
|
+
"lodash",
|
|
109
|
+
"moment",
|
|
110
|
+
"dayjs"
|
|
111
|
+
]);
|
|
100
112
|
!!maxDeps.length && await exec("pnpm", ["add", ...maxDeps]);
|
|
101
113
|
}
|
|
102
114
|
logStep("Installation completed.");
|