@storm-software/cloudflare-tools 0.55.63 → 0.55.65
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/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/dist/{chunk-MLJ3OSJX.js → chunk-2YQVZSHO.js} +16 -16
- package/dist/{chunk-HBBHWDJS.mjs → chunk-4KLMKQMN.mjs} +11 -3
- package/dist/{chunk-KSTLYSXJ.mjs → chunk-65QGIJV4.mjs} +198 -1075
- package/dist/{chunk-VQLLSEHB.mjs → chunk-6YO5XRT2.mjs} +1 -1
- package/dist/{chunk-HA6XAX4C.mjs → chunk-7TRJIJ2N.mjs} +4 -4
- package/dist/{chunk-NRIZ2TF7.js → chunk-DWDJDH7W.js} +1 -1
- package/dist/{chunk-XFPT4O23.js → chunk-IVLCYFXD.js} +50 -42
- package/dist/{chunk-3O6RTR7W.mjs → chunk-NGKRYZY2.mjs} +2 -2
- package/dist/{chunk-UCUXAMZ3.js → chunk-NNDGLEEI.js} +12 -12
- package/dist/{chunk-RGBGVGWZ.mjs → chunk-PFHP5EL7.mjs} +2 -2
- package/dist/{chunk-UBEHQVYS.js → chunk-QGRENI3O.js} +3 -3
- package/dist/{chunk-ITJMNVMG.mjs → chunk-U2DL5OU3.mjs} +2 -2
- package/dist/{chunk-SSSAGTTW.mjs → chunk-U5WWE2HS.mjs} +1 -6
- package/dist/{chunk-IKNX7KR7.js → chunk-UQLMM4XV.js} +280 -1157
- package/dist/{chunk-TEEOPHLZ.js → chunk-V7LBWOVV.js} +1 -6
- package/dist/{chunk-CI3G746G.mjs → chunk-XPLMFM2J.mjs} +1 -1
- package/dist/{chunk-C3CWFFYT.mjs → chunk-YV555N5S.mjs} +5 -5
- package/dist/executors.js +5 -5
- package/dist/executors.mjs +8 -8
- package/dist/generators.js +5 -5
- package/dist/generators.mjs +5 -5
- package/dist/index.js +8 -8
- package/dist/index.mjs +10 -10
- package/dist/src/executors/cloudflare-publish/executor.js +3 -3
- package/dist/src/executors/cloudflare-publish/executor.mjs +6 -6
- package/dist/src/executors/r2-upload-publish/executor.js +5 -5
- package/dist/src/executors/r2-upload-publish/executor.mjs +6 -6
- package/dist/src/executors/serve/executor.js +4 -4
- package/dist/src/executors/serve/executor.mjs +5 -5
- package/dist/src/generators/init/generator.js +2 -2
- package/dist/src/generators/init/generator.mjs +2 -2
- package/dist/src/generators/worker/generator.js +5 -5
- package/dist/src/generators/worker/generator.mjs +5 -5
- package/dist/src/utils/index.js +3 -3
- package/dist/src/utils/index.mjs +3 -3
- package/dist/src/utils/r2-bucket-helpers.js +3 -3
- package/dist/src/utils/r2-bucket-helpers.mjs +3 -3
- package/dist/tsup.config.mjs +1 -1
- package/package.json +13 -39
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return 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; }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return 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
3
|
|
|
4
4
|
var _chunkVTHBMY4Bjs = require('./chunk-VTHBMY4B.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var _chunkXFPT4O23js = require('./chunk-XFPT4O23.js');
|
|
8
7
|
|
|
8
|
+
var _chunkIVLCYFXDjs = require('./chunk-IVLCYFXD.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -19,8 +19,7 @@ var _chunkXFPT4O23js = require('./chunk-XFPT4O23.js');
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
var _chunkTEEOPHLZjs = require('./chunk-TEEOPHLZ.js');
|
|
22
|
+
var _chunkV7LBWOVVjs = require('./chunk-V7LBWOVV.js');
|
|
24
23
|
|
|
25
24
|
|
|
26
25
|
|
|
@@ -53,7 +52,7 @@ var applyWorkspaceBaseTokens = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
|
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
54
|
if (result.includes("{workspaceRoot}")) {
|
|
56
|
-
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(tokenParams.workspaceRoot, () => ( _optionalChain([tokenParams, 'access', _3 => _3.config, 'optionalAccess', _4 => _4.workspaceRoot]))), () => (
|
|
55
|
+
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(tokenParams.workspaceRoot, () => ( _optionalChain([tokenParams, 'access', _3 => _3.config, 'optionalAccess', _4 => _4.workspaceRoot]))), () => ( _chunkV7LBWOVVjs.findWorkspaceRoot.call(void 0, ))));
|
|
57
56
|
}
|
|
58
57
|
return result;
|
|
59
58
|
}, "applyWorkspaceBaseTokens");
|
|
@@ -79,57 +78,38 @@ var applyWorkspaceTokens = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0,
|
|
|
79
78
|
return result;
|
|
80
79
|
}, "applyWorkspaceTokens");
|
|
81
80
|
|
|
82
|
-
// ../config-tools/src/utilities/run.ts
|
|
83
|
-
var _child_process = require('child_process');
|
|
84
|
-
var LARGE_BUFFER = 1024 * 1e6;
|
|
85
|
-
var run = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (config, command, cwd = _nullishCoalesce(config.workspaceRoot, () => ( process.cwd())), stdio = "inherit", env = process.env) => {
|
|
86
|
-
return _child_process.execSync.call(void 0, command, {
|
|
87
|
-
cwd,
|
|
88
|
-
env: {
|
|
89
|
-
...process.env,
|
|
90
|
-
...env,
|
|
91
|
-
CLICOLOR: "true",
|
|
92
|
-
FORCE_COLOR: "true"
|
|
93
|
-
},
|
|
94
|
-
windowsHide: true,
|
|
95
|
-
stdio,
|
|
96
|
-
maxBuffer: LARGE_BUFFER,
|
|
97
|
-
killSignal: "SIGTERM"
|
|
98
|
-
});
|
|
99
|
-
}, "run");
|
|
100
|
-
|
|
101
81
|
// ../workspace-tools/src/base/base-executor.ts
|
|
102
82
|
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
103
|
-
var withRunExecutor = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name, executorFn, executorOptions = {}) => async (_options,
|
|
104
|
-
const stopwatch =
|
|
83
|
+
var withRunExecutor = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name, executorFn, executorOptions = {}) => async (_options, context) => {
|
|
84
|
+
const stopwatch = _chunkV7LBWOVVjs.getStopwatch.call(void 0, name);
|
|
105
85
|
let options = _options;
|
|
106
86
|
let config = {};
|
|
107
87
|
try {
|
|
108
|
-
if (!_optionalChain([
|
|
88
|
+
if (!_optionalChain([context, 'access', _5 => _5.projectsConfigurations, 'optionalAccess', _6 => _6.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
109
89
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
110
90
|
}
|
|
111
|
-
const workspaceRoot3 =
|
|
112
|
-
const projectRoot =
|
|
113
|
-
const sourceRoot =
|
|
114
|
-
const projectName =
|
|
91
|
+
const workspaceRoot3 = _chunkV7LBWOVVjs.findWorkspaceRoot.call(void 0, );
|
|
92
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName].root || workspaceRoot3;
|
|
93
|
+
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot || projectRoot || workspaceRoot3;
|
|
94
|
+
const projectName = context.projectName;
|
|
115
95
|
config.workspaceRoot = workspaceRoot3;
|
|
116
|
-
|
|
96
|
+
_chunkV7LBWOVVjs.writeInfo.call(void 0, `\u26A1 Running the ${name} executor for ${projectName} `, config);
|
|
117
97
|
if (!executorOptions.skipReadingConfig) {
|
|
118
|
-
|
|
98
|
+
_chunkV7LBWOVVjs.writeTrace.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
119
99
|
- workspaceRoot: ${workspaceRoot3}
|
|
120
100
|
- projectRoot: ${projectRoot}
|
|
121
101
|
- sourceRoot: ${sourceRoot}
|
|
122
102
|
- projectName: ${projectName}
|
|
123
103
|
`, config);
|
|
124
|
-
config = await
|
|
104
|
+
config = await _chunkIVLCYFXDjs.getConfig.call(void 0, workspaceRoot3);
|
|
125
105
|
}
|
|
126
106
|
if (_optionalChain([executorOptions, 'optionalAccess', _7 => _7.hooks, 'optionalAccess', _8 => _8.applyDefaultOptions])) {
|
|
127
|
-
|
|
107
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
128
108
|
options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
|
|
129
|
-
|
|
109
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
130
110
|
}
|
|
131
|
-
|
|
132
|
-
${
|
|
111
|
+
_chunkV7LBWOVVjs.writeTrace.call(void 0, `Executor schema options \u2699\uFE0F
|
|
112
|
+
${_chunkV7LBWOVVjs.formatLogMessage.call(void 0, options)}
|
|
133
113
|
`, config);
|
|
134
114
|
const tokenized = await applyWorkspaceTokens(options, _defu.defu.call(void 0, {
|
|
135
115
|
workspaceRoot: workspaceRoot3,
|
|
@@ -137,16 +117,16 @@ ${_chunkTEEOPHLZjs.formatLogMessage.call(void 0, options)}
|
|
|
137
117
|
sourceRoot,
|
|
138
118
|
projectName,
|
|
139
119
|
config
|
|
140
|
-
}, config,
|
|
141
|
-
|
|
142
|
-
${
|
|
120
|
+
}, config, context.projectsConfigurations.projects[context.projectName]), applyWorkspaceProjectTokens);
|
|
121
|
+
_chunkV7LBWOVVjs.writeTrace.call(void 0, `Executor schema tokenized options \u2699\uFE0F
|
|
122
|
+
${_chunkV7LBWOVVjs.formatLogMessage.call(void 0, tokenized)}
|
|
143
123
|
`, config);
|
|
144
124
|
if (_optionalChain([executorOptions, 'optionalAccess', _9 => _9.hooks, 'optionalAccess', _10 => _10.preProcess])) {
|
|
145
|
-
|
|
125
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
146
126
|
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
147
|
-
|
|
127
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
148
128
|
}
|
|
149
|
-
const ret = executorFn(tokenized,
|
|
129
|
+
const ret = executorFn(tokenized, context, config);
|
|
150
130
|
if (_isFunction(_optionalChain([ret, 'optionalAccess', _11 => _11.next]))) {
|
|
151
131
|
const asyncGen = ret;
|
|
152
132
|
for await (const iter of asyncGen) {
|
|
@@ -155,26 +135,26 @@ ${_chunkTEEOPHLZjs.formatLogMessage.call(void 0, tokenized)}
|
|
|
155
135
|
}
|
|
156
136
|
const result = await Promise.resolve(ret);
|
|
157
137
|
if (result && (!result.success || result.error && _optionalChain([result, 'optionalAccess', _12 => _12.error, 'optionalAccess', _13 => _13.message]) && typeof _optionalChain([result, 'optionalAccess', _14 => _14.error, 'optionalAccess', _15 => _15.message]) === "string" && _optionalChain([result, 'optionalAccess', _16 => _16.error, 'optionalAccess', _17 => _17.name]) && typeof _optionalChain([result, 'optionalAccess', _18 => _18.error, 'optionalAccess', _19 => _19.name]) === "string")) {
|
|
158
|
-
|
|
159
|
-
${
|
|
138
|
+
_chunkV7LBWOVVjs.writeTrace.call(void 0, `Failure determined by the ${name} executor
|
|
139
|
+
${_chunkV7LBWOVVjs.formatLogMessage.call(void 0, result)}`, config);
|
|
160
140
|
console.error(result);
|
|
161
141
|
throw new Error(`The ${name} executor failed to run`, {
|
|
162
142
|
cause: _optionalChain([result, 'optionalAccess', _20 => _20.error])
|
|
163
143
|
});
|
|
164
144
|
}
|
|
165
145
|
if (_optionalChain([executorOptions, 'optionalAccess', _21 => _21.hooks, 'optionalAccess', _22 => _22.postProcess])) {
|
|
166
|
-
|
|
146
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
167
147
|
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
168
|
-
|
|
148
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
169
149
|
}
|
|
170
|
-
|
|
150
|
+
_chunkV7LBWOVVjs.writeSuccess.call(void 0, `Completed running the ${name} task executor!
|
|
171
151
|
`, config);
|
|
172
152
|
return {
|
|
173
153
|
success: true
|
|
174
154
|
};
|
|
175
155
|
} catch (error) {
|
|
176
|
-
|
|
177
|
-
|
|
156
|
+
_chunkV7LBWOVVjs.writeFatal.call(void 0, "A fatal error occurred while running the executor - the process was forced to terminate", config);
|
|
157
|
+
_chunkV7LBWOVVjs.writeError.call(void 0, `An exception was thrown in the executor's process
|
|
178
158
|
- Details: ${error.message}
|
|
179
159
|
- Stacktrace: ${error.stack}`, config);
|
|
180
160
|
return {
|
|
@@ -194,8 +174,8 @@ var _isFunction = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (value) =
|
|
|
194
174
|
|
|
195
175
|
// ../workspace-tools/src/utils/cargo.ts
|
|
196
176
|
var _devkit = require('@nx/devkit');
|
|
197
|
-
|
|
198
|
-
var _path = require('path'); var
|
|
177
|
+
var _child_process = require('child_process');
|
|
178
|
+
var _path = require('path'); var path3 = _interopRequireWildcard(_path);
|
|
199
179
|
var INVALID_CARGO_ARGS = [
|
|
200
180
|
"allFeatures",
|
|
201
181
|
"allTargets",
|
|
@@ -204,7 +184,7 @@ var INVALID_CARGO_ARGS = [
|
|
|
204
184
|
"package",
|
|
205
185
|
"tsConfig"
|
|
206
186
|
];
|
|
207
|
-
var buildCargoCommand = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (baseCommand, options,
|
|
187
|
+
var buildCargoCommand = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (baseCommand, options, context) => {
|
|
208
188
|
const args = [];
|
|
209
189
|
if (options.toolchain && options.toolchain !== "stable") {
|
|
210
190
|
args.push(`+${options.toolchain}`);
|
|
@@ -226,8 +206,8 @@ var buildCargoCommand = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (ba
|
|
|
226
206
|
args.push(`--${key}`, String(value));
|
|
227
207
|
}
|
|
228
208
|
}
|
|
229
|
-
if (
|
|
230
|
-
args.push("-p",
|
|
209
|
+
if (context.projectName) {
|
|
210
|
+
args.push("-p", context.projectName);
|
|
231
211
|
}
|
|
232
212
|
if (options.allFeatures && !args.includes("--all-features")) {
|
|
233
213
|
args.push("--all-features");
|
|
@@ -319,8 +299,8 @@ function runProcess(processCmd, ...args) {
|
|
|
319
299
|
_chunkJ5SB6L2Ljs.__name.call(void 0, runProcess, "runProcess");
|
|
320
300
|
|
|
321
301
|
// ../workspace-tools/src/executors/cargo-build/executor.ts
|
|
322
|
-
async function cargoBuildExecutor(options,
|
|
323
|
-
const command = buildCargoCommand("build", options,
|
|
302
|
+
async function cargoBuildExecutor(options, context) {
|
|
303
|
+
const command = buildCargoCommand("build", options, context);
|
|
324
304
|
return await cargoCommand(...command);
|
|
325
305
|
}
|
|
326
306
|
_chunkJ5SB6L2Ljs.__name.call(void 0, cargoBuildExecutor, "cargoBuildExecutor");
|
|
@@ -336,8 +316,8 @@ var executor_default = withRunExecutor("Cargo Build", cargoBuildExecutor, {
|
|
|
336
316
|
});
|
|
337
317
|
|
|
338
318
|
// ../workspace-tools/src/executors/cargo-check/executor.ts
|
|
339
|
-
async function cargoCheckExecutor(options,
|
|
340
|
-
const command = buildCargoCommand("check", options,
|
|
319
|
+
async function cargoCheckExecutor(options, context) {
|
|
320
|
+
const command = buildCargoCommand("check", options, context);
|
|
341
321
|
return await cargoCommand(...command);
|
|
342
322
|
}
|
|
343
323
|
_chunkJ5SB6L2Ljs.__name.call(void 0, cargoCheckExecutor, "cargoCheckExecutor");
|
|
@@ -352,8 +332,8 @@ var executor_default2 = withRunExecutor("Cargo Check", cargoCheckExecutor, {
|
|
|
352
332
|
});
|
|
353
333
|
|
|
354
334
|
// ../workspace-tools/src/executors/cargo-clippy/executor.ts
|
|
355
|
-
async function cargoClippyExecutor(options,
|
|
356
|
-
const command = buildCargoCommand("clippy", options,
|
|
335
|
+
async function cargoClippyExecutor(options, context) {
|
|
336
|
+
const command = buildCargoCommand("clippy", options, context);
|
|
357
337
|
return await cargoCommand(...command);
|
|
358
338
|
}
|
|
359
339
|
_chunkJ5SB6L2Ljs.__name.call(void 0, cargoClippyExecutor, "cargoClippyExecutor");
|
|
@@ -369,13 +349,13 @@ var executor_default3 = withRunExecutor("Cargo Clippy", cargoClippyExecutor, {
|
|
|
369
349
|
});
|
|
370
350
|
|
|
371
351
|
// ../workspace-tools/src/executors/cargo-doc/executor.ts
|
|
372
|
-
async function cargoDocExecutor(options,
|
|
352
|
+
async function cargoDocExecutor(options, context) {
|
|
373
353
|
const opts = {
|
|
374
354
|
...options
|
|
375
355
|
};
|
|
376
356
|
opts["no-deps"] = opts.noDeps;
|
|
377
357
|
delete opts.noDeps;
|
|
378
|
-
const command = buildCargoCommand("doc", options,
|
|
358
|
+
const command = buildCargoCommand("doc", options, context);
|
|
379
359
|
return await cargoCommand(...command);
|
|
380
360
|
}
|
|
381
361
|
_chunkJ5SB6L2Ljs.__name.call(void 0, cargoDocExecutor, "cargoDocExecutor");
|
|
@@ -397,8 +377,8 @@ var executor_default4 = withRunExecutor("Cargo Doc", cargoDocExecutor, {
|
|
|
397
377
|
});
|
|
398
378
|
|
|
399
379
|
// ../workspace-tools/src/executors/cargo-format/executor.ts
|
|
400
|
-
async function cargoFormatExecutor(options,
|
|
401
|
-
const command = buildCargoCommand("fmt", options,
|
|
380
|
+
async function cargoFormatExecutor(options, context) {
|
|
381
|
+
const command = buildCargoCommand("fmt", options, context);
|
|
402
382
|
return await cargoCommand(...command);
|
|
403
383
|
}
|
|
404
384
|
_chunkJ5SB6L2Ljs.__name.call(void 0, cargoFormatExecutor, "cargoFormatExecutor");
|
|
@@ -418,7 +398,7 @@ var executor_default5 = withRunExecutor("Cargo Format", cargoFormatExecutor, {
|
|
|
418
398
|
|
|
419
399
|
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
|
|
420
400
|
var _https = require('https'); var _https2 = _interopRequireDefault(_https);
|
|
421
|
-
var
|
|
401
|
+
var LARGE_BUFFER = 1024 * 1e6;
|
|
422
402
|
|
|
423
403
|
// ../esbuild/src/build.ts
|
|
424
404
|
|
|
@@ -477,8 +457,8 @@ var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (con
|
|
|
477
457
|
output: "src/"
|
|
478
458
|
});
|
|
479
459
|
}
|
|
480
|
-
|
|
481
|
-
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${
|
|
460
|
+
_chunkV7LBWOVVjs.writeTrace.call(void 0, `\u{1F4DD} Copying the following assets to the output directory:
|
|
461
|
+
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${_chunkV7LBWOVVjs.joinPaths.call(void 0, outputPath, pendingAsset.output)}`).join("\n")}`, config);
|
|
482
462
|
const assetHandler = new (0, _copyassetshandler.CopyAssetsHandler)({
|
|
483
463
|
projectDir: projectRoot,
|
|
484
464
|
rootDir: config.workspaceRoot,
|
|
@@ -487,12 +467,12 @@ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${p
|
|
|
487
467
|
});
|
|
488
468
|
await assetHandler.processAllAssetsOnce();
|
|
489
469
|
if (includeSrc === true) {
|
|
490
|
-
|
|
470
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkV7LBWOVVjs.joinPaths.call(void 0, outputPath, "src")}`, config);
|
|
491
471
|
const files = await _glob.glob.call(void 0, [
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
472
|
+
_chunkV7LBWOVVjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
473
|
+
_chunkV7LBWOVVjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
474
|
+
_chunkV7LBWOVVjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
475
|
+
_chunkV7LBWOVVjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
496
476
|
]);
|
|
497
477
|
await Promise.allSettled(files.map(async (file) => _promises.writeFile.call(void 0, file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
498
478
|
|
|
@@ -515,7 +495,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
515
495
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && _optionalChain([dep, 'access', _29 => _29.node, 'access', _30 => _30.data, 'optionalAccess', _31 => _31.root]) !== projectRoot && _optionalChain([dep, 'access', _32 => _32.node, 'access', _33 => _33.data, 'optionalAccess', _34 => _34.root]) !== workspaceRoot3)) {
|
|
516
496
|
const projectNode = project.node;
|
|
517
497
|
if (projectNode.data.root) {
|
|
518
|
-
const projectPackageJsonPath =
|
|
498
|
+
const projectPackageJsonPath = _chunkV7LBWOVVjs.joinPaths.call(void 0, workspaceRoot3, projectNode.data.root, "package.json");
|
|
519
499
|
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
520
500
|
const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
|
|
521
501
|
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
@@ -526,8 +506,8 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
526
506
|
}
|
|
527
507
|
}
|
|
528
508
|
if (localPackages.length > 0) {
|
|
529
|
-
|
|
530
|
-
const projectJsonFile = await _promises.readFile.call(void 0,
|
|
509
|
+
_chunkV7LBWOVVjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
|
|
510
|
+
const projectJsonFile = await _promises.readFile.call(void 0, _chunkV7LBWOVVjs.joinPaths.call(void 0, projectRoot, "project.json"), "utf8");
|
|
531
511
|
const projectJson = JSON.parse(projectJsonFile);
|
|
532
512
|
const projectName2 = projectJson.name;
|
|
533
513
|
const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
@@ -536,7 +516,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
536
516
|
}
|
|
537
517
|
const implicitDependencies = _optionalChain([projectConfigurations, 'access', _37 => _37.projects, 'optionalAccess', _38 => _38[projectName2], 'access', _39 => _39.implicitDependencies, 'optionalAccess', _40 => _40.reduce, 'call', _41 => _41((ret, dep) => {
|
|
538
518
|
if (_optionalChain([projectConfigurations, 'access', _42 => _42.projects, 'optionalAccess', _43 => _43[dep]])) {
|
|
539
|
-
const depPackageJsonPath =
|
|
519
|
+
const depPackageJsonPath = _chunkV7LBWOVVjs.joinPaths.call(void 0, workspaceRoot3, projectConfigurations.projects[dep].root, "package.json");
|
|
540
520
|
if (_fs.existsSync.call(void 0, depPackageJsonPath)) {
|
|
541
521
|
const depPackageJsonContent = _fs.readFileSync.call(void 0, depPackageJsonPath, "utf8");
|
|
542
522
|
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
@@ -555,18 +535,18 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
555
535
|
}, _nullishCoalesce(packageJson.dependencies, () => ( {})));
|
|
556
536
|
packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
|
|
557
537
|
if (!ret[localPackage.name] && _optionalChain([implicitDependencies, 'optionalAccess', _48 => _48.includes, 'call', _49 => _49(localPackage.name)]) && _optionalChain([packageJson, 'access', _50 => _50.dependencies, 'optionalAccess', _51 => _51[localPackage.name]]) === void 0) {
|
|
558
|
-
ret[localPackage.name] = localPackage.version || "0.0.1"
|
|
538
|
+
ret[localPackage.name] = `^${localPackage.version || "0.0.1"}`;
|
|
559
539
|
}
|
|
560
540
|
return ret;
|
|
561
541
|
}, _nullishCoalesce(packageJson.devDependencies, () => ( {})));
|
|
562
542
|
} else {
|
|
563
|
-
|
|
543
|
+
_chunkV7LBWOVVjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
|
|
564
544
|
}
|
|
565
545
|
return packageJson;
|
|
566
546
|
}, "addPackageDependencies");
|
|
567
|
-
var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (
|
|
568
|
-
const workspaceRoot3 =
|
|
569
|
-
const workspacePackageJsonContent = await _promises.readFile.call(void 0,
|
|
547
|
+
var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (workspaceConfig, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
548
|
+
const workspaceRoot3 = workspaceConfig.workspaceRoot ? workspaceConfig.workspaceRoot : _chunkV7LBWOVVjs.findWorkspaceRoot.call(void 0, );
|
|
549
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkV7LBWOVVjs.joinPaths.call(void 0, workspaceRoot3, "package.json"), "utf8");
|
|
570
550
|
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
571
551
|
packageJson.type ??= "module";
|
|
572
552
|
packageJson.sideEffects ??= false;
|
|
@@ -575,7 +555,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call
|
|
|
575
555
|
if (distSrc.startsWith("/")) {
|
|
576
556
|
distSrc = distSrc.substring(1);
|
|
577
557
|
}
|
|
578
|
-
packageJson.source ??= `${
|
|
558
|
+
packageJson.source ??= `${_chunkV7LBWOVVjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
579
559
|
}
|
|
580
560
|
packageJson.files ??= [
|
|
581
561
|
"dist/**/*"
|
|
@@ -606,7 +586,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call
|
|
|
606
586
|
];
|
|
607
587
|
}
|
|
608
588
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
609
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot :
|
|
589
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkV7LBWOVVjs.joinPaths.call(void 0, "packages", projectName);
|
|
610
590
|
return packageJson;
|
|
611
591
|
}, "addWorkspacePackageJsonFields");
|
|
612
592
|
|
|
@@ -638,157 +618,16 @@ var _createtaskgraph = require('nx/src/tasks-runner/create-task-graph');
|
|
|
638
618
|
var _chokidar = require('chokidar');
|
|
639
619
|
|
|
640
620
|
var _estoolkit = require('es-toolkit');
|
|
641
|
-
var
|
|
642
|
-
var _esbuild = require('esbuild'); var esbuild2 = _interopRequireWildcard(_esbuild); var esbuild = _interopRequireWildcard(_esbuild);
|
|
621
|
+
var _esbuild = require('esbuild'); var esbuild = _interopRequireWildcard(_esbuild);
|
|
643
622
|
var _globby = require('globby');
|
|
644
623
|
|
|
645
624
|
|
|
646
625
|
var _findworkspaceroot = require('nx/src/utils/find-workspace-root');
|
|
647
|
-
|
|
648
|
-
// ../esbuild/src/base/renderer-engine.ts
|
|
649
|
-
|
|
650
|
-
var _sourcemap = require('source-map');
|
|
651
|
-
|
|
652
|
-
// ../esbuild/src/utilities/output-file.ts
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
var outputFile = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (filepath, data, options) => {
|
|
656
|
-
await _fs2.default.promises.mkdir(path6.default.dirname(filepath), {
|
|
657
|
-
recursive: true
|
|
658
|
-
});
|
|
659
|
-
await _fs2.default.promises.writeFile(filepath, data, options);
|
|
660
|
-
}, "outputFile");
|
|
661
|
-
|
|
662
|
-
// ../esbuild/src/base/renderer-engine.ts
|
|
663
|
-
var parseSourceMap = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (map2) => {
|
|
664
|
-
return typeof map2 === "string" ? JSON.parse(map2) : map2;
|
|
665
|
-
}, "parseSourceMap");
|
|
666
|
-
var isJS = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (path7) => /\.(js|mjs|cjs)$/.test(path7), "isJS");
|
|
667
|
-
var isCSS = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (path7) => /\.css$/.test(path7), "isCSS");
|
|
668
|
-
var getSourcemapComment = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (inline, map2, filepath, isCssFile) => {
|
|
669
|
-
if (!map2) return "";
|
|
670
|
-
const prefix = isCssFile ? "/*" : "//";
|
|
671
|
-
const suffix = isCssFile ? " */" : "";
|
|
672
|
-
const url = inline ? `data:application/json;base64,${Buffer.from(typeof map2 === "string" ? map2 : JSON.stringify(map2)).toString("base64")}` : `${path6.default.basename(filepath)}.map`;
|
|
673
|
-
return `${prefix}# sourceMappingURL=${url}${suffix}`;
|
|
674
|
-
}, "getSourcemapComment");
|
|
675
|
-
var RendererEngine = class {
|
|
676
|
-
static {
|
|
677
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, this, "RendererEngine");
|
|
678
|
-
}
|
|
679
|
-
#renderers;
|
|
680
|
-
#options;
|
|
681
|
-
constructor(renderers) {
|
|
682
|
-
this.#renderers = renderers;
|
|
683
|
-
}
|
|
684
|
-
setOptions(options) {
|
|
685
|
-
this.#options = options;
|
|
686
|
-
}
|
|
687
|
-
getOptions() {
|
|
688
|
-
if (!this.#options) {
|
|
689
|
-
throw new Error(`Renderer options is not set`);
|
|
690
|
-
}
|
|
691
|
-
return this.#options;
|
|
692
|
-
}
|
|
693
|
-
modifyEsbuildOptions(options) {
|
|
694
|
-
for (const renderer of this.#renderers) {
|
|
695
|
-
if (renderer.esbuildOptions) {
|
|
696
|
-
renderer.esbuildOptions.call(this.getOptions(), options);
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
async buildStarted() {
|
|
701
|
-
for (const renderer of this.#renderers) {
|
|
702
|
-
if (renderer.buildStart) {
|
|
703
|
-
await renderer.buildStart.call(this.getOptions());
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
async buildFinished({ outputFiles, metafile }) {
|
|
708
|
-
const files = outputFiles.filter((file) => !file.path.endsWith(".map")).map((file) => {
|
|
709
|
-
if (isJS(file.path) || isCSS(file.path)) {
|
|
710
|
-
let relativePath = path6.default.relative(this.getOptions().config.workspaceRoot, file.path);
|
|
711
|
-
if (!relativePath.startsWith("\\\\?\\")) {
|
|
712
|
-
relativePath = relativePath.replace(/\\/g, "/");
|
|
713
|
-
}
|
|
714
|
-
const meta = _optionalChain([metafile, 'optionalAccess', _52 => _52.outputs, 'access', _53 => _53[relativePath]]);
|
|
715
|
-
return {
|
|
716
|
-
type: "chunk",
|
|
717
|
-
path: file.path,
|
|
718
|
-
code: file.text,
|
|
719
|
-
map: _optionalChain([outputFiles, 'access', _54 => _54.find, 'call', _55 => _55((f) => f.path === `${file.path}.map`), 'optionalAccess', _56 => _56.text]),
|
|
720
|
-
entryPoint: _optionalChain([meta, 'optionalAccess', _57 => _57.entryPoint]),
|
|
721
|
-
exports: _optionalChain([meta, 'optionalAccess', _58 => _58.exports]),
|
|
722
|
-
imports: _optionalChain([meta, 'optionalAccess', _59 => _59.imports])
|
|
723
|
-
};
|
|
724
|
-
} else {
|
|
725
|
-
return {
|
|
726
|
-
type: "asset",
|
|
727
|
-
path: file.path,
|
|
728
|
-
contents: file.contents
|
|
729
|
-
};
|
|
730
|
-
}
|
|
731
|
-
});
|
|
732
|
-
const writtenFiles = [];
|
|
733
|
-
await Promise.all(files.map(async (info) => {
|
|
734
|
-
for (const renderer of this.#renderers) {
|
|
735
|
-
if (info.type === "chunk" && renderer.renderChunk) {
|
|
736
|
-
const result = await renderer.renderChunk.call(this.getOptions(), info.code, info);
|
|
737
|
-
if (result) {
|
|
738
|
-
info.code = result.code;
|
|
739
|
-
if (result.map) {
|
|
740
|
-
const originalConsumer = await new (0, _sourcemap.SourceMapConsumer)(parseSourceMap(info.map));
|
|
741
|
-
const newConsumer = await new (0, _sourcemap.SourceMapConsumer)(parseSourceMap(result.map));
|
|
742
|
-
const generator = _sourcemap.SourceMapGenerator.fromSourceMap(newConsumer);
|
|
743
|
-
generator.applySourceMap(originalConsumer, info.path);
|
|
744
|
-
info.map = generator.toJSON();
|
|
745
|
-
originalConsumer.destroy();
|
|
746
|
-
newConsumer.destroy();
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
const inlineSourceMap = this.#options.sourcemap === "inline";
|
|
752
|
-
const contents = info.type === "chunk" ? info.code + getSourcemapComment(inlineSourceMap, info.map, info.path, isCSS(info.path)) : info.contents;
|
|
753
|
-
await outputFile(info.path, contents, {
|
|
754
|
-
mode: info.type === "chunk" ? info.mode : void 0
|
|
755
|
-
});
|
|
756
|
-
writtenFiles.push({
|
|
757
|
-
get name() {
|
|
758
|
-
return path6.default.relative(process.cwd(), info.path);
|
|
759
|
-
},
|
|
760
|
-
get size() {
|
|
761
|
-
return contents.length;
|
|
762
|
-
}
|
|
763
|
-
});
|
|
764
|
-
if (info.type === "chunk" && info.map && !inlineSourceMap) {
|
|
765
|
-
const map2 = typeof info.map === "string" ? JSON.parse(info.map) : info.map;
|
|
766
|
-
const outPath = `${info.path}.map`;
|
|
767
|
-
const contents2 = JSON.stringify(map2);
|
|
768
|
-
await outputFile(outPath, contents2);
|
|
769
|
-
writtenFiles.push({
|
|
770
|
-
get name() {
|
|
771
|
-
return path6.default.relative(process.cwd(), outPath);
|
|
772
|
-
},
|
|
773
|
-
get size() {
|
|
774
|
-
return contents2.length;
|
|
775
|
-
}
|
|
776
|
-
});
|
|
777
|
-
}
|
|
778
|
-
}));
|
|
779
|
-
for (const renderer of this.#renderers) {
|
|
780
|
-
if (renderer.buildEnd) {
|
|
781
|
-
await renderer.buildEnd.call(this.getOptions(), {
|
|
782
|
-
writtenFiles
|
|
783
|
-
});
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
};
|
|
626
|
+
var _tsup = require('tsup');
|
|
788
627
|
|
|
789
628
|
// ../esbuild/src/clean.ts
|
|
790
629
|
|
|
791
|
-
async function cleanDirectories(
|
|
630
|
+
async function cleanDirectories(directory) {
|
|
792
631
|
await _promises.rm.call(void 0, directory, {
|
|
793
632
|
recursive: true,
|
|
794
633
|
force: true
|
|
@@ -796,315 +635,24 @@ async function cleanDirectories(name = "ESBuild", directory, config) {
|
|
|
796
635
|
}
|
|
797
636
|
_chunkJ5SB6L2Ljs.__name.call(void 0, cleanDirectories, "cleanDirectories");
|
|
798
637
|
|
|
799
|
-
// ../esbuild/src/plugins/esm-split-code-to-cjs.ts
|
|
800
|
-
|
|
801
|
-
var esmSplitCodeToCjsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
802
|
-
name: "storm:esm-split-code-to-cjs",
|
|
803
|
-
setup(build4) {
|
|
804
|
-
build4.onEnd(async (result) => {
|
|
805
|
-
const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access', _60 => _60.metafile, 'optionalAccess', _61 => _61.outputs]), () => ( {})));
|
|
806
|
-
const jsFiles = outFiles.filter((f) => f.endsWith("js"));
|
|
807
|
-
await esbuild.build({
|
|
808
|
-
outdir: resolvedOptions.outdir,
|
|
809
|
-
entryPoints: jsFiles,
|
|
810
|
-
allowOverwrite: true,
|
|
811
|
-
format: "cjs",
|
|
812
|
-
logLevel: "error",
|
|
813
|
-
packages: "external"
|
|
814
|
-
});
|
|
815
|
-
});
|
|
816
|
-
}
|
|
817
|
-
}), "esmSplitCodeToCjsPlugin");
|
|
818
|
-
|
|
819
|
-
// ../esbuild/src/plugins/fix-imports.ts
|
|
820
|
-
var fixImportsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
821
|
-
name: "storm:fix-imports",
|
|
822
|
-
setup(build4) {
|
|
823
|
-
build4.onResolve({
|
|
824
|
-
filter: /^spdx-exceptions/
|
|
825
|
-
}, () => {
|
|
826
|
-
return {
|
|
827
|
-
path: _chunkJ5SB6L2Ljs.__require.resolve("spdx-exceptions")
|
|
828
|
-
};
|
|
829
|
-
});
|
|
830
|
-
build4.onResolve({
|
|
831
|
-
filter: /^spdx-license-ids/
|
|
832
|
-
}, () => {
|
|
833
|
-
return {
|
|
834
|
-
path: _chunkJ5SB6L2Ljs.__require.resolve("spdx-license-ids")
|
|
835
|
-
};
|
|
836
|
-
});
|
|
837
|
-
}
|
|
838
|
-
}), "fixImportsPlugin");
|
|
839
|
-
|
|
840
|
-
// ../esbuild/src/plugins/native-node-module.ts
|
|
841
|
-
|
|
842
|
-
var nativeNodeModulesPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => {
|
|
843
|
-
return {
|
|
844
|
-
name: "native-node-modules",
|
|
845
|
-
setup(build4) {
|
|
846
|
-
build4.onResolve({
|
|
847
|
-
filter: /\.node$/,
|
|
848
|
-
namespace: "file"
|
|
849
|
-
}, (args) => {
|
|
850
|
-
const resolvedId = _chunkJ5SB6L2Ljs.__require.resolve(args.path, {
|
|
851
|
-
paths: [
|
|
852
|
-
args.resolveDir
|
|
853
|
-
]
|
|
854
|
-
});
|
|
855
|
-
if (resolvedId.endsWith(".node")) {
|
|
856
|
-
return {
|
|
857
|
-
path: resolvedId,
|
|
858
|
-
namespace: "node-file"
|
|
859
|
-
};
|
|
860
|
-
}
|
|
861
|
-
return {
|
|
862
|
-
path: resolvedId
|
|
863
|
-
};
|
|
864
|
-
});
|
|
865
|
-
build4.onLoad({
|
|
866
|
-
filter: /.*/,
|
|
867
|
-
namespace: "node-file"
|
|
868
|
-
}, (args) => {
|
|
869
|
-
return {
|
|
870
|
-
contents: `
|
|
871
|
-
import path from ${JSON.stringify(args.path)}
|
|
872
|
-
try { module.exports = require(path) }
|
|
873
|
-
catch {}
|
|
874
|
-
`,
|
|
875
|
-
resolveDir: _path.dirname.call(void 0, args.path)
|
|
876
|
-
};
|
|
877
|
-
});
|
|
878
|
-
build4.onResolve({
|
|
879
|
-
filter: /\.node$/,
|
|
880
|
-
namespace: "node-file"
|
|
881
|
-
}, (args) => ({
|
|
882
|
-
path: args.path,
|
|
883
|
-
namespace: "file"
|
|
884
|
-
}));
|
|
885
|
-
const opts = build4.initialOptions;
|
|
886
|
-
opts.loader = opts.loader || {};
|
|
887
|
-
opts.loader[".node"] = "file";
|
|
888
|
-
}
|
|
889
|
-
};
|
|
890
|
-
}, "nativeNodeModulesPlugin");
|
|
891
|
-
|
|
892
|
-
// ../esbuild/src/plugins/node-protocol.ts
|
|
893
|
-
var nodeProtocolPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => {
|
|
894
|
-
const nodeProtocol = "node:";
|
|
895
|
-
return {
|
|
896
|
-
name: "node-protocol-plugin",
|
|
897
|
-
setup({ onResolve }) {
|
|
898
|
-
onResolve({
|
|
899
|
-
filter: /^node:/
|
|
900
|
-
}, ({ path: path7 }) => ({
|
|
901
|
-
path: path7.slice(nodeProtocol.length),
|
|
902
|
-
external: true
|
|
903
|
-
}));
|
|
904
|
-
}
|
|
905
|
-
};
|
|
906
|
-
}, "nodeProtocolPlugin");
|
|
907
|
-
|
|
908
|
-
// ../esbuild/src/plugins/on-error.ts
|
|
909
|
-
var onErrorPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
910
|
-
name: "storm:on-error",
|
|
911
|
-
setup(build4) {
|
|
912
|
-
build4.onEnd((result) => {
|
|
913
|
-
if (result.errors.length > 0 && process.env.WATCH !== "true") {
|
|
914
|
-
_chunkTEEOPHLZjs.writeError.call(void 0, `The following errors occurred during the build:
|
|
915
|
-
${result.errors.map((error) => error.text).join("\n")}
|
|
916
|
-
|
|
917
|
-
`, resolvedOptions.config);
|
|
918
|
-
throw new Error("Storm esbuild process failed with errors.");
|
|
919
|
-
}
|
|
920
|
-
});
|
|
921
|
-
}
|
|
922
|
-
}), "onErrorPlugin");
|
|
923
|
-
|
|
924
|
-
// ../esbuild/src/plugins/resolve-paths.ts
|
|
925
|
-
|
|
926
|
-
function resolvePathsConfig(options, cwd) {
|
|
927
|
-
if (_optionalChain([options, 'optionalAccess', _62 => _62.compilerOptions, 'optionalAccess', _63 => _63.paths])) {
|
|
928
|
-
const paths = Object.entries(options.compilerOptions.paths);
|
|
929
|
-
const resolvedPaths = paths.map(([key, paths2]) => {
|
|
930
|
-
return [
|
|
931
|
-
key,
|
|
932
|
-
paths2.map((v) => path6.default.resolve(cwd, v))
|
|
933
|
-
];
|
|
934
|
-
});
|
|
935
|
-
return Object.fromEntries(resolvedPaths);
|
|
936
|
-
}
|
|
937
|
-
if (options.extends) {
|
|
938
|
-
const extendsPath = path6.default.resolve(cwd, options.extends);
|
|
939
|
-
const extendsDir = path6.default.dirname(extendsPath);
|
|
940
|
-
const extendsConfig = _chunkJ5SB6L2Ljs.__require.call(void 0, extendsPath);
|
|
941
|
-
return resolvePathsConfig(extendsConfig, extendsDir);
|
|
942
|
-
}
|
|
943
|
-
return [];
|
|
944
|
-
}
|
|
945
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, resolvePathsConfig, "resolvePathsConfig");
|
|
946
|
-
var resolvePathsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
947
|
-
name: "storm:resolve-paths",
|
|
948
|
-
setup(build4) {
|
|
949
|
-
const parentTsConfig = build4.initialOptions.tsconfig ? _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkTEEOPHLZjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, build4.initialOptions.tsconfig)) : _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkTEEOPHLZjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, "tsconfig.json"));
|
|
950
|
-
const resolvedTsPaths = resolvePathsConfig(parentTsConfig, options.projectRoot);
|
|
951
|
-
const packagesRegex = new RegExp(`^(${Object.keys(resolvedTsPaths).join("|")})$`);
|
|
952
|
-
build4.onResolve({
|
|
953
|
-
filter: packagesRegex
|
|
954
|
-
}, (args) => {
|
|
955
|
-
if (_optionalChain([build4, 'access', _64 => _64.initialOptions, 'access', _65 => _65.external, 'optionalAccess', _66 => _66.includes, 'call', _67 => _67(args.path)])) {
|
|
956
|
-
return {
|
|
957
|
-
path: args.path,
|
|
958
|
-
external: true
|
|
959
|
-
};
|
|
960
|
-
}
|
|
961
|
-
return {
|
|
962
|
-
path: `${resolvedTsPaths[args.path][0]}/index.ts`
|
|
963
|
-
};
|
|
964
|
-
});
|
|
965
|
-
}
|
|
966
|
-
}), "resolvePathsPlugin");
|
|
967
|
-
|
|
968
|
-
// ../esbuild/src/plugins/tsc.ts
|
|
969
|
-
var _apiextractor = require('@microsoft/api-extractor');
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
973
|
-
const { dependencies, peerDependencies, devDependencies } = _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkTEEOPHLZjs.joinPaths.call(void 0, options.projectRoot, "package.json"));
|
|
974
|
-
const dependenciesKeys = Object.keys(_nullishCoalesce(dependencies, () => ( {}))).flatMap((p) => [
|
|
975
|
-
p,
|
|
976
|
-
getTypeDependencyPackageName(p)
|
|
977
|
-
]);
|
|
978
|
-
const peerDependenciesKeys = Object.keys(_nullishCoalesce(peerDependencies, () => ( {}))).flatMap((p) => [
|
|
979
|
-
p,
|
|
980
|
-
getTypeDependencyPackageName(p)
|
|
981
|
-
]);
|
|
982
|
-
const devDependenciesKeys = Object.keys(_nullishCoalesce(devDependencies, () => ( {}))).flatMap((p) => [
|
|
983
|
-
p,
|
|
984
|
-
getTypeDependencyPackageName(p)
|
|
985
|
-
]);
|
|
986
|
-
const includeDeps = devDependenciesKeys;
|
|
987
|
-
const excludeDeps = /* @__PURE__ */ new Set([
|
|
988
|
-
...dependenciesKeys,
|
|
989
|
-
...peerDependenciesKeys,
|
|
990
|
-
...externals
|
|
991
|
-
]);
|
|
992
|
-
const bundledPackages = includeDeps.filter((dep) => !excludeDeps.has(dep));
|
|
993
|
-
const extractorConfig = _apiextractor.ExtractorConfig.prepare({
|
|
994
|
-
configObject: {
|
|
995
|
-
projectFolder: options.projectRoot,
|
|
996
|
-
mainEntryPointFilePath: filename,
|
|
997
|
-
bundledPackages,
|
|
998
|
-
compiler: {
|
|
999
|
-
tsconfigFilePath: options.tsconfig,
|
|
1000
|
-
overrideTsconfig: {
|
|
1001
|
-
compilerOptions: {
|
|
1002
|
-
paths: {}
|
|
1003
|
-
// bug with api extract + paths
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
},
|
|
1007
|
-
dtsRollup: {
|
|
1008
|
-
enabled: true,
|
|
1009
|
-
untrimmedFilePath: _chunkTEEOPHLZjs.joinPaths.call(void 0, options.outdir, `${outfile}.d.ts`)
|
|
1010
|
-
},
|
|
1011
|
-
tsdocMetadata: {
|
|
1012
|
-
enabled: false
|
|
1013
|
-
}
|
|
1014
|
-
},
|
|
1015
|
-
packageJsonFullPath: _chunkTEEOPHLZjs.joinPaths.call(void 0, options.projectRoot, "package.json"),
|
|
1016
|
-
configObjectFullPath: void 0
|
|
1017
|
-
});
|
|
1018
|
-
const extractorResult = _apiextractor.Extractor.invoke(extractorConfig, {
|
|
1019
|
-
showVerboseMessages: true,
|
|
1020
|
-
localBuild: true
|
|
1021
|
-
});
|
|
1022
|
-
if (extractorResult.succeeded === false) {
|
|
1023
|
-
_chunkTEEOPHLZjs.writeError.call(void 0, `API Extractor completed with ${extractorResult.errorCount} ${extractorResult.errorCount === 1 ? "error" : "errors"}`);
|
|
1024
|
-
throw new Error("API Extractor completed with errors");
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, bundleTypeDefinitions, "bundleTypeDefinitions");
|
|
1028
|
-
var tscPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
1029
|
-
name: "storm:tsc",
|
|
1030
|
-
setup(build4) {
|
|
1031
|
-
if (options.dts === false) {
|
|
1032
|
-
return;
|
|
1033
|
-
}
|
|
1034
|
-
build4.onStart(async () => {
|
|
1035
|
-
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
1036
|
-
await run(resolvedOptions.config, `pnpm exec tsc --project ${resolvedOptions.tsconfig}`, resolvedOptions.config.workspaceRoot);
|
|
1037
|
-
}
|
|
1038
|
-
if (resolvedOptions.bundle && resolvedOptions.entryPoints && resolvedOptions.entryPoints.length > 0 && _optionalChain([resolvedOptions, 'access', _68 => _68.entryPoints, 'access', _69 => _69[0], 'optionalAccess', _70 => _70.in]) && resolvedOptions.entryPoints[0].in.endsWith(".ts")) {
|
|
1039
|
-
const sourceRoot = resolvedOptions.sourceRoot.replaceAll(resolvedOptions.projectRoot, "");
|
|
1040
|
-
const typeOutDir = resolvedOptions.outdir;
|
|
1041
|
-
const entryPoint = resolvedOptions.entryPoints[0].in.replace(sourceRoot, "").replace(/\.ts$/, "");
|
|
1042
|
-
const bundlePath = _chunkTEEOPHLZjs.joinPaths.call(void 0, resolvedOptions.outdir, entryPoint);
|
|
1043
|
-
let dtsPath;
|
|
1044
|
-
if (_fs.existsSync.call(void 0, _chunkTEEOPHLZjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
|
|
1045
|
-
dtsPath = _chunkTEEOPHLZjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`);
|
|
1046
|
-
} else if (_fs.existsSync.call(void 0, _chunkTEEOPHLZjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
|
|
1047
|
-
dtsPath = _chunkTEEOPHLZjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`);
|
|
1048
|
-
}
|
|
1049
|
-
const ext = resolvedOptions.format === "esm" ? "d.mts" : "d.ts";
|
|
1050
|
-
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
1051
|
-
bundleTypeDefinitions(dtsPath, bundlePath, _nullishCoalesce(resolvedOptions.external, () => ( [])), resolvedOptions);
|
|
1052
|
-
const dtsContents = await _promises2.default.readFile(`${bundlePath}.d.ts`, "utf8");
|
|
1053
|
-
await _promises2.default.writeFile(`${bundlePath}.${ext}`, dtsContents);
|
|
1054
|
-
} else {
|
|
1055
|
-
await _promises2.default.writeFile(`${bundlePath}.${ext}`, `export * from './${entryPoint}'`);
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
});
|
|
1059
|
-
}
|
|
1060
|
-
}), "tscPlugin");
|
|
1061
|
-
function getTypeDependencyPackageName(npmPackage) {
|
|
1062
|
-
if (npmPackage.startsWith("@")) {
|
|
1063
|
-
const [scope, name] = npmPackage.split("/");
|
|
1064
|
-
return `@types/${_optionalChain([scope, 'optionalAccess', _71 => _71.slice, 'call', _72 => _72(1)])}__${name}`;
|
|
1065
|
-
}
|
|
1066
|
-
return `@types/${npmPackage}`;
|
|
1067
|
-
}
|
|
1068
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, getTypeDependencyPackageName, "getTypeDependencyPackageName");
|
|
1069
|
-
|
|
1070
638
|
// ../esbuild/src/config.ts
|
|
1071
|
-
var getDefaultBuildPlugins = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => [
|
|
1072
|
-
nodeProtocolPlugin(options, resolvedOptions),
|
|
1073
|
-
resolvePathsPlugin(options, resolvedOptions),
|
|
1074
|
-
fixImportsPlugin(options, resolvedOptions),
|
|
1075
|
-
nativeNodeModulesPlugin(options, resolvedOptions),
|
|
1076
|
-
esmSplitCodeToCjsPlugin(options, resolvedOptions),
|
|
1077
|
-
tscPlugin(options, resolvedOptions),
|
|
1078
|
-
onErrorPlugin(options, resolvedOptions)
|
|
1079
|
-
], "getDefaultBuildPlugins");
|
|
1080
639
|
var DEFAULT_BUILD_OPTIONS = {
|
|
640
|
+
assets: [],
|
|
1081
641
|
platform: "node",
|
|
1082
|
-
target:
|
|
642
|
+
target: [
|
|
643
|
+
"esnext"
|
|
644
|
+
],
|
|
1083
645
|
format: "esm",
|
|
1084
|
-
external: [],
|
|
1085
|
-
logLevel: "error",
|
|
1086
646
|
tsconfig: "tsconfig.json",
|
|
1087
647
|
mode: "production",
|
|
648
|
+
generatePackageJson: true,
|
|
649
|
+
includeSrc: false,
|
|
1088
650
|
keepNames: true,
|
|
1089
|
-
metafile:
|
|
1090
|
-
|
|
1091
|
-
|
|
651
|
+
metafile: false,
|
|
652
|
+
treeshake: true,
|
|
653
|
+
shims: false,
|
|
1092
654
|
watch: false,
|
|
1093
655
|
bundle: true,
|
|
1094
|
-
clean: true,
|
|
1095
|
-
debug: false,
|
|
1096
|
-
resolveExtensions: [
|
|
1097
|
-
".tsx",
|
|
1098
|
-
".ts",
|
|
1099
|
-
".cts",
|
|
1100
|
-
".mts",
|
|
1101
|
-
".jsx",
|
|
1102
|
-
".js",
|
|
1103
|
-
".cjs",
|
|
1104
|
-
".mjs",
|
|
1105
|
-
".css",
|
|
1106
|
-
".json"
|
|
1107
|
-
],
|
|
1108
656
|
loader: {
|
|
1109
657
|
".aac": "file",
|
|
1110
658
|
".css": "file",
|
|
@@ -1126,7 +674,10 @@ var DEFAULT_BUILD_OPTIONS = {
|
|
|
1126
674
|
".woff": "file",
|
|
1127
675
|
".woff2": "file"
|
|
1128
676
|
},
|
|
1129
|
-
banner:
|
|
677
|
+
banner: {
|
|
678
|
+
js: DEFAULT_COMPILED_BANNER,
|
|
679
|
+
css: DEFAULT_COMPILED_BANNER
|
|
680
|
+
}
|
|
1130
681
|
};
|
|
1131
682
|
|
|
1132
683
|
// ../esbuild/src/plugins/deps-check.ts
|
|
@@ -1163,8 +714,8 @@ var missingIgnore = [
|
|
|
1163
714
|
];
|
|
1164
715
|
var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bundle) => ({
|
|
1165
716
|
name: "storm:deps-check",
|
|
1166
|
-
setup(
|
|
1167
|
-
const pkgJsonPath =
|
|
717
|
+
setup(build3) {
|
|
718
|
+
const pkgJsonPath = path3.default.join(process.cwd(), "package.json");
|
|
1168
719
|
const pkgContents = _chunkJ5SB6L2Ljs.__require.call(void 0, pkgJsonPath);
|
|
1169
720
|
const regDependencies = Object.keys(_nullishCoalesce(pkgContents["dependencies"], () => ( {})));
|
|
1170
721
|
const devDependencies = Object.keys(_nullishCoalesce(pkgContents["devDependencies"], () => ( {})));
|
|
@@ -1175,7 +726,7 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
|
|
|
1175
726
|
];
|
|
1176
727
|
const collectedDependencies = /* @__PURE__ */ new Set();
|
|
1177
728
|
const onlyPackages = /^[^./](?!:)|^\.[^./]|^\.\.[^/]/;
|
|
1178
|
-
|
|
729
|
+
build3.onResolve({
|
|
1179
730
|
filter: onlyPackages
|
|
1180
731
|
}, (args) => {
|
|
1181
732
|
if (args.importer.includes(process.cwd())) {
|
|
@@ -1191,7 +742,7 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
|
|
|
1191
742
|
external: true
|
|
1192
743
|
};
|
|
1193
744
|
});
|
|
1194
|
-
|
|
745
|
+
build3.onEnd(() => {
|
|
1195
746
|
const unusedDependencies = [
|
|
1196
747
|
...dependencies
|
|
1197
748
|
].filter((dep) => {
|
|
@@ -1208,8 +759,8 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
|
|
|
1208
759
|
const filteredMissingDeps = missingDependencies.filter((dep) => {
|
|
1209
760
|
return !missingIgnore.some((pattern) => dep.match(pattern)) && !peerDependencies.includes(dep);
|
|
1210
761
|
});
|
|
1211
|
-
|
|
1212
|
-
|
|
762
|
+
_chunkV7LBWOVVjs.writeWarning.call(void 0, `Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`);
|
|
763
|
+
_chunkV7LBWOVVjs.writeError.call(void 0, `Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`);
|
|
1213
764
|
if (filteredMissingDeps.length > 0) {
|
|
1214
765
|
throw new Error(`Missing dependencies detected - please install them:
|
|
1215
766
|
${JSON.stringify(filteredMissingDeps)}
|
|
@@ -1219,391 +770,53 @@ ${JSON.stringify(filteredMissingDeps)}
|
|
|
1219
770
|
}
|
|
1220
771
|
}), "depsCheckPlugin");
|
|
1221
772
|
|
|
1222
|
-
// ../esbuild/src/renderers/shebang.ts
|
|
1223
|
-
var shebangRenderer = {
|
|
1224
|
-
name: "shebang",
|
|
1225
|
-
renderChunk(_, __, info) {
|
|
1226
|
-
if (info.type === "chunk" && /\.(cjs|js|mjs)$/.test(info.path) && info.code.startsWith("#!")) {
|
|
1227
|
-
info.mode = 493;
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
};
|
|
1231
|
-
|
|
1232
|
-
// ../esbuild/src/tsc.ts
|
|
1233
|
-
var _bundlerequire = require('bundle-require');
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
var _typescript = require('typescript'); var _typescript2 = _interopRequireDefault(_typescript);
|
|
1238
|
-
function ensureTempDeclarationDir(workspaceConfig) {
|
|
1239
|
-
const root = workspaceConfig.directories.temp || _path.join.call(void 0, workspaceConfig.workspaceRoot, "tmp");
|
|
1240
|
-
const dirPath = _path.join.call(void 0, root, ".tsc", "declaration");
|
|
1241
|
-
if (_fs.existsSync.call(void 0, dirPath)) {
|
|
1242
|
-
return dirPath;
|
|
1243
|
-
}
|
|
1244
|
-
_fs.mkdirSync.call(void 0, dirPath, {
|
|
1245
|
-
recursive: true
|
|
1246
|
-
});
|
|
1247
|
-
const gitIgnorePath = _path.join.call(void 0, root, ".tsc", ".gitignore");
|
|
1248
|
-
_fs.writeFileSync.call(void 0, gitIgnorePath, "**/*\n");
|
|
1249
|
-
return dirPath;
|
|
1250
|
-
}
|
|
1251
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, ensureTempDeclarationDir, "ensureTempDeclarationDir");
|
|
1252
|
-
function slash(path7) {
|
|
1253
|
-
const isExtendedLengthPath = path7.startsWith("\\\\?\\");
|
|
1254
|
-
if (isExtendedLengthPath) {
|
|
1255
|
-
return path7;
|
|
1256
|
-
}
|
|
1257
|
-
return path7.replace(/\\/g, "/");
|
|
1258
|
-
}
|
|
1259
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, slash, "slash");
|
|
1260
|
-
function toAbsolutePath(workspaceConfig, p, cwd) {
|
|
1261
|
-
if (_path.isAbsolute.call(void 0, p)) {
|
|
1262
|
-
return p;
|
|
1263
|
-
}
|
|
1264
|
-
return slash(_path.normalize.call(void 0, _path.join.call(void 0, cwd || workspaceConfig.workspaceRoot, p)));
|
|
1265
|
-
}
|
|
1266
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, toAbsolutePath, "toAbsolutePath");
|
|
1267
|
-
var AliasPool = (_class = class AliasPool2 {constructor() { _class.prototype.__init.call(this); }
|
|
1268
|
-
static {
|
|
1269
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, this, "AliasPool");
|
|
1270
|
-
}
|
|
1271
|
-
__init() {this.seen = /* @__PURE__ */ new Set()}
|
|
1272
|
-
assign(name) {
|
|
1273
|
-
let suffix = 0;
|
|
1274
|
-
let alias = name === "default" ? "default_alias" : name;
|
|
1275
|
-
while (this.seen.has(alias)) {
|
|
1276
|
-
alias = `${name}_alias_${++suffix}`;
|
|
1277
|
-
if (suffix >= 1e3) {
|
|
1278
|
-
throw new Error("Alias generation exceeded limit. Possible infinite loop detected.");
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
this.seen.add(alias);
|
|
1282
|
-
return alias;
|
|
1283
|
-
}
|
|
1284
|
-
}, _class);
|
|
1285
|
-
function getExports(workspaceConfig, program, fileMapping) {
|
|
1286
|
-
const checker = program.getTypeChecker();
|
|
1287
|
-
const aliasPool = new AliasPool();
|
|
1288
|
-
const assignAlias = aliasPool.assign.bind(aliasPool);
|
|
1289
|
-
function extractExports(sourceFileName) {
|
|
1290
|
-
const cwd = program.getCurrentDirectory();
|
|
1291
|
-
sourceFileName = toAbsolutePath(workspaceConfig, sourceFileName, cwd);
|
|
1292
|
-
const sourceFile = program.getSourceFile(sourceFileName);
|
|
1293
|
-
if (!sourceFile) {
|
|
1294
|
-
return [];
|
|
1295
|
-
}
|
|
1296
|
-
const destFileName = fileMapping.get(sourceFileName);
|
|
1297
|
-
if (!destFileName) {
|
|
1298
|
-
return [];
|
|
1299
|
-
}
|
|
1300
|
-
const moduleSymbol = checker.getSymbolAtLocation(sourceFile);
|
|
1301
|
-
if (!moduleSymbol) {
|
|
1302
|
-
return [];
|
|
1303
|
-
}
|
|
1304
|
-
const exports = [];
|
|
1305
|
-
const exportSymbols = checker.getExportsOfModule(moduleSymbol);
|
|
1306
|
-
exportSymbols.forEach((symbol) => {
|
|
1307
|
-
const name = symbol.getName();
|
|
1308
|
-
exports.push({
|
|
1309
|
-
kind: "named",
|
|
1310
|
-
sourceFileName,
|
|
1311
|
-
destFileName,
|
|
1312
|
-
name,
|
|
1313
|
-
alias: assignAlias(name),
|
|
1314
|
-
isTypeOnly: false
|
|
1315
|
-
});
|
|
1316
|
-
});
|
|
1317
|
-
return exports;
|
|
1318
|
-
}
|
|
1319
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, extractExports, "extractExports");
|
|
1320
|
-
return program.getRootFileNames().flatMap(extractExports);
|
|
1321
|
-
}
|
|
1322
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, getExports, "getExports");
|
|
1323
|
-
function emitDtsFiles(workspaceConfig, program, host, emitOnlyDtsFiles = true, customTransformers) {
|
|
1324
|
-
const fileMapping = /* @__PURE__ */ new Map();
|
|
1325
|
-
const writeFile3 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => {
|
|
1326
|
-
const sourceFile = _optionalChain([sourceFiles, 'optionalAccess', _73 => _73[0]]);
|
|
1327
|
-
const sourceFileName = _optionalChain([sourceFile, 'optionalAccess', _74 => _74.fileName]);
|
|
1328
|
-
if (sourceFileName && !fileName.endsWith(".map")) {
|
|
1329
|
-
const cwd = program.getCurrentDirectory();
|
|
1330
|
-
fileMapping.set(toAbsolutePath(workspaceConfig, sourceFileName, cwd), toAbsolutePath(workspaceConfig, fileName, cwd));
|
|
1331
|
-
}
|
|
1332
|
-
return host.writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
|
|
1333
|
-
}, "writeFile");
|
|
1334
|
-
const emitResult = program.emit(void 0, writeFile3, void 0, emitOnlyDtsFiles, customTransformers);
|
|
1335
|
-
const diagnostics = _typescript2.default.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);
|
|
1336
|
-
const diagnosticMessages = [];
|
|
1337
|
-
diagnostics.forEach((diagnostic) => {
|
|
1338
|
-
if (diagnostic.file) {
|
|
1339
|
-
const { line, character } = _typescript2.default.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start);
|
|
1340
|
-
const message = _typescript2.default.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
|
|
1341
|
-
diagnosticMessages.push(`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);
|
|
1342
|
-
} else {
|
|
1343
|
-
const message = _typescript2.default.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
|
|
1344
|
-
diagnosticMessages.push(message);
|
|
1345
|
-
}
|
|
1346
|
-
});
|
|
1347
|
-
const diagnosticMessage = diagnosticMessages.join("\n");
|
|
1348
|
-
if (diagnosticMessage) {
|
|
1349
|
-
_chunkTEEOPHLZjs.writeError.call(void 0, `Failed to emit declaration files.
|
|
1350
|
-
|
|
1351
|
-
${diagnosticMessage}`, workspaceConfig);
|
|
1352
|
-
throw new Error("TypeScript compilation failed");
|
|
1353
|
-
}
|
|
1354
|
-
return fileMapping;
|
|
1355
|
-
}
|
|
1356
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, emitDtsFiles, "emitDtsFiles");
|
|
1357
|
-
function emitDts(workspaceConfig, tsconfig, tsconfigRaw, emitOnlyDtsFiles = true, customTransformers) {
|
|
1358
|
-
const rawTsconfig = _bundlerequire.loadTsConfig.call(void 0, workspaceConfig.workspaceRoot, tsconfig);
|
|
1359
|
-
if (!rawTsconfig) {
|
|
1360
|
-
throw new Error(`Unable to find ${tsconfig || "tsconfig.json"} in ${workspaceConfig.workspaceRoot}`);
|
|
1361
|
-
}
|
|
1362
|
-
const declarationDir = ensureTempDeclarationDir(workspaceConfig);
|
|
1363
|
-
const parsedTsconfig = _typescript2.default.parseJsonConfigFileContent(_defu2.default.call(void 0, {
|
|
1364
|
-
compilerOptions: {
|
|
1365
|
-
// Enable declaration emit and disable javascript emit
|
|
1366
|
-
noEmit: false,
|
|
1367
|
-
declaration: true,
|
|
1368
|
-
declarationMap: true,
|
|
1369
|
-
declarationDir,
|
|
1370
|
-
emitDeclarationOnly: true
|
|
1371
|
-
}
|
|
1372
|
-
}, _nullishCoalesce(_optionalChain([tsconfigRaw, 'optionalAccess', _75 => _75.compilerOptions]), () => ( {})), _nullishCoalesce(rawTsconfig.data, () => ( {}))), _typescript2.default.sys, tsconfig ? _path.dirname.call(void 0, tsconfig) : "./");
|
|
1373
|
-
const options = parsedTsconfig.options;
|
|
1374
|
-
const host = _typescript2.default.createCompilerHost(options);
|
|
1375
|
-
const program = _typescript2.default.createProgram(parsedTsconfig.fileNames, options, host);
|
|
1376
|
-
const fileMapping = emitDtsFiles(workspaceConfig, program, host, emitOnlyDtsFiles, customTransformers);
|
|
1377
|
-
return getExports(workspaceConfig, program, fileMapping);
|
|
1378
|
-
}
|
|
1379
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, emitDts, "emitDts");
|
|
1380
|
-
|
|
1381
|
-
// ../esbuild/src/utilities/get-entry-points.ts
|
|
1382
|
-
|
|
1383
|
-
var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
|
|
1384
|
-
const workspaceRoot3 = config.workspaceRoot || _chunkTEEOPHLZjs.findWorkspaceRoot.call(void 0, );
|
|
1385
|
-
const entryPoints = [];
|
|
1386
|
-
if (entry) {
|
|
1387
|
-
if (typeof entry === "string") {
|
|
1388
|
-
entryPoints.push({
|
|
1389
|
-
in: entry,
|
|
1390
|
-
out: entry
|
|
1391
|
-
});
|
|
1392
|
-
} else if (Array.isArray(entry)) {
|
|
1393
|
-
entryPoints.push(...entry.map((entry2) => ({
|
|
1394
|
-
in: entry2,
|
|
1395
|
-
out: entry2
|
|
1396
|
-
})));
|
|
1397
|
-
} else {
|
|
1398
|
-
entryPoints.push(...Object.entries(entry).map(([key, value]) => {
|
|
1399
|
-
if (typeof value === "string") {
|
|
1400
|
-
return {
|
|
1401
|
-
in: value,
|
|
1402
|
-
out: key
|
|
1403
|
-
};
|
|
1404
|
-
} else {
|
|
1405
|
-
return {
|
|
1406
|
-
in: key,
|
|
1407
|
-
out: key
|
|
1408
|
-
};
|
|
1409
|
-
}
|
|
1410
|
-
}));
|
|
1411
|
-
}
|
|
1412
|
-
}
|
|
1413
|
-
if (emitOnAll) {
|
|
1414
|
-
entryPoints.push({
|
|
1415
|
-
in: _chunkTEEOPHLZjs.joinPaths.call(void 0, workspaceRoot3, sourceRoot || projectRoot, "**/*.{ts,tsx}"),
|
|
1416
|
-
out: _chunkTEEOPHLZjs.joinPaths.call(void 0, workspaceRoot3, sourceRoot || projectRoot, "**/*.{ts,tsx}")
|
|
1417
|
-
});
|
|
1418
|
-
}
|
|
1419
|
-
const results = await Promise.all(entryPoints.map(async (entryPoint) => {
|
|
1420
|
-
const paths = [];
|
|
1421
|
-
if (entryPoint.in.includes("*")) {
|
|
1422
|
-
const files = await _glob.glob.call(void 0, entryPoint.in, {
|
|
1423
|
-
withFileTypes: true,
|
|
1424
|
-
ignore: [
|
|
1425
|
-
"**/node_modules/**"
|
|
1426
|
-
]
|
|
1427
|
-
});
|
|
1428
|
-
paths.push(...files.reduce((ret, filePath) => {
|
|
1429
|
-
const result = _chunkTEEOPHLZjs.correctPaths.call(void 0, _chunkTEEOPHLZjs.joinPaths.call(void 0, filePath.path, filePath.name).replaceAll(_chunkTEEOPHLZjs.correctPaths.call(void 0, workspaceRoot3), "").replaceAll(_chunkTEEOPHLZjs.correctPaths.call(void 0, projectRoot), ""));
|
|
1430
|
-
if (result) {
|
|
1431
|
-
_chunkTEEOPHLZjs.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunkTEEOPHLZjs.joinPaths.call(void 0, filePath.path, filePath.name)}"`, config);
|
|
1432
|
-
if (!paths.some((p) => p.in === result)) {
|
|
1433
|
-
paths.push({
|
|
1434
|
-
in: result,
|
|
1435
|
-
out: entryPoint.out.replace(entryPoint.in, result)
|
|
1436
|
-
});
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1439
|
-
return ret;
|
|
1440
|
-
}, []));
|
|
1441
|
-
} else {
|
|
1442
|
-
_chunkTEEOPHLZjs.writeDebug.call(void 0, `Adding ESBuild entry point
|
|
1443
|
-
- Input: ${entryPoint.in}
|
|
1444
|
-
- Output: ${entryPoint.out}`, config);
|
|
1445
|
-
if (!paths.some((p) => p.out === entryPoint.out)) {
|
|
1446
|
-
paths.push(entryPoint);
|
|
1447
|
-
}
|
|
1448
|
-
}
|
|
1449
|
-
return paths;
|
|
1450
|
-
}));
|
|
1451
|
-
return results.filter(Boolean).reduce((ret, result) => {
|
|
1452
|
-
result.forEach((res) => {
|
|
1453
|
-
if (res && !ret.some((p) => p.in === res.in)) {
|
|
1454
|
-
ret.push(res);
|
|
1455
|
-
}
|
|
1456
|
-
});
|
|
1457
|
-
return ret;
|
|
1458
|
-
}, []);
|
|
1459
|
-
}, "getEntryPoints");
|
|
1460
|
-
|
|
1461
|
-
// ../esbuild/src/utilities/helpers.ts
|
|
1462
|
-
function handleSync(fn) {
|
|
1463
|
-
try {
|
|
1464
|
-
return fn();
|
|
1465
|
-
} catch (error_) {
|
|
1466
|
-
return error_;
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, handleSync, "handleSync");
|
|
1470
|
-
async function handleAsync(fn) {
|
|
1471
|
-
try {
|
|
1472
|
-
return await fn();
|
|
1473
|
-
} catch (error_) {
|
|
1474
|
-
return error_;
|
|
1475
|
-
}
|
|
1476
|
-
}
|
|
1477
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, handleAsync, "handleAsync");
|
|
1478
|
-
var handle = handleSync;
|
|
1479
|
-
handle.async = handleAsync;
|
|
1480
|
-
var skip = Symbol("skip");
|
|
1481
|
-
function transduceSync(list, transformer) {
|
|
1482
|
-
const transduced = [];
|
|
1483
|
-
for (const [i, element_] of list.entries()) {
|
|
1484
|
-
const transformed = transformer(element_, i);
|
|
1485
|
-
if (transformed !== skip) {
|
|
1486
|
-
transduced[transduced.length] = transformed;
|
|
1487
|
-
}
|
|
1488
|
-
}
|
|
1489
|
-
return transduced;
|
|
1490
|
-
}
|
|
1491
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, transduceSync, "transduceSync");
|
|
1492
|
-
async function transduceAsync(list, transformer) {
|
|
1493
|
-
const transduced = [];
|
|
1494
|
-
await Promise.all(list.entries().map(async ([i, element_]) => {
|
|
1495
|
-
const transformed = await transformer(element_, i);
|
|
1496
|
-
if (transformed !== skip) {
|
|
1497
|
-
transduced[transduced.length] = transformed;
|
|
1498
|
-
}
|
|
1499
|
-
}));
|
|
1500
|
-
return transduced;
|
|
1501
|
-
}
|
|
1502
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, transduceAsync, "transduceAsync");
|
|
1503
|
-
var transduce = transduceSync;
|
|
1504
|
-
transduce.async = transduceAsync;
|
|
1505
|
-
function pipeSync(fn, ...fns) {
|
|
1506
|
-
return (...args) => {
|
|
1507
|
-
let result = fn(...args);
|
|
1508
|
-
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1509
|
-
result = _optionalChain([fns, 'access', _76 => _76[i], 'optionalCall', _77 => _77(result)]);
|
|
1510
|
-
}
|
|
1511
|
-
return result;
|
|
1512
|
-
};
|
|
1513
|
-
}
|
|
1514
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, pipeSync, "pipeSync");
|
|
1515
|
-
function pipeAsync(fn, ...fns) {
|
|
1516
|
-
return async (...args) => {
|
|
1517
|
-
let result = await fn(...args);
|
|
1518
|
-
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
1519
|
-
result = await _optionalChain([fns, 'access', _78 => _78[i], 'optionalCall', _79 => _79(result)]);
|
|
1520
|
-
}
|
|
1521
|
-
return result;
|
|
1522
|
-
};
|
|
1523
|
-
}
|
|
1524
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, pipeAsync, "pipeAsync");
|
|
1525
|
-
var pipe = pipeSync;
|
|
1526
|
-
pipe.async = pipeAsync;
|
|
1527
|
-
|
|
1528
773
|
// ../esbuild/src/build.ts
|
|
1529
|
-
|
|
774
|
+
async function resolveContext(userOptions) {
|
|
1530
775
|
const projectRoot = userOptions.projectRoot;
|
|
1531
776
|
const workspaceRoot3 = _findworkspaceroot.findWorkspaceRoot.call(void 0, projectRoot);
|
|
1532
777
|
if (!workspaceRoot3) {
|
|
1533
778
|
throw new Error("Cannot find Nx workspace root");
|
|
1534
779
|
}
|
|
1535
|
-
const
|
|
1536
|
-
|
|
1537
|
-
|
|
780
|
+
const workspaceConfig = await _chunkIVLCYFXDjs.getWorkspaceConfig.call(void 0, true, {
|
|
781
|
+
workspaceRoot: workspaceRoot3.dir
|
|
782
|
+
});
|
|
783
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", workspaceConfig);
|
|
784
|
+
const stopwatch = _chunkV7LBWOVVjs.getStopwatch.call(void 0, "Build options resolution");
|
|
1538
785
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
1539
786
|
exitOnError: true
|
|
1540
787
|
});
|
|
1541
|
-
const projectJsonPath =
|
|
788
|
+
const projectJsonPath = _chunkV7LBWOVVjs.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "project.json");
|
|
1542
789
|
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
1543
790
|
throw new Error("Cannot find project.json configuration");
|
|
1544
791
|
}
|
|
1545
792
|
const projectJsonFile = await _promises2.default.readFile(projectJsonPath, "utf8");
|
|
1546
793
|
const projectJson = JSON.parse(projectJsonFile);
|
|
1547
|
-
const projectName = projectJson.name;
|
|
794
|
+
const projectName = projectJson.name || userOptions.name;
|
|
1548
795
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
1549
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
796
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _52 => _52.projects, 'optionalAccess', _53 => _53[projectName]])) {
|
|
1550
797
|
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.");
|
|
1551
798
|
}
|
|
1552
799
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
|
|
1553
800
|
options.name ??= `${projectName}-${options.format}`;
|
|
1554
801
|
options.target ??= DEFAULT_TARGET;
|
|
1555
|
-
const packageJsonPath =
|
|
802
|
+
const packageJsonPath = _chunkV7LBWOVVjs.joinPaths.call(void 0, workspaceRoot3.dir, options.projectRoot, "package.json");
|
|
1556
803
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1557
804
|
throw new Error("Cannot find package.json configuration");
|
|
1558
805
|
}
|
|
1559
806
|
const env = getEnv("esbuild", options);
|
|
1560
|
-
const
|
|
807
|
+
const resolvedOptions = {
|
|
1561
808
|
...options,
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
] : [
|
|
1567
|
-
"browser",
|
|
1568
|
-
"module",
|
|
1569
|
-
"main"
|
|
1570
|
-
],
|
|
809
|
+
tsconfig: _chunkV7LBWOVVjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
810
|
+
distDir: "dist",
|
|
811
|
+
name: projectName,
|
|
812
|
+
metafile: userOptions.mode === "development",
|
|
1571
813
|
...userOptions,
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
outdir: userOptions.outputPath || _chunkTEEOPHLZjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
1576
|
-
distDir: userOptions.distDir || "dist",
|
|
1577
|
-
plugins: [],
|
|
1578
|
-
name: userOptions.name || projectName,
|
|
1579
|
-
projectConfigurations,
|
|
1580
|
-
projectName,
|
|
1581
|
-
projectGraph,
|
|
1582
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkTEEOPHLZjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
1583
|
-
minify: userOptions.minify || !userOptions.debug,
|
|
1584
|
-
verbose: userOptions.verbose || _chunkTEEOPHLZjs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
1585
|
-
includeSrc: userOptions.includeSrc === true,
|
|
1586
|
-
metafile: userOptions.metafile !== false,
|
|
1587
|
-
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
1588
|
-
clean: userOptions.clean !== false,
|
|
1589
|
-
assets: _nullishCoalesce(userOptions.assets, () => ( [])),
|
|
1590
|
-
injectShims: userOptions.injectShims !== true,
|
|
1591
|
-
bundle: userOptions.bundle !== false,
|
|
1592
|
-
keepNames: true,
|
|
1593
|
-
watch: userOptions.watch === true,
|
|
1594
|
-
footer: userOptions.footer,
|
|
1595
|
-
banner: {
|
|
1596
|
-
js: options.banner || DEFAULT_COMPILED_BANNER,
|
|
1597
|
-
css: options.banner || DEFAULT_COMPILED_BANNER
|
|
1598
|
-
},
|
|
1599
|
-
splitting: options.format === "iife" ? false : typeof options.splitting === "boolean" ? options.splitting : options.format === "esm",
|
|
1600
|
-
treeShaking: options.format === "esm",
|
|
814
|
+
clean: false,
|
|
815
|
+
target: userOptions.target || options.target,
|
|
816
|
+
splitting: options.format === "iife" ? false : options.treeshake === void 0 ? options.splitting : true,
|
|
1601
817
|
env,
|
|
1602
818
|
define: {
|
|
1603
|
-
STORM_FORMAT: JSON.stringify(options.format
|
|
1604
|
-
...options.format === "cjs" && options.injectShims ? {
|
|
1605
|
-
"import.meta.url": "importMetaUrl"
|
|
1606
|
-
} : {},
|
|
819
|
+
STORM_FORMAT: JSON.stringify(options.format),
|
|
1607
820
|
...options.define,
|
|
1608
821
|
...Object.keys(env || {}).reduce((res, key) => {
|
|
1609
822
|
const value = JSON.stringify(env[key]);
|
|
@@ -1614,167 +827,98 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1614
827
|
[`import.meta.env.${safeKey}`]: value
|
|
1615
828
|
};
|
|
1616
829
|
}, {})
|
|
1617
|
-
}
|
|
1618
|
-
inject: [
|
|
1619
|
-
options.format === "cjs" && options.injectShims ? _chunkTEEOPHLZjs.joinPaths.call(void 0, __dirname, "../assets/cjs_shims.js") : void 0,
|
|
1620
|
-
options.format === "esm" && options.injectShims && options.platform === "node" ? _chunkTEEOPHLZjs.joinPaths.call(void 0, __dirname, "../assets/esm_shims.js") : void 0
|
|
1621
|
-
].filter(Boolean)
|
|
830
|
+
}
|
|
1622
831
|
};
|
|
1623
|
-
result.plugins = _nullishCoalesce(userOptions.plugins, () => ( getDefaultBuildPlugins(userOptions, result)));
|
|
1624
|
-
if (options.inject && Array.isArray(options.inject) && options.inject.length > 0) {
|
|
1625
|
-
result.inject = options.inject.reduce((ret, inj) => {
|
|
1626
|
-
if (inj && typeof inj === "string" && ret.includes(inj)) {
|
|
1627
|
-
ret.push(inj);
|
|
1628
|
-
}
|
|
1629
|
-
return ret;
|
|
1630
|
-
}, result.inject);
|
|
1631
|
-
}
|
|
1632
|
-
delete result.entry;
|
|
1633
|
-
delete result.outputPath;
|
|
1634
832
|
stopwatch();
|
|
1635
|
-
return
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
833
|
+
return {
|
|
834
|
+
options: resolvedOptions,
|
|
835
|
+
clean: userOptions.clean !== false,
|
|
836
|
+
workspaceConfig,
|
|
837
|
+
projectConfigurations,
|
|
838
|
+
projectName,
|
|
839
|
+
projectGraph,
|
|
840
|
+
sourceRoot: resolvedOptions.sourceRoot || projectJson.sourceRoot || _chunkV7LBWOVVjs.joinPaths.call(void 0, resolvedOptions.projectRoot, "src"),
|
|
841
|
+
outputPath: resolvedOptions.outputPath || _chunkV7LBWOVVjs.joinPaths.call(void 0, workspaceConfig.workspaceRoot, "dist", resolvedOptions.projectRoot),
|
|
842
|
+
minify: resolvedOptions.minify || resolvedOptions.mode === "production"
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
_chunkJ5SB6L2Ljs.__name.call(void 0, resolveContext, "resolveContext");
|
|
846
|
+
async function generatePackageJson(context) {
|
|
847
|
+
if (context.options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkV7LBWOVVjs.joinPaths.call(void 0, context.options.projectRoot, "package.json"))) {
|
|
848
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context.workspaceConfig);
|
|
849
|
+
const stopwatch = _chunkV7LBWOVVjs.getStopwatch.call(void 0, "Write package.json file");
|
|
850
|
+
const packageJsonPath = _chunkV7LBWOVVjs.joinPaths.call(void 0, context.options.projectRoot, "project.json");
|
|
1642
851
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1643
852
|
throw new Error("Cannot find package.json configuration");
|
|
1644
853
|
}
|
|
1645
|
-
const packageJsonFile = await _promises2.default.readFile(
|
|
854
|
+
const packageJsonFile = await _promises2.default.readFile(_chunkV7LBWOVVjs.joinPaths.call(void 0, context.workspaceConfig.workspaceRoot, context.options.projectRoot, "package.json"), "utf8");
|
|
1646
855
|
let packageJson = JSON.parse(packageJsonFile);
|
|
1647
856
|
if (!packageJson) {
|
|
1648
857
|
throw new Error("Cannot find package.json configuration file");
|
|
1649
858
|
}
|
|
1650
|
-
packageJson = await addPackageDependencies(
|
|
1651
|
-
packageJson = await addWorkspacePackageJsonFields(
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
859
|
+
packageJson = await addPackageDependencies(context.workspaceConfig.workspaceRoot, context.options.projectRoot, context.projectName, packageJson);
|
|
860
|
+
packageJson = await addWorkspacePackageJsonFields(context.workspaceConfig, context.options.projectRoot, context.sourceRoot, context.projectName, false, packageJson);
|
|
861
|
+
if (context.options.entry) {
|
|
862
|
+
packageJson.exports ??= {};
|
|
863
|
+
packageJson.exports["./package.json"] ??= "./package.json";
|
|
864
|
+
packageJson.exports["."] ??= `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index.js`;
|
|
865
|
+
const entryPoints = Array.isArray(context.options.entry) ? context.options.entry : Object.keys(context.options.entry);
|
|
866
|
+
for (const entryPoint of entryPoints) {
|
|
867
|
+
if (context.options.entry[entryPoint]) {
|
|
868
|
+
const entry = context.options.entry[entryPoint].replaceAll("\\", "/").replaceAll(/^(\.\/)*/g, "").replace(/\.([cm])?[jt]s(x)?$/g, "");
|
|
869
|
+
packageJson.exports[`./${entry}`] ??= `.${context.options.distDir ? `/${context.options.distDir}` : ""}/${entry}.js`;
|
|
870
|
+
}
|
|
1659
871
|
}
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
packageJson.main = packageJson.type === "commonjs" ? `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.js` : `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.cjs`;
|
|
1665
|
-
}
|
|
1666
|
-
packageJson.types = `.${context2.options.distDir ? `/${context2.options.distDir}` : ""}/index.d.ts`;
|
|
1667
|
-
packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
|
|
1668
|
-
if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
|
|
1669
|
-
ret[key.replace("/index", "")] = packageJson.exports[key];
|
|
872
|
+
if (context.options.format === "esm") {
|
|
873
|
+
packageJson.module = packageJson.type === "module" ? `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index.js` : `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index.mjs`;
|
|
874
|
+
} else {
|
|
875
|
+
packageJson.main = packageJson.type === "commonjs" ? `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index.js` : `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index.cjs`;
|
|
1670
876
|
}
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
877
|
+
packageJson.types = `.${context.options.distDir ? `/${context.options.distDir}` : ""}/index.d.ts`;
|
|
878
|
+
packageJson.exports = Object.keys(packageJson.exports).reduce((ret, key) => {
|
|
879
|
+
if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
|
|
880
|
+
ret[key.replace("/index", "")] = packageJson.exports[key];
|
|
881
|
+
}
|
|
882
|
+
return ret;
|
|
883
|
+
}, packageJson.exports);
|
|
884
|
+
}
|
|
885
|
+
await _devkit.writeJsonFile.call(void 0, _chunkV7LBWOVVjs.joinPaths.call(void 0, context.outputPath, "package.json"), packageJson);
|
|
1674
886
|
stopwatch();
|
|
1675
887
|
}
|
|
1676
|
-
return
|
|
888
|
+
return context;
|
|
1677
889
|
}
|
|
1678
890
|
_chunkJ5SB6L2Ljs.__name.call(void 0, generatePackageJson, "generatePackageJson");
|
|
1679
|
-
async function
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
const options = await getOptions();
|
|
1688
|
-
const rendererEngine = new RendererEngine([
|
|
1689
|
-
shebangRenderer,
|
|
1690
|
-
...options.renderers || []
|
|
1691
|
-
]);
|
|
1692
|
-
return {
|
|
1693
|
-
options,
|
|
1694
|
-
rendererEngine
|
|
1695
|
-
};
|
|
1696
|
-
}
|
|
1697
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, generateContext, "generateContext");
|
|
1698
|
-
async function executeEsBuild(context2) {
|
|
1699
|
-
_chunkTEEOPHLZjs.writeDebug.call(void 0, ` \u{1F680} Running ${context2.options.name} build`, context2.options.config);
|
|
1700
|
-
const stopwatch = _chunkTEEOPHLZjs.getStopwatch.call(void 0, `${context2.options.name} build`);
|
|
1701
|
-
if (process.env.STORM_WATCH) {
|
|
1702
|
-
const ctx = await esbuild2.context(context2.options);
|
|
1703
|
-
watch(ctx, context2.options);
|
|
1704
|
-
}
|
|
1705
|
-
const options = {
|
|
1706
|
-
...context2.options
|
|
1707
|
-
};
|
|
1708
|
-
options.outdir = _chunkTEEOPHLZjs.joinPaths.call(void 0, context2.options.outdir, context2.options.distDir);
|
|
1709
|
-
if (!options.inject || !Array.isArray(options.inject) || options.inject.length === 0 || // eslint-disable-next-line no-constant-binary-expression, @typescript-eslint/no-explicit-any
|
|
1710
|
-
options.inject === {}) {
|
|
1711
|
-
delete options.inject;
|
|
1712
|
-
}
|
|
1713
|
-
delete options.dts;
|
|
1714
|
-
delete options.env;
|
|
1715
|
-
delete options.name;
|
|
1716
|
-
delete options.assets;
|
|
1717
|
-
delete options.mode;
|
|
1718
|
-
delete options.orgName;
|
|
1719
|
-
delete options.watch;
|
|
1720
|
-
delete options.clean;
|
|
1721
|
-
delete options.debug;
|
|
1722
|
-
delete options.generatePackageJson;
|
|
1723
|
-
delete options.distDir;
|
|
1724
|
-
delete options.includeSrc;
|
|
1725
|
-
delete options.verbose;
|
|
1726
|
-
delete options.projectRoot;
|
|
1727
|
-
delete options.projectName;
|
|
1728
|
-
delete options.projectGraph;
|
|
1729
|
-
delete options.projectConfigurations;
|
|
1730
|
-
delete options.renderers;
|
|
1731
|
-
delete options.config;
|
|
1732
|
-
delete options.injectShims;
|
|
1733
|
-
delete options.external;
|
|
1734
|
-
_chunkTEEOPHLZjs.writeTrace.call(void 0, `Run esbuild (${context2.options.name}) with the following options:
|
|
1735
|
-
${_chunkTEEOPHLZjs.formatLogMessage.call(void 0, {
|
|
1736
|
-
...options,
|
|
1737
|
-
define: "<Hidden>"
|
|
1738
|
-
})}`, context2.options.config);
|
|
1739
|
-
const result = await esbuild2.build(options);
|
|
1740
|
-
await esbuild2.stop();
|
|
1741
|
-
if (result.metafile) {
|
|
1742
|
-
const metafilePath = `${context2.options.outdir}/${context2.options.name}.meta.json`;
|
|
1743
|
-
await _promises2.default.writeFile(metafilePath, JSON.stringify(result.metafile));
|
|
1744
|
-
}
|
|
891
|
+
async function executeTsup(context) {
|
|
892
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, ` \u{1F680} Running ${context.options.name} build`, context.workspaceConfig);
|
|
893
|
+
const stopwatch = _chunkV7LBWOVVjs.getStopwatch.call(void 0, `${context.options.name} build`);
|
|
894
|
+
await _tsup.build.call(void 0, {
|
|
895
|
+
...context.options,
|
|
896
|
+
outDir: context.outputPath,
|
|
897
|
+
workspaceConfig: context.workspaceConfig
|
|
898
|
+
});
|
|
1745
899
|
stopwatch();
|
|
1746
|
-
return
|
|
1747
|
-
}
|
|
1748
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, executeEsBuild, "executeEsBuild");
|
|
1749
|
-
async function executeTypescript(context2) {
|
|
1750
|
-
if (_optionalChain([context2, 'access', _82 => _82.result, 'optionalAccess', _83 => _83.errors, 'access', _84 => _84.length]) === 0 && context2.options.dts) {
|
|
1751
|
-
_chunkTEEOPHLZjs.writeDebug.call(void 0, ` \u{1F4CB} Running TypeScript Compiler for ${context2.options.name}`, context2.options.config);
|
|
1752
|
-
const stopwatch = _chunkTEEOPHLZjs.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
|
|
1753
|
-
await emitDts(context2.options.config, context2.options.tsconfig, context2.options.tsconfigRaw, true);
|
|
1754
|
-
stopwatch();
|
|
1755
|
-
}
|
|
1756
|
-
return context2;
|
|
900
|
+
return context;
|
|
1757
901
|
}
|
|
1758
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0,
|
|
1759
|
-
async function copyBuildAssets(
|
|
1760
|
-
if (_optionalChain([
|
|
1761
|
-
|
|
1762
|
-
const stopwatch =
|
|
1763
|
-
await copyAssets(
|
|
902
|
+
_chunkJ5SB6L2Ljs.__name.call(void 0, executeTsup, "executeTsup");
|
|
903
|
+
async function copyBuildAssets(context) {
|
|
904
|
+
if (_optionalChain([context, 'access', _54 => _54.result, 'optionalAccess', _55 => _55.errors, 'access', _56 => _56.length]) === 0) {
|
|
905
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context.outputPath}`, context.workspaceConfig);
|
|
906
|
+
const stopwatch = _chunkV7LBWOVVjs.getStopwatch.call(void 0, `${context.options.name} asset copy`);
|
|
907
|
+
await copyAssets(context.workspaceConfig, _nullishCoalesce(context.options.assets, () => ( [])), context.outputPath, context.options.projectRoot, context.sourceRoot, true, false);
|
|
1764
908
|
stopwatch();
|
|
1765
909
|
}
|
|
1766
|
-
return
|
|
910
|
+
return context;
|
|
1767
911
|
}
|
|
1768
912
|
_chunkJ5SB6L2Ljs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
1769
|
-
async function reportResults(
|
|
1770
|
-
if (_optionalChain([
|
|
1771
|
-
if (
|
|
1772
|
-
|
|
913
|
+
async function reportResults(context) {
|
|
914
|
+
if (_optionalChain([context, 'access', _57 => _57.result, 'optionalAccess', _58 => _58.errors, 'access', _59 => _59.length]) === 0) {
|
|
915
|
+
if (context.result.warnings.length > 0) {
|
|
916
|
+
_chunkV7LBWOVVjs.writeWarning.call(void 0, ` \u{1F6A7} The following warnings occurred during the build: ${context.result.warnings.map((warning) => warning.text).join("\n")}`, context.workspaceConfig);
|
|
1773
917
|
}
|
|
1774
|
-
|
|
1775
|
-
} else if (_optionalChain([
|
|
1776
|
-
|
|
1777
|
-
throw new Error(`The ${
|
|
918
|
+
_chunkV7LBWOVVjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${context.options.name} build completed successfully`, context.workspaceConfig);
|
|
919
|
+
} else if (_optionalChain([context, 'access', _60 => _60.result, 'optionalAccess', _61 => _61.errors]) && _optionalChain([context, 'access', _62 => _62.result, 'optionalAccess', _63 => _63.errors, 'access', _64 => _64.length]) > 0) {
|
|
920
|
+
_chunkV7LBWOVVjs.writeError.call(void 0, ` \u274C The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`, context.workspaceConfig);
|
|
921
|
+
throw new Error(`The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`);
|
|
1778
922
|
}
|
|
1779
923
|
}
|
|
1780
924
|
_chunkJ5SB6L2Ljs.__name.call(void 0, reportResults, "reportResults");
|
|
@@ -1785,7 +929,7 @@ async function dependencyCheck(options) {
|
|
|
1785
929
|
if (process.env.CI && !process.env.BUILDKITE) {
|
|
1786
930
|
return void 0;
|
|
1787
931
|
}
|
|
1788
|
-
const buildPromise =
|
|
932
|
+
const buildPromise = esbuild.build({
|
|
1789
933
|
entryPoints: _globby.globbySync.call(void 0, "**/*.{j,t}s", {
|
|
1790
934
|
// We don't check dependencies in ecosystem tests because tests are isolated from the build.
|
|
1791
935
|
ignore: [
|
|
@@ -1808,19 +952,19 @@ async function dependencyCheck(options) {
|
|
|
1808
952
|
return void 0;
|
|
1809
953
|
}
|
|
1810
954
|
_chunkJ5SB6L2Ljs.__name.call(void 0, dependencyCheck, "dependencyCheck");
|
|
1811
|
-
async function cleanOutputPath(
|
|
1812
|
-
if (
|
|
1813
|
-
|
|
1814
|
-
const stopwatch =
|
|
1815
|
-
await cleanDirectories(
|
|
955
|
+
async function cleanOutputPath(context) {
|
|
956
|
+
if (context.clean !== false && context.outputPath) {
|
|
957
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${context.options.name} output path: ${context.outputPath}`, context.workspaceConfig);
|
|
958
|
+
const stopwatch = _chunkV7LBWOVVjs.getStopwatch.call(void 0, `${context.options.name} output clean`);
|
|
959
|
+
await cleanDirectories(context.outputPath);
|
|
1816
960
|
stopwatch();
|
|
1817
961
|
}
|
|
1818
|
-
return
|
|
962
|
+
return context;
|
|
1819
963
|
}
|
|
1820
964
|
_chunkJ5SB6L2Ljs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
|
|
1821
|
-
async function
|
|
1822
|
-
|
|
1823
|
-
const stopwatch =
|
|
965
|
+
async function build2(options) {
|
|
966
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, ` \u26A1 Executing Storm ESBuild pipeline`);
|
|
967
|
+
const stopwatch = _chunkV7LBWOVVjs.getStopwatch.call(void 0, "ESBuild pipeline");
|
|
1824
968
|
try {
|
|
1825
969
|
const opts = Array.isArray(options) ? options : [
|
|
1826
970
|
options
|
|
@@ -1828,57 +972,36 @@ async function build3(options) {
|
|
|
1828
972
|
if (opts.length === 0) {
|
|
1829
973
|
throw new Error("No build options were provided");
|
|
1830
974
|
}
|
|
1831
|
-
|
|
1832
|
-
await
|
|
1833
|
-
|
|
975
|
+
const context = await resolveContext(options);
|
|
976
|
+
await cleanOutputPath(context);
|
|
977
|
+
await Promise.all([
|
|
978
|
+
dependencyCheck(context.options),
|
|
979
|
+
generatePackageJson(context),
|
|
980
|
+
copyBuildAssets(context),
|
|
981
|
+
executeTsup(context)
|
|
982
|
+
]);
|
|
983
|
+
await reportResults(context);
|
|
984
|
+
_chunkV7LBWOVVjs.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
|
|
1834
985
|
} catch (error) {
|
|
1835
|
-
|
|
986
|
+
_chunkV7LBWOVVjs.writeFatal.call(void 0, "Fatal errors that the build process could not recover from have occured. The build process has been terminated.");
|
|
1836
987
|
throw error;
|
|
1837
988
|
} finally {
|
|
1838
989
|
stopwatch();
|
|
1839
990
|
}
|
|
1840
991
|
}
|
|
1841
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0,
|
|
1842
|
-
var watch = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (context2, options) => {
|
|
1843
|
-
if (!options.watch) {
|
|
1844
|
-
return context2;
|
|
1845
|
-
}
|
|
1846
|
-
const config = {
|
|
1847
|
-
ignoreInitial: true,
|
|
1848
|
-
useFsEvents: true,
|
|
1849
|
-
ignored: [
|
|
1850
|
-
"./src/__tests__/**/*",
|
|
1851
|
-
"./package.json"
|
|
1852
|
-
]
|
|
1853
|
-
};
|
|
1854
|
-
const changeWatcher = _chokidar.watch.call(void 0, [
|
|
1855
|
-
"./src/**/*"
|
|
1856
|
-
], config);
|
|
1857
|
-
const fastRebuild = _estoolkit.debounce.call(void 0, async () => {
|
|
1858
|
-
const timeBefore = Date.now();
|
|
1859
|
-
const rebuildResult = await handle.async(() => {
|
|
1860
|
-
return context2.rebuild();
|
|
1861
|
-
});
|
|
1862
|
-
if (rebuildResult instanceof Error) {
|
|
1863
|
-
_chunkTEEOPHLZjs.writeError.call(void 0, rebuildResult.message);
|
|
1864
|
-
}
|
|
1865
|
-
_chunkTEEOPHLZjs.writeTrace.call(void 0, `${Date.now() - timeBefore}ms [${_nullishCoalesce(options.name, () => ( ""))}]`);
|
|
1866
|
-
}, 10);
|
|
1867
|
-
changeWatcher.on("change", fastRebuild);
|
|
1868
|
-
return void 0;
|
|
1869
|
-
}, "watch");
|
|
992
|
+
_chunkJ5SB6L2Ljs.__name.call(void 0, build2, "build");
|
|
1870
993
|
|
|
1871
994
|
// ../workspace-tools/src/executors/esbuild/executor.ts
|
|
1872
|
-
async function esbuildExecutorFn(options,
|
|
1873
|
-
|
|
1874
|
-
if (!_optionalChain([
|
|
995
|
+
async function esbuildExecutorFn(options, context, config) {
|
|
996
|
+
_chunkV7LBWOVVjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
|
|
997
|
+
if (!_optionalChain([context, 'access', _65 => _65.projectsConfigurations, 'optionalAccess', _66 => _66.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName] || !_optionalChain([context, 'access', _67 => _67.projectsConfigurations, 'access', _68 => _68.projects, 'access', _69 => _69[context.projectName], 'optionalAccess', _70 => _70.root])) {
|
|
1875
998
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
1876
999
|
}
|
|
1877
|
-
await
|
|
1000
|
+
await build2({
|
|
1878
1001
|
...options,
|
|
1879
|
-
projectRoot: _optionalChain([
|
|
1880
|
-
|
|
1881
|
-
sourceRoot: _optionalChain([
|
|
1002
|
+
projectRoot: _optionalChain([context, 'access', _71 => _71.projectsConfigurations, 'access', _72 => _72.projects, 'optionalAccess', _73 => _73[context.projectName], 'access', _74 => _74.root]),
|
|
1003
|
+
name: context.projectName,
|
|
1004
|
+
sourceRoot: _optionalChain([context, 'access', _75 => _75.projectsConfigurations, 'access', _76 => _76.projects, 'optionalAccess', _77 => _77[context.projectName], 'optionalAccess', _78 => _78.sourceRoot]),
|
|
1882
1005
|
format: options.format,
|
|
1883
1006
|
platform: options.format
|
|
1884
1007
|
});
|
|
@@ -1912,7 +1035,7 @@ var _prettier = require('prettier');
|
|
|
1912
1035
|
var _readyamlfile = require('read-yaml-file'); var _readyamlfile2 = _interopRequireDefault(_readyamlfile);
|
|
1913
1036
|
|
|
1914
1037
|
// ../workspace-tools/src/executors/npm-publish/executor.ts
|
|
1915
|
-
var
|
|
1038
|
+
var LARGE_BUFFER2 = 1024 * 1e6;
|
|
1916
1039
|
|
|
1917
1040
|
// ../workspace-tools/src/executors/size-limit/executor.ts
|
|
1918
1041
|
|
|
@@ -1920,19 +1043,19 @@ var _esbuild2 = require('@size-limit/esbuild'); var _esbuild3 = _interopRequireD
|
|
|
1920
1043
|
var _esbuildwhy = require('@size-limit/esbuild-why'); var _esbuildwhy2 = _interopRequireDefault(_esbuildwhy);
|
|
1921
1044
|
var _file = require('@size-limit/file'); var _file2 = _interopRequireDefault(_file);
|
|
1922
1045
|
var _sizelimit = require('size-limit'); var _sizelimit2 = _interopRequireDefault(_sizelimit);
|
|
1923
|
-
async function sizeLimitExecutorFn(options,
|
|
1924
|
-
if (!_optionalChain([
|
|
1046
|
+
async function sizeLimitExecutorFn(options, context, config) {
|
|
1047
|
+
if (!_optionalChain([context, 'optionalAccess', _79 => _79.projectName]) || !_optionalChain([context, 'access', _80 => _80.projectsConfigurations, 'optionalAccess', _81 => _81.projects]) || !context.projectsConfigurations.projects[context.projectName]) {
|
|
1925
1048
|
throw new Error("The Size-Limit process failed because the context is not valid. Please run this command from a workspace.");
|
|
1926
1049
|
}
|
|
1927
|
-
|
|
1050
|
+
_chunkV7LBWOVVjs.writeInfo.call(void 0, `\u{1F4CF} Running Size-Limit on ${context.projectName}`, config);
|
|
1928
1051
|
_sizelimit2.default.call(void 0, [
|
|
1929
1052
|
_file2.default,
|
|
1930
1053
|
_esbuild3.default,
|
|
1931
1054
|
_esbuildwhy2.default
|
|
1932
1055
|
], {
|
|
1933
|
-
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([
|
|
1056
|
+
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context, 'access', _82 => _82.projectsConfigurations, 'access', _83 => _83.projects, 'access', _84 => _84[context.projectName], 'optionalAccess', _85 => _85.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0, _nullishCoalesce(_optionalChain([context, 'access', _86 => _86.projectsConfigurations, 'access', _87 => _87.projects, 'access', _88 => _88[context.projectName], 'optionalAccess', _89 => _89.root]), () => ( "./")), "src")))
|
|
1934
1057
|
}).then((result) => {
|
|
1935
|
-
|
|
1058
|
+
_chunkV7LBWOVVjs.writeInfo.call(void 0, `\u{1F4CF} ${context.projectName} Size-Limit result: ${JSON.stringify(result)}`, config);
|
|
1936
1059
|
});
|
|
1937
1060
|
return {
|
|
1938
1061
|
success: true
|
|
@@ -1953,11 +1076,11 @@ var _fsextra = require('fs-extra');
|
|
|
1953
1076
|
var _TypiaProgrammerjs = require('typia/lib/programmers/TypiaProgrammer.js');
|
|
1954
1077
|
async function typiaExecutorFn(options, _, config) {
|
|
1955
1078
|
if (options.clean !== false) {
|
|
1956
|
-
|
|
1079
|
+
_chunkV7LBWOVVjs.writeInfo.call(void 0, `\u{1F9F9} Cleaning output path: ${options.outputPath}`, config);
|
|
1957
1080
|
_fsextra.removeSync.call(void 0, options.outputPath);
|
|
1958
1081
|
}
|
|
1959
1082
|
await Promise.all(options.entry.map((entry) => {
|
|
1960
|
-
|
|
1083
|
+
_chunkV7LBWOVVjs.writeInfo.call(void 0, `\u{1F680} Running Typia on entry: ${entry}`, config);
|
|
1961
1084
|
return _TypiaProgrammerjs.TypiaProgrammer.build({
|
|
1962
1085
|
input: entry,
|
|
1963
1086
|
output: options.outputPath,
|
|
@@ -1987,32 +1110,32 @@ var executor_default8 = withRunExecutor("Typia runtime validation generator", ty
|
|
|
1987
1110
|
// ../workspace-tools/src/executors/unbuild/executor.ts
|
|
1988
1111
|
|
|
1989
1112
|
var _jiti = require('jiti');
|
|
1990
|
-
async function unbuildExecutorFn(options,
|
|
1991
|
-
|
|
1992
|
-
if (!_optionalChain([
|
|
1113
|
+
async function unbuildExecutorFn(options, context, config) {
|
|
1114
|
+
_chunkV7LBWOVVjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
|
|
1115
|
+
if (!_optionalChain([context, 'access', _90 => _90.projectsConfigurations, 'optionalAccess', _91 => _91.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
1993
1116
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace root directory.");
|
|
1994
1117
|
}
|
|
1995
|
-
if (!
|
|
1118
|
+
if (!context.projectsConfigurations.projects[context.projectName].root) {
|
|
1996
1119
|
throw new Error("The Build process failed because the project root is not valid. Please run this command from a workspace root directory.");
|
|
1997
1120
|
}
|
|
1998
|
-
if (!
|
|
1121
|
+
if (!context.projectsConfigurations.projects[context.projectName].sourceRoot) {
|
|
1999
1122
|
throw new Error("The Build process failed because the project's source root is not valid. Please run this command from a workspace root directory.");
|
|
2000
1123
|
}
|
|
2001
1124
|
const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
|
|
2002
|
-
fsCache: config.skipCache ? false :
|
|
1125
|
+
fsCache: config.skipCache ? false : _chunkV7LBWOVVjs.joinPaths.call(void 0, config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti"),
|
|
2003
1126
|
interopDefault: true
|
|
2004
1127
|
});
|
|
2005
1128
|
const stormUnbuild = await jiti.import(jiti.esmResolve("@storm-software/unbuild/build"));
|
|
2006
1129
|
await stormUnbuild.build(_defu.defu.call(void 0, {
|
|
2007
1130
|
...options,
|
|
2008
|
-
projectRoot:
|
|
2009
|
-
projectName:
|
|
2010
|
-
sourceRoot:
|
|
1131
|
+
projectRoot: context.projectsConfigurations.projects[context.projectName].root,
|
|
1132
|
+
projectName: context.projectName,
|
|
1133
|
+
sourceRoot: context.projectsConfigurations.projects[context.projectName].sourceRoot,
|
|
2011
1134
|
platform: options.platform
|
|
2012
1135
|
}, {
|
|
2013
1136
|
stubOptions: {
|
|
2014
1137
|
jiti: {
|
|
2015
|
-
fsCache: config.skipCache ? false :
|
|
1138
|
+
fsCache: config.skipCache ? false : _chunkV7LBWOVVjs.joinPaths.call(void 0, config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti")
|
|
2016
1139
|
}
|
|
2017
1140
|
},
|
|
2018
1141
|
rollup: {
|
|
@@ -2060,58 +1183,58 @@ var executor_default9 = withRunExecutor("TypeScript Unbuild build", unbuildExecu
|
|
|
2060
1183
|
var withRunGenerator = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name, generatorFn, generatorOptions = {
|
|
2061
1184
|
skipReadingConfig: false
|
|
2062
1185
|
}) => async (tree, _options) => {
|
|
2063
|
-
const stopwatch =
|
|
1186
|
+
const stopwatch = _chunkV7LBWOVVjs.getStopwatch.call(void 0, name);
|
|
2064
1187
|
let options = _options;
|
|
2065
1188
|
let config;
|
|
2066
1189
|
try {
|
|
2067
|
-
|
|
1190
|
+
_chunkV7LBWOVVjs.writeInfo.call(void 0, `\u26A1 Running the ${name} generator...
|
|
2068
1191
|
|
|
2069
1192
|
`, config);
|
|
2070
|
-
const workspaceRoot3 =
|
|
1193
|
+
const workspaceRoot3 = _chunkV7LBWOVVjs.findWorkspaceRoot.call(void 0, );
|
|
2071
1194
|
if (!generatorOptions.skipReadingConfig) {
|
|
2072
|
-
|
|
1195
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
2073
1196
|
- workspaceRoot: ${workspaceRoot3}`, config);
|
|
2074
|
-
config = await
|
|
1197
|
+
config = await _chunkIVLCYFXDjs.getConfig.call(void 0, workspaceRoot3);
|
|
2075
1198
|
}
|
|
2076
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
2077
|
-
|
|
1199
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _92 => _92.hooks, 'optionalAccess', _93 => _93.applyDefaultOptions])) {
|
|
1200
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
2078
1201
|
options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
|
|
2079
|
-
|
|
1202
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
2080
1203
|
}
|
|
2081
|
-
|
|
1204
|
+
_chunkV7LBWOVVjs.writeTrace.call(void 0, `Generator schema options \u2699\uFE0F
|
|
2082
1205
|
${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`, config);
|
|
2083
1206
|
const tokenized = await applyWorkspaceTokens(options, {
|
|
2084
1207
|
workspaceRoot: tree.root,
|
|
2085
1208
|
config
|
|
2086
1209
|
}, applyWorkspaceBaseTokens);
|
|
2087
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
2088
|
-
|
|
1210
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _94 => _94.hooks, 'optionalAccess', _95 => _95.preProcess])) {
|
|
1211
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
2089
1212
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
2090
|
-
|
|
1213
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
2091
1214
|
}
|
|
2092
1215
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
2093
1216
|
if (result) {
|
|
2094
|
-
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess',
|
|
1217
|
+
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _96 => _96.error, 'optionalAccess', _97 => _97.message]) && typeof _optionalChain([result, 'optionalAccess', _98 => _98.error, 'optionalAccess', _99 => _99.message]) === "string" && _optionalChain([result, 'optionalAccess', _100 => _100.error, 'optionalAccess', _101 => _101.name]) && typeof _optionalChain([result, 'optionalAccess', _102 => _102.error, 'optionalAccess', _103 => _103.name]) === "string") {
|
|
2095
1218
|
throw new Error(`The ${name} generator failed to run`, {
|
|
2096
|
-
cause: _optionalChain([result, 'optionalAccess',
|
|
1219
|
+
cause: _optionalChain([result, 'optionalAccess', _104 => _104.error])
|
|
2097
1220
|
});
|
|
2098
1221
|
} else if (result.success && result.data) {
|
|
2099
1222
|
return result;
|
|
2100
1223
|
}
|
|
2101
1224
|
}
|
|
2102
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
2103
|
-
|
|
1225
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _105 => _105.hooks, 'optionalAccess', _106 => _106.postProcess])) {
|
|
1226
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
2104
1227
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
2105
|
-
|
|
1228
|
+
_chunkV7LBWOVVjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
2106
1229
|
}
|
|
2107
1230
|
return () => {
|
|
2108
|
-
|
|
1231
|
+
_chunkV7LBWOVVjs.writeSuccess.call(void 0, `Completed running the ${name} generator!
|
|
2109
1232
|
`, config);
|
|
2110
1233
|
};
|
|
2111
1234
|
} catch (error) {
|
|
2112
1235
|
return () => {
|
|
2113
|
-
|
|
2114
|
-
|
|
1236
|
+
_chunkV7LBWOVVjs.writeFatal.call(void 0, "A fatal error occurred while running the generator - the process was forced to terminate", config);
|
|
1237
|
+
_chunkV7LBWOVVjs.writeError.call(void 0, `An exception was thrown in the generator's process
|
|
2115
1238
|
- Details: ${error.message}
|
|
2116
1239
|
- Stacktrace: ${error.stack}`, config);
|
|
2117
1240
|
};
|
|
@@ -2157,7 +1280,7 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2157
1280
|
const projectConfig = {
|
|
2158
1281
|
root: normalized.directory,
|
|
2159
1282
|
projectType: "library",
|
|
2160
|
-
sourceRoot:
|
|
1283
|
+
sourceRoot: _chunkV7LBWOVVjs.joinPaths.call(void 0, _nullishCoalesce(normalized.directory, () => ( "")), "src"),
|
|
2161
1284
|
targets: {
|
|
2162
1285
|
build: {
|
|
2163
1286
|
executor: options.buildExecutor,
|
|
@@ -2166,11 +1289,11 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2166
1289
|
],
|
|
2167
1290
|
options: {
|
|
2168
1291
|
entry: [
|
|
2169
|
-
|
|
1292
|
+
_chunkV7LBWOVVjs.joinPaths.call(void 0, normalized.projectRoot, "src", "index.ts")
|
|
2170
1293
|
],
|
|
2171
1294
|
outputPath: getOutputPath(normalized),
|
|
2172
|
-
tsconfig:
|
|
2173
|
-
project:
|
|
1295
|
+
tsconfig: _chunkV7LBWOVVjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json"),
|
|
1296
|
+
project: _chunkV7LBWOVVjs.joinPaths.call(void 0, normalized.projectRoot, "package.json"),
|
|
2174
1297
|
defaultConfiguration: "production",
|
|
2175
1298
|
platform: "neutral",
|
|
2176
1299
|
assets: [
|
|
@@ -2209,22 +1332,22 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2209
1332
|
_devkit.addProjectConfiguration.call(void 0, tree, normalized.name, projectConfig);
|
|
2210
1333
|
let repository = {
|
|
2211
1334
|
type: "github",
|
|
2212
|
-
url: _optionalChain([config, 'optionalAccess',
|
|
1335
|
+
url: _optionalChain([config, 'optionalAccess', _107 => _107.repository]) || `https://github.com/${_optionalChain([config, 'optionalAccess', _108 => _108.organization]) || "storm-software"}/${_optionalChain([config, 'optionalAccess', _109 => _109.namespace]) || _optionalChain([config, 'optionalAccess', _110 => _110.name]) || "repository"}.git`
|
|
2213
1336
|
};
|
|
2214
1337
|
let description = options.description || "A package developed by Storm Software used to create modern, scalable web applications.";
|
|
2215
1338
|
if (tree.exists("package.json")) {
|
|
2216
1339
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2217
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
1340
|
+
if (_optionalChain([packageJson, 'optionalAccess', _111 => _111.repository])) {
|
|
2218
1341
|
repository = packageJson.repository;
|
|
2219
1342
|
}
|
|
2220
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
1343
|
+
if (_optionalChain([packageJson, 'optionalAccess', _112 => _112.description])) {
|
|
2221
1344
|
description = packageJson.description;
|
|
2222
1345
|
}
|
|
2223
1346
|
}
|
|
2224
1347
|
if (!normalized.importPath) {
|
|
2225
1348
|
normalized.importPath = normalized.name;
|
|
2226
1349
|
}
|
|
2227
|
-
const packageJsonPath =
|
|
1350
|
+
const packageJsonPath = _chunkV7LBWOVVjs.joinPaths.call(void 0, normalized.projectRoot, "package.json");
|
|
2228
1351
|
if (tree.exists(packageJsonPath)) {
|
|
2229
1352
|
_devkit.updateJson.call(void 0, tree, packageJsonPath, (json) => {
|
|
2230
1353
|
if (!normalized.importPath) {
|
|
@@ -2272,30 +1395,30 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2272
1395
|
_devkit.updateJson.call(void 0, tree, "package.json", (json) => ({
|
|
2273
1396
|
...json,
|
|
2274
1397
|
pnpm: {
|
|
2275
|
-
..._optionalChain([json, 'optionalAccess',
|
|
1398
|
+
..._optionalChain([json, 'optionalAccess', _113 => _113.pnpm]),
|
|
2276
1399
|
overrides: {
|
|
2277
|
-
..._optionalChain([json, 'optionalAccess',
|
|
1400
|
+
..._optionalChain([json, 'optionalAccess', _114 => _114.pnpm, 'optionalAccess', _115 => _115.overrides]),
|
|
2278
1401
|
[_nullishCoalesce(normalized.importPath, () => ( ""))]: "workspace:*"
|
|
2279
1402
|
}
|
|
2280
1403
|
}
|
|
2281
1404
|
}));
|
|
2282
1405
|
}
|
|
2283
1406
|
_js.addTsConfigPath.call(void 0, tree, normalized.importPath, [
|
|
2284
|
-
|
|
1407
|
+
_chunkV7LBWOVVjs.joinPaths.call(void 0, normalized.projectRoot, "./src", `index.${normalized.js ? "js" : "ts"}`)
|
|
2285
1408
|
]);
|
|
2286
|
-
_js.addTsConfigPath.call(void 0, tree,
|
|
2287
|
-
|
|
1409
|
+
_js.addTsConfigPath.call(void 0, tree, _chunkV7LBWOVVjs.joinPaths.call(void 0, normalized.importPath, "/*"), [
|
|
1410
|
+
_chunkV7LBWOVVjs.joinPaths.call(void 0, normalized.projectRoot, "./src", "/*")
|
|
2288
1411
|
]);
|
|
2289
1412
|
if (tree.exists("package.json")) {
|
|
2290
1413
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
2291
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
1414
|
+
if (_optionalChain([packageJson, 'optionalAccess', _116 => _116.repository])) {
|
|
2292
1415
|
repository = packageJson.repository;
|
|
2293
1416
|
}
|
|
2294
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
1417
|
+
if (_optionalChain([packageJson, 'optionalAccess', _117 => _117.description])) {
|
|
2295
1418
|
description = packageJson.description;
|
|
2296
1419
|
}
|
|
2297
1420
|
}
|
|
2298
|
-
const tsconfigPath =
|
|
1421
|
+
const tsconfigPath = _chunkV7LBWOVVjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json");
|
|
2299
1422
|
if (tree.exists(tsconfigPath)) {
|
|
2300
1423
|
_devkit.updateJson.call(void 0, tree, tsconfigPath, (json) => {
|
|
2301
1424
|
json.composite ??= true;
|
|
@@ -2333,42 +1456,42 @@ function getOutputPath(options) {
|
|
|
2333
1456
|
} else {
|
|
2334
1457
|
parts.push(options.projectRoot);
|
|
2335
1458
|
}
|
|
2336
|
-
return
|
|
1459
|
+
return _chunkV7LBWOVVjs.joinPaths.call(void 0, ...parts);
|
|
2337
1460
|
}
|
|
2338
1461
|
_chunkJ5SB6L2Ljs.__name.call(void 0, getOutputPath, "getOutputPath");
|
|
2339
1462
|
function createProjectTsConfigJson(tree, options) {
|
|
2340
1463
|
const tsconfig = {
|
|
2341
1464
|
extends: options.rootProject ? void 0 : _js.getRelativePathToRootTsConfig.call(void 0, tree, options.projectRoot),
|
|
2342
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1465
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _118 => _118.tsconfigOptions]), () => ( {})),
|
|
2343
1466
|
compilerOptions: {
|
|
2344
1467
|
...options.rootProject ? _js.tsConfigBaseOptions : {},
|
|
2345
|
-
outDir:
|
|
1468
|
+
outDir: _chunkV7LBWOVVjs.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
|
|
2346
1469
|
noEmit: true,
|
|
2347
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1470
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _119 => _119.tsconfigOptions, 'optionalAccess', _120 => _120.compilerOptions]), () => ( {}))
|
|
2348
1471
|
},
|
|
2349
1472
|
files: [
|
|
2350
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1473
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _121 => _121.tsconfigOptions, 'optionalAccess', _122 => _122.files]), () => ( []))
|
|
2351
1474
|
],
|
|
2352
1475
|
include: [
|
|
2353
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1476
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _123 => _123.tsconfigOptions, 'optionalAccess', _124 => _124.include]), () => ( [])),
|
|
2354
1477
|
"src/**/*.ts",
|
|
2355
1478
|
"src/**/*.js",
|
|
2356
1479
|
"bin/**/*"
|
|
2357
1480
|
],
|
|
2358
1481
|
exclude: [
|
|
2359
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
1482
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _125 => _125.tsconfigOptions, 'optionalAccess', _126 => _126.exclude]), () => ( [])),
|
|
2360
1483
|
"jest.config.ts",
|
|
2361
1484
|
"src/**/*.spec.ts",
|
|
2362
1485
|
"src/**/*.test.ts"
|
|
2363
1486
|
]
|
|
2364
1487
|
};
|
|
2365
|
-
_devkit.writeJson.call(void 0, tree,
|
|
1488
|
+
_devkit.writeJson.call(void 0, tree, _chunkV7LBWOVVjs.joinPaths.call(void 0, options.projectRoot, "tsconfig.json"), tsconfig);
|
|
2366
1489
|
}
|
|
2367
1490
|
_chunkJ5SB6L2Ljs.__name.call(void 0, createProjectTsConfigJson, "createProjectTsConfigJson");
|
|
2368
1491
|
async function normalizeOptions(tree, options, config) {
|
|
2369
1492
|
let importPath = options.importPath;
|
|
2370
|
-
if (!importPath && _optionalChain([config, 'optionalAccess',
|
|
2371
|
-
importPath = `@${_optionalChain([config, 'optionalAccess',
|
|
1493
|
+
if (!importPath && _optionalChain([config, 'optionalAccess', _127 => _127.namespace])) {
|
|
1494
|
+
importPath = `@${_optionalChain([config, 'optionalAccess', _128 => _128.namespace])}/${options.name}`;
|
|
2372
1495
|
}
|
|
2373
1496
|
if (options.publishable) {
|
|
2374
1497
|
if (!importPath) {
|
|
@@ -2422,7 +1545,7 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, normalizeOptions, "normalizeOptions");
|
|
|
2422
1545
|
|
|
2423
1546
|
// ../workspace-tools/src/generators/browser-library/generator.ts
|
|
2424
1547
|
async function browserLibraryGeneratorFn(tree, schema, config) {
|
|
2425
|
-
const filesDir =
|
|
1548
|
+
const filesDir = _chunkV7LBWOVVjs.joinPaths.call(void 0, __dirname, "src", "generators", "browser-library", "files");
|
|
2426
1549
|
const tsLibraryGeneratorOptions = {
|
|
2427
1550
|
buildExecutor: "@storm-software/workspace-tools:unbuild",
|
|
2428
1551
|
platform: "browser",
|
|
@@ -2494,19 +1617,19 @@ var generator_default = withRunGenerator("TypeScript Library Creator (Browser Pl
|
|
|
2494
1617
|
|
|
2495
1618
|
var _zodtojsonschema = require('zod-to-json-schema');
|
|
2496
1619
|
async function configSchemaGeneratorFn(tree, options, config) {
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0,
|
|
1620
|
+
_chunkV7LBWOVVjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Workspace Configuration JSON Schema generator", config);
|
|
1621
|
+
_chunkV7LBWOVVjs.writeTrace.call(void 0, `Determining the Storm Workspace Configuration JSON Schema...`, config);
|
|
1622
|
+
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0, _chunkV7LBWOVVjs.stormWorkspaceConfigSchema, {
|
|
2500
1623
|
name: "StormWorkspaceConfiguration"
|
|
2501
1624
|
});
|
|
2502
|
-
|
|
2503
|
-
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess',
|
|
2504
|
-
|
|
1625
|
+
_chunkV7LBWOVVjs.writeTrace.call(void 0, jsonSchema, config);
|
|
1626
|
+
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _129 => _129.workspaceRoot]), () => ( _chunkV7LBWOVVjs.findWorkspaceRoot.call(void 0, ))), _optionalChain([options, 'access', _130 => _130.outputFile, 'optionalAccess', _131 => _131.startsWith, 'call', _132 => _132("./")]) ? "" : "./");
|
|
1627
|
+
_chunkV7LBWOVVjs.writeTrace.call(void 0, `\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`, config);
|
|
2505
1628
|
_devkit.writeJson.call(void 0, tree, outputPath, jsonSchema, {
|
|
2506
1629
|
spaces: 2
|
|
2507
1630
|
});
|
|
2508
1631
|
await _devkit.formatFiles.call(void 0, tree);
|
|
2509
|
-
|
|
1632
|
+
_chunkV7LBWOVVjs.writeSuccess.call(void 0, "\u{1F680} Storm Configuration JSON Schema creation has completed successfully!", config);
|
|
2510
1633
|
return {
|
|
2511
1634
|
success: true
|
|
2512
1635
|
};
|
|
@@ -2527,7 +1650,7 @@ var generator_default2 = withRunGenerator("Configuration Schema Creator", config
|
|
|
2527
1650
|
// ../workspace-tools/src/generators/neutral-library/generator.ts
|
|
2528
1651
|
|
|
2529
1652
|
async function neutralLibraryGeneratorFn(tree, schema, config) {
|
|
2530
|
-
const filesDir =
|
|
1653
|
+
const filesDir = _chunkV7LBWOVVjs.joinPaths.call(void 0, __dirname, "src", "generators", "neutral-library", "files");
|
|
2531
1654
|
const tsLibraryGeneratorOptions = {
|
|
2532
1655
|
...schema,
|
|
2533
1656
|
platform: "neutral",
|
|
@@ -2570,7 +1693,7 @@ var generator_default3 = withRunGenerator("TypeScript Library Creator (Neutral P
|
|
|
2570
1693
|
// ../workspace-tools/src/generators/node-library/generator.ts
|
|
2571
1694
|
|
|
2572
1695
|
async function nodeLibraryGeneratorFn(tree, schema, config) {
|
|
2573
|
-
const filesDir =
|
|
1696
|
+
const filesDir = _chunkV7LBWOVVjs.joinPaths.call(void 0, __dirname, "src", "generators", "node-library", "files");
|
|
2574
1697
|
const tsLibraryGeneratorOptions = {
|
|
2575
1698
|
platform: "node",
|
|
2576
1699
|
devDependencies: {
|
|
@@ -2764,7 +1887,7 @@ async function presetGeneratorFn(tree, options) {
|
|
|
2764
1887
|
};
|
|
2765
1888
|
return json;
|
|
2766
1889
|
});
|
|
2767
|
-
_devkit.generateFiles.call(void 0, tree,
|
|
1890
|
+
_devkit.generateFiles.call(void 0, tree, path3.join(__dirname, "files"), projectRoot, {
|
|
2768
1891
|
...options,
|
|
2769
1892
|
pnpmVersion,
|
|
2770
1893
|
nodeVersion
|