@storm-software/cloudflare-tools 0.55.85 → 0.55.87
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 +24 -0
- package/README.md +1 -1
- package/dist/{chunk-VTHBMY4B.js → chunk-6XDOBG77.js} +39 -28
- package/dist/{chunk-FUE3PSOC.mjs → chunk-CW6SXRL4.mjs} +825 -544
- package/dist/{chunk-VRLPVMXP.mjs → chunk-FABNT5TZ.mjs} +15 -13
- package/dist/{chunk-QQJ225UZ.mjs → chunk-GPAI4NHQ.mjs} +141 -87
- package/dist/{chunk-YNJJF3XM.mjs → chunk-H4XWGL24.mjs} +93 -56
- package/dist/{chunk-IVLCYFXD.js → chunk-HBASMEU5.js} +168 -114
- package/dist/{chunk-6B5PUF7X.js → chunk-HIUZ6UL7.js} +97 -47
- package/dist/{chunk-R7AIVBS7.js → chunk-I4P7DVDN.js} +19 -24
- package/dist/{chunk-KWHACLHR.mjs → chunk-ISGKIYF5.mjs} +92 -42
- package/dist/{chunk-5RE7UZTH.mjs → chunk-L4WFYC7K.mjs} +39 -28
- package/dist/{chunk-PWYTCJYX.js → chunk-LDHIZ5T7.js} +875 -594
- package/dist/{chunk-J5SB6L2L.js → chunk-MCKGQKYU.js} +2 -5
- package/dist/{chunk-DEJ5S46A.mjs → chunk-MV24QW26.mjs} +195 -127
- package/dist/{chunk-V7LBWOVV.js → chunk-PZ5CI56F.js} +196 -128
- package/dist/{chunk-AOEF7EWN.mjs → chunk-QPABB45G.mjs} +19 -24
- package/dist/{chunk-TLFPZXKG.mjs → chunk-QQ22YQSB.mjs} +3 -6
- package/dist/{chunk-QGRENI3O.js → chunk-RIUVF72K.js} +17 -15
- package/dist/{chunk-PKQBY4ZM.js → chunk-X4Y76AIM.js} +26 -20
- package/dist/{chunk-CNGX2WYG.js → chunk-XCEENUJB.js} +93 -58
- package/dist/{chunk-N4KJP2OA.mjs → chunk-YJOYATEB.mjs} +27 -21
- package/dist/executors.js +8 -8
- package/dist/executors.mjs +8 -8
- package/dist/generators.js +6 -6
- package/dist/generators.mjs +5 -5
- package/dist/index.js +41 -49
- package/dist/index.mjs +40 -48
- package/dist/src/executors/cloudflare-publish/executor.js +7 -7
- package/dist/src/executors/cloudflare-publish/executor.mjs +6 -6
- package/dist/src/executors/r2-upload-publish/executor.js +7 -7
- package/dist/src/executors/r2-upload-publish/executor.mjs +6 -6
- package/dist/src/executors/serve/executor.js +49 -50
- package/dist/src/executors/serve/executor.mjs +48 -49
- package/dist/src/generators/init/generator.js +3 -3
- package/dist/src/generators/init/generator.mjs +2 -2
- package/dist/src/generators/worker/generator.js +6 -6
- package/dist/src/generators/worker/generator.mjs +5 -5
- package/dist/src/utils/index.js +4 -4
- package/dist/src/utils/index.mjs +3 -3
- package/dist/src/utils/r2-bucket-helpers.js +4 -4
- package/dist/src/utils/r2-bucket-helpers.mjs +3 -3
- package/dist/tsup.config.js +3 -8
- package/dist/tsup.config.mjs +3 -8
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
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
|
-
var
|
|
4
|
+
var _chunk6XDOBG77js = require('./chunk-6XDOBG77.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkHBASMEU5js = require('./chunk-HBASMEU5.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -19,14 +19,13 @@ var _chunkIVLCYFXDjs = require('./chunk-IVLCYFXD.js');
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _chunkPZ5CI56Fjs = require('./chunk-PZ5CI56F.js');
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
var _chunkJ5SB6L2Ljs = require('./chunk-J5SB6L2L.js');
|
|
25
|
+
var _chunkMCKGQKYUjs = require('./chunk-MCKGQKYU.js');
|
|
27
26
|
|
|
28
27
|
// ../config-tools/src/utilities/apply-workspace-tokens.ts
|
|
29
|
-
var applyWorkspaceBaseTokens =
|
|
28
|
+
var applyWorkspaceBaseTokens = async (option, tokenParams) => {
|
|
30
29
|
let result = option;
|
|
31
30
|
if (!result) {
|
|
32
31
|
return result;
|
|
@@ -36,7 +35,10 @@ var applyWorkspaceBaseTokens = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
|
|
|
36
35
|
if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
|
|
37
36
|
for (const optionKey of optionKeys) {
|
|
38
37
|
if (result.includes(`{${optionKey}}`)) {
|
|
39
|
-
result = result.replaceAll(
|
|
38
|
+
result = result.replaceAll(
|
|
39
|
+
`{${optionKey}}`,
|
|
40
|
+
_optionalChain([tokenParams, 'optionalAccess', _2 => _2[optionKey]]) || ""
|
|
41
|
+
);
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
}
|
|
@@ -46,85 +48,118 @@ var applyWorkspaceBaseTokens = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
|
|
|
46
48
|
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
47
49
|
for (const configKey of configKeys) {
|
|
48
50
|
if (result.includes(`{${configKey}}`)) {
|
|
49
|
-
result = result.replaceAll(
|
|
51
|
+
result = result.replaceAll(
|
|
52
|
+
`{${configKey}}`,
|
|
53
|
+
tokenParams.config[configKey] || ""
|
|
54
|
+
);
|
|
50
55
|
}
|
|
51
56
|
}
|
|
52
57
|
}
|
|
53
58
|
}
|
|
54
59
|
if (result.includes("{workspaceRoot}")) {
|
|
55
|
-
result = result.replaceAll(
|
|
60
|
+
result = result.replaceAll(
|
|
61
|
+
"{workspaceRoot}",
|
|
62
|
+
_nullishCoalesce(_nullishCoalesce(tokenParams.workspaceRoot, () => ( _optionalChain([tokenParams, 'access', _3 => _3.config, 'optionalAccess', _4 => _4.workspaceRoot]))), () => ( _chunkPZ5CI56Fjs.findWorkspaceRoot.call(void 0, )))
|
|
63
|
+
);
|
|
56
64
|
}
|
|
57
65
|
return result;
|
|
58
|
-
}
|
|
59
|
-
var applyWorkspaceProjectTokens =
|
|
66
|
+
};
|
|
67
|
+
var applyWorkspaceProjectTokens = (option, tokenParams) => {
|
|
60
68
|
return applyWorkspaceBaseTokens(option, tokenParams);
|
|
61
|
-
}
|
|
62
|
-
var applyWorkspaceTokens =
|
|
69
|
+
};
|
|
70
|
+
var applyWorkspaceTokens = async (options, tokenParams, tokenizerFn) => {
|
|
63
71
|
if (!options) {
|
|
64
72
|
return {};
|
|
65
73
|
}
|
|
66
74
|
const result = {};
|
|
67
75
|
for (const option of Object.keys(options)) {
|
|
68
76
|
if (typeof options[option] === "string") {
|
|
69
|
-
result[option] = await Promise.resolve(
|
|
77
|
+
result[option] = await Promise.resolve(
|
|
78
|
+
tokenizerFn(options[option], tokenParams)
|
|
79
|
+
);
|
|
70
80
|
} else if (Array.isArray(options[option])) {
|
|
71
|
-
result[option] = await Promise.all(
|
|
81
|
+
result[option] = await Promise.all(
|
|
82
|
+
options[option].map(
|
|
83
|
+
async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item
|
|
84
|
+
)
|
|
85
|
+
);
|
|
72
86
|
} else if (typeof options[option] === "object") {
|
|
73
|
-
result[option] = await applyWorkspaceTokens(
|
|
87
|
+
result[option] = await applyWorkspaceTokens(
|
|
88
|
+
options[option],
|
|
89
|
+
tokenParams,
|
|
90
|
+
tokenizerFn
|
|
91
|
+
);
|
|
74
92
|
} else {
|
|
75
93
|
result[option] = options[option];
|
|
76
94
|
}
|
|
77
95
|
}
|
|
78
96
|
return result;
|
|
79
|
-
}
|
|
97
|
+
};
|
|
80
98
|
|
|
81
99
|
// ../workspace-tools/src/base/base-executor.ts
|
|
82
100
|
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
83
|
-
var withRunExecutor =
|
|
84
|
-
const stopwatch =
|
|
101
|
+
var withRunExecutor = (name, executorFn, executorOptions = {}) => async (_options, context) => {
|
|
102
|
+
const stopwatch = _chunkPZ5CI56Fjs.getStopwatch.call(void 0, name);
|
|
85
103
|
let options = _options;
|
|
86
104
|
let config = {};
|
|
87
105
|
try {
|
|
88
106
|
if (!_optionalChain([context, 'access', _5 => _5.projectsConfigurations, 'optionalAccess', _6 => _6.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
89
|
-
throw new Error(
|
|
107
|
+
throw new Error(
|
|
108
|
+
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
109
|
+
);
|
|
90
110
|
}
|
|
91
|
-
const workspaceRoot3 =
|
|
111
|
+
const workspaceRoot3 = _chunkPZ5CI56Fjs.findWorkspaceRoot.call(void 0, );
|
|
92
112
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root || workspaceRoot3;
|
|
93
113
|
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot || projectRoot || workspaceRoot3;
|
|
94
114
|
const projectName = context.projectName;
|
|
95
115
|
config.workspaceRoot = workspaceRoot3;
|
|
96
|
-
|
|
116
|
+
_chunkPZ5CI56Fjs.writeInfo.call(void 0, `\u26A1 Running the ${name} executor for ${projectName} `, config);
|
|
97
117
|
if (!executorOptions.skipReadingConfig) {
|
|
98
|
-
|
|
118
|
+
_chunkPZ5CI56Fjs.writeTrace.call(void 0,
|
|
119
|
+
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
99
120
|
- workspaceRoot: ${workspaceRoot3}
|
|
100
121
|
- projectRoot: ${projectRoot}
|
|
101
122
|
- sourceRoot: ${sourceRoot}
|
|
102
123
|
- projectName: ${projectName}
|
|
103
|
-
`,
|
|
104
|
-
|
|
124
|
+
`,
|
|
125
|
+
config
|
|
126
|
+
);
|
|
127
|
+
config = await _chunkHBASMEU5js.getConfig.call(void 0, workspaceRoot3);
|
|
105
128
|
}
|
|
106
129
|
if (_optionalChain([executorOptions, 'optionalAccess', _7 => _7.hooks, 'optionalAccess', _8 => _8.applyDefaultOptions])) {
|
|
107
|
-
|
|
108
|
-
options = await Promise.resolve(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
sourceRoot,
|
|
118
|
-
projectName,
|
|
130
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
131
|
+
options = await Promise.resolve(
|
|
132
|
+
executorOptions.hooks.applyDefaultOptions(options, config)
|
|
133
|
+
);
|
|
134
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
135
|
+
}
|
|
136
|
+
_chunkPZ5CI56Fjs.writeTrace.call(void 0,
|
|
137
|
+
`Executor schema options \u2699\uFE0F
|
|
138
|
+
${_chunkPZ5CI56Fjs.formatLogMessage.call(void 0, options)}
|
|
139
|
+
`,
|
|
119
140
|
config
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
141
|
+
);
|
|
142
|
+
const tokenized = await applyWorkspaceTokens(
|
|
143
|
+
options,
|
|
144
|
+
_defu.defu.call(void 0,
|
|
145
|
+
{ workspaceRoot: workspaceRoot3, projectRoot, sourceRoot, projectName, config },
|
|
146
|
+
config,
|
|
147
|
+
context.projectsConfigurations.projects[context.projectName]
|
|
148
|
+
),
|
|
149
|
+
applyWorkspaceProjectTokens
|
|
150
|
+
);
|
|
151
|
+
_chunkPZ5CI56Fjs.writeTrace.call(void 0,
|
|
152
|
+
`Executor schema tokenized options \u2699\uFE0F
|
|
153
|
+
${_chunkPZ5CI56Fjs.formatLogMessage.call(void 0, tokenized)}
|
|
154
|
+
`,
|
|
155
|
+
config
|
|
156
|
+
);
|
|
124
157
|
if (_optionalChain([executorOptions, 'optionalAccess', _9 => _9.hooks, 'optionalAccess', _10 => _10.preProcess])) {
|
|
125
|
-
|
|
126
|
-
await Promise.resolve(
|
|
127
|
-
|
|
158
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
159
|
+
await Promise.resolve(
|
|
160
|
+
executorOptions.hooks.preProcess(tokenized, config)
|
|
161
|
+
);
|
|
162
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
128
163
|
}
|
|
129
164
|
const ret = executorFn(tokenized, context, config);
|
|
130
165
|
if (_isFunction(_optionalChain([ret, 'optionalAccess', _11 => _11.next]))) {
|
|
@@ -133,47 +168,61 @@ ${_chunkV7LBWOVVjs.formatLogMessage.call(void 0, tokenized)}
|
|
|
133
168
|
void iter;
|
|
134
169
|
}
|
|
135
170
|
}
|
|
136
|
-
const result = await Promise.resolve(
|
|
171
|
+
const result = await Promise.resolve(
|
|
172
|
+
ret
|
|
173
|
+
);
|
|
137
174
|
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")) {
|
|
138
|
-
|
|
139
|
-
${
|
|
175
|
+
_chunkPZ5CI56Fjs.writeTrace.call(void 0,
|
|
176
|
+
`Failure determined by the ${name} executor
|
|
177
|
+
${_chunkPZ5CI56Fjs.formatLogMessage.call(void 0, result)}`,
|
|
178
|
+
config
|
|
179
|
+
);
|
|
140
180
|
console.error(result);
|
|
141
181
|
throw new Error(`The ${name} executor failed to run`, {
|
|
142
182
|
cause: _optionalChain([result, 'optionalAccess', _20 => _20.error])
|
|
143
183
|
});
|
|
144
184
|
}
|
|
145
185
|
if (_optionalChain([executorOptions, 'optionalAccess', _21 => _21.hooks, 'optionalAccess', _22 => _22.postProcess])) {
|
|
146
|
-
|
|
186
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
147
187
|
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
148
|
-
|
|
188
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
149
189
|
}
|
|
150
|
-
|
|
190
|
+
_chunkPZ5CI56Fjs.writeSuccess.call(void 0, `Completed running the ${name} task executor!
|
|
151
191
|
`, config);
|
|
152
192
|
return {
|
|
153
193
|
success: true
|
|
154
194
|
};
|
|
155
195
|
} catch (error) {
|
|
156
|
-
|
|
157
|
-
|
|
196
|
+
_chunkPZ5CI56Fjs.writeFatal.call(void 0,
|
|
197
|
+
"A fatal error occurred while running the executor - the process was forced to terminate",
|
|
198
|
+
config
|
|
199
|
+
);
|
|
200
|
+
_chunkPZ5CI56Fjs.writeError.call(void 0,
|
|
201
|
+
`An exception was thrown in the executor's process
|
|
158
202
|
- Details: ${error.message}
|
|
159
|
-
- Stacktrace: ${error.stack}`,
|
|
203
|
+
- Stacktrace: ${error.stack}`,
|
|
204
|
+
config
|
|
205
|
+
);
|
|
160
206
|
return {
|
|
161
207
|
success: false
|
|
162
208
|
};
|
|
163
209
|
} finally {
|
|
164
210
|
stopwatch();
|
|
165
211
|
}
|
|
166
|
-
}
|
|
167
|
-
var _isFunction =
|
|
212
|
+
};
|
|
213
|
+
var _isFunction = (value) => {
|
|
168
214
|
try {
|
|
169
215
|
return value instanceof Function || typeof value === "function" || !!(_optionalChain([value, 'optionalAccess', _23 => _23.constructor]) && _optionalChain([value, 'optionalAccess', _24 => _24.call]) && _optionalChain([value, 'optionalAccess', _25 => _25.apply]));
|
|
170
216
|
} catch (e) {
|
|
171
217
|
return false;
|
|
172
218
|
}
|
|
173
|
-
}
|
|
219
|
+
};
|
|
174
220
|
|
|
175
221
|
// ../workspace-tools/src/utils/cargo.ts
|
|
176
222
|
var _devkit = require('@nx/devkit');
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
177
226
|
var _child_process = require('child_process');
|
|
178
227
|
var _path = require('path'); var path4 = _interopRequireWildcard(_path);
|
|
179
228
|
var INVALID_CARGO_ARGS = [
|
|
@@ -184,7 +233,7 @@ var INVALID_CARGO_ARGS = [
|
|
|
184
233
|
"package",
|
|
185
234
|
"tsConfig"
|
|
186
235
|
];
|
|
187
|
-
var buildCargoCommand =
|
|
236
|
+
var buildCargoCommand = (baseCommand, options, context) => {
|
|
188
237
|
const args = [];
|
|
189
238
|
if (options.toolchain && options.toolchain !== "stable") {
|
|
190
239
|
args.push(`+${options.toolchain}`);
|
|
@@ -222,13 +271,12 @@ var buildCargoCommand = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (ba
|
|
|
222
271
|
args.push("--target-dir", options.outputPath);
|
|
223
272
|
}
|
|
224
273
|
return args;
|
|
225
|
-
}
|
|
274
|
+
};
|
|
226
275
|
async function cargoCommand(...args) {
|
|
227
276
|
console.log(`> cargo ${args.join(" ")}`);
|
|
228
277
|
args.push("--color", "always");
|
|
229
278
|
return await Promise.resolve(runProcess("cargo", ...args));
|
|
230
279
|
}
|
|
231
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, cargoCommand, "cargoCommand");
|
|
232
280
|
function cargoCommandSync(args = "", options) {
|
|
233
281
|
const normalizedOptions = {
|
|
234
282
|
stdio: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _26 => _26.stdio]), () => ( "inherit")),
|
|
@@ -255,7 +303,6 @@ function cargoCommandSync(args = "", options) {
|
|
|
255
303
|
};
|
|
256
304
|
}
|
|
257
305
|
}
|
|
258
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, cargoCommandSync, "cargoCommandSync");
|
|
259
306
|
function cargoMetadata() {
|
|
260
307
|
const output3 = cargoCommandSync("metadata --format-version=1", {
|
|
261
308
|
stdio: "pipe"
|
|
@@ -266,15 +313,12 @@ function cargoMetadata() {
|
|
|
266
313
|
}
|
|
267
314
|
return JSON.parse(output3.output);
|
|
268
315
|
}
|
|
269
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, cargoMetadata, "cargoMetadata");
|
|
270
316
|
function runProcess(processCmd, ...args) {
|
|
271
317
|
const metadata = cargoMetadata();
|
|
272
318
|
const targetDir = _nullishCoalesce(_optionalChain([metadata, 'optionalAccess', _28 => _28.target_directory]), () => ( _devkit.joinPathFragments.call(void 0, _devkit.workspaceRoot, "dist", "cargo")));
|
|
273
319
|
return new Promise((resolve) => {
|
|
274
320
|
if (process.env.VERCEL) {
|
|
275
|
-
return resolve({
|
|
276
|
-
success: true
|
|
277
|
-
});
|
|
321
|
+
return resolve({ success: true });
|
|
278
322
|
}
|
|
279
323
|
_child_process.execSync.call(void 0, `${processCmd} ${args.join(" ")}`, {
|
|
280
324
|
cwd: process.cwd(),
|
|
@@ -285,113 +329,119 @@ function runProcess(processCmd, ...args) {
|
|
|
285
329
|
CARGO_BUILD_TARGET_DIR: targetDir
|
|
286
330
|
},
|
|
287
331
|
windowsHide: true,
|
|
288
|
-
stdio: [
|
|
289
|
-
"inherit",
|
|
290
|
-
"inherit",
|
|
291
|
-
"inherit"
|
|
292
|
-
]
|
|
293
|
-
});
|
|
294
|
-
resolve({
|
|
295
|
-
success: true
|
|
332
|
+
stdio: ["inherit", "inherit", "inherit"]
|
|
296
333
|
});
|
|
334
|
+
resolve({ success: true });
|
|
297
335
|
});
|
|
298
336
|
}
|
|
299
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, runProcess, "runProcess");
|
|
300
337
|
|
|
301
338
|
// ../workspace-tools/src/executors/cargo-build/executor.ts
|
|
302
339
|
async function cargoBuildExecutor(options, context) {
|
|
303
340
|
const command = buildCargoCommand("build", options, context);
|
|
304
341
|
return await cargoCommand(...command);
|
|
305
342
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
options
|
|
313
|
-
|
|
314
|
-
|
|
343
|
+
var executor_default = withRunExecutor(
|
|
344
|
+
"Cargo Build",
|
|
345
|
+
cargoBuildExecutor,
|
|
346
|
+
{
|
|
347
|
+
skipReadingConfig: false,
|
|
348
|
+
hooks: {
|
|
349
|
+
applyDefaultOptions: (options) => {
|
|
350
|
+
options.outputPath ??= "dist/target/{projectRoot}";
|
|
351
|
+
options.toolchain ??= "stable";
|
|
352
|
+
return options;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
315
355
|
}
|
|
316
|
-
|
|
356
|
+
);
|
|
317
357
|
|
|
318
358
|
// ../workspace-tools/src/executors/cargo-check/executor.ts
|
|
319
359
|
async function cargoCheckExecutor(options, context) {
|
|
320
360
|
const command = buildCargoCommand("check", options, context);
|
|
321
361
|
return await cargoCommand(...command);
|
|
322
362
|
}
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
363
|
+
var executor_default2 = withRunExecutor(
|
|
364
|
+
"Cargo Check",
|
|
365
|
+
cargoCheckExecutor,
|
|
366
|
+
{
|
|
367
|
+
skipReadingConfig: false,
|
|
368
|
+
hooks: {
|
|
369
|
+
applyDefaultOptions: (options) => {
|
|
370
|
+
options.toolchain ??= "stable";
|
|
371
|
+
return options;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
331
374
|
}
|
|
332
|
-
|
|
375
|
+
);
|
|
333
376
|
|
|
334
377
|
// ../workspace-tools/src/executors/cargo-clippy/executor.ts
|
|
335
378
|
async function cargoClippyExecutor(options, context) {
|
|
336
379
|
const command = buildCargoCommand("clippy", options, context);
|
|
337
380
|
return await cargoCommand(...command);
|
|
338
381
|
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
options
|
|
346
|
-
|
|
347
|
-
|
|
382
|
+
var executor_default3 = withRunExecutor(
|
|
383
|
+
"Cargo Clippy",
|
|
384
|
+
cargoClippyExecutor,
|
|
385
|
+
{
|
|
386
|
+
skipReadingConfig: false,
|
|
387
|
+
hooks: {
|
|
388
|
+
applyDefaultOptions: (options) => {
|
|
389
|
+
options.toolchain ??= "stable";
|
|
390
|
+
options.fix ??= false;
|
|
391
|
+
return options;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
348
394
|
}
|
|
349
|
-
|
|
395
|
+
);
|
|
350
396
|
|
|
351
397
|
// ../workspace-tools/src/executors/cargo-doc/executor.ts
|
|
352
398
|
async function cargoDocExecutor(options, context) {
|
|
353
|
-
const opts = {
|
|
354
|
-
...options
|
|
355
|
-
};
|
|
399
|
+
const opts = { ...options };
|
|
356
400
|
opts["no-deps"] = opts.noDeps;
|
|
357
401
|
delete opts.noDeps;
|
|
358
402
|
const command = buildCargoCommand("doc", options, context);
|
|
359
403
|
return await cargoCommand(...command);
|
|
360
404
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
options
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
405
|
+
var executor_default4 = withRunExecutor(
|
|
406
|
+
"Cargo Doc",
|
|
407
|
+
cargoDocExecutor,
|
|
408
|
+
{
|
|
409
|
+
skipReadingConfig: false,
|
|
410
|
+
hooks: {
|
|
411
|
+
applyDefaultOptions: (options) => {
|
|
412
|
+
options.outputPath ??= "dist/docs/{projectRoot}";
|
|
413
|
+
options.toolchain ??= "stable";
|
|
414
|
+
options.release ??= options.profile ? false : true;
|
|
415
|
+
options.allFeatures ??= true;
|
|
416
|
+
options.lib ??= true;
|
|
417
|
+
options.bins ??= true;
|
|
418
|
+
options.examples ??= true;
|
|
419
|
+
options.noDeps ??= false;
|
|
420
|
+
return options;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
376
423
|
}
|
|
377
|
-
|
|
424
|
+
);
|
|
378
425
|
|
|
379
426
|
// ../workspace-tools/src/executors/cargo-format/executor.ts
|
|
380
427
|
async function cargoFormatExecutor(options, context) {
|
|
381
428
|
const command = buildCargoCommand("fmt", options, context);
|
|
382
429
|
return await cargoCommand(...command);
|
|
383
430
|
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
options
|
|
391
|
-
|
|
392
|
-
|
|
431
|
+
var executor_default5 = withRunExecutor(
|
|
432
|
+
"Cargo Format",
|
|
433
|
+
cargoFormatExecutor,
|
|
434
|
+
{
|
|
435
|
+
skipReadingConfig: false,
|
|
436
|
+
hooks: {
|
|
437
|
+
applyDefaultOptions: (options) => {
|
|
438
|
+
options.outputPath ??= "dist/target/{projectRoot}";
|
|
439
|
+
options.toolchain ??= "stable";
|
|
440
|
+
return options;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
393
443
|
}
|
|
394
|
-
|
|
444
|
+
);
|
|
395
445
|
|
|
396
446
|
// ../workspace-tools/src/executors/cargo-publish/executor.ts
|
|
397
447
|
|
|
@@ -431,7 +481,7 @@ var _resolve2 = require('resolve'); var _resolve3 = _interopRequireDefault(_reso
|
|
|
431
481
|
var _copyassetshandler = require('@nx/js/src/utils/assets/copy-assets-handler');
|
|
432
482
|
var _glob = require('glob');
|
|
433
483
|
var _promises = require('fs/promises'); var _promises2 = _interopRequireDefault(_promises);
|
|
434
|
-
var copyAssets =
|
|
484
|
+
var copyAssets = async (config, assets, outputPath, projectRoot, sourceRoot, generatePackageJson2 = true, includeSrc = false, banner, footer) => {
|
|
435
485
|
const pendingAssets = Array.from(_nullishCoalesce(assets, () => ( [])));
|
|
436
486
|
pendingAssets.push({
|
|
437
487
|
input: projectRoot,
|
|
@@ -457,8 +507,11 @@ var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (con
|
|
|
457
507
|
output: "src/"
|
|
458
508
|
});
|
|
459
509
|
}
|
|
460
|
-
|
|
461
|
-
|
|
510
|
+
_chunkPZ5CI56Fjs.writeTrace.call(void 0,
|
|
511
|
+
`\u{1F4DD} Copying the following assets to the output directory:
|
|
512
|
+
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${_chunkPZ5CI56Fjs.joinPaths.call(void 0, outputPath, pendingAsset.output)}`).join("\n")}`,
|
|
513
|
+
config
|
|
514
|
+
);
|
|
462
515
|
const assetHandler = new (0, _copyassetshandler.CopyAssetsHandler)({
|
|
463
516
|
projectDir: projectRoot,
|
|
464
517
|
rootDir: config.workspaceRoot,
|
|
@@ -467,28 +520,45 @@ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${p
|
|
|
467
520
|
});
|
|
468
521
|
await assetHandler.processAllAssetsOnce();
|
|
469
522
|
if (includeSrc === true) {
|
|
470
|
-
|
|
523
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0,
|
|
524
|
+
`\u{1F4DD} Adding banner and writing source files: ${_chunkPZ5CI56Fjs.joinPaths.call(void 0,
|
|
525
|
+
outputPath,
|
|
526
|
+
"src"
|
|
527
|
+
)}`,
|
|
528
|
+
config
|
|
529
|
+
);
|
|
471
530
|
const files = await _glob.glob.call(void 0, [
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
531
|
+
_chunkPZ5CI56Fjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
532
|
+
_chunkPZ5CI56Fjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
533
|
+
_chunkPZ5CI56Fjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
534
|
+
_chunkPZ5CI56Fjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
476
535
|
]);
|
|
477
|
-
await Promise.allSettled(
|
|
536
|
+
await Promise.allSettled(
|
|
537
|
+
files.map(
|
|
538
|
+
async (file) => _promises.writeFile.call(void 0,
|
|
539
|
+
file,
|
|
540
|
+
`${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
478
541
|
|
|
479
542
|
${await _promises.readFile.call(void 0, file, "utf8")}
|
|
480
543
|
|
|
481
|
-
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`
|
|
544
|
+
${footer && typeof footer === "string" ? footer.startsWith("//") ? footer : `// ${footer}` : ""}`
|
|
545
|
+
)
|
|
546
|
+
)
|
|
547
|
+
);
|
|
482
548
|
}
|
|
483
|
-
}
|
|
549
|
+
};
|
|
484
550
|
|
|
485
551
|
// ../build-tools/src/utilities/generate-package-json.ts
|
|
486
552
|
var _buildablelibsutils = require('@nx/js/src/utils/buildable-libs-utils');
|
|
487
553
|
|
|
488
554
|
|
|
489
555
|
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
|
|
490
560
|
var _projectgraph = require('nx/src/project-graph/project-graph');
|
|
491
|
-
var addPackageDependencies =
|
|
561
|
+
var addPackageDependencies = async (workspaceRoot3, projectRoot, projectName, packageJson) => {
|
|
492
562
|
let projectGraph;
|
|
493
563
|
try {
|
|
494
564
|
projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
|
|
@@ -497,16 +567,35 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
497
567
|
projectGraph = _projectgraph.readCachedProjectGraph.call(void 0, );
|
|
498
568
|
}
|
|
499
569
|
if (!projectGraph) {
|
|
500
|
-
throw new Error(
|
|
570
|
+
throw new Error(
|
|
571
|
+
"The Build process failed because the project graph is not available. Please run the build command again."
|
|
572
|
+
);
|
|
501
573
|
}
|
|
502
|
-
const projectDependencies = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0,
|
|
574
|
+
const projectDependencies = _buildablelibsutils.calculateProjectBuildableDependencies.call(void 0,
|
|
575
|
+
void 0,
|
|
576
|
+
projectGraph,
|
|
577
|
+
workspaceRoot3,
|
|
578
|
+
projectName,
|
|
579
|
+
process.env.NX_TASK_TARGET_TARGET || "build",
|
|
580
|
+
process.env.NX_TASK_TARGET_CONFIGURATION || "production",
|
|
581
|
+
true
|
|
582
|
+
);
|
|
503
583
|
const localPackages = [];
|
|
504
|
-
for (const project of projectDependencies.dependencies.filter(
|
|
584
|
+
for (const project of projectDependencies.dependencies.filter(
|
|
585
|
+
(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
|
|
586
|
+
)) {
|
|
505
587
|
const projectNode = project.node;
|
|
506
588
|
if (projectNode.data.root) {
|
|
507
|
-
const projectPackageJsonPath =
|
|
589
|
+
const projectPackageJsonPath = _chunkPZ5CI56Fjs.joinPaths.call(void 0,
|
|
590
|
+
workspaceRoot3,
|
|
591
|
+
projectNode.data.root,
|
|
592
|
+
"package.json"
|
|
593
|
+
);
|
|
508
594
|
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
509
|
-
const projectPackageJsonContent = await _promises.readFile.call(void 0,
|
|
595
|
+
const projectPackageJsonContent = await _promises.readFile.call(void 0,
|
|
596
|
+
projectPackageJsonPath,
|
|
597
|
+
"utf8"
|
|
598
|
+
);
|
|
510
599
|
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
511
600
|
if (projectPackageJson.private !== true) {
|
|
512
601
|
localPackages.push(projectPackageJson);
|
|
@@ -515,19 +604,33 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
515
604
|
}
|
|
516
605
|
}
|
|
517
606
|
if (localPackages.length > 0) {
|
|
518
|
-
|
|
519
|
-
|
|
607
|
+
_chunkPZ5CI56Fjs.writeTrace.call(void 0,
|
|
608
|
+
`\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`
|
|
609
|
+
);
|
|
610
|
+
const projectJsonFile = await _promises.readFile.call(void 0,
|
|
611
|
+
_chunkPZ5CI56Fjs.joinPaths.call(void 0, projectRoot, "project.json"),
|
|
612
|
+
"utf8"
|
|
613
|
+
);
|
|
520
614
|
const projectJson = JSON.parse(projectJsonFile);
|
|
521
615
|
const projectName2 = projectJson.name;
|
|
522
616
|
const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
523
617
|
if (!_optionalChain([projectConfigurations, 'optionalAccess', _35 => _35.projects, 'optionalAccess', _36 => _36[projectName2]])) {
|
|
524
|
-
throw new Error(
|
|
618
|
+
throw new Error(
|
|
619
|
+
"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."
|
|
620
|
+
);
|
|
525
621
|
}
|
|
526
622
|
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) => {
|
|
527
623
|
if (_optionalChain([projectConfigurations, 'access', _42 => _42.projects, 'optionalAccess', _43 => _43[dep]])) {
|
|
528
|
-
const depPackageJsonPath =
|
|
624
|
+
const depPackageJsonPath = _chunkPZ5CI56Fjs.joinPaths.call(void 0,
|
|
625
|
+
workspaceRoot3,
|
|
626
|
+
projectConfigurations.projects[dep].root,
|
|
627
|
+
"package.json"
|
|
628
|
+
);
|
|
529
629
|
if (_fs.existsSync.call(void 0, depPackageJsonPath)) {
|
|
530
|
-
const depPackageJsonContent = _fs.readFileSync.call(void 0,
|
|
630
|
+
const depPackageJsonContent = _fs.readFileSync.call(void 0,
|
|
631
|
+
depPackageJsonPath,
|
|
632
|
+
"utf8"
|
|
633
|
+
);
|
|
531
634
|
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
532
635
|
if (depPackageJson.private !== true && !ret.includes(depPackageJson.name)) {
|
|
533
636
|
ret.push(depPackageJson.name);
|
|
@@ -549,13 +652,16 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
549
652
|
return ret;
|
|
550
653
|
}, _nullishCoalesce(packageJson.devDependencies, () => ( {})));
|
|
551
654
|
} else {
|
|
552
|
-
|
|
655
|
+
_chunkPZ5CI56Fjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
|
|
553
656
|
}
|
|
554
657
|
return packageJson;
|
|
555
|
-
}
|
|
556
|
-
var addWorkspacePackageJsonFields =
|
|
557
|
-
const workspaceRoot3 = workspaceConfig.workspaceRoot ? workspaceConfig.workspaceRoot :
|
|
558
|
-
const workspacePackageJsonContent = await _promises.readFile.call(void 0,
|
|
658
|
+
};
|
|
659
|
+
var addWorkspacePackageJsonFields = async (workspaceConfig, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
660
|
+
const workspaceRoot3 = workspaceConfig.workspaceRoot ? workspaceConfig.workspaceRoot : _chunkPZ5CI56Fjs.findWorkspaceRoot.call(void 0, );
|
|
661
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0,
|
|
662
|
+
_chunkPZ5CI56Fjs.joinPaths.call(void 0, workspaceRoot3, "package.json"),
|
|
663
|
+
"utf8"
|
|
664
|
+
);
|
|
559
665
|
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
560
666
|
packageJson.type ??= "module";
|
|
561
667
|
packageJson.sideEffects ??= false;
|
|
@@ -564,11 +670,9 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call
|
|
|
564
670
|
if (distSrc.startsWith("/")) {
|
|
565
671
|
distSrc = distSrc.substring(1);
|
|
566
672
|
}
|
|
567
|
-
packageJson.source ??= `${
|
|
673
|
+
packageJson.source ??= `${_chunkPZ5CI56Fjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
568
674
|
}
|
|
569
|
-
packageJson.files ??= [
|
|
570
|
-
"dist/**/*"
|
|
571
|
-
];
|
|
675
|
+
packageJson.files ??= ["dist/**/*"];
|
|
572
676
|
if (includeSrc === true && !packageJson.files.includes("src")) {
|
|
573
677
|
packageJson.files.push("src/**/*");
|
|
574
678
|
}
|
|
@@ -584,26 +688,22 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call
|
|
|
584
688
|
packageJson.author ??= workspacePackageJson.author;
|
|
585
689
|
packageJson.maintainers ??= workspacePackageJson.maintainers;
|
|
586
690
|
if (!packageJson.maintainers && packageJson.author) {
|
|
587
|
-
packageJson.maintainers = [
|
|
588
|
-
packageJson.author
|
|
589
|
-
];
|
|
691
|
+
packageJson.maintainers = [packageJson.author];
|
|
590
692
|
}
|
|
591
693
|
packageJson.contributors ??= workspacePackageJson.contributors;
|
|
592
694
|
if (!packageJson.contributors && packageJson.author) {
|
|
593
|
-
packageJson.contributors = [
|
|
594
|
-
packageJson.author
|
|
595
|
-
];
|
|
695
|
+
packageJson.contributors = [packageJson.author];
|
|
596
696
|
}
|
|
597
697
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
598
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot :
|
|
698
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkPZ5CI56Fjs.joinPaths.call(void 0, "packages", projectName);
|
|
599
699
|
return packageJson;
|
|
600
|
-
}
|
|
700
|
+
};
|
|
601
701
|
|
|
602
702
|
// ../build-tools/src/utilities/get-entry-points.ts
|
|
603
703
|
|
|
604
704
|
|
|
605
705
|
// ../build-tools/src/utilities/get-env.ts
|
|
606
|
-
var getEnv =
|
|
706
|
+
var getEnv = (builder, options) => {
|
|
607
707
|
return {
|
|
608
708
|
STORM_BUILD: builder,
|
|
609
709
|
STORM_ORG: options.orgName || DEFAULT_ORGANIZATION,
|
|
@@ -614,42 +714,54 @@ var getEnv = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (builder, opti
|
|
|
614
714
|
STORM_TARGET: JSON.stringify(options.target),
|
|
615
715
|
...options.env
|
|
616
716
|
};
|
|
617
|
-
}
|
|
717
|
+
};
|
|
618
718
|
|
|
619
719
|
// ../build-tools/src/utilities/read-nx-config.ts
|
|
620
720
|
|
|
621
721
|
|
|
622
722
|
|
|
623
723
|
// ../build-tools/src/utilities/task-graph.ts
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
|
|
624
727
|
var _createtaskgraph = require('nx/src/tasks-runner/create-task-graph');
|
|
625
728
|
|
|
626
729
|
// ../esbuild/src/assets.ts
|
|
627
730
|
async function copyBuildAssets(context) {
|
|
628
731
|
if (_optionalChain([context, 'access', _52 => _52.result, 'optionalAccess', _53 => _53.errors, 'access', _54 => _54.length]) === 0) {
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
732
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0,
|
|
733
|
+
` \u{1F4CB} Copying asset files to output directory: ${context.outputPath}`,
|
|
734
|
+
context.workspaceConfig
|
|
735
|
+
);
|
|
736
|
+
const stopwatch = _chunkPZ5CI56Fjs.getStopwatch.call(void 0, `${context.options.name} asset copy`);
|
|
737
|
+
await copyAssets(
|
|
738
|
+
context.workspaceConfig,
|
|
739
|
+
_nullishCoalesce(context.options.assets, () => ( [])),
|
|
740
|
+
context.outputPath,
|
|
741
|
+
context.options.projectRoot,
|
|
742
|
+
context.sourceRoot,
|
|
743
|
+
true,
|
|
744
|
+
false
|
|
745
|
+
);
|
|
632
746
|
stopwatch();
|
|
633
747
|
}
|
|
634
748
|
return context;
|
|
635
749
|
}
|
|
636
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
637
750
|
|
|
638
751
|
// ../esbuild/src/clean.ts
|
|
639
752
|
|
|
640
753
|
async function cleanDirectories(directory) {
|
|
641
|
-
await _promises.rm.call(void 0, directory, {
|
|
642
|
-
recursive: true,
|
|
643
|
-
force: true
|
|
644
|
-
});
|
|
754
|
+
await _promises.rm.call(void 0, directory, { recursive: true, force: true });
|
|
645
755
|
}
|
|
646
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, cleanDirectories, "cleanDirectories");
|
|
647
756
|
|
|
648
757
|
// ../esbuild/src/context.ts
|
|
649
758
|
|
|
650
759
|
|
|
651
760
|
|
|
652
761
|
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
|
|
653
765
|
var _findworkspaceroot = require('nx/src/utils/find-workspace-root');
|
|
654
766
|
|
|
655
767
|
// ../esbuild/src/config.ts
|
|
@@ -703,43 +815,46 @@ function resolvePathsConfig(options, cwd, projectRoot) {
|
|
|
703
815
|
if (_optionalChain([options, 'optionalAccess', _55 => _55.compilerOptions, 'optionalAccess', _56 => _56.paths])) {
|
|
704
816
|
const paths = Object.entries(options.compilerOptions.paths);
|
|
705
817
|
const resolvedPaths = paths.map(([key, paths2]) => {
|
|
706
|
-
return [
|
|
707
|
-
key,
|
|
708
|
-
paths2.map((v) => path4.default.resolve(cwd, v))
|
|
709
|
-
];
|
|
818
|
+
return [key, paths2.map((v) => path4.default.resolve(cwd, v))];
|
|
710
819
|
});
|
|
711
820
|
return Object.fromEntries(resolvedPaths);
|
|
712
821
|
}
|
|
713
822
|
if (options.extends) {
|
|
714
|
-
const extendsPath = path4.default.resolve(
|
|
823
|
+
const extendsPath = path4.default.resolve(
|
|
824
|
+
projectRoot ? _chunkPZ5CI56Fjs.joinPaths.call(void 0, cwd, projectRoot, options.extends) : _chunkPZ5CI56Fjs.joinPaths.call(void 0, cwd, options.extends)
|
|
825
|
+
);
|
|
715
826
|
const extendsDir = path4.default.dirname(extendsPath);
|
|
716
|
-
const extendsConfig =
|
|
827
|
+
const extendsConfig = _chunkMCKGQKYUjs.__require.call(void 0, extendsPath);
|
|
717
828
|
return resolvePathsConfig(extendsConfig, extendsDir);
|
|
718
829
|
}
|
|
719
830
|
return [];
|
|
720
831
|
}
|
|
721
|
-
|
|
722
|
-
var resolvePathsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (context) => ({
|
|
832
|
+
var resolvePathsPlugin = (context) => ({
|
|
723
833
|
name: "storm:resolve-paths",
|
|
724
834
|
setup(build3) {
|
|
725
|
-
const parentTsConfig = build3.initialOptions.tsconfig ?
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
835
|
+
const parentTsConfig = build3.initialOptions.tsconfig ? _chunkMCKGQKYUjs.__require.call(void 0, _chunkPZ5CI56Fjs.joinPaths.call(void 0,
|
|
836
|
+
context.workspaceConfig.workspaceRoot,
|
|
837
|
+
build3.initialOptions.tsconfig.replace(
|
|
838
|
+
context.workspaceConfig.workspaceRoot,
|
|
839
|
+
""
|
|
840
|
+
)
|
|
841
|
+
)) : _chunkMCKGQKYUjs.__require.call(void 0, _chunkPZ5CI56Fjs.joinPaths.call(void 0, context.workspaceConfig.workspaceRoot, "tsconfig.json"));
|
|
842
|
+
const resolvedTsPaths = resolvePathsConfig(
|
|
843
|
+
parentTsConfig,
|
|
844
|
+
context.workspaceConfig.workspaceRoot,
|
|
845
|
+
context.options.projectRoot
|
|
846
|
+
);
|
|
847
|
+
const packagesRegex = new RegExp(
|
|
848
|
+
`^(${Object.keys(resolvedTsPaths).join("|")})$`
|
|
849
|
+
);
|
|
850
|
+
build3.onResolve({ filter: packagesRegex }, (args) => {
|
|
731
851
|
if (_optionalChain([build3, 'access', _57 => _57.initialOptions, 'access', _58 => _58.external, 'optionalAccess', _59 => _59.includes, 'call', _60 => _60(args.path)])) {
|
|
732
|
-
return {
|
|
733
|
-
path: args.path,
|
|
734
|
-
external: true
|
|
735
|
-
};
|
|
852
|
+
return { path: args.path, external: true };
|
|
736
853
|
}
|
|
737
|
-
return {
|
|
738
|
-
path: `${resolvedTsPaths[args.path][0]}/index.ts`
|
|
739
|
-
};
|
|
854
|
+
return { path: `${resolvedTsPaths[args.path][0]}/index.ts` };
|
|
740
855
|
});
|
|
741
856
|
}
|
|
742
|
-
})
|
|
857
|
+
});
|
|
743
858
|
|
|
744
859
|
// ../esbuild/src/context.ts
|
|
745
860
|
async function resolveContext(userOptions) {
|
|
@@ -748,15 +863,19 @@ async function resolveContext(userOptions) {
|
|
|
748
863
|
if (!workspaceRoot3) {
|
|
749
864
|
throw new Error("Cannot find Nx workspace root");
|
|
750
865
|
}
|
|
751
|
-
const workspaceConfig = await
|
|
866
|
+
const workspaceConfig = await _chunkHBASMEU5js.getWorkspaceConfig.call(void 0, true, {
|
|
752
867
|
workspaceRoot: workspaceRoot3.dir
|
|
753
868
|
});
|
|
754
|
-
|
|
755
|
-
const stopwatch =
|
|
869
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", workspaceConfig);
|
|
870
|
+
const stopwatch = _chunkPZ5CI56Fjs.getStopwatch.call(void 0, "Build options resolution");
|
|
756
871
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
757
872
|
exitOnError: true
|
|
758
873
|
});
|
|
759
|
-
const projectJsonPath =
|
|
874
|
+
const projectJsonPath = _chunkPZ5CI56Fjs.joinPaths.call(void 0,
|
|
875
|
+
workspaceRoot3.dir,
|
|
876
|
+
projectRoot,
|
|
877
|
+
"project.json"
|
|
878
|
+
);
|
|
760
879
|
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
761
880
|
throw new Error("Cannot find project.json configuration");
|
|
762
881
|
}
|
|
@@ -765,18 +884,24 @@ async function resolveContext(userOptions) {
|
|
|
765
884
|
const projectName = projectJson.name || userOptions.name;
|
|
766
885
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
767
886
|
if (!_optionalChain([projectConfigurations, 'optionalAccess', _61 => _61.projects, 'optionalAccess', _62 => _62[projectName]])) {
|
|
768
|
-
throw new Error(
|
|
887
|
+
throw new Error(
|
|
888
|
+
"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."
|
|
889
|
+
);
|
|
769
890
|
}
|
|
770
891
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
|
|
771
892
|
options.name ??= projectName;
|
|
772
|
-
const packageJsonPath =
|
|
893
|
+
const packageJsonPath = _chunkPZ5CI56Fjs.joinPaths.call(void 0,
|
|
894
|
+
workspaceRoot3.dir,
|
|
895
|
+
options.projectRoot,
|
|
896
|
+
"package.json"
|
|
897
|
+
);
|
|
773
898
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
774
899
|
throw new Error("Cannot find package.json configuration");
|
|
775
900
|
}
|
|
776
901
|
const env = getEnv("esbuild", options);
|
|
777
902
|
const define = _defu2.default.call(void 0, _nullishCoalesce(options.define, () => ( {})), _nullishCoalesce(env, () => ( {})));
|
|
778
903
|
const resolvedOptions = {
|
|
779
|
-
tsconfig:
|
|
904
|
+
tsconfig: _chunkPZ5CI56Fjs.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "tsconfig.json"),
|
|
780
905
|
...options,
|
|
781
906
|
metafile: userOptions.mode === "development",
|
|
782
907
|
clean: false,
|
|
@@ -802,8 +927,12 @@ async function resolveContext(userOptions) {
|
|
|
802
927
|
projectConfigurations,
|
|
803
928
|
projectName,
|
|
804
929
|
projectGraph,
|
|
805
|
-
sourceRoot: resolvedOptions.sourceRoot || projectJson.sourceRoot ||
|
|
806
|
-
outputPath: resolvedOptions.outputPath ||
|
|
930
|
+
sourceRoot: resolvedOptions.sourceRoot || projectJson.sourceRoot || _chunkPZ5CI56Fjs.joinPaths.call(void 0, resolvedOptions.projectRoot, "src"),
|
|
931
|
+
outputPath: resolvedOptions.outputPath || _chunkPZ5CI56Fjs.joinPaths.call(void 0,
|
|
932
|
+
workspaceConfig.workspaceRoot,
|
|
933
|
+
"dist",
|
|
934
|
+
resolvedOptions.projectRoot
|
|
935
|
+
),
|
|
807
936
|
minify: resolvedOptions.minify || resolvedOptions.mode === "production"
|
|
808
937
|
};
|
|
809
938
|
context.options.esbuildPlugins = [
|
|
@@ -812,27 +941,48 @@ async function resolveContext(userOptions) {
|
|
|
812
941
|
];
|
|
813
942
|
return context;
|
|
814
943
|
}
|
|
815
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, resolveContext, "resolveContext");
|
|
816
944
|
|
|
817
945
|
// ../esbuild/src/package-json.ts
|
|
818
946
|
|
|
819
947
|
|
|
820
948
|
|
|
821
949
|
async function generatePackageJson(context) {
|
|
822
|
-
if (context.options.generatePackageJson !== false && _fs.existsSync.call(void 0,
|
|
823
|
-
|
|
824
|
-
const stopwatch =
|
|
825
|
-
const packageJsonPath =
|
|
950
|
+
if (context.options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkPZ5CI56Fjs.joinPaths.call(void 0, context.options.projectRoot, "package.json"))) {
|
|
951
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context.workspaceConfig);
|
|
952
|
+
const stopwatch = _chunkPZ5CI56Fjs.getStopwatch.call(void 0, "Write package.json file");
|
|
953
|
+
const packageJsonPath = _chunkPZ5CI56Fjs.joinPaths.call(void 0,
|
|
954
|
+
context.options.projectRoot,
|
|
955
|
+
"project.json"
|
|
956
|
+
);
|
|
826
957
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
827
958
|
throw new Error("Cannot find package.json configuration");
|
|
828
959
|
}
|
|
829
|
-
const packageJsonFile = await _promises2.default.readFile(
|
|
960
|
+
const packageJsonFile = await _promises2.default.readFile(
|
|
961
|
+
_chunkPZ5CI56Fjs.joinPaths.call(void 0,
|
|
962
|
+
context.workspaceConfig.workspaceRoot,
|
|
963
|
+
context.options.projectRoot,
|
|
964
|
+
"package.json"
|
|
965
|
+
),
|
|
966
|
+
"utf8"
|
|
967
|
+
);
|
|
830
968
|
let packageJson = JSON.parse(packageJsonFile);
|
|
831
969
|
if (!packageJson) {
|
|
832
970
|
throw new Error("Cannot find package.json configuration file");
|
|
833
971
|
}
|
|
834
|
-
packageJson = await addPackageDependencies(
|
|
835
|
-
|
|
972
|
+
packageJson = await addPackageDependencies(
|
|
973
|
+
context.workspaceConfig.workspaceRoot,
|
|
974
|
+
context.options.projectRoot,
|
|
975
|
+
context.projectName,
|
|
976
|
+
packageJson
|
|
977
|
+
);
|
|
978
|
+
packageJson = await addWorkspacePackageJsonFields(
|
|
979
|
+
context.workspaceConfig,
|
|
980
|
+
context.options.projectRoot,
|
|
981
|
+
context.sourceRoot,
|
|
982
|
+
context.projectName,
|
|
983
|
+
false,
|
|
984
|
+
packageJson
|
|
985
|
+
);
|
|
836
986
|
if (context.options.entry) {
|
|
837
987
|
packageJson.exports ??= {};
|
|
838
988
|
packageJson.exports["./package.json"] ??= "./package.json";
|
|
@@ -902,20 +1052,25 @@ async function generatePackageJson(context) {
|
|
|
902
1052
|
if (isDts) {
|
|
903
1053
|
packageJson.types = `${defaultEntry}.d.${isEsm ? "mts" : isCjs ? "cts" : "ts"}`;
|
|
904
1054
|
}
|
|
905
|
-
packageJson.exports = Object.keys(packageJson.exports).reduce(
|
|
906
|
-
|
|
907
|
-
ret[key.replace("/index", "")]
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
1055
|
+
packageJson.exports = Object.keys(packageJson.exports).reduce(
|
|
1056
|
+
(ret, key) => {
|
|
1057
|
+
if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
|
|
1058
|
+
ret[key.replace("/index", "")] = packageJson.exports[key];
|
|
1059
|
+
}
|
|
1060
|
+
return ret;
|
|
1061
|
+
},
|
|
1062
|
+
packageJson.exports
|
|
1063
|
+
);
|
|
911
1064
|
}
|
|
912
1065
|
}
|
|
913
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
1066
|
+
await _devkit.writeJsonFile.call(void 0,
|
|
1067
|
+
_chunkPZ5CI56Fjs.joinPaths.call(void 0, context.outputPath, "package.json"),
|
|
1068
|
+
packageJson
|
|
1069
|
+
);
|
|
914
1070
|
stopwatch();
|
|
915
1071
|
}
|
|
916
1072
|
return context;
|
|
917
1073
|
}
|
|
918
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, generatePackageJson, "generatePackageJson");
|
|
919
1074
|
|
|
920
1075
|
// ../esbuild/src/plugins/deps-check.ts
|
|
921
1076
|
|
|
@@ -944,16 +1099,12 @@ var unusedIgnore = [
|
|
|
944
1099
|
// these are indirectly used by build
|
|
945
1100
|
"buffer"
|
|
946
1101
|
];
|
|
947
|
-
var missingIgnore = [
|
|
948
|
-
|
|
949
|
-
"@prisma/client",
|
|
950
|
-
"ts-toolbelt"
|
|
951
|
-
];
|
|
952
|
-
var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bundle) => ({
|
|
1102
|
+
var missingIgnore = [".prisma", "@prisma/client", "ts-toolbelt"];
|
|
1103
|
+
var depsCheckPlugin = (bundle) => ({
|
|
953
1104
|
name: "storm:deps-check",
|
|
954
1105
|
setup(build3) {
|
|
955
1106
|
const pkgJsonPath = path4.default.join(process.cwd(), "package.json");
|
|
956
|
-
const pkgContents =
|
|
1107
|
+
const pkgContents = _chunkMCKGQKYUjs.__require.call(void 0, pkgJsonPath);
|
|
957
1108
|
const regDependencies = Object.keys(_nullishCoalesce(pkgContents["dependencies"], () => ( {})));
|
|
958
1109
|
const devDependencies = Object.keys(_nullishCoalesce(pkgContents["devDependencies"], () => ( {})));
|
|
959
1110
|
const peerDependencies = Object.keys(_nullishCoalesce(pkgContents["peerDependencies"], () => ( {})));
|
|
@@ -963,9 +1114,7 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
|
|
|
963
1114
|
];
|
|
964
1115
|
const collectedDependencies = /* @__PURE__ */ new Set();
|
|
965
1116
|
const onlyPackages = /^[^./](?!:)|^\.[^./]|^\.\.[^/]/;
|
|
966
|
-
build3.onResolve({
|
|
967
|
-
filter: onlyPackages
|
|
968
|
-
}, (args) => {
|
|
1117
|
+
build3.onResolve({ filter: onlyPackages }, (args) => {
|
|
969
1118
|
if (args.importer.includes(process.cwd())) {
|
|
970
1119
|
if (args.path[0] === "@") {
|
|
971
1120
|
const [org, pkg] = args.path.split("/");
|
|
@@ -975,19 +1124,13 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
|
|
|
975
1124
|
collectedDependencies.add(pkg);
|
|
976
1125
|
}
|
|
977
1126
|
}
|
|
978
|
-
return {
|
|
979
|
-
external: true
|
|
980
|
-
};
|
|
1127
|
+
return { external: true };
|
|
981
1128
|
});
|
|
982
1129
|
build3.onEnd(() => {
|
|
983
|
-
const unusedDependencies = [
|
|
984
|
-
...dependencies
|
|
985
|
-
].filter((dep) => {
|
|
1130
|
+
const unusedDependencies = [...dependencies].filter((dep) => {
|
|
986
1131
|
return !collectedDependencies.has(dep) || _module.builtinModules.includes(dep);
|
|
987
1132
|
});
|
|
988
|
-
const missingDependencies = [
|
|
989
|
-
...collectedDependencies
|
|
990
|
-
].filter((dep) => {
|
|
1133
|
+
const missingDependencies = [...collectedDependencies].filter((dep) => {
|
|
991
1134
|
return !dependencies.includes(dep) && !_module.builtinModules.includes(dep);
|
|
992
1135
|
});
|
|
993
1136
|
const filteredUnusedDeps = unusedDependencies.filter((dep) => {
|
|
@@ -996,8 +1139,12 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
|
|
|
996
1139
|
const filteredMissingDeps = missingDependencies.filter((dep) => {
|
|
997
1140
|
return !missingIgnore.some((pattern) => dep.match(pattern)) && !peerDependencies.includes(dep);
|
|
998
1141
|
});
|
|
999
|
-
|
|
1000
|
-
|
|
1142
|
+
_chunkPZ5CI56Fjs.writeWarning.call(void 0,
|
|
1143
|
+
`Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`
|
|
1144
|
+
);
|
|
1145
|
+
_chunkPZ5CI56Fjs.writeError.call(void 0,
|
|
1146
|
+
`Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`
|
|
1147
|
+
);
|
|
1001
1148
|
if (filteredMissingDeps.length > 0) {
|
|
1002
1149
|
throw new Error(`Missing dependencies detected - please install them:
|
|
1003
1150
|
${JSON.stringify(filteredMissingDeps)}
|
|
@@ -1005,36 +1152,48 @@ ${JSON.stringify(filteredMissingDeps)}
|
|
|
1005
1152
|
}
|
|
1006
1153
|
});
|
|
1007
1154
|
}
|
|
1008
|
-
})
|
|
1155
|
+
});
|
|
1009
1156
|
|
|
1010
1157
|
// ../esbuild/src/tsup.ts
|
|
1011
1158
|
var _tsup = require('tsup');
|
|
1012
1159
|
async function executeTsup(context) {
|
|
1013
|
-
|
|
1014
|
-
|
|
1160
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0,
|
|
1161
|
+
` \u{1F680} Running ${context.options.name} build`,
|
|
1162
|
+
context.workspaceConfig
|
|
1163
|
+
);
|
|
1164
|
+
const stopwatch = _chunkPZ5CI56Fjs.getStopwatch.call(void 0, `${context.options.name} build`);
|
|
1015
1165
|
await _tsup.build.call(void 0, {
|
|
1016
1166
|
...context.options,
|
|
1017
|
-
outDir: context.options.distDir ?
|
|
1167
|
+
outDir: context.options.distDir ? _chunkPZ5CI56Fjs.joinPaths.call(void 0, context.outputPath, context.options.distDir) : context.outputPath,
|
|
1018
1168
|
workspaceConfig: context.workspaceConfig
|
|
1019
1169
|
});
|
|
1020
1170
|
stopwatch();
|
|
1021
1171
|
return context;
|
|
1022
1172
|
}
|
|
1023
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, executeTsup, "executeTsup");
|
|
1024
1173
|
|
|
1025
1174
|
// ../esbuild/src/build.ts
|
|
1026
1175
|
async function reportResults(context) {
|
|
1027
1176
|
if (_optionalChain([context, 'access', _63 => _63.result, 'optionalAccess', _64 => _64.errors, 'access', _65 => _65.length]) === 0) {
|
|
1028
1177
|
if (context.result.warnings.length > 0) {
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1178
|
+
_chunkPZ5CI56Fjs.writeWarning.call(void 0,
|
|
1179
|
+
` \u{1F6A7} The following warnings occurred during the build: ${context.result.warnings.map((warning) => warning.text).join("\n")}`,
|
|
1180
|
+
context.workspaceConfig
|
|
1181
|
+
);
|
|
1182
|
+
}
|
|
1183
|
+
_chunkPZ5CI56Fjs.writeSuccess.call(void 0,
|
|
1184
|
+
` \u{1F4E6} The ${context.options.name} build completed successfully`,
|
|
1185
|
+
context.workspaceConfig
|
|
1186
|
+
);
|
|
1032
1187
|
} else if (_optionalChain([context, 'access', _66 => _66.result, 'optionalAccess', _67 => _67.errors]) && _optionalChain([context, 'access', _68 => _68.result, 'optionalAccess', _69 => _69.errors, 'access', _70 => _70.length]) > 0) {
|
|
1033
|
-
|
|
1034
|
-
|
|
1188
|
+
_chunkPZ5CI56Fjs.writeError.call(void 0,
|
|
1189
|
+
` \u274C The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`,
|
|
1190
|
+
context.workspaceConfig
|
|
1191
|
+
);
|
|
1192
|
+
throw new Error(
|
|
1193
|
+
`The ${context.options.name} build failed with the following errors: ${context.result.errors.map((error) => error.text).join("\n")}`
|
|
1194
|
+
);
|
|
1035
1195
|
}
|
|
1036
1196
|
}
|
|
1037
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, reportResults, "reportResults");
|
|
1038
1197
|
async function dependencyCheck(options) {
|
|
1039
1198
|
if (process.env.DEV === "true") {
|
|
1040
1199
|
return void 0;
|
|
@@ -1045,43 +1204,39 @@ async function dependencyCheck(options) {
|
|
|
1045
1204
|
const buildPromise = esbuild.build({
|
|
1046
1205
|
entryPoints: _globby.globbySync.call(void 0, "**/*.{j,t}s", {
|
|
1047
1206
|
// We don't check dependencies in ecosystem tests because tests are isolated from the build.
|
|
1048
|
-
ignore: [
|
|
1049
|
-
"./src/__tests__/**/*",
|
|
1050
|
-
"./tests/e2e/**/*",
|
|
1051
|
-
"./dist/**/*"
|
|
1052
|
-
],
|
|
1207
|
+
ignore: ["./src/__tests__/**/*", "./tests/e2e/**/*", "./dist/**/*"],
|
|
1053
1208
|
gitignore: true
|
|
1054
1209
|
}),
|
|
1055
1210
|
logLevel: "silent",
|
|
1211
|
+
// there will be errors
|
|
1056
1212
|
bundle: true,
|
|
1213
|
+
// we bundle to get everything
|
|
1057
1214
|
write: false,
|
|
1215
|
+
// no need to write for analysis
|
|
1058
1216
|
outdir: "out",
|
|
1059
|
-
plugins: [
|
|
1060
|
-
depsCheckPlugin(options.bundle)
|
|
1061
|
-
]
|
|
1217
|
+
plugins: [depsCheckPlugin(options.bundle)]
|
|
1062
1218
|
});
|
|
1063
1219
|
await buildPromise.catch(() => {
|
|
1064
1220
|
});
|
|
1065
1221
|
return void 0;
|
|
1066
1222
|
}
|
|
1067
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, dependencyCheck, "dependencyCheck");
|
|
1068
1223
|
async function cleanOutputPath(context) {
|
|
1069
1224
|
if (context.clean !== false && context.outputPath) {
|
|
1070
|
-
|
|
1071
|
-
|
|
1225
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0,
|
|
1226
|
+
` \u{1F9F9} Cleaning ${context.options.name} output path: ${context.outputPath}`,
|
|
1227
|
+
context.workspaceConfig
|
|
1228
|
+
);
|
|
1229
|
+
const stopwatch = _chunkPZ5CI56Fjs.getStopwatch.call(void 0, `${context.options.name} output clean`);
|
|
1072
1230
|
await cleanDirectories(context.outputPath);
|
|
1073
1231
|
stopwatch();
|
|
1074
1232
|
}
|
|
1075
1233
|
return context;
|
|
1076
1234
|
}
|
|
1077
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
|
|
1078
1235
|
async function build2(options) {
|
|
1079
|
-
|
|
1080
|
-
const stopwatch =
|
|
1236
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0, ` \u26A1 Executing Storm ESBuild pipeline`);
|
|
1237
|
+
const stopwatch = _chunkPZ5CI56Fjs.getStopwatch.call(void 0, "ESBuild pipeline");
|
|
1081
1238
|
try {
|
|
1082
|
-
const opts = Array.isArray(options) ? options : [
|
|
1083
|
-
options
|
|
1084
|
-
];
|
|
1239
|
+
const opts = Array.isArray(options) ? options : [options];
|
|
1085
1240
|
if (opts.length === 0) {
|
|
1086
1241
|
throw new Error("No build options were provided");
|
|
1087
1242
|
}
|
|
@@ -1094,21 +1249,24 @@ async function build2(options) {
|
|
|
1094
1249
|
executeTsup(context)
|
|
1095
1250
|
]);
|
|
1096
1251
|
await reportResults(context);
|
|
1097
|
-
|
|
1252
|
+
_chunkPZ5CI56Fjs.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
|
|
1098
1253
|
} catch (error) {
|
|
1099
|
-
|
|
1254
|
+
_chunkPZ5CI56Fjs.writeFatal.call(void 0,
|
|
1255
|
+
"Fatal errors that the build process could not recover from have occured. The build process has been terminated."
|
|
1256
|
+
);
|
|
1100
1257
|
throw error;
|
|
1101
1258
|
} finally {
|
|
1102
1259
|
stopwatch();
|
|
1103
1260
|
}
|
|
1104
1261
|
}
|
|
1105
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, build2, "build");
|
|
1106
1262
|
|
|
1107
1263
|
// ../workspace-tools/src/executors/esbuild/executor.ts
|
|
1108
1264
|
async function esbuildExecutorFn(options, context, config) {
|
|
1109
|
-
|
|
1265
|
+
_chunkPZ5CI56Fjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
|
|
1110
1266
|
if (!_optionalChain([context, 'access', _71 => _71.projectsConfigurations, 'optionalAccess', _72 => _72.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName] || !_optionalChain([context, 'access', _73 => _73.projectsConfigurations, 'access', _74 => _74.projects, 'access', _75 => _75[context.projectName], 'optionalAccess', _76 => _76.root])) {
|
|
1111
|
-
throw new Error(
|
|
1267
|
+
throw new Error(
|
|
1268
|
+
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
1269
|
+
);
|
|
1112
1270
|
}
|
|
1113
1271
|
await build2({
|
|
1114
1272
|
...options,
|
|
@@ -1122,20 +1280,21 @@ async function esbuildExecutorFn(options, context, config) {
|
|
|
1122
1280
|
success: true
|
|
1123
1281
|
};
|
|
1124
1282
|
}
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1283
|
+
var executor_default6 = withRunExecutor(
|
|
1284
|
+
"Storm ESBuild build",
|
|
1285
|
+
esbuildExecutorFn,
|
|
1286
|
+
{
|
|
1287
|
+
skipReadingConfig: false,
|
|
1288
|
+
hooks: {
|
|
1289
|
+
applyDefaultOptions: async (options, config) => {
|
|
1290
|
+
options.entry ??= ["src/index.ts"];
|
|
1291
|
+
options.outputPath ??= "dist/{projectRoot}";
|
|
1292
|
+
options.tsconfig ??= "{projectRoot}/tsconfig.json";
|
|
1293
|
+
return options;
|
|
1294
|
+
}
|
|
1295
|
+
}
|
|
1137
1296
|
}
|
|
1138
|
-
|
|
1297
|
+
);
|
|
1139
1298
|
|
|
1140
1299
|
// ../workspace-tools/src/executors/npm-publish/executor.ts
|
|
1141
1300
|
|
|
@@ -1158,174 +1317,224 @@ var _file = require('@size-limit/file'); var _file2 = _interopRequireDefault(_fi
|
|
|
1158
1317
|
var _sizelimit = require('size-limit'); var _sizelimit2 = _interopRequireDefault(_sizelimit);
|
|
1159
1318
|
async function sizeLimitExecutorFn(options, context, config) {
|
|
1160
1319
|
if (!_optionalChain([context, 'optionalAccess', _85 => _85.projectName]) || !_optionalChain([context, 'access', _86 => _86.projectsConfigurations, 'optionalAccess', _87 => _87.projects]) || !context.projectsConfigurations.projects[context.projectName]) {
|
|
1161
|
-
throw new Error(
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1320
|
+
throw new Error(
|
|
1321
|
+
"The Size-Limit process failed because the context is not valid. Please run this command from a workspace."
|
|
1322
|
+
);
|
|
1323
|
+
}
|
|
1324
|
+
_chunkPZ5CI56Fjs.writeInfo.call(void 0, `\u{1F4CF} Running Size-Limit on ${context.projectName}`, config);
|
|
1325
|
+
_sizelimit2.default.call(void 0, [_file2.default, _esbuild3.default, _esbuildwhy2.default], {
|
|
1326
|
+
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context, 'access', _88 => _88.projectsConfigurations, 'access', _89 => _89.projects, 'access', _90 => _90[context.projectName], 'optionalAccess', _91 => _91.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0,
|
|
1327
|
+
_nullishCoalesce(_optionalChain([context, 'access', _92 => _92.projectsConfigurations, 'access', _93 => _93.projects, 'access', _94 => _94[context.projectName], 'optionalAccess', _95 => _95.root]), () => ( "./")),
|
|
1328
|
+
"src"
|
|
1329
|
+
)))
|
|
1170
1330
|
}).then((result) => {
|
|
1171
|
-
|
|
1331
|
+
_chunkPZ5CI56Fjs.writeInfo.call(void 0,
|
|
1332
|
+
`\u{1F4CF} ${context.projectName} Size-Limit result: ${JSON.stringify(result)}`,
|
|
1333
|
+
config
|
|
1334
|
+
);
|
|
1172
1335
|
});
|
|
1173
1336
|
return {
|
|
1174
1337
|
success: true
|
|
1175
1338
|
};
|
|
1176
1339
|
}
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1340
|
+
var executor_default7 = withRunExecutor(
|
|
1341
|
+
"Size-Limit Performance Test Executor",
|
|
1342
|
+
sizeLimitExecutorFn,
|
|
1343
|
+
{
|
|
1344
|
+
skipReadingConfig: false,
|
|
1345
|
+
hooks: {
|
|
1346
|
+
applyDefaultOptions: (options) => {
|
|
1347
|
+
return options;
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1184
1350
|
}
|
|
1185
|
-
|
|
1351
|
+
);
|
|
1186
1352
|
|
|
1187
1353
|
// ../workspace-tools/src/executors/typia/executor.ts
|
|
1188
1354
|
var _fsextra = require('fs-extra');
|
|
1189
1355
|
var _TypiaProgrammerjs = require('typia/lib/programmers/TypiaProgrammer.js');
|
|
1190
1356
|
async function typiaExecutorFn(options, _, config) {
|
|
1191
1357
|
if (options.clean !== false) {
|
|
1192
|
-
|
|
1358
|
+
_chunkPZ5CI56Fjs.writeInfo.call(void 0, `\u{1F9F9} Cleaning output path: ${options.outputPath}`, config);
|
|
1193
1359
|
_fsextra.removeSync.call(void 0, options.outputPath);
|
|
1194
1360
|
}
|
|
1195
|
-
await Promise.all(
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1361
|
+
await Promise.all(
|
|
1362
|
+
options.entry.map((entry) => {
|
|
1363
|
+
_chunkPZ5CI56Fjs.writeInfo.call(void 0, `\u{1F680} Running Typia on entry: ${entry}`, config);
|
|
1364
|
+
return _TypiaProgrammerjs.TypiaProgrammer.build({
|
|
1365
|
+
input: entry,
|
|
1366
|
+
output: options.outputPath,
|
|
1367
|
+
project: options.tsconfig
|
|
1368
|
+
});
|
|
1369
|
+
})
|
|
1370
|
+
);
|
|
1203
1371
|
return {
|
|
1204
1372
|
success: true
|
|
1205
1373
|
};
|
|
1206
1374
|
}
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1375
|
+
var executor_default8 = withRunExecutor(
|
|
1376
|
+
"Typia runtime validation generator",
|
|
1377
|
+
typiaExecutorFn,
|
|
1378
|
+
{
|
|
1379
|
+
skipReadingConfig: false,
|
|
1380
|
+
hooks: {
|
|
1381
|
+
applyDefaultOptions: (options) => {
|
|
1382
|
+
options.entry ??= ["{sourceRoot}/index.ts"];
|
|
1383
|
+
options.outputPath ??= "{sourceRoot}/__generated__/typia";
|
|
1384
|
+
options.tsconfig ??= "{projectRoot}/tsconfig.json";
|
|
1385
|
+
options.clean ??= true;
|
|
1386
|
+
return options;
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1220
1389
|
}
|
|
1221
|
-
|
|
1390
|
+
);
|
|
1222
1391
|
|
|
1223
1392
|
// ../workspace-tools/src/executors/unbuild/executor.ts
|
|
1224
1393
|
|
|
1225
1394
|
var _jiti = require('jiti');
|
|
1226
1395
|
async function unbuildExecutorFn(options, context, config) {
|
|
1227
|
-
|
|
1396
|
+
_chunkPZ5CI56Fjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
|
|
1228
1397
|
if (!_optionalChain([context, 'access', _96 => _96.projectsConfigurations, 'optionalAccess', _97 => _97.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
1229
|
-
throw new Error(
|
|
1398
|
+
throw new Error(
|
|
1399
|
+
"The Build process failed because the context is not valid. Please run this command from a workspace root directory."
|
|
1400
|
+
);
|
|
1230
1401
|
}
|
|
1231
1402
|
if (!context.projectsConfigurations.projects[context.projectName].root) {
|
|
1232
|
-
throw new Error(
|
|
1403
|
+
throw new Error(
|
|
1404
|
+
"The Build process failed because the project root is not valid. Please run this command from a workspace root directory."
|
|
1405
|
+
);
|
|
1233
1406
|
}
|
|
1234
1407
|
if (!context.projectsConfigurations.projects[context.projectName].sourceRoot) {
|
|
1235
|
-
throw new Error(
|
|
1408
|
+
throw new Error(
|
|
1409
|
+
"The Build process failed because the project's source root is not valid. Please run this command from a workspace root directory."
|
|
1410
|
+
);
|
|
1236
1411
|
}
|
|
1237
1412
|
const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
|
|
1238
|
-
fsCache: config.skipCache ? false :
|
|
1413
|
+
fsCache: config.skipCache ? false : _chunkPZ5CI56Fjs.joinPaths.call(void 0,
|
|
1414
|
+
config.workspaceRoot,
|
|
1415
|
+
config.directories.cache || "node_modules/.cache/storm",
|
|
1416
|
+
"jiti"
|
|
1417
|
+
),
|
|
1239
1418
|
interopDefault: true
|
|
1240
1419
|
});
|
|
1241
|
-
const stormUnbuild = await jiti.import(
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
}
|
|
1253
|
-
},
|
|
1254
|
-
rollup: {
|
|
1255
|
-
emitCJS: true,
|
|
1256
|
-
watch: false,
|
|
1257
|
-
dts: {
|
|
1258
|
-
respectExternal: true
|
|
1420
|
+
const stormUnbuild = await jiti.import(
|
|
1421
|
+
jiti.esmResolve("@storm-software/unbuild/build")
|
|
1422
|
+
);
|
|
1423
|
+
await stormUnbuild.build(
|
|
1424
|
+
_defu.defu.call(void 0,
|
|
1425
|
+
{
|
|
1426
|
+
...options,
|
|
1427
|
+
projectRoot: context.projectsConfigurations.projects[context.projectName].root,
|
|
1428
|
+
projectName: context.projectName,
|
|
1429
|
+
sourceRoot: context.projectsConfigurations.projects[context.projectName].sourceRoot,
|
|
1430
|
+
platform: options.platform
|
|
1259
1431
|
},
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1432
|
+
{
|
|
1433
|
+
stubOptions: {
|
|
1434
|
+
jiti: {
|
|
1435
|
+
fsCache: config.skipCache ? false : _chunkPZ5CI56Fjs.joinPaths.call(void 0,
|
|
1436
|
+
config.workspaceRoot,
|
|
1437
|
+
config.directories.cache || "node_modules/.cache/storm",
|
|
1438
|
+
"jiti"
|
|
1439
|
+
)
|
|
1440
|
+
}
|
|
1441
|
+
},
|
|
1442
|
+
rollup: {
|
|
1443
|
+
emitCJS: true,
|
|
1444
|
+
watch: false,
|
|
1445
|
+
dts: {
|
|
1446
|
+
respectExternal: true
|
|
1447
|
+
},
|
|
1448
|
+
esbuild: {
|
|
1449
|
+
target: options.target,
|
|
1450
|
+
format: "esm",
|
|
1451
|
+
platform: options.platform,
|
|
1452
|
+
minify: _nullishCoalesce(options.minify, () => ( !options.debug)),
|
|
1453
|
+
sourcemap: _nullishCoalesce(options.sourcemap, () => ( options.debug)),
|
|
1454
|
+
treeShaking: options.treeShaking
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1267
1457
|
}
|
|
1268
|
-
|
|
1269
|
-
|
|
1458
|
+
)
|
|
1459
|
+
);
|
|
1270
1460
|
return {
|
|
1271
1461
|
success: true
|
|
1272
1462
|
};
|
|
1273
1463
|
}
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
options
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
"
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1464
|
+
var executor_default9 = withRunExecutor(
|
|
1465
|
+
"TypeScript Unbuild build",
|
|
1466
|
+
unbuildExecutorFn,
|
|
1467
|
+
{
|
|
1468
|
+
skipReadingConfig: false,
|
|
1469
|
+
hooks: {
|
|
1470
|
+
applyDefaultOptions: async (options, config) => {
|
|
1471
|
+
options.debug ??= false;
|
|
1472
|
+
options.treeShaking ??= true;
|
|
1473
|
+
options.buildOnly ??= false;
|
|
1474
|
+
options.platform ??= "neutral";
|
|
1475
|
+
options.entry ??= ["{sourceRoot}"];
|
|
1476
|
+
options.tsconfig ??= "{projectRoot}/tsconfig.json";
|
|
1477
|
+
return options;
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1289
1480
|
}
|
|
1290
|
-
|
|
1481
|
+
);
|
|
1291
1482
|
|
|
1292
1483
|
// ../workspace-tools/src/generators/browser-library/generator.ts
|
|
1293
1484
|
|
|
1294
1485
|
|
|
1486
|
+
|
|
1487
|
+
|
|
1488
|
+
|
|
1489
|
+
|
|
1490
|
+
|
|
1295
1491
|
// ../workspace-tools/src/base/base-generator.ts
|
|
1296
|
-
var withRunGenerator =
|
|
1492
|
+
var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
1297
1493
|
skipReadingConfig: false
|
|
1298
1494
|
}) => async (tree, _options) => {
|
|
1299
|
-
const stopwatch =
|
|
1495
|
+
const stopwatch = _chunkPZ5CI56Fjs.getStopwatch.call(void 0, name);
|
|
1300
1496
|
let options = _options;
|
|
1301
1497
|
let config;
|
|
1302
1498
|
try {
|
|
1303
|
-
|
|
1499
|
+
_chunkPZ5CI56Fjs.writeInfo.call(void 0, `\u26A1 Running the ${name} generator...
|
|
1304
1500
|
|
|
1305
1501
|
`, config);
|
|
1306
|
-
const workspaceRoot3 =
|
|
1502
|
+
const workspaceRoot3 = _chunkPZ5CI56Fjs.findWorkspaceRoot.call(void 0, );
|
|
1307
1503
|
if (!generatorOptions.skipReadingConfig) {
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1504
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0,
|
|
1505
|
+
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
1506
|
+
- workspaceRoot: ${workspaceRoot3}`,
|
|
1507
|
+
config
|
|
1508
|
+
);
|
|
1509
|
+
config = await _chunkHBASMEU5js.getConfig.call(void 0, workspaceRoot3);
|
|
1311
1510
|
}
|
|
1312
1511
|
if (_optionalChain([generatorOptions, 'optionalAccess', _98 => _98.hooks, 'optionalAccess', _99 => _99.applyDefaultOptions])) {
|
|
1313
|
-
|
|
1314
|
-
options = await Promise.resolve(
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1512
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
1513
|
+
options = await Promise.resolve(
|
|
1514
|
+
generatorOptions.hooks.applyDefaultOptions(options, config)
|
|
1515
|
+
);
|
|
1516
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
1517
|
+
}
|
|
1518
|
+
_chunkPZ5CI56Fjs.writeTrace.call(void 0,
|
|
1519
|
+
`Generator schema options \u2699\uFE0F
|
|
1520
|
+
${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`,
|
|
1321
1521
|
config
|
|
1322
|
-
|
|
1522
|
+
);
|
|
1523
|
+
const tokenized = await applyWorkspaceTokens(
|
|
1524
|
+
options,
|
|
1525
|
+
{ workspaceRoot: tree.root, config },
|
|
1526
|
+
applyWorkspaceBaseTokens
|
|
1527
|
+
);
|
|
1323
1528
|
if (_optionalChain([generatorOptions, 'optionalAccess', _100 => _100.hooks, 'optionalAccess', _101 => _101.preProcess])) {
|
|
1324
|
-
|
|
1325
|
-
await Promise.resolve(
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1529
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
1530
|
+
await Promise.resolve(
|
|
1531
|
+
generatorOptions.hooks.preProcess(tokenized, config)
|
|
1532
|
+
);
|
|
1533
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
1534
|
+
}
|
|
1535
|
+
const result = await Promise.resolve(
|
|
1536
|
+
generatorFn(tree, tokenized, config)
|
|
1537
|
+
);
|
|
1329
1538
|
if (result) {
|
|
1330
1539
|
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _102 => _102.error, 'optionalAccess', _103 => _103.message]) && typeof _optionalChain([result, 'optionalAccess', _104 => _104.error, 'optionalAccess', _105 => _105.message]) === "string" && _optionalChain([result, 'optionalAccess', _106 => _106.error, 'optionalAccess', _107 => _107.name]) && typeof _optionalChain([result, 'optionalAccess', _108 => _108.error, 'optionalAccess', _109 => _109.name]) === "string") {
|
|
1331
1540
|
throw new Error(`The ${name} generator failed to run`, {
|
|
@@ -1336,29 +1545,49 @@ ${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${
|
|
|
1336
1545
|
}
|
|
1337
1546
|
}
|
|
1338
1547
|
if (_optionalChain([generatorOptions, 'optionalAccess', _111 => _111.hooks, 'optionalAccess', _112 => _112.postProcess])) {
|
|
1339
|
-
|
|
1548
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
1340
1549
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
1341
|
-
|
|
1550
|
+
_chunkPZ5CI56Fjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
1342
1551
|
}
|
|
1343
1552
|
return () => {
|
|
1344
|
-
|
|
1553
|
+
_chunkPZ5CI56Fjs.writeSuccess.call(void 0, `Completed running the ${name} generator!
|
|
1345
1554
|
`, config);
|
|
1346
1555
|
};
|
|
1347
1556
|
} catch (error) {
|
|
1348
1557
|
return () => {
|
|
1349
|
-
|
|
1350
|
-
|
|
1558
|
+
_chunkPZ5CI56Fjs.writeFatal.call(void 0,
|
|
1559
|
+
"A fatal error occurred while running the generator - the process was forced to terminate",
|
|
1560
|
+
config
|
|
1561
|
+
);
|
|
1562
|
+
_chunkPZ5CI56Fjs.writeError.call(void 0,
|
|
1563
|
+
`An exception was thrown in the generator's process
|
|
1351
1564
|
- Details: ${error.message}
|
|
1352
|
-
- Stacktrace: ${error.stack}`,
|
|
1565
|
+
- Stacktrace: ${error.stack}`,
|
|
1566
|
+
config
|
|
1567
|
+
);
|
|
1353
1568
|
};
|
|
1354
1569
|
} finally {
|
|
1355
1570
|
stopwatch();
|
|
1356
1571
|
}
|
|
1357
|
-
}
|
|
1572
|
+
};
|
|
1358
1573
|
|
|
1359
1574
|
// ../workspace-tools/src/base/typescript-library-generator.ts
|
|
1360
1575
|
|
|
1576
|
+
|
|
1577
|
+
|
|
1578
|
+
|
|
1579
|
+
|
|
1580
|
+
|
|
1581
|
+
|
|
1582
|
+
|
|
1583
|
+
|
|
1584
|
+
|
|
1585
|
+
|
|
1361
1586
|
var _projectnameandrootutils = require('@nx/devkit/src/generators/project-name-and-root-utils');
|
|
1587
|
+
|
|
1588
|
+
|
|
1589
|
+
|
|
1590
|
+
|
|
1362
1591
|
var _js = require('@nx/js');
|
|
1363
1592
|
var _init = require('@nx/js/src/generators/init/init'); var _init2 = _interopRequireDefault(_init);
|
|
1364
1593
|
var _generator = require('@nx/js/src/generators/setup-verdaccio/generator'); var _generator2 = _interopRequireDefault(_generator);
|
|
@@ -1371,42 +1600,41 @@ var pnpmVersion = "8.10.2";
|
|
|
1371
1600
|
|
|
1372
1601
|
// ../workspace-tools/src/base/typescript-library-generator.ts
|
|
1373
1602
|
async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
1374
|
-
const normalized = await normalizeOptions(tree, {
|
|
1375
|
-
...options
|
|
1376
|
-
});
|
|
1603
|
+
const normalized = await normalizeOptions(tree, { ...options });
|
|
1377
1604
|
const tasks = [];
|
|
1378
|
-
tasks.push(
|
|
1379
|
-
|
|
1380
|
-
tsConfigName: normalized.rootProject ? "tsconfig.json" : "tsconfig.base.json"
|
|
1381
|
-
}));
|
|
1382
|
-
tasks.push(_devkit.addDependenciesToPackageJson.call(void 0, tree, {}, {
|
|
1383
|
-
"@storm-software/workspace-tools": "latest",
|
|
1384
|
-
"@storm-software/testing-tools": "latest",
|
|
1385
|
-
..._nullishCoalesce(options.devDependencies, () => ( {}))
|
|
1386
|
-
}));
|
|
1387
|
-
if (normalized.publishable) {
|
|
1388
|
-
tasks.push(await _generator2.default.call(void 0, tree, {
|
|
1605
|
+
tasks.push(
|
|
1606
|
+
await _init2.default.call(void 0, tree, {
|
|
1389
1607
|
...normalized,
|
|
1390
|
-
|
|
1391
|
-
})
|
|
1608
|
+
tsConfigName: normalized.rootProject ? "tsconfig.json" : "tsconfig.base.json"
|
|
1609
|
+
})
|
|
1610
|
+
);
|
|
1611
|
+
tasks.push(
|
|
1612
|
+
_devkit.addDependenciesToPackageJson.call(void 0,
|
|
1613
|
+
tree,
|
|
1614
|
+
{},
|
|
1615
|
+
{
|
|
1616
|
+
"@storm-software/workspace-tools": "latest",
|
|
1617
|
+
"@storm-software/testing-tools": "latest",
|
|
1618
|
+
..._nullishCoalesce(options.devDependencies, () => ( {}))
|
|
1619
|
+
}
|
|
1620
|
+
)
|
|
1621
|
+
);
|
|
1622
|
+
if (normalized.publishable) {
|
|
1623
|
+
tasks.push(await _generator2.default.call(void 0, tree, { ...normalized, skipFormat: true }));
|
|
1392
1624
|
}
|
|
1393
1625
|
const projectConfig = {
|
|
1394
1626
|
root: normalized.directory,
|
|
1395
1627
|
projectType: "library",
|
|
1396
|
-
sourceRoot:
|
|
1628
|
+
sourceRoot: _chunkPZ5CI56Fjs.joinPaths.call(void 0, _nullishCoalesce(normalized.directory, () => ( "")), "src"),
|
|
1397
1629
|
targets: {
|
|
1398
1630
|
build: {
|
|
1399
1631
|
executor: options.buildExecutor,
|
|
1400
|
-
outputs: [
|
|
1401
|
-
"{options.outputPath}"
|
|
1402
|
-
],
|
|
1632
|
+
outputs: ["{options.outputPath}"],
|
|
1403
1633
|
options: {
|
|
1404
|
-
entry: [
|
|
1405
|
-
_chunkV7LBWOVVjs.joinPaths.call(void 0, normalized.projectRoot, "src", "index.ts")
|
|
1406
|
-
],
|
|
1634
|
+
entry: [_chunkPZ5CI56Fjs.joinPaths.call(void 0, normalized.projectRoot, "src", "index.ts")],
|
|
1407
1635
|
outputPath: getOutputPath(normalized),
|
|
1408
|
-
tsconfig:
|
|
1409
|
-
project:
|
|
1636
|
+
tsconfig: _chunkPZ5CI56Fjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json"),
|
|
1637
|
+
project: _chunkPZ5CI56Fjs.joinPaths.call(void 0, normalized.projectRoot, "package.json"),
|
|
1410
1638
|
defaultConfiguration: "production",
|
|
1411
1639
|
platform: "neutral",
|
|
1412
1640
|
assets: [
|
|
@@ -1438,9 +1666,12 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
1438
1666
|
if (options.platform) {
|
|
1439
1667
|
projectConfig.targets.build.options.platform = options.platform === "worker" ? "node" : options.platform;
|
|
1440
1668
|
}
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1669
|
+
_chunk6XDOBG77js.addProjectTag.call(void 0,
|
|
1670
|
+
projectConfig,
|
|
1671
|
+
_chunk6XDOBG77js.ProjectTagConstants.Platform.TAG_ID,
|
|
1672
|
+
options.platform === "node" ? _chunk6XDOBG77js.ProjectTagConstants.Platform.NODE : options.platform === "worker" ? _chunk6XDOBG77js.ProjectTagConstants.Platform.WORKER : options.platform === "browser" ? _chunk6XDOBG77js.ProjectTagConstants.Platform.BROWSER : _chunk6XDOBG77js.ProjectTagConstants.Platform.NEUTRAL,
|
|
1673
|
+
{ overwrite: false }
|
|
1674
|
+
);
|
|
1444
1675
|
createProjectTsConfigJson(tree, normalized);
|
|
1445
1676
|
_devkit.addProjectConfiguration.call(void 0, tree, normalized.name, projectConfig);
|
|
1446
1677
|
let repository = {
|
|
@@ -1460,7 +1691,7 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
1460
1691
|
if (!normalized.importPath) {
|
|
1461
1692
|
normalized.importPath = normalized.name;
|
|
1462
1693
|
}
|
|
1463
|
-
const packageJsonPath =
|
|
1694
|
+
const packageJsonPath = _chunkPZ5CI56Fjs.joinPaths.call(void 0, normalized.projectRoot, "package.json");
|
|
1464
1695
|
if (tree.exists(packageJsonPath)) {
|
|
1465
1696
|
_devkit.updateJson.call(void 0, tree, packageJsonPath, (json) => {
|
|
1466
1697
|
if (!normalized.importPath) {
|
|
@@ -1517,10 +1748,14 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
1517
1748
|
}));
|
|
1518
1749
|
}
|
|
1519
1750
|
_js.addTsConfigPath.call(void 0, tree, normalized.importPath, [
|
|
1520
|
-
|
|
1751
|
+
_chunkPZ5CI56Fjs.joinPaths.call(void 0,
|
|
1752
|
+
normalized.projectRoot,
|
|
1753
|
+
"./src",
|
|
1754
|
+
`index.${normalized.js ? "js" : "ts"}`
|
|
1755
|
+
)
|
|
1521
1756
|
]);
|
|
1522
|
-
_js.addTsConfigPath.call(void 0, tree,
|
|
1523
|
-
|
|
1757
|
+
_js.addTsConfigPath.call(void 0, tree, _chunkPZ5CI56Fjs.joinPaths.call(void 0, normalized.importPath, "/*"), [
|
|
1758
|
+
_chunkPZ5CI56Fjs.joinPaths.call(void 0, normalized.projectRoot, "./src", "/*")
|
|
1524
1759
|
]);
|
|
1525
1760
|
if (tree.exists("package.json")) {
|
|
1526
1761
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
@@ -1531,7 +1766,7 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
1531
1766
|
description = packageJson.description;
|
|
1532
1767
|
}
|
|
1533
1768
|
}
|
|
1534
|
-
const tsconfigPath =
|
|
1769
|
+
const tsconfigPath = _chunkPZ5CI56Fjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json");
|
|
1535
1770
|
if (tree.exists(tsconfigPath)) {
|
|
1536
1771
|
_devkit.updateJson.call(void 0, tree, tsconfigPath, (json) => {
|
|
1537
1772
|
json.composite ??= true;
|
|
@@ -1545,46 +1780,33 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
1545
1780
|
outDir: `${_devkit.offsetFromRoot.call(void 0, normalized.projectRoot)}dist/out-tsc`
|
|
1546
1781
|
},
|
|
1547
1782
|
files: [],
|
|
1548
|
-
include: [
|
|
1549
|
-
|
|
1550
|
-
"src/**/*.js"
|
|
1551
|
-
],
|
|
1552
|
-
exclude: [
|
|
1553
|
-
"jest.config.ts",
|
|
1554
|
-
"src/**/*.spec.ts",
|
|
1555
|
-
"src/**/*.test.ts"
|
|
1556
|
-
]
|
|
1783
|
+
include: ["src/**/*.ts", "src/**/*.js"],
|
|
1784
|
+
exclude: ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
|
|
1557
1785
|
});
|
|
1558
1786
|
}
|
|
1559
1787
|
await _devkit.formatFiles.call(void 0, tree);
|
|
1560
1788
|
return null;
|
|
1561
1789
|
}
|
|
1562
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, typeScriptLibraryGeneratorFn, "typeScriptLibraryGeneratorFn");
|
|
1563
1790
|
function getOutputPath(options) {
|
|
1564
|
-
const parts = [
|
|
1565
|
-
"dist"
|
|
1566
|
-
];
|
|
1791
|
+
const parts = ["dist"];
|
|
1567
1792
|
if (options.projectRoot === ".") {
|
|
1568
1793
|
parts.push(options.name);
|
|
1569
1794
|
} else {
|
|
1570
1795
|
parts.push(options.projectRoot);
|
|
1571
1796
|
}
|
|
1572
|
-
return
|
|
1797
|
+
return _chunkPZ5CI56Fjs.joinPaths.call(void 0, ...parts);
|
|
1573
1798
|
}
|
|
1574
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, getOutputPath, "getOutputPath");
|
|
1575
1799
|
function createProjectTsConfigJson(tree, options) {
|
|
1576
1800
|
const tsconfig = {
|
|
1577
1801
|
extends: options.rootProject ? void 0 : _js.getRelativePathToRootTsConfig.call(void 0, tree, options.projectRoot),
|
|
1578
1802
|
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _124 => _124.tsconfigOptions]), () => ( {})),
|
|
1579
1803
|
compilerOptions: {
|
|
1580
1804
|
...options.rootProject ? _js.tsConfigBaseOptions : {},
|
|
1581
|
-
outDir:
|
|
1805
|
+
outDir: _chunkPZ5CI56Fjs.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
|
|
1582
1806
|
noEmit: true,
|
|
1583
1807
|
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _125 => _125.tsconfigOptions, 'optionalAccess', _126 => _126.compilerOptions]), () => ( {}))
|
|
1584
1808
|
},
|
|
1585
|
-
files: [
|
|
1586
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _127 => _127.tsconfigOptions, 'optionalAccess', _128 => _128.files]), () => ( []))
|
|
1587
|
-
],
|
|
1809
|
+
files: [..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _127 => _127.tsconfigOptions, 'optionalAccess', _128 => _128.files]), () => ( []))],
|
|
1588
1810
|
include: [
|
|
1589
1811
|
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _129 => _129.tsconfigOptions, 'optionalAccess', _130 => _130.include]), () => ( [])),
|
|
1590
1812
|
"src/**/*.ts",
|
|
@@ -1598,9 +1820,8 @@ function createProjectTsConfigJson(tree, options) {
|
|
|
1598
1820
|
"src/**/*.test.ts"
|
|
1599
1821
|
]
|
|
1600
1822
|
};
|
|
1601
|
-
_devkit.writeJson.call(void 0, tree,
|
|
1823
|
+
_devkit.writeJson.call(void 0, tree, _chunkPZ5CI56Fjs.joinPaths.call(void 0, options.projectRoot, "tsconfig.json"), tsconfig);
|
|
1602
1824
|
}
|
|
1603
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, createProjectTsConfigJson, "createProjectTsConfigJson");
|
|
1604
1825
|
async function normalizeOptions(tree, options, config) {
|
|
1605
1826
|
let importPath = options.importPath;
|
|
1606
1827
|
if (!importPath && _optionalChain([config, 'optionalAccess', _133 => _133.namespace])) {
|
|
@@ -1608,7 +1829,9 @@ async function normalizeOptions(tree, options, config) {
|
|
|
1608
1829
|
}
|
|
1609
1830
|
if (options.publishable) {
|
|
1610
1831
|
if (!importPath) {
|
|
1611
|
-
throw new Error(
|
|
1832
|
+
throw new Error(
|
|
1833
|
+
`For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`
|
|
1834
|
+
);
|
|
1612
1835
|
}
|
|
1613
1836
|
}
|
|
1614
1837
|
let bundler = "tsc";
|
|
@@ -1617,7 +1840,12 @@ async function normalizeOptions(tree, options, config) {
|
|
|
1617
1840
|
}
|
|
1618
1841
|
const { Linter } = _devkit.ensurePackage.call(void 0, "@nx/eslint", nxVersion);
|
|
1619
1842
|
const rootProject = false;
|
|
1620
|
-
const {
|
|
1843
|
+
const {
|
|
1844
|
+
projectName,
|
|
1845
|
+
names: projectNames,
|
|
1846
|
+
projectRoot,
|
|
1847
|
+
importPath: normalizedImportPath
|
|
1848
|
+
} = await _projectnameandrootutils.determineProjectNameAndRootOptions.call(void 0, tree, {
|
|
1621
1849
|
name: options.name,
|
|
1622
1850
|
projectType: "library",
|
|
1623
1851
|
directory: options.directory,
|
|
@@ -1654,11 +1882,16 @@ async function normalizeOptions(tree, options, config) {
|
|
|
1654
1882
|
shouldUseSwcJest: false
|
|
1655
1883
|
};
|
|
1656
1884
|
}
|
|
1657
|
-
_chunkJ5SB6L2Ljs.__name.call(void 0, normalizeOptions, "normalizeOptions");
|
|
1658
1885
|
|
|
1659
1886
|
// ../workspace-tools/src/generators/browser-library/generator.ts
|
|
1660
1887
|
async function browserLibraryGeneratorFn(tree, schema, config) {
|
|
1661
|
-
const filesDir =
|
|
1888
|
+
const filesDir = _chunkPZ5CI56Fjs.joinPaths.call(void 0,
|
|
1889
|
+
__dirname,
|
|
1890
|
+
"src",
|
|
1891
|
+
"generators",
|
|
1892
|
+
"browser-library",
|
|
1893
|
+
"files"
|
|
1894
|
+
);
|
|
1662
1895
|
const tsLibraryGeneratorOptions = {
|
|
1663
1896
|
buildExecutor: "@storm-software/workspace-tools:unbuild",
|
|
1664
1897
|
platform: "browser",
|
|
@@ -1684,7 +1917,9 @@ async function browserLibraryGeneratorFn(tree, schema, config) {
|
|
|
1684
1917
|
directory: schema.directory
|
|
1685
1918
|
};
|
|
1686
1919
|
const options = await normalizeOptions(tree, tsLibraryGeneratorOptions);
|
|
1687
|
-
const { className, name, propertyName } = _devkit.names.call(void 0,
|
|
1920
|
+
const { className, name, propertyName } = _devkit.names.call(void 0,
|
|
1921
|
+
options.projectNames.projectFileName
|
|
1922
|
+
);
|
|
1688
1923
|
_devkit.generateFiles.call(void 0, tree, filesDir, options.projectRoot, {
|
|
1689
1924
|
...schema,
|
|
1690
1925
|
dot: ".",
|
|
@@ -1715,55 +1950,88 @@ async function browserLibraryGeneratorFn(tree, schema, config) {
|
|
|
1715
1950
|
await _devkit.formatFiles.call(void 0, tree);
|
|
1716
1951
|
return null;
|
|
1717
1952
|
}
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
options
|
|
1724
|
-
|
|
1725
|
-
|
|
1953
|
+
var generator_default = withRunGenerator(
|
|
1954
|
+
"TypeScript Library Creator (Browser Platform)",
|
|
1955
|
+
browserLibraryGeneratorFn,
|
|
1956
|
+
{
|
|
1957
|
+
hooks: {
|
|
1958
|
+
applyDefaultOptions: (options) => {
|
|
1959
|
+
options.description ??= "A library used by Storm Software to support browser applications";
|
|
1960
|
+
options.platform ??= "browser";
|
|
1961
|
+
return options;
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1726
1964
|
}
|
|
1727
|
-
|
|
1965
|
+
);
|
|
1728
1966
|
|
|
1729
1967
|
// ../workspace-tools/src/generators/config-schema/generator.ts
|
|
1730
1968
|
|
|
1731
1969
|
var _zodtojsonschema = require('zod-to-json-schema');
|
|
1732
1970
|
async function configSchemaGeneratorFn(tree, options, config) {
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1971
|
+
_chunkPZ5CI56Fjs.writeInfo.call(void 0,
|
|
1972
|
+
"\u{1F4E6} Running Storm Workspace Configuration JSON Schema generator",
|
|
1973
|
+
config
|
|
1974
|
+
);
|
|
1975
|
+
_chunkPZ5CI56Fjs.writeTrace.call(void 0,
|
|
1976
|
+
`Determining the Storm Workspace Configuration JSON Schema...`,
|
|
1977
|
+
config
|
|
1978
|
+
);
|
|
1979
|
+
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0, _chunkPZ5CI56Fjs.stormWorkspaceConfigSchema, {
|
|
1736
1980
|
name: "StormWorkspaceConfiguration"
|
|
1737
1981
|
});
|
|
1738
|
-
|
|
1739
|
-
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1982
|
+
_chunkPZ5CI56Fjs.writeTrace.call(void 0, jsonSchema, config);
|
|
1983
|
+
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(
|
|
1984
|
+
_nullishCoalesce(_optionalChain([config, 'optionalAccess', _135 => _135.workspaceRoot]), () => ( _chunkPZ5CI56Fjs.findWorkspaceRoot.call(void 0, ))),
|
|
1985
|
+
_optionalChain([options, 'access', _136 => _136.outputFile, 'optionalAccess', _137 => _137.startsWith, 'call', _138 => _138("./")]) ? "" : "./"
|
|
1986
|
+
);
|
|
1987
|
+
_chunkPZ5CI56Fjs.writeTrace.call(void 0,
|
|
1988
|
+
`\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`,
|
|
1989
|
+
config
|
|
1990
|
+
);
|
|
1991
|
+
_devkit.writeJson.call(void 0, tree, outputPath, jsonSchema, { spaces: 2 });
|
|
1744
1992
|
await _devkit.formatFiles.call(void 0, tree);
|
|
1745
|
-
|
|
1993
|
+
_chunkPZ5CI56Fjs.writeSuccess.call(void 0,
|
|
1994
|
+
"\u{1F680} Storm Configuration JSON Schema creation has completed successfully!",
|
|
1995
|
+
config
|
|
1996
|
+
);
|
|
1746
1997
|
return {
|
|
1747
1998
|
success: true
|
|
1748
1999
|
};
|
|
1749
2000
|
}
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
2001
|
+
var generator_default2 = withRunGenerator(
|
|
2002
|
+
"Configuration Schema Creator",
|
|
2003
|
+
configSchemaGeneratorFn,
|
|
2004
|
+
{
|
|
2005
|
+
hooks: {
|
|
2006
|
+
applyDefaultOptions: (options) => {
|
|
2007
|
+
options.outputFile ??= "{workspaceRoot}/storm-workspace.schema.json";
|
|
2008
|
+
return options;
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
1757
2011
|
}
|
|
1758
|
-
|
|
2012
|
+
);
|
|
1759
2013
|
|
|
1760
2014
|
// ../workspace-tools/src/generators/init/init.ts
|
|
1761
2015
|
|
|
1762
2016
|
|
|
2017
|
+
|
|
2018
|
+
|
|
2019
|
+
|
|
1763
2020
|
// ../workspace-tools/src/generators/neutral-library/generator.ts
|
|
1764
2021
|
|
|
2022
|
+
|
|
2023
|
+
|
|
2024
|
+
|
|
2025
|
+
|
|
2026
|
+
|
|
1765
2027
|
async function neutralLibraryGeneratorFn(tree, schema, config) {
|
|
1766
|
-
const filesDir =
|
|
2028
|
+
const filesDir = _chunkPZ5CI56Fjs.joinPaths.call(void 0,
|
|
2029
|
+
__dirname,
|
|
2030
|
+
"src",
|
|
2031
|
+
"generators",
|
|
2032
|
+
"neutral-library",
|
|
2033
|
+
"files"
|
|
2034
|
+
);
|
|
1767
2035
|
const tsLibraryGeneratorOptions = {
|
|
1768
2036
|
...schema,
|
|
1769
2037
|
platform: "neutral",
|
|
@@ -1771,7 +2039,9 @@ async function neutralLibraryGeneratorFn(tree, schema, config) {
|
|
|
1771
2039
|
buildExecutor: "@storm-software/workspace-tools:unbuild"
|
|
1772
2040
|
};
|
|
1773
2041
|
const options = await normalizeOptions(tree, tsLibraryGeneratorOptions);
|
|
1774
|
-
const { className, name, propertyName } = _devkit.names.call(void 0,
|
|
2042
|
+
const { className, name, propertyName } = _devkit.names.call(void 0,
|
|
2043
|
+
options.projectNames.projectFileName
|
|
2044
|
+
);
|
|
1775
2045
|
_devkit.generateFiles.call(void 0, tree, filesDir, options.projectRoot, {
|
|
1776
2046
|
...schema,
|
|
1777
2047
|
dot: ".",
|
|
@@ -1792,21 +2062,35 @@ async function neutralLibraryGeneratorFn(tree, schema, config) {
|
|
|
1792
2062
|
await _devkit.formatFiles.call(void 0, tree);
|
|
1793
2063
|
return null;
|
|
1794
2064
|
}
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
options
|
|
1801
|
-
|
|
1802
|
-
|
|
2065
|
+
var generator_default3 = withRunGenerator(
|
|
2066
|
+
"TypeScript Library Creator (Neutral Platform)",
|
|
2067
|
+
neutralLibraryGeneratorFn,
|
|
2068
|
+
{
|
|
2069
|
+
hooks: {
|
|
2070
|
+
applyDefaultOptions: (options) => {
|
|
2071
|
+
options.description ??= "A library used by Storm Software to support either browser or NodeJs applications";
|
|
2072
|
+
options.platform = "neutral";
|
|
2073
|
+
return options;
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
1803
2076
|
}
|
|
1804
|
-
|
|
2077
|
+
);
|
|
1805
2078
|
|
|
1806
2079
|
// ../workspace-tools/src/generators/node-library/generator.ts
|
|
1807
2080
|
|
|
2081
|
+
|
|
2082
|
+
|
|
2083
|
+
|
|
2084
|
+
|
|
2085
|
+
|
|
1808
2086
|
async function nodeLibraryGeneratorFn(tree, schema, config) {
|
|
1809
|
-
const filesDir =
|
|
2087
|
+
const filesDir = _chunkPZ5CI56Fjs.joinPaths.call(void 0,
|
|
2088
|
+
__dirname,
|
|
2089
|
+
"src",
|
|
2090
|
+
"generators",
|
|
2091
|
+
"node-library",
|
|
2092
|
+
"files"
|
|
2093
|
+
);
|
|
1810
2094
|
const tsLibraryGeneratorOptions = {
|
|
1811
2095
|
platform: "node",
|
|
1812
2096
|
devDependencies: {
|
|
@@ -1839,20 +2123,30 @@ async function nodeLibraryGeneratorFn(tree, schema, config) {
|
|
|
1839
2123
|
await _devkit.formatFiles.call(void 0, tree);
|
|
1840
2124
|
return null;
|
|
1841
2125
|
}
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
options
|
|
1848
|
-
|
|
1849
|
-
|
|
2126
|
+
var generator_default4 = withRunGenerator(
|
|
2127
|
+
"TypeScript Library Creator (NodeJs Platform)",
|
|
2128
|
+
nodeLibraryGeneratorFn,
|
|
2129
|
+
{
|
|
2130
|
+
hooks: {
|
|
2131
|
+
applyDefaultOptions: (options) => {
|
|
2132
|
+
options.description ??= "A library used by Storm Software to support NodeJs applications";
|
|
2133
|
+
options.platform ??= "node";
|
|
2134
|
+
return options;
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
1850
2137
|
}
|
|
1851
|
-
|
|
2138
|
+
);
|
|
1852
2139
|
|
|
1853
2140
|
// ../workspace-tools/src/generators/preset/generator.ts
|
|
1854
2141
|
|
|
1855
2142
|
|
|
2143
|
+
|
|
2144
|
+
|
|
2145
|
+
|
|
2146
|
+
|
|
2147
|
+
|
|
2148
|
+
|
|
2149
|
+
|
|
1856
2150
|
async function presetGeneratorFn(tree, options) {
|
|
1857
2151
|
const projectRoot = ".";
|
|
1858
2152
|
options.description ??= `\u26A1The ${options.namespace ? options.namespace : options.name} monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.`;
|
|
@@ -2066,14 +2360,30 @@ async function presetGeneratorFn(tree, options) {
|
|
|
2066
2360
|
"nx-cloud": "latest"
|
|
2067
2361
|
};
|
|
2068
2362
|
}
|
|
2069
|
-
await Promise.resolve(
|
|
2363
|
+
await Promise.resolve(
|
|
2364
|
+
_devkit.addDependenciesToPackageJson.call(void 0,
|
|
2365
|
+
tree,
|
|
2366
|
+
dependencies,
|
|
2367
|
+
{},
|
|
2368
|
+
_devkit.joinPathFragments.call(void 0, projectRoot, "package.json")
|
|
2369
|
+
)
|
|
2370
|
+
);
|
|
2070
2371
|
return null;
|
|
2071
2372
|
}
|
|
2072
|
-
|
|
2073
|
-
|
|
2373
|
+
var generator_default5 = withRunGenerator(
|
|
2374
|
+
"Storm Workspace Preset Generator",
|
|
2375
|
+
presetGeneratorFn
|
|
2376
|
+
);
|
|
2074
2377
|
|
|
2075
2378
|
// ../workspace-tools/src/generators/release-version/generator.ts
|
|
2076
2379
|
|
|
2380
|
+
|
|
2381
|
+
|
|
2382
|
+
|
|
2383
|
+
|
|
2384
|
+
|
|
2385
|
+
|
|
2386
|
+
|
|
2077
2387
|
var _resolvelocalpackagedependencies = require('@nx/js/src/generators/release-version/utils/resolve-local-package-dependencies');
|
|
2078
2388
|
var _updatelockfile = require('@nx/js/src/release/utils/update-lock-file');
|
|
2079
2389
|
|
|
@@ -2212,7 +2522,9 @@ var DEFAULT_COMMIT_QUESTIONS = {
|
|
|
2212
2522
|
type: "select",
|
|
2213
2523
|
title: "Commit Type",
|
|
2214
2524
|
description: "Select the commit type that best describes your changes",
|
|
2215
|
-
enum: Object.keys(DEFAULT_COMMIT_TYPES).filter(
|
|
2525
|
+
enum: Object.keys(DEFAULT_COMMIT_TYPES).filter(
|
|
2526
|
+
(type) => DEFAULT_COMMIT_TYPES[type].hidden !== true
|
|
2527
|
+
).reduce((ret, type) => {
|
|
2216
2528
|
ret[type] = DEFAULT_COMMIT_TYPES[type];
|
|
2217
2529
|
return ret;
|
|
2218
2530
|
}, {}),
|
|
@@ -2252,7 +2564,7 @@ var DEFAULT_COMMIT_QUESTIONS = {
|
|
|
2252
2564
|
type: "input",
|
|
2253
2565
|
title: "Breaking Changes (Details)",
|
|
2254
2566
|
description: "A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself",
|
|
2255
|
-
when:
|
|
2567
|
+
when: (answers) => answers.isBreaking === true,
|
|
2256
2568
|
maxLength: 600,
|
|
2257
2569
|
minLength: 3
|
|
2258
2570
|
},
|
|
@@ -2266,25 +2578,28 @@ var DEFAULT_COMMIT_QUESTIONS = {
|
|
|
2266
2578
|
type: "input",
|
|
2267
2579
|
title: "Open Issue Affected (Details)",
|
|
2268
2580
|
description: "If issues are closed, the commit requires a body. Please enter a longer description of the commit itself",
|
|
2269
|
-
when:
|
|
2581
|
+
when: (answers) => answers.isIssueAffected === true,
|
|
2270
2582
|
maxLength: 600,
|
|
2271
2583
|
minLength: 3
|
|
2272
2584
|
}
|
|
2273
2585
|
};
|
|
2274
|
-
var RuleConfigSeverity;
|
|
2275
|
-
(function(RuleConfigSeverity2) {
|
|
2276
|
-
RuleConfigSeverity2[RuleConfigSeverity2["Disabled"] = 0] = "Disabled";
|
|
2277
|
-
RuleConfigSeverity2[RuleConfigSeverity2["Warning"] = 1] = "Warning";
|
|
2278
|
-
RuleConfigSeverity2[RuleConfigSeverity2["Error"] = 2] = "Error";
|
|
2279
|
-
})(RuleConfigSeverity || (RuleConfigSeverity = {}));
|
|
2280
2586
|
|
|
2281
2587
|
// ../workspace-tools/src/generators/release-version/generator.ts
|
|
2282
2588
|
|
|
2283
2589
|
|
|
2284
2590
|
var _config = require('nx/src/command-line/release/config/config');
|
|
2591
|
+
|
|
2592
|
+
|
|
2593
|
+
|
|
2285
2594
|
var _git = require('nx/src/command-line/release/utils/git');
|
|
2595
|
+
|
|
2596
|
+
|
|
2597
|
+
|
|
2286
2598
|
var _resolvesemverspecifier = require('nx/src/command-line/release/utils/resolve-semver-specifier');
|
|
2287
2599
|
var _semver = require('nx/src/command-line/release/utils/semver');
|
|
2600
|
+
|
|
2601
|
+
|
|
2602
|
+
|
|
2288
2603
|
var _versionlegacy = require('nx/src/command-line/release/version-legacy');
|
|
2289
2604
|
var _utils = require('nx/src/tasks-runner/utils');
|
|
2290
2605
|
var _semver3 = require('semver');
|
|
@@ -2347,11 +2662,7 @@ var cargo_base_executor_untyped_default = _untyped.defineUntypedSchema.call(void
|
|
|
2347
2662
|
$schema: {
|
|
2348
2663
|
title: "Toolchain",
|
|
2349
2664
|
description: "The type of toolchain to use for the build",
|
|
2350
|
-
enum: [
|
|
2351
|
-
"stable",
|
|
2352
|
-
"beta",
|
|
2353
|
-
"nightly"
|
|
2354
|
-
],
|
|
2665
|
+
enum: ["stable", "beta", "nightly"],
|
|
2355
2666
|
default: "stable"
|
|
2356
2667
|
},
|
|
2357
2668
|
$default: "stable"
|
|
@@ -2389,17 +2700,7 @@ var cargo_base_executor_untyped_default = _untyped.defineUntypedSchema.call(void
|
|
|
2389
2700
|
title: "Features",
|
|
2390
2701
|
type: "string",
|
|
2391
2702
|
description: "The features to build",
|
|
2392
|
-
oneOf: [
|
|
2393
|
-
{
|
|
2394
|
-
type: "string"
|
|
2395
|
-
},
|
|
2396
|
-
{
|
|
2397
|
-
type: "array",
|
|
2398
|
-
items: {
|
|
2399
|
-
type: "string"
|
|
2400
|
-
}
|
|
2401
|
-
}
|
|
2402
|
-
]
|
|
2703
|
+
oneOf: [{ type: "string" }, { type: "array", items: { type: "string" } }]
|
|
2403
2704
|
}
|
|
2404
2705
|
},
|
|
2405
2706
|
allFeatures: {
|
|
@@ -2419,10 +2720,7 @@ var typescript_build_executor_untyped_default = _untyped.defineUntypedSchema.cal
|
|
|
2419
2720
|
id: "TypeScriptBuildExecutorSchema",
|
|
2420
2721
|
title: "TypeScript Build Executor",
|
|
2421
2722
|
description: "A type definition for the base TypeScript build executor schema",
|
|
2422
|
-
required: [
|
|
2423
|
-
"entry",
|
|
2424
|
-
"tsconfig"
|
|
2425
|
-
]
|
|
2723
|
+
required: ["entry", "tsconfig"]
|
|
2426
2724
|
},
|
|
2427
2725
|
entry: {
|
|
2428
2726
|
$schema: {
|
|
@@ -2430,13 +2728,9 @@ var typescript_build_executor_untyped_default = _untyped.defineUntypedSchema.cal
|
|
|
2430
2728
|
format: "path",
|
|
2431
2729
|
type: "array",
|
|
2432
2730
|
description: "The entry file or files to build",
|
|
2433
|
-
items: {
|
|
2434
|
-
type: "string"
|
|
2435
|
-
}
|
|
2731
|
+
items: { type: "string" }
|
|
2436
2732
|
},
|
|
2437
|
-
$default: [
|
|
2438
|
-
"{sourceRoot}/index.ts"
|
|
2439
|
-
]
|
|
2733
|
+
$default: ["{sourceRoot}/index.ts"]
|
|
2440
2734
|
},
|
|
2441
2735
|
tsconfig: {
|
|
2442
2736
|
$schema: {
|
|
@@ -2516,7 +2810,7 @@ var typescript_build_executor_untyped_default = _untyped.defineUntypedSchema.cal
|
|
|
2516
2810
|
]
|
|
2517
2811
|
},
|
|
2518
2812
|
$default: "esnext",
|
|
2519
|
-
$resolve:
|
|
2813
|
+
$resolve: (val = "esnext") => val.toLowerCase()
|
|
2520
2814
|
},
|
|
2521
2815
|
format: {
|
|
2522
2816
|
$schema: {
|
|
@@ -2525,28 +2819,17 @@ var typescript_build_executor_untyped_default = _untyped.defineUntypedSchema.cal
|
|
|
2525
2819
|
description: "The format to build",
|
|
2526
2820
|
items: {
|
|
2527
2821
|
type: "string",
|
|
2528
|
-
enum: [
|
|
2529
|
-
"cjs",
|
|
2530
|
-
"esm",
|
|
2531
|
-
"iife"
|
|
2532
|
-
]
|
|
2822
|
+
enum: ["cjs", "esm", "iife"]
|
|
2533
2823
|
}
|
|
2534
2824
|
},
|
|
2535
|
-
$resolve:
|
|
2536
|
-
"cjs",
|
|
2537
|
-
"esm"
|
|
2538
|
-
]) => [].concat(val), "$resolve")
|
|
2825
|
+
$resolve: (val = ["cjs", "esm"]) => [].concat(val)
|
|
2539
2826
|
},
|
|
2540
2827
|
platform: {
|
|
2541
2828
|
$schema: {
|
|
2542
2829
|
title: "Platform",
|
|
2543
2830
|
type: "string",
|
|
2544
2831
|
description: "The platform to build",
|
|
2545
|
-
enum: [
|
|
2546
|
-
"neutral",
|
|
2547
|
-
"node",
|
|
2548
|
-
"browser"
|
|
2549
|
-
]
|
|
2832
|
+
enum: ["neutral", "node", "browser"]
|
|
2550
2833
|
},
|
|
2551
2834
|
$default: "neutral"
|
|
2552
2835
|
},
|
|
@@ -2556,7 +2839,7 @@ var typescript_build_executor_untyped_default = _untyped.defineUntypedSchema.cal
|
|
|
2556
2839
|
type: "array",
|
|
2557
2840
|
description: "The external dependencies"
|
|
2558
2841
|
},
|
|
2559
|
-
$resolve:
|
|
2842
|
+
$resolve: (val = []) => [].concat(val)
|
|
2560
2843
|
},
|
|
2561
2844
|
define: {
|
|
2562
2845
|
$schema: {
|
|
@@ -2565,7 +2848,7 @@ var typescript_build_executor_untyped_default = _untyped.defineUntypedSchema.cal
|
|
|
2565
2848
|
tsType: "Record<string, string>",
|
|
2566
2849
|
description: "The define values"
|
|
2567
2850
|
},
|
|
2568
|
-
$resolve:
|
|
2851
|
+
$resolve: (val = {}) => val,
|
|
2569
2852
|
$default: {}
|
|
2570
2853
|
},
|
|
2571
2854
|
env: {
|
|
@@ -2575,7 +2858,7 @@ var typescript_build_executor_untyped_default = _untyped.defineUntypedSchema.cal
|
|
|
2575
2858
|
tsType: "Record<string, string>",
|
|
2576
2859
|
description: "The environment variable values"
|
|
2577
2860
|
},
|
|
2578
|
-
$resolve:
|
|
2861
|
+
$resolve: (val = {}) => val,
|
|
2579
2862
|
$default: {}
|
|
2580
2863
|
}
|
|
2581
2864
|
});
|
|
@@ -2588,10 +2871,7 @@ var typescript_library_generator_untyped_default = _untyped.defineUntypedSchema.
|
|
|
2588
2871
|
id: "TypeScriptLibraryGeneratorSchema",
|
|
2589
2872
|
title: "TypeScript Library Generator",
|
|
2590
2873
|
description: "A type definition for the base TypeScript Library Generator schema",
|
|
2591
|
-
required: [
|
|
2592
|
-
"directory",
|
|
2593
|
-
"name"
|
|
2594
|
-
]
|
|
2874
|
+
required: ["directory", "name"]
|
|
2595
2875
|
},
|
|
2596
2876
|
name: {
|
|
2597
2877
|
$schema: {
|
|
@@ -2620,12 +2900,7 @@ var typescript_library_generator_untyped_default = _untyped.defineUntypedSchema.
|
|
|
2620
2900
|
title: "Platform",
|
|
2621
2901
|
type: "string",
|
|
2622
2902
|
description: "The platform to target with the library",
|
|
2623
|
-
enum: [
|
|
2624
|
-
"neutral",
|
|
2625
|
-
"node",
|
|
2626
|
-
"worker",
|
|
2627
|
-
"browser"
|
|
2628
|
-
]
|
|
2903
|
+
enum: ["neutral", "node", "worker", "browser"]
|
|
2629
2904
|
},
|
|
2630
2905
|
$default: "neutral"
|
|
2631
2906
|
},
|
|
@@ -2647,11 +2922,7 @@ var typescript_library_generator_untyped_default = _untyped.defineUntypedSchema.
|
|
|
2647
2922
|
$schema: {
|
|
2648
2923
|
title: "Unit Test Runner",
|
|
2649
2924
|
type: "string",
|
|
2650
|
-
enum: [
|
|
2651
|
-
"jest",
|
|
2652
|
-
"vitest",
|
|
2653
|
-
"none"
|
|
2654
|
-
],
|
|
2925
|
+
enum: ["jest", "vitest", "none"],
|
|
2655
2926
|
description: "The unit test runner to use"
|
|
2656
2927
|
}
|
|
2657
2928
|
},
|
|
@@ -2659,10 +2930,7 @@ var typescript_library_generator_untyped_default = _untyped.defineUntypedSchema.
|
|
|
2659
2930
|
$schema: {
|
|
2660
2931
|
title: "Test Environment",
|
|
2661
2932
|
type: "string",
|
|
2662
|
-
enum: [
|
|
2663
|
-
"jsdom",
|
|
2664
|
-
"node"
|
|
2665
|
-
],
|
|
2933
|
+
enum: ["jsdom", "node"],
|
|
2666
2934
|
description: "The test environment to use"
|
|
2667
2935
|
}
|
|
2668
2936
|
},
|
|
@@ -2707,8 +2975,21 @@ var _retrieveworkspacefiles = require('nx/src/project-graph/utils/retrieve-works
|
|
|
2707
2975
|
|
|
2708
2976
|
|
|
2709
2977
|
|
|
2978
|
+
|
|
2979
|
+
|
|
2980
|
+
|
|
2981
|
+
|
|
2982
|
+
|
|
2983
|
+
|
|
2984
|
+
|
|
2710
2985
|
var _npmparser = require('nx/src/plugins/js/lock-file/npm-parser');
|
|
2986
|
+
|
|
2987
|
+
|
|
2988
|
+
|
|
2711
2989
|
var _pnpmparser = require('nx/src/plugins/js/lock-file/pnpm-parser');
|
|
2990
|
+
|
|
2991
|
+
|
|
2992
|
+
|
|
2712
2993
|
var _yarnparser = require('nx/src/plugins/js/lock-file/yarn-parser');
|
|
2713
2994
|
var YARN_LOCK_FILE = "yarn.lock";
|
|
2714
2995
|
var NPM_LOCK_FILE = "package-lock.json";
|