@storm-software/unbuild 0.20.0 → 0.21.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/README.md +1 -1
- package/bin/unbuild.js +13665 -263
- package/bin/unbuild.mjs +13673 -271
- package/dist/build.js +9 -10
- package/dist/build.mjs +8 -9
- package/dist/{chunk-XI6ZXBUG.js → chunk-3KCZOJ2Q.js} +119 -135
- package/dist/{chunk-ZUXO7HQP.js → chunk-3OJD7CO4.js} +8 -5
- package/dist/chunk-AICX43E6.mjs +13496 -0
- package/dist/{chunk-I24R5RY2.mjs → chunk-AYFS4N2Z.mjs} +46 -62
- package/dist/chunk-AYRYNROK.js +27 -0
- package/dist/{chunk-5SOSUWM3.mjs → chunk-B5GGHMTB.mjs} +9 -8
- package/dist/chunk-BIZYEBW3.mjs +38 -0
- package/dist/chunk-DFIGNXGY.js +13496 -0
- package/dist/{chunk-34DH32EF.mjs → chunk-FDF3FMZP.mjs} +1 -1
- package/dist/{chunk-AH7CDDC4.mjs → chunk-IIVTCNH5.mjs} +6 -3
- package/dist/{chunk-FP34RJ2B.mjs → chunk-OG2CKJQU.mjs} +1 -1
- package/dist/{chunk-2CDKPC2J.js → chunk-OQPSH7GE.js} +9 -8
- package/dist/chunk-RCEWRXM5.js +38 -0
- package/dist/{chunk-LMAVRNZF.mjs → chunk-T5NKX2EJ.mjs} +5 -9
- package/dist/{chunk-QUQ5VOD7.js → chunk-WPOEGALQ.js} +3 -3
- package/dist/{chunk-JOAJEBTW.js → chunk-XEAFTDQ7.js} +2 -2
- package/dist/clean.js +3 -3
- package/dist/clean.mjs +2 -2
- package/dist/config.js +7 -8
- package/dist/config.mjs +6 -7
- package/dist/index.js +9 -10
- package/dist/index.mjs +8 -9
- package/package.json +1 -1
- package/dist/chunk-4REDJQMU.js +0 -35
- package/dist/chunk-ITLNJJHL.mjs +0 -65
- package/dist/chunk-KTRDC23G.mjs +0 -28
- package/dist/chunk-L73LP5QX.js +0 -31
- package/dist/chunk-TYJGNL6P.mjs +0 -35
- package/dist/chunk-V2LF4EEM.js +0 -28
- package/dist/chunk-YNOD6WE4.js +0 -65
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk3OJD7CO4js = require('./chunk-3OJD7CO4.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkAYRYNROKjs = require('./chunk-AYRYNROK.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkDFIGNXGYjs = require('./chunk-DFIGNXGY.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -29,13 +29,12 @@ var _chunkYNOD6WE4js = require('./chunk-YNOD6WE4.js');
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunkOQPSH7GEjs = require('./chunk-OQPSH7GE.js');
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
36
36
|
|
|
37
37
|
// src/build.ts
|
|
38
|
-
var _node = require('@humanfs/node');
|
|
39
38
|
var _devkit = require('@nx/devkit');
|
|
40
39
|
var _js = require('@nx/js');
|
|
41
40
|
var _buildablelibsutils = require('@nx/js/src/utils/buildable-libs-utils');
|
|
@@ -56,37 +55,34 @@ var _resolve2 = require('resolve'); var _resolve3 = _interopRequireDefault(_reso
|
|
|
56
55
|
// ../build-tools/src/utilities/copy-assets.ts
|
|
57
56
|
|
|
58
57
|
|
|
59
|
-
|
|
60
58
|
var _glob = require('glob');
|
|
61
|
-
|
|
62
|
-
// ../build-tools/src/utilities/read-nx-config.ts
|
|
63
|
-
|
|
59
|
+
var _promises = require('fs/promises');
|
|
64
60
|
|
|
65
61
|
// ../config-tools/src/config-file/get-config-file.ts
|
|
66
62
|
var _c12 = require('c12');
|
|
67
63
|
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
68
64
|
var getConfigFileByName = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (fileName, filePath, options = {}) => {
|
|
69
|
-
const workspacePath = filePath ||
|
|
70
|
-
let config = _c12.loadConfig.call(void 0, {
|
|
65
|
+
const workspacePath = filePath || _chunkOQPSH7GEjs.findWorkspaceRoot.call(void 0, filePath);
|
|
66
|
+
let config = await _c12.loadConfig.call(void 0, {
|
|
71
67
|
cwd: workspacePath,
|
|
72
68
|
packageJson: true,
|
|
73
69
|
name: fileName,
|
|
74
70
|
envName: _optionalChain([fileName, 'optionalAccess', _ => _.toUpperCase, 'call', _2 => _2()]),
|
|
75
71
|
jitiOptions: {
|
|
76
72
|
debug: false,
|
|
77
|
-
|
|
73
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkOQPSH7GEjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "config")
|
|
78
74
|
},
|
|
79
75
|
...options
|
|
80
76
|
});
|
|
81
77
|
if (!config || Object.keys(config).length === 0) {
|
|
82
|
-
config = _c12.loadConfig.call(void 0, {
|
|
78
|
+
config = await _c12.loadConfig.call(void 0, {
|
|
83
79
|
cwd: workspacePath,
|
|
84
80
|
packageJson: true,
|
|
85
81
|
name: fileName,
|
|
86
82
|
envName: _optionalChain([fileName, 'optionalAccess', _3 => _3.toUpperCase, 'call', _4 => _4()]),
|
|
87
83
|
jitiOptions: {
|
|
88
84
|
debug: false,
|
|
89
|
-
|
|
85
|
+
fsCache: process.env.STORM_SKIP_CACHE === "true" ? false : _chunkOQPSH7GEjs.joinPaths.call(void 0, process.env.STORM_CACHE_DIR || "node_modules/.cache/storm", "config")
|
|
90
86
|
},
|
|
91
87
|
configFile: fileName,
|
|
92
88
|
...options
|
|
@@ -95,12 +91,12 @@ var getConfigFileByName = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, a
|
|
|
95
91
|
return config;
|
|
96
92
|
}, "getConfigFileByName");
|
|
97
93
|
var getConfigFile = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (filePath, additionalFileNames = []) => {
|
|
98
|
-
const workspacePath = filePath ? filePath :
|
|
94
|
+
const workspacePath = filePath ? filePath : _chunkOQPSH7GEjs.findWorkspaceRoot.call(void 0, filePath);
|
|
99
95
|
const result = await getConfigFileByName("storm", workspacePath);
|
|
100
96
|
let config = result.config;
|
|
101
97
|
const configFile = result.configFile;
|
|
102
98
|
if (config && configFile && Object.keys(config).length > 0) {
|
|
103
|
-
|
|
99
|
+
_chunkOQPSH7GEjs.writeSystem.call(void 0, `Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
|
|
104
100
|
logLevel: "all"
|
|
105
101
|
});
|
|
106
102
|
}
|
|
@@ -108,7 +104,7 @@ var getConfigFile = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (
|
|
|
108
104
|
const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
|
|
109
105
|
for (const result2 of results) {
|
|
110
106
|
if (_optionalChain([result2, 'optionalAccess', _5 => _5.config]) && _optionalChain([result2, 'optionalAccess', _6 => _6.configFile]) && Object.keys(result2.config).length > 0) {
|
|
111
|
-
|
|
107
|
+
_chunkOQPSH7GEjs.writeSystem.call(void 0, `Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
|
|
112
108
|
logLevel: "all"
|
|
113
109
|
});
|
|
114
110
|
config = _defu2.default.call(void 0, _nullishCoalesce(result2.config, () => ( {})), _nullishCoalesce(config, () => ( {})));
|
|
@@ -145,15 +141,15 @@ var getConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, () => {
|
|
|
145
141
|
licensing: process.env[`${prefix}LICENSING`] || void 0,
|
|
146
142
|
timezone: process.env[`${prefix}TIMEZONE`] || process.env.TZ || void 0,
|
|
147
143
|
locale: process.env[`${prefix}LOCALE`] || process.env.LOCALE || void 0,
|
|
148
|
-
configFile: process.env[`${prefix}CONFIG_FILE`] ?
|
|
149
|
-
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ?
|
|
144
|
+
configFile: process.env[`${prefix}CONFIG_FILE`] ? _chunkOQPSH7GEjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_FILE`]) : void 0,
|
|
145
|
+
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`] ? _chunkOQPSH7GEjs.correctPaths.call(void 0, process.env[`${prefix}WORKSPACE_ROOT`]) : void 0,
|
|
150
146
|
directories: {
|
|
151
|
-
cache: process.env[`${prefix}CACHE_DIR`] ?
|
|
152
|
-
data: process.env[`${prefix}DATA_DIR`] ?
|
|
153
|
-
config: process.env[`${prefix}CONFIG_DIR`] ?
|
|
154
|
-
temp: process.env[`${prefix}TEMP_DIR`] ?
|
|
155
|
-
log: process.env[`${prefix}LOG_DIR`] ?
|
|
156
|
-
build: process.env[`${prefix}BUILD_DIR`] ?
|
|
147
|
+
cache: process.env[`${prefix}CACHE_DIR`] ? _chunkOQPSH7GEjs.correctPaths.call(void 0, process.env[`${prefix}CACHE_DIR`]) : void 0,
|
|
148
|
+
data: process.env[`${prefix}DATA_DIR`] ? _chunkOQPSH7GEjs.correctPaths.call(void 0, process.env[`${prefix}DATA_DIR`]) : void 0,
|
|
149
|
+
config: process.env[`${prefix}CONFIG_DIR`] ? _chunkOQPSH7GEjs.correctPaths.call(void 0, process.env[`${prefix}CONFIG_DIR`]) : void 0,
|
|
150
|
+
temp: process.env[`${prefix}TEMP_DIR`] ? _chunkOQPSH7GEjs.correctPaths.call(void 0, process.env[`${prefix}TEMP_DIR`]) : void 0,
|
|
151
|
+
log: process.env[`${prefix}LOG_DIR`] ? _chunkOQPSH7GEjs.correctPaths.call(void 0, process.env[`${prefix}LOG_DIR`]) : void 0,
|
|
152
|
+
build: process.env[`${prefix}BUILD_DIR`] ? _chunkOQPSH7GEjs.correctPaths.call(void 0, process.env[`${prefix}BUILD_DIR`]) : void 0
|
|
157
153
|
},
|
|
158
154
|
skipCache: process.env[`${prefix}SKIP_CACHE`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CACHE`]) : void 0,
|
|
159
155
|
env: (_nullishCoalesce(_nullishCoalesce(process.env[`${prefix}ENV`], () => ( process.env.NODE_ENV)), () => ( process.env.ENVIRONMENT))) || void 0,
|
|
@@ -176,23 +172,23 @@ var getConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, () => {
|
|
|
176
172
|
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
177
173
|
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
178
174
|
},
|
|
179
|
-
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ?
|
|
175
|
+
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? _chunkOQPSH7GEjs.getLogLevelLabel.call(void 0, Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0
|
|
180
176
|
};
|
|
181
|
-
const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) &&
|
|
177
|
+
const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && _chunkOQPSH7GEjs.COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
|
|
182
178
|
config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
|
|
183
179
|
ret[themeName] = getThemeColorConfigEnv(prefix, themeName);
|
|
184
180
|
return ret;
|
|
185
181
|
}, {}) : getThemeColorConfigEnv(prefix);
|
|
186
|
-
if (config.docs ===
|
|
187
|
-
if (config.homepage ===
|
|
188
|
-
config.docs = `${
|
|
182
|
+
if (config.docs === _chunkOQPSH7GEjs.STORM_DEFAULT_DOCS) {
|
|
183
|
+
if (config.homepage === _chunkOQPSH7GEjs.STORM_DEFAULT_HOMEPAGE) {
|
|
184
|
+
config.docs = `${_chunkOQPSH7GEjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/docs`;
|
|
189
185
|
} else {
|
|
190
186
|
config.docs = `${config.homepage}/docs`;
|
|
191
187
|
}
|
|
192
188
|
}
|
|
193
|
-
if (config.licensing ===
|
|
194
|
-
if (config.homepage ===
|
|
195
|
-
config.licensing = `${
|
|
189
|
+
if (config.licensing === _chunkOQPSH7GEjs.STORM_DEFAULT_LICENSING) {
|
|
190
|
+
if (config.homepage === _chunkOQPSH7GEjs.STORM_DEFAULT_HOMEPAGE) {
|
|
191
|
+
config.licensing = `${_chunkOQPSH7GEjs.STORM_DEFAULT_HOMEPAGE}/projects/${config.name}/licensing`;
|
|
196
192
|
} else {
|
|
197
193
|
config.licensing = `${config.homepage}/docs`;
|
|
198
194
|
}
|
|
@@ -330,31 +326,31 @@ var setConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (config)
|
|
|
330
326
|
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
331
327
|
}
|
|
332
328
|
if (config.configFile) {
|
|
333
|
-
process.env[`${prefix}CONFIG_FILE`] =
|
|
329
|
+
process.env[`${prefix}CONFIG_FILE`] = _chunkOQPSH7GEjs.correctPaths.call(void 0, config.configFile);
|
|
334
330
|
}
|
|
335
331
|
if (config.workspaceRoot) {
|
|
336
|
-
process.env[`${prefix}WORKSPACE_ROOT`] =
|
|
337
|
-
process.env.NX_WORKSPACE_ROOT =
|
|
338
|
-
process.env.NX_WORKSPACE_ROOT_PATH =
|
|
332
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = _chunkOQPSH7GEjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
333
|
+
process.env.NX_WORKSPACE_ROOT = _chunkOQPSH7GEjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
334
|
+
process.env.NX_WORKSPACE_ROOT_PATH = _chunkOQPSH7GEjs.correctPaths.call(void 0, config.workspaceRoot);
|
|
339
335
|
}
|
|
340
336
|
if (config.directories) {
|
|
341
337
|
if (!config.skipCache && config.directories.cache) {
|
|
342
|
-
process.env[`${prefix}CACHE_DIR`] =
|
|
338
|
+
process.env[`${prefix}CACHE_DIR`] = _chunkOQPSH7GEjs.correctPaths.call(void 0, config.directories.cache);
|
|
343
339
|
}
|
|
344
340
|
if (config.directories.data) {
|
|
345
|
-
process.env[`${prefix}DATA_DIR`] =
|
|
341
|
+
process.env[`${prefix}DATA_DIR`] = _chunkOQPSH7GEjs.correctPaths.call(void 0, config.directories.data);
|
|
346
342
|
}
|
|
347
343
|
if (config.directories.config) {
|
|
348
|
-
process.env[`${prefix}CONFIG_DIR`] =
|
|
344
|
+
process.env[`${prefix}CONFIG_DIR`] = _chunkOQPSH7GEjs.correctPaths.call(void 0, config.directories.config);
|
|
349
345
|
}
|
|
350
346
|
if (config.directories.temp) {
|
|
351
|
-
process.env[`${prefix}TEMP_DIR`] =
|
|
347
|
+
process.env[`${prefix}TEMP_DIR`] = _chunkOQPSH7GEjs.correctPaths.call(void 0, config.directories.temp);
|
|
352
348
|
}
|
|
353
349
|
if (config.directories.log) {
|
|
354
|
-
process.env[`${prefix}LOG_DIR`] =
|
|
350
|
+
process.env[`${prefix}LOG_DIR`] = _chunkOQPSH7GEjs.correctPaths.call(void 0, config.directories.log);
|
|
355
351
|
}
|
|
356
352
|
if (config.directories.build) {
|
|
357
|
-
process.env[`${prefix}BUILD_DIR`] =
|
|
353
|
+
process.env[`${prefix}BUILD_DIR`] = _chunkOQPSH7GEjs.correctPaths.call(void 0, config.directories.build);
|
|
358
354
|
}
|
|
359
355
|
}
|
|
360
356
|
if (config.skipCache !== void 0) {
|
|
@@ -408,8 +404,8 @@ var setConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (config)
|
|
|
408
404
|
if (config.logLevel) {
|
|
409
405
|
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
410
406
|
process.env.LOG_LEVEL = String(config.logLevel);
|
|
411
|
-
process.env.NX_VERBOSE_LOGGING = String(
|
|
412
|
-
process.env.RUST_BACKTRACE =
|
|
407
|
+
process.env.NX_VERBOSE_LOGGING = String(_chunkOQPSH7GEjs.getLogLevel.call(void 0, config.logLevel) >= _chunkOQPSH7GEjs.LogLevel.DEBUG ? true : false);
|
|
408
|
+
process.env.RUST_BACKTRACE = _chunkOQPSH7GEjs.getLogLevel.call(void 0, config.logLevel) >= _chunkOQPSH7GEjs.LogLevel.DEBUG ? "full" : "none";
|
|
413
409
|
}
|
|
414
410
|
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
415
411
|
for (const key of Object.keys(_nullishCoalesce(config.extensions, () => ( {})))) {
|
|
@@ -519,38 +515,41 @@ var _static_cache = void 0;
|
|
|
519
515
|
var loadStormConfig = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (workspaceRoot) => {
|
|
520
516
|
let config = {};
|
|
521
517
|
if (_optionalChain([_static_cache, 'optionalAccess', _29 => _29.data]) && _optionalChain([_static_cache, 'optionalAccess', _30 => _30.timestamp]) && _static_cache.timestamp >= Date.now() + 3e4) {
|
|
522
|
-
|
|
518
|
+
_chunkOQPSH7GEjs.writeTrace.call(void 0, `Configuration cache hit - ${_static_cache.timestamp}`, _static_cache.data);
|
|
523
519
|
return _static_cache.data;
|
|
524
520
|
}
|
|
525
521
|
let _workspaceRoot = workspaceRoot;
|
|
526
522
|
if (!_workspaceRoot) {
|
|
527
|
-
_workspaceRoot =
|
|
523
|
+
_workspaceRoot = _chunkOQPSH7GEjs.findWorkspaceRoot.call(void 0, );
|
|
528
524
|
}
|
|
529
525
|
const configFile = await getConfigFile(_workspaceRoot);
|
|
530
526
|
if (!configFile) {
|
|
531
|
-
|
|
527
|
+
_chunkOQPSH7GEjs.writeWarning.call(void 0, "No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.json` file to the root of your workspace if it is not.\n", {
|
|
532
528
|
logLevel: "all"
|
|
533
529
|
});
|
|
534
530
|
}
|
|
535
|
-
config = _defu2.default.call(void 0, getConfigEnv(), configFile,
|
|
531
|
+
config = _defu2.default.call(void 0, getConfigEnv(), configFile, _chunkOQPSH7GEjs.getDefaultConfig.call(void 0, _workspaceRoot));
|
|
536
532
|
setConfigEnv(config);
|
|
537
|
-
|
|
538
|
-
${
|
|
533
|
+
_chunkOQPSH7GEjs.writeTrace.call(void 0, `\u2699\uFE0F Using Storm configuration:
|
|
534
|
+
${_chunkOQPSH7GEjs.formatLogMessage.call(void 0, config)}`, config);
|
|
539
535
|
return config;
|
|
540
536
|
}, "loadStormConfig");
|
|
541
537
|
|
|
542
538
|
// ../build-tools/src/utilities/read-nx-config.ts
|
|
539
|
+
|
|
540
|
+
|
|
543
541
|
var readNxConfig = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (workspaceRoot) => {
|
|
544
542
|
let rootDir = workspaceRoot;
|
|
545
543
|
if (!rootDir) {
|
|
546
544
|
const config = await loadStormConfig();
|
|
547
545
|
rootDir = config.workspaceRoot;
|
|
548
546
|
}
|
|
549
|
-
const nxJsonPath =
|
|
550
|
-
if (!
|
|
547
|
+
const nxJsonPath = _chunkOQPSH7GEjs.joinPaths.call(void 0, rootDir, "nx.json");
|
|
548
|
+
if (!_fs.existsSync.call(void 0, nxJsonPath)) {
|
|
551
549
|
throw new Error("Cannot find project.json configuration");
|
|
552
550
|
}
|
|
553
|
-
|
|
551
|
+
const configContent = await _promises.readFile.call(void 0, nxJsonPath, "utf8");
|
|
552
|
+
return JSON.parse(configContent);
|
|
554
553
|
}, "readNxConfig");
|
|
555
554
|
|
|
556
555
|
// ../build-tools/src/utilities/copy-assets.ts
|
|
@@ -585,16 +584,14 @@ var copyAssets = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (con
|
|
|
585
584
|
});
|
|
586
585
|
}
|
|
587
586
|
const nxJson = readNxConfig(config.workspaceRoot);
|
|
588
|
-
const projectGraph =
|
|
589
|
-
exitOnError: true
|
|
590
|
-
});
|
|
587
|
+
const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
|
|
591
588
|
const projectsConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
592
589
|
if (!_optionalChain([projectsConfigurations, 'optionalAccess', _37 => _37.projects, 'optionalAccess', _38 => _38[projectName]])) {
|
|
593
590
|
throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
|
|
594
591
|
}
|
|
595
|
-
const buildTarget = _optionalChain([projectsConfigurations, 'access', _39 => _39.projects, 'access', _40 => _40[projectName], '
|
|
592
|
+
const buildTarget = _optionalChain([projectsConfigurations, 'access', _39 => _39.projects, 'access', _40 => _40[projectName], 'access', _41 => _41.targets, 'optionalAccess', _42 => _42.build]);
|
|
596
593
|
if (!buildTarget) {
|
|
597
|
-
throw new Error(`The Build process failed because the project does not have a valid build target in the project.json file. Check if the file exists in the root of the project at ${
|
|
594
|
+
throw new Error(`The Build process failed because the project does not have a valid build target in the project.json file. Check if the file exists in the root of the project at ${_chunkOQPSH7GEjs.joinPaths.call(void 0, projectRoot, "project.json")}`);
|
|
598
595
|
}
|
|
599
596
|
const result = await _js.copyAssets.call(void 0, {
|
|
600
597
|
assets,
|
|
@@ -609,22 +606,22 @@ var copyAssets = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (con
|
|
|
609
606
|
projectsConfigurations,
|
|
610
607
|
nxJsonConfiguration: nxJson,
|
|
611
608
|
cwd: config.workspaceRoot,
|
|
612
|
-
isVerbose:
|
|
609
|
+
isVerbose: _chunkOQPSH7GEjs.isVerbose.call(void 0, config.logLevel)
|
|
613
610
|
});
|
|
614
611
|
if (!result.success) {
|
|
615
612
|
throw new Error("The Build process failed trying to copy assets");
|
|
616
613
|
}
|
|
617
614
|
if (includeSrc === true) {
|
|
618
|
-
|
|
615
|
+
_chunkOQPSH7GEjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkOQPSH7GEjs.joinPaths.call(void 0, outputPath, "src")}`, config);
|
|
619
616
|
const files = await _glob.glob.call(void 0, [
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
617
|
+
_chunkOQPSH7GEjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
618
|
+
_chunkOQPSH7GEjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
619
|
+
_chunkOQPSH7GEjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
620
|
+
_chunkOQPSH7GEjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
624
621
|
]);
|
|
625
|
-
await Promise.allSettled(files.map(async (file) =>
|
|
622
|
+
await Promise.allSettled(files.map(async (file) => _promises.writeFile.call(void 0, file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
626
623
|
|
|
627
|
-
${await
|
|
624
|
+
${await _promises.readFile.call(void 0, file, "utf8")}
|
|
628
625
|
|
|
629
626
|
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`)));
|
|
630
627
|
}
|
|
@@ -634,30 +631,18 @@ ${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `//
|
|
|
634
631
|
|
|
635
632
|
|
|
636
633
|
|
|
634
|
+
|
|
637
635
|
var _projectgraph = require('nx/src/project-graph/project-graph');
|
|
638
636
|
var addPackageDependencies = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (workspaceRoot, projectRoot, projectName, packageJson) => {
|
|
639
|
-
const
|
|
640
|
-
exitOnError: true
|
|
641
|
-
});
|
|
642
|
-
const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
643
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess', _43 => _43.projects, 'optionalAccess', _44 => _44[projectName]])) {
|
|
644
|
-
throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
|
|
645
|
-
}
|
|
646
|
-
const projectJsonPath = _chunk2CDKPC2Jjs.joinPaths.call(void 0, workspaceRoot, projectRoot, "project.json");
|
|
647
|
-
if (!await _node.hfs.isFile(projectJsonPath)) {
|
|
648
|
-
throw new Error("Cannot find project.json configuration");
|
|
649
|
-
}
|
|
650
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess', _45 => _45.projects, 'optionalAccess', _46 => _46[projectName]])) {
|
|
651
|
-
throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
|
|
652
|
-
}
|
|
653
|
-
const projectDependencies = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
637
|
+
const projectDependencies = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, _projectgraph.readCachedProjectGraph.call(void 0, ), workspaceRoot, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
654
638
|
const localPackages = [];
|
|
655
639
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
|
|
656
640
|
const projectNode = project.node;
|
|
657
641
|
if (projectNode.data.root) {
|
|
658
|
-
const projectPackageJsonPath =
|
|
659
|
-
if (
|
|
660
|
-
const
|
|
642
|
+
const projectPackageJsonPath = _chunkOQPSH7GEjs.joinPaths.call(void 0, workspaceRoot, projectNode.data.root, "package.json");
|
|
643
|
+
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
644
|
+
const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
|
|
645
|
+
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
661
646
|
if (projectPackageJson.private !== false) {
|
|
662
647
|
localPackages.push(projectPackageJson);
|
|
663
648
|
}
|
|
@@ -665,7 +650,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0
|
|
|
665
650
|
}
|
|
666
651
|
}
|
|
667
652
|
if (localPackages.length > 0) {
|
|
668
|
-
|
|
653
|
+
_chunkOQPSH7GEjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
|
|
669
654
|
packageJson.peerDependencies = localPackages.reduce((ret, localPackage) => {
|
|
670
655
|
if (!ret[localPackage.name]) {
|
|
671
656
|
ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
|
|
@@ -687,13 +672,14 @@ var addPackageDependencies = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0
|
|
|
687
672
|
return ret;
|
|
688
673
|
}, _nullishCoalesce(packageJson.peerDependencies, () => ( {})));
|
|
689
674
|
} else {
|
|
690
|
-
|
|
675
|
+
_chunkOQPSH7GEjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
|
|
691
676
|
}
|
|
692
677
|
return packageJson;
|
|
693
678
|
}, "addPackageDependencies");
|
|
694
679
|
var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
695
|
-
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot :
|
|
696
|
-
const
|
|
680
|
+
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : _chunkOQPSH7GEjs.findWorkspaceRoot.call(void 0, );
|
|
681
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkOQPSH7GEjs.joinPaths.call(void 0, workspaceRoot, "package.json"), "utf8");
|
|
682
|
+
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
697
683
|
packageJson.type ??= "module";
|
|
698
684
|
packageJson.sideEffects ??= false;
|
|
699
685
|
if (includeSrc === true) {
|
|
@@ -701,7 +687,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call
|
|
|
701
687
|
if (distSrc.startsWith("/")) {
|
|
702
688
|
distSrc = distSrc.substring(1);
|
|
703
689
|
}
|
|
704
|
-
packageJson.source ??= `${
|
|
690
|
+
packageJson.source ??= `${_chunkOQPSH7GEjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
705
691
|
}
|
|
706
692
|
packageJson.files ??= [
|
|
707
693
|
"dist/**/*"
|
|
@@ -732,7 +718,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call
|
|
|
732
718
|
];
|
|
733
719
|
}
|
|
734
720
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
735
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot :
|
|
721
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkOQPSH7GEjs.joinPaths.call(void 0, "packages", projectName);
|
|
736
722
|
return packageJson;
|
|
737
723
|
}, "addWorkspacePackageJsonFields");
|
|
738
724
|
var addPackageJsonExport = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (file, type = "module", sourceRoot) => {
|
|
@@ -793,6 +779,8 @@ var _createtaskgraph = require('nx/src/tasks-runner/create-task-graph');
|
|
|
793
779
|
// src/build.ts
|
|
794
780
|
|
|
795
781
|
|
|
782
|
+
|
|
783
|
+
|
|
796
784
|
var _findworkspaceroot = require('nx/src/utils/find-workspace-root');
|
|
797
785
|
var _unbuild = require('unbuild');
|
|
798
786
|
async function resolveOptions(options) {
|
|
@@ -800,52 +788,48 @@ async function resolveOptions(options) {
|
|
|
800
788
|
if (!projectRoot) {
|
|
801
789
|
throw new Error("Cannot find project root");
|
|
802
790
|
}
|
|
803
|
-
const outputPath = options.outputPath ||
|
|
791
|
+
const outputPath = options.outputPath || _chunkOQPSH7GEjs.joinPaths.call(void 0, "dist", projectRoot);
|
|
804
792
|
const workspaceRoot = _findworkspaceroot.findWorkspaceRoot.call(void 0, projectRoot);
|
|
805
793
|
if (!workspaceRoot) {
|
|
806
794
|
throw new Error("Cannot find workspace root");
|
|
807
795
|
}
|
|
808
796
|
const config = await loadStormConfig(workspaceRoot.dir);
|
|
809
|
-
|
|
810
|
-
const stopwatch =
|
|
797
|
+
_chunkOQPSH7GEjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
798
|
+
const stopwatch = _chunkOQPSH7GEjs.getStopwatch.call(void 0, "Build options resolution");
|
|
811
799
|
if (options.configPath) {
|
|
812
|
-
const configFile = await
|
|
800
|
+
const configFile = await _chunkDFIGNXGYjs.loadConfig.call(void 0, options.configPath);
|
|
813
801
|
if (configFile) {
|
|
814
802
|
options = _defu2.default.call(void 0, options, configFile);
|
|
815
803
|
}
|
|
816
804
|
}
|
|
817
|
-
const projectGraph =
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
const projectJsonPath = _chunk2CDKPC2Jjs.joinPaths.call(void 0, config.workspaceRoot, projectRoot, "project.json");
|
|
821
|
-
if (!await _node.hfs.isFile(projectJsonPath)) {
|
|
805
|
+
const projectGraph = _devkit.readCachedProjectGraph.call(void 0, );
|
|
806
|
+
const projectJsonPath = _chunkOQPSH7GEjs.joinPaths.call(void 0, config.workspaceRoot, projectRoot, "project.json");
|
|
807
|
+
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
822
808
|
throw new Error("Cannot find project.json configuration");
|
|
823
809
|
}
|
|
824
|
-
const
|
|
810
|
+
const projectJsonContent = await _promises.readFile.call(void 0, projectJsonPath, "utf8");
|
|
811
|
+
const projectJson = JSON.parse(projectJsonContent);
|
|
825
812
|
const projectName = projectJson.name;
|
|
826
|
-
const packageJsonPath =
|
|
827
|
-
if (!
|
|
813
|
+
const packageJsonPath = _chunkOQPSH7GEjs.joinPaths.call(void 0, workspaceRoot.dir, projectRoot, "package.json");
|
|
814
|
+
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
828
815
|
throw new Error("Cannot find package.json configuration");
|
|
829
816
|
}
|
|
830
|
-
const
|
|
817
|
+
const packageJsonContent = await _promises.readFile.call(void 0, packageJsonPath, "utf8");
|
|
818
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
831
819
|
let tsconfig = options.tsconfig;
|
|
832
820
|
if (!tsconfig) {
|
|
833
|
-
tsconfig =
|
|
821
|
+
tsconfig = _chunkOQPSH7GEjs.joinPaths.call(void 0, workspaceRoot.dir, projectRoot, "tsconfig.json");
|
|
834
822
|
}
|
|
835
|
-
if (!
|
|
823
|
+
if (!_fs.existsSync.call(void 0, tsconfig)) {
|
|
836
824
|
throw new Error("Cannot find tsconfig.json configuration");
|
|
837
825
|
}
|
|
838
826
|
let sourceRoot = projectJson.sourceRoot;
|
|
839
827
|
if (!sourceRoot) {
|
|
840
|
-
sourceRoot =
|
|
828
|
+
sourceRoot = _chunkOQPSH7GEjs.joinPaths.call(void 0, projectRoot, "src");
|
|
841
829
|
}
|
|
842
|
-
if (!
|
|
830
|
+
if (!_fs.existsSync.call(void 0, sourceRoot)) {
|
|
843
831
|
throw new Error("Cannot find sourceRoot directory");
|
|
844
832
|
}
|
|
845
|
-
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
846
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess', _47 => _47.projects, 'optionalAccess', _48 => _48[projectName]])) {
|
|
847
|
-
throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
|
|
848
|
-
}
|
|
849
833
|
const result = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0, void 0, projectGraph, workspaceRoot.dir, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
850
834
|
let dependencies = result.dependencies;
|
|
851
835
|
const tsLibDependency = _js.getHelperDependency.call(void 0, _js.HelperDependency.tsc, tsconfig, dependencies, projectGraph, true);
|
|
@@ -865,14 +849,14 @@ async function resolveOptions(options) {
|
|
|
865
849
|
{
|
|
866
850
|
builder: "mkdist",
|
|
867
851
|
input: `.${sourceRoot.replace(projectRoot, "")}`,
|
|
868
|
-
outDir:
|
|
852
|
+
outDir: _chunkOQPSH7GEjs.joinPaths.call(void 0, _path.relative.call(void 0, _chunkOQPSH7GEjs.joinPaths.call(void 0, config.workspaceRoot, projectRoot), config.workspaceRoot).replaceAll("\\", "/"), outputPath, "dist").replaceAll("\\", "/"),
|
|
869
853
|
declaration: options.emitTypes !== false,
|
|
870
854
|
format: "esm"
|
|
871
855
|
},
|
|
872
856
|
{
|
|
873
857
|
builder: "mkdist",
|
|
874
858
|
input: `.${sourceRoot.replace(projectRoot, "")}`,
|
|
875
|
-
outDir:
|
|
859
|
+
outDir: _chunkOQPSH7GEjs.joinPaths.call(void 0, _path.relative.call(void 0, _chunkOQPSH7GEjs.joinPaths.call(void 0, config.workspaceRoot, projectRoot), config.workspaceRoot).replaceAll("\\", "/"), outputPath, "dist").replaceAll("\\", "/"),
|
|
876
860
|
declaration: options.emitTypes !== false,
|
|
877
861
|
format: "cjs",
|
|
878
862
|
ext: "cjs"
|
|
@@ -930,7 +914,7 @@ async function resolveOptions(options) {
|
|
|
930
914
|
splitting: options.splitting !== false,
|
|
931
915
|
treeShaking: options.treeShaking !== false,
|
|
932
916
|
color: true,
|
|
933
|
-
logLevel: config.logLevel ===
|
|
917
|
+
logLevel: config.logLevel === _chunkOQPSH7GEjs.LogLevelLabel.FATAL ? _chunkOQPSH7GEjs.LogLevelLabel.ERROR : _chunkOQPSH7GEjs.isVerbose.call(void 0, ) ? "verbose" : config.logLevel
|
|
934
918
|
}
|
|
935
919
|
}
|
|
936
920
|
};
|
|
@@ -947,7 +931,7 @@ async function resolveOptions(options) {
|
|
|
947
931
|
if (options.rollup) {
|
|
948
932
|
let rollup = {};
|
|
949
933
|
if (typeof options.rollup === "string") {
|
|
950
|
-
const rollupFile = await
|
|
934
|
+
const rollupFile = await _chunkDFIGNXGYjs.loadConfig.call(void 0, options.rollup);
|
|
951
935
|
if (rollupFile) {
|
|
952
936
|
rollup = rollupFile;
|
|
953
937
|
}
|
|
@@ -958,7 +942,7 @@ async function resolveOptions(options) {
|
|
|
958
942
|
}
|
|
959
943
|
resolvedOptions.hooks = {
|
|
960
944
|
"rollup:options": /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (ctx, opts) => {
|
|
961
|
-
opts.plugins = await _asyncNullishCoalesce(options.plugins, async () => ( await
|
|
945
|
+
opts.plugins = await _asyncNullishCoalesce(options.plugins, async () => ( await _chunkAYRYNROKjs.getDefaultBuildPlugins.call(void 0, options, resolvedOptions)));
|
|
962
946
|
}, "rollup:options")
|
|
963
947
|
};
|
|
964
948
|
stopwatch();
|
|
@@ -966,29 +950,29 @@ async function resolveOptions(options) {
|
|
|
966
950
|
}
|
|
967
951
|
_chunk3GQAWCBQjs.__name.call(void 0, resolveOptions, "resolveOptions");
|
|
968
952
|
async function generatePackageJson(options) {
|
|
969
|
-
if (options.generatePackageJson !== false &&
|
|
970
|
-
|
|
971
|
-
const stopwatch =
|
|
972
|
-
const packageJsonPath =
|
|
973
|
-
if (!
|
|
953
|
+
if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkOQPSH7GEjs.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
|
|
954
|
+
_chunkOQPSH7GEjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.config);
|
|
955
|
+
const stopwatch = _chunkOQPSH7GEjs.getStopwatch.call(void 0, "Write package.json file");
|
|
956
|
+
const packageJsonPath = _chunkOQPSH7GEjs.joinPaths.call(void 0, options.projectRoot, "project.json");
|
|
957
|
+
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
974
958
|
throw new Error("Cannot find package.json configuration");
|
|
975
959
|
}
|
|
976
|
-
let
|
|
977
|
-
if (!
|
|
960
|
+
let packageJsonContent = await _promises.readFile.call(void 0, _chunkOQPSH7GEjs.joinPaths.call(void 0, options.config.workspaceRoot, options.projectRoot, "package.json"), "utf8");
|
|
961
|
+
if (!packageJsonContent) {
|
|
978
962
|
throw new Error("Cannot find package.json configuration file");
|
|
979
963
|
}
|
|
964
|
+
let packageJson = JSON.parse(packageJsonContent);
|
|
980
965
|
packageJson = await addPackageDependencies(options.config.workspaceRoot, options.projectRoot, options.projectName, packageJson);
|
|
981
966
|
packageJson = await addWorkspacePackageJsonFields(options.config, options.projectRoot, options.sourceRoot, options.projectName, false, packageJson);
|
|
982
|
-
|
|
983
|
-
await _devkit.writeJsonFile.call(void 0, _chunk2CDKPC2Jjs.joinPaths.call(void 0, options.outDir, "package.json"), packageJson);
|
|
967
|
+
await _devkit.writeJsonFile.call(void 0, _chunkOQPSH7GEjs.joinPaths.call(void 0, options.outDir, "package.json"), await addPackageJsonExports(options.sourceRoot, packageJson));
|
|
984
968
|
stopwatch();
|
|
985
969
|
}
|
|
986
970
|
return options;
|
|
987
971
|
}
|
|
988
972
|
_chunk3GQAWCBQjs.__name.call(void 0, generatePackageJson, "generatePackageJson");
|
|
989
973
|
async function executeUnbuild(options) {
|
|
990
|
-
|
|
991
|
-
const stopwatch =
|
|
974
|
+
_chunkOQPSH7GEjs.writeDebug.call(void 0, ` \u{1F680} Running ${options.name} (${options.projectRoot}) build`, options.config);
|
|
975
|
+
const stopwatch = _chunkOQPSH7GEjs.getStopwatch.call(void 0, `${options.name} (${options.projectRoot}) build`);
|
|
992
976
|
try {
|
|
993
977
|
await _unbuild.build.call(void 0, options.projectRoot, false, {
|
|
994
978
|
...options,
|
|
@@ -1001,8 +985,8 @@ async function executeUnbuild(options) {
|
|
|
1001
985
|
}
|
|
1002
986
|
_chunk3GQAWCBQjs.__name.call(void 0, executeUnbuild, "executeUnbuild");
|
|
1003
987
|
async function copyBuildAssets(options) {
|
|
1004
|
-
|
|
1005
|
-
const stopwatch =
|
|
988
|
+
_chunkOQPSH7GEjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${options.outDir}`, options.config);
|
|
989
|
+
const stopwatch = _chunkOQPSH7GEjs.getStopwatch.call(void 0, `${options.name} asset copy`);
|
|
1006
990
|
await copyAssets(options.config, _nullishCoalesce(options.assets, () => ( [])), options.outDir, options.projectRoot, options.projectName, options.sourceRoot, options.generatePackageJson, options.includeSrc);
|
|
1007
991
|
stopwatch();
|
|
1008
992
|
return options;
|
|
@@ -1010,23 +994,23 @@ async function copyBuildAssets(options) {
|
|
|
1010
994
|
_chunk3GQAWCBQjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
1011
995
|
async function cleanOutputPath(options) {
|
|
1012
996
|
if (options.clean !== false && options.outDir) {
|
|
1013
|
-
await
|
|
997
|
+
await _chunk3OJD7CO4js.clean.call(void 0, options.name, options.outDir, options.config);
|
|
1014
998
|
}
|
|
1015
999
|
return options;
|
|
1016
1000
|
}
|
|
1017
1001
|
_chunk3GQAWCBQjs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
|
|
1018
1002
|
async function build(options) {
|
|
1019
|
-
|
|
1020
|
-
const stopwatch =
|
|
1003
|
+
_chunkOQPSH7GEjs.writeDebug.call(void 0, ` \u26A1 Executing Storm Unbuild pipeline`);
|
|
1004
|
+
const stopwatch = _chunkOQPSH7GEjs.getStopwatch.call(void 0, "Unbuild pipeline");
|
|
1021
1005
|
try {
|
|
1022
1006
|
const resolvedOptions = await resolveOptions(options);
|
|
1023
1007
|
await cleanOutputPath(resolvedOptions);
|
|
1024
1008
|
await generatePackageJson(resolvedOptions);
|
|
1025
1009
|
await executeUnbuild(resolvedOptions);
|
|
1026
1010
|
await copyBuildAssets(resolvedOptions);
|
|
1027
|
-
|
|
1011
|
+
_chunkOQPSH7GEjs.writeSuccess.call(void 0, ` \u{1F3C1} The ${resolvedOptions.name} build completed successfully`, resolvedOptions.config);
|
|
1028
1012
|
} catch (error) {
|
|
1029
|
-
|
|
1013
|
+
_chunkOQPSH7GEjs.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
|
|
1030
1014
|
throw error;
|
|
1031
1015
|
} finally {
|
|
1032
1016
|
stopwatch();
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkOQPSH7GEjs = require('./chunk-OQPSH7GE.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
8
8
|
|
|
9
9
|
// src/clean.ts
|
|
10
|
-
var
|
|
10
|
+
var _promises = require('fs/promises');
|
|
11
11
|
async function clean(name = "Unbuild", directory, config) {
|
|
12
|
-
|
|
13
|
-
const stopwatch =
|
|
14
|
-
await
|
|
12
|
+
_chunkOQPSH7GEjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
|
|
13
|
+
const stopwatch = _chunkOQPSH7GEjs.getStopwatch.call(void 0, `${name} output clean`);
|
|
14
|
+
await _promises.rm.call(void 0, directory, {
|
|
15
|
+
recursive: true,
|
|
16
|
+
force: true
|
|
17
|
+
});
|
|
15
18
|
stopwatch();
|
|
16
19
|
}
|
|
17
20
|
_chunk3GQAWCBQjs.__name.call(void 0, clean, "clean");
|