@storm-software/cloudflare-tools 0.55.21 → 0.55.23
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 +12 -0
- package/README.md +1 -1
- package/dist/{chunk-T4IWTHDS.js → chunk-6GDCEDJO.js} +3 -3
- package/dist/{chunk-C7LFNTNE.mjs → chunk-AHT3CRUF.mjs} +3 -5
- package/dist/{chunk-BRNE2OJC.js → chunk-BCL7PY4I.js} +41 -41
- package/dist/{chunk-VN5NKV4M.js → chunk-DBSH4BRC.js} +12 -12
- package/dist/{chunk-X6VJDRKI.js → chunk-E7YOJ4JG.js} +8 -9
- package/dist/{chunk-AHEAMC5D.mjs → chunk-GNKRSWX6.mjs} +3 -3
- package/dist/{chunk-R5IK37XB.mjs → chunk-K4SZWADC.mjs} +3 -3
- package/dist/{chunk-LI7SJBJ3.mjs → chunk-KXSJMDJH.mjs} +1 -1
- package/dist/{chunk-5WDALT4X.js → chunk-RDDSMEJF.js} +1 -1
- package/dist/{chunk-MUNYIY4Y.js → chunk-SOJGUDFD.js} +16 -16
- package/dist/{chunk-ZO73VQJ6.js → chunk-T4YFTNGO.js} +160 -162
- package/dist/{chunk-PAM7JMC5.mjs → chunk-X64HH4GP.mjs} +1 -1
- package/dist/{chunk-WBCAYK6X.mjs → chunk-YEBDVDCV.mjs} +1 -1
- package/dist/{chunk-IMI2SM4Q.mjs → chunk-ZV2BVSPZ.mjs} +8 -9
- package/dist/executors.js +5 -5
- package/dist/executors.mjs +5 -5
- package/dist/generators.js +5 -5
- package/dist/generators.mjs +4 -4
- package/dist/index.js +8 -8
- package/dist/index.mjs +7 -7
- package/dist/src/executors/cloudflare-publish/executor.js +3 -3
- package/dist/src/executors/cloudflare-publish/executor.mjs +3 -3
- package/dist/src/executors/r2-upload-publish/executor.js +5 -5
- package/dist/src/executors/r2-upload-publish/executor.mjs +4 -4
- package/dist/src/executors/serve/executor.js +4 -4
- package/dist/src/executors/serve/executor.mjs +3 -3
- package/dist/src/generators/init/generator.js +2 -2
- package/dist/src/generators/init/generator.mjs +1 -1
- package/dist/src/generators/worker/generator.js +5 -5
- package/dist/src/generators/worker/generator.mjs +4 -4
- package/dist/src/utils/index.js +3 -3
- package/dist/src/utils/index.mjs +2 -2
- package/dist/src/utils/r2-bucket-helpers.js +3 -3
- package/dist/src/utils/r2-bucket-helpers.mjs +2 -2
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _chunkVTHBMY4Bjs = require('./chunk-VTHBMY4B.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkBCL7PY4Ijs = require('./chunk-BCL7PY4I.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -20,7 +20,7 @@ var _chunkBRNE2OJCjs = require('./chunk-BRNE2OJC.js');
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkE7YOJ4JGjs = require('./chunk-E7YOJ4JG.js');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -53,7 +53,7 @@ var applyWorkspaceBaseTokens = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
if (result.includes("{workspaceRoot}")) {
|
|
56
|
-
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(tokenParams.workspaceRoot, () => ( _optionalChain([tokenParams, 'access', _3 => _3.config, 'optionalAccess', _4 => _4.workspaceRoot]))), () => (
|
|
56
|
+
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(_nullishCoalesce(tokenParams.workspaceRoot, () => ( _optionalChain([tokenParams, 'access', _3 => _3.config, 'optionalAccess', _4 => _4.workspaceRoot]))), () => ( _chunkE7YOJ4JGjs.findWorkspaceRoot.call(void 0, ))));
|
|
57
57
|
}
|
|
58
58
|
return result;
|
|
59
59
|
}, "applyWorkspaceBaseTokens");
|
|
@@ -101,37 +101,35 @@ var run = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (config, command,
|
|
|
101
101
|
// ../workspace-tools/src/base/base-executor.ts
|
|
102
102
|
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
103
103
|
var withRunExecutor = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name, executorFn, executorOptions = {}) => async (_options, context2) => {
|
|
104
|
-
const stopwatch =
|
|
104
|
+
const stopwatch = _chunkE7YOJ4JGjs.getStopwatch.call(void 0, name);
|
|
105
105
|
let options = _options;
|
|
106
106
|
let config = {};
|
|
107
107
|
try {
|
|
108
108
|
if (!_optionalChain([context2, 'access', _5 => _5.projectsConfigurations, 'optionalAccess', _6 => _6.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
109
109
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
110
110
|
}
|
|
111
|
-
const workspaceRoot3 =
|
|
111
|
+
const workspaceRoot3 = _chunkE7YOJ4JGjs.findWorkspaceRoot.call(void 0, );
|
|
112
112
|
const projectRoot = context2.projectsConfigurations.projects[context2.projectName].root || workspaceRoot3;
|
|
113
113
|
const sourceRoot = context2.projectsConfigurations.projects[context2.projectName].sourceRoot || projectRoot || workspaceRoot3;
|
|
114
114
|
const projectName = context2.projectName;
|
|
115
115
|
config.workspaceRoot = workspaceRoot3;
|
|
116
|
-
|
|
117
|
-
\u26A1 Running the ${name} executor for ${projectName}
|
|
118
|
-
`, config);
|
|
116
|
+
_chunkE7YOJ4JGjs.writeInfo.call(void 0, `\u26A1 Running the ${name} executor for ${projectName} `, config);
|
|
119
117
|
if (!executorOptions.skipReadingConfig) {
|
|
120
|
-
|
|
118
|
+
_chunkE7YOJ4JGjs.writeTrace.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
121
119
|
- workspaceRoot: ${workspaceRoot3}
|
|
122
120
|
- projectRoot: ${projectRoot}
|
|
123
121
|
- sourceRoot: ${sourceRoot}
|
|
124
122
|
- projectName: ${projectName}
|
|
125
123
|
`, config);
|
|
126
|
-
config = await
|
|
124
|
+
config = await _chunkBCL7PY4Ijs.getConfig.call(void 0, workspaceRoot3);
|
|
127
125
|
}
|
|
128
126
|
if (_optionalChain([executorOptions, 'optionalAccess', _7 => _7.hooks, 'optionalAccess', _8 => _8.applyDefaultOptions])) {
|
|
129
|
-
|
|
127
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
130
128
|
options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
|
|
131
|
-
|
|
129
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
132
130
|
}
|
|
133
|
-
|
|
134
|
-
${
|
|
131
|
+
_chunkE7YOJ4JGjs.writeTrace.call(void 0, `Executor schema options \u2699\uFE0F
|
|
132
|
+
${_chunkE7YOJ4JGjs.formatLogMessage.call(void 0, options)}
|
|
135
133
|
`, config);
|
|
136
134
|
const tokenized = await applyWorkspaceTokens(options, _defu.defu.call(void 0, {
|
|
137
135
|
workspaceRoot: workspaceRoot3,
|
|
@@ -140,13 +138,13 @@ ${_chunkX6VJDRKIjs.formatLogMessage.call(void 0, options)}
|
|
|
140
138
|
projectName,
|
|
141
139
|
config
|
|
142
140
|
}, config, context2.projectsConfigurations.projects[context2.projectName]), applyWorkspaceProjectTokens);
|
|
143
|
-
|
|
144
|
-
${
|
|
141
|
+
_chunkE7YOJ4JGjs.writeTrace.call(void 0, `Executor schema tokenized options \u2699\uFE0F
|
|
142
|
+
${_chunkE7YOJ4JGjs.formatLogMessage.call(void 0, tokenized)}
|
|
145
143
|
`, config);
|
|
146
144
|
if (_optionalChain([executorOptions, 'optionalAccess', _9 => _9.hooks, 'optionalAccess', _10 => _10.preProcess])) {
|
|
147
|
-
|
|
145
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
148
146
|
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
149
|
-
|
|
147
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
150
148
|
}
|
|
151
149
|
const ret = executorFn(tokenized, context2, config);
|
|
152
150
|
if (_isFunction(_optionalChain([ret, 'optionalAccess', _11 => _11.next]))) {
|
|
@@ -156,26 +154,26 @@ ${_chunkX6VJDRKIjs.formatLogMessage.call(void 0, tokenized)}
|
|
|
156
154
|
}
|
|
157
155
|
const result = await Promise.resolve(ret);
|
|
158
156
|
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")) {
|
|
159
|
-
|
|
160
|
-
${
|
|
157
|
+
_chunkE7YOJ4JGjs.writeTrace.call(void 0, `Failure determined by the ${name} executor
|
|
158
|
+
${_chunkE7YOJ4JGjs.formatLogMessage.call(void 0, result)}`, config);
|
|
161
159
|
console.error(result);
|
|
162
160
|
throw new Error(`The ${name} executor failed to run`, {
|
|
163
161
|
cause: _optionalChain([result, 'optionalAccess', _20 => _20.error])
|
|
164
162
|
});
|
|
165
163
|
}
|
|
166
164
|
if (_optionalChain([executorOptions, 'optionalAccess', _21 => _21.hooks, 'optionalAccess', _22 => _22.postProcess])) {
|
|
167
|
-
|
|
165
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
168
166
|
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
169
|
-
|
|
167
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
170
168
|
}
|
|
171
|
-
|
|
169
|
+
_chunkE7YOJ4JGjs.writeSuccess.call(void 0, `Completed running the ${name} task executor!
|
|
172
170
|
`, config);
|
|
173
171
|
return {
|
|
174
172
|
success: true
|
|
175
173
|
};
|
|
176
174
|
} catch (error) {
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
_chunkE7YOJ4JGjs.writeFatal.call(void 0, "A fatal error occurred while running the executor - the process was forced to terminate", config);
|
|
176
|
+
_chunkE7YOJ4JGjs.writeError.call(void 0, `An exception was thrown in the executor's process
|
|
179
177
|
- Details: ${error.message}
|
|
180
178
|
- Stacktrace: ${error.stack}`, config);
|
|
181
179
|
return {
|
|
@@ -478,8 +476,8 @@ var copyAssets = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (con
|
|
|
478
476
|
output: "src/"
|
|
479
477
|
});
|
|
480
478
|
}
|
|
481
|
-
|
|
482
|
-
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${
|
|
479
|
+
_chunkE7YOJ4JGjs.writeTrace.call(void 0, `\u{1F4DD} Copying the following assets to the output directory:
|
|
480
|
+
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${_chunkE7YOJ4JGjs.joinPaths.call(void 0, outputPath, pendingAsset.output)}`).join("\n")}`, config);
|
|
483
481
|
const assetHandler = new (0, _copyassetshandler.CopyAssetsHandler)({
|
|
484
482
|
projectDir: projectRoot,
|
|
485
483
|
rootDir: config.workspaceRoot,
|
|
@@ -488,12 +486,12 @@ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${p
|
|
|
488
486
|
});
|
|
489
487
|
await assetHandler.processAllAssetsOnce();
|
|
490
488
|
if (includeSrc === true) {
|
|
491
|
-
|
|
489
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkE7YOJ4JGjs.joinPaths.call(void 0, outputPath, "src")}`, config);
|
|
492
490
|
const files = await _glob.glob.call(void 0, [
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
491
|
+
_chunkE7YOJ4JGjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
492
|
+
_chunkE7YOJ4JGjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
493
|
+
_chunkE7YOJ4JGjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
494
|
+
_chunkE7YOJ4JGjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
497
495
|
]);
|
|
498
496
|
await Promise.allSettled(files.map(async (file) => _promises.writeFile.call(void 0, file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
499
497
|
|
|
@@ -516,7 +514,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
516
514
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot3)) {
|
|
517
515
|
const projectNode = project.node;
|
|
518
516
|
if (projectNode.data.root) {
|
|
519
|
-
const projectPackageJsonPath =
|
|
517
|
+
const projectPackageJsonPath = _chunkE7YOJ4JGjs.joinPaths.call(void 0, workspaceRoot3, projectNode.data.root, "package.json");
|
|
520
518
|
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
521
519
|
const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
|
|
522
520
|
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
@@ -527,8 +525,8 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
527
525
|
}
|
|
528
526
|
}
|
|
529
527
|
if (localPackages.length > 0) {
|
|
530
|
-
|
|
531
|
-
const projectJsonFile = await _promises.readFile.call(void 0,
|
|
528
|
+
_chunkE7YOJ4JGjs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
|
|
529
|
+
const projectJsonFile = await _promises.readFile.call(void 0, _chunkE7YOJ4JGjs.joinPaths.call(void 0, projectRoot, "project.json"), "utf8");
|
|
532
530
|
const projectJson = JSON.parse(projectJsonFile);
|
|
533
531
|
const projectName2 = projectJson.name;
|
|
534
532
|
const projectConfigurations = _projectgraph.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
@@ -537,7 +535,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
537
535
|
}
|
|
538
536
|
const implicitDependencies = _optionalChain([projectConfigurations, 'access', _31 => _31.projects, 'optionalAccess', _32 => _32[projectName2], 'access', _33 => _33.implicitDependencies, 'optionalAccess', _34 => _34.reduce, 'call', _35 => _35((ret, dep) => {
|
|
539
537
|
if (_optionalChain([projectConfigurations, 'access', _36 => _36.projects, 'optionalAccess', _37 => _37[dep]])) {
|
|
540
|
-
const depPackageJsonPath =
|
|
538
|
+
const depPackageJsonPath = _chunkE7YOJ4JGjs.joinPaths.call(void 0, workspaceRoot3, projectConfigurations.projects[dep].root, "package.json");
|
|
541
539
|
if (_fs.existsSync.call(void 0, depPackageJsonPath)) {
|
|
542
540
|
const depPackageJsonContent = _fs.readFileSync.call(void 0, depPackageJsonPath, "utf8");
|
|
543
541
|
const depPackageJson = JSON.parse(depPackageJsonContent);
|
|
@@ -561,13 +559,13 @@ var addPackageDependencies = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0
|
|
|
561
559
|
return ret;
|
|
562
560
|
}, _nullishCoalesce(packageJson.devDependencies, () => ( {})));
|
|
563
561
|
} else {
|
|
564
|
-
|
|
562
|
+
_chunkE7YOJ4JGjs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
|
|
565
563
|
}
|
|
566
564
|
return packageJson;
|
|
567
565
|
}, "addPackageDependencies");
|
|
568
566
|
var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
569
|
-
const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot :
|
|
570
|
-
const workspacePackageJsonContent = await _promises.readFile.call(void 0,
|
|
567
|
+
const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot : _chunkE7YOJ4JGjs.findWorkspaceRoot.call(void 0, );
|
|
568
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkE7YOJ4JGjs.joinPaths.call(void 0, workspaceRoot3, "package.json"), "utf8");
|
|
571
569
|
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
572
570
|
packageJson.type ??= "module";
|
|
573
571
|
packageJson.sideEffects ??= false;
|
|
@@ -576,7 +574,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call
|
|
|
576
574
|
if (distSrc.startsWith("/")) {
|
|
577
575
|
distSrc = distSrc.substring(1);
|
|
578
576
|
}
|
|
579
|
-
packageJson.source ??= `${
|
|
577
|
+
packageJson.source ??= `${_chunkE7YOJ4JGjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
580
578
|
}
|
|
581
579
|
packageJson.files ??= [
|
|
582
580
|
"dist/**/*"
|
|
@@ -607,7 +605,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call
|
|
|
607
605
|
];
|
|
608
606
|
}
|
|
609
607
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
610
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot :
|
|
608
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkE7YOJ4JGjs.joinPaths.call(void 0, "packages", projectName);
|
|
611
609
|
return packageJson;
|
|
612
610
|
}, "addWorkspacePackageJsonFields");
|
|
613
611
|
var addPackageJsonExport = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (file, type = "module", sourceRoot) => {
|
|
@@ -634,7 +632,7 @@ var addPackageJsonExport = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0,
|
|
|
634
632
|
// ../build-tools/src/utilities/get-entry-points.ts
|
|
635
633
|
|
|
636
634
|
var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
|
|
637
|
-
const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot :
|
|
635
|
+
const workspaceRoot3 = config.workspaceRoot ? config.workspaceRoot : _chunkE7YOJ4JGjs.findWorkspaceRoot.call(void 0, );
|
|
638
636
|
const entryPoints = [];
|
|
639
637
|
if (entry) {
|
|
640
638
|
if (Array.isArray(entry)) {
|
|
@@ -646,7 +644,7 @@ var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
646
644
|
}
|
|
647
645
|
}
|
|
648
646
|
if (emitOnAll) {
|
|
649
|
-
entryPoints.push(
|
|
647
|
+
entryPoints.push(_chunkE7YOJ4JGjs.joinPaths.call(void 0, workspaceRoot3, sourceRoot || projectRoot, "**/*.{ts,tsx}"));
|
|
650
648
|
}
|
|
651
649
|
const results = [];
|
|
652
650
|
for (const entryPoint in entryPoints) {
|
|
@@ -655,9 +653,9 @@ var getEntryPoints = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
655
653
|
withFileTypes: true
|
|
656
654
|
});
|
|
657
655
|
results.push(...files.reduce((ret, filePath) => {
|
|
658
|
-
const result =
|
|
656
|
+
const result = _chunkE7YOJ4JGjs.correctPaths.call(void 0, _chunkE7YOJ4JGjs.joinPaths.call(void 0, filePath.path, filePath.name).replaceAll(_chunkE7YOJ4JGjs.correctPaths.call(void 0, workspaceRoot3), "").replaceAll(_chunkE7YOJ4JGjs.correctPaths.call(void 0, projectRoot), ""));
|
|
659
657
|
if (result) {
|
|
660
|
-
|
|
658
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunkE7YOJ4JGjs.joinPaths.call(void 0, filePath.path, filePath.name)}"`, config);
|
|
661
659
|
if (!results.includes(result)) {
|
|
662
660
|
results.push(result);
|
|
663
661
|
}
|
|
@@ -991,7 +989,7 @@ var onErrorPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (option
|
|
|
991
989
|
setup(build5) {
|
|
992
990
|
build5.onEnd((result) => {
|
|
993
991
|
if (result.errors.length > 0 && process.env.WATCH !== "true") {
|
|
994
|
-
|
|
992
|
+
_chunkE7YOJ4JGjs.writeError.call(void 0, `The following errors occurred during the build:
|
|
995
993
|
${result.errors.map((error) => error.text).join("\n")}
|
|
996
994
|
|
|
997
995
|
`, resolvedOptions.config);
|
|
@@ -1026,7 +1024,7 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, resolvePathsConfig, "resolvePathsConfig");
|
|
|
1026
1024
|
var resolvePathsPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
1027
1025
|
name: "storm:resolve-paths",
|
|
1028
1026
|
setup(build5) {
|
|
1029
|
-
const parentTsConfig = build5.initialOptions.tsconfig ? _chunkJ5SB6L2Ljs.__require.call(void 0,
|
|
1027
|
+
const parentTsConfig = build5.initialOptions.tsconfig ? _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkE7YOJ4JGjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, build5.initialOptions.tsconfig)) : _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkE7YOJ4JGjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, "tsconfig.json"));
|
|
1030
1028
|
const resolvedTsPaths = resolvePathsConfig(parentTsConfig, options.projectRoot);
|
|
1031
1029
|
const packagesRegex = new RegExp(`^(${Object.keys(resolvedTsPaths).join("|")})$`);
|
|
1032
1030
|
build5.onResolve({
|
|
@@ -1050,7 +1048,7 @@ var _apiextractor = require('@microsoft/api-extractor');
|
|
|
1050
1048
|
|
|
1051
1049
|
|
|
1052
1050
|
function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
1053
|
-
const { dependencies, peerDependencies, devDependencies } = _chunkJ5SB6L2Ljs.__require.call(void 0,
|
|
1051
|
+
const { dependencies, peerDependencies, devDependencies } = _chunkJ5SB6L2Ljs.__require.call(void 0, _chunkE7YOJ4JGjs.joinPaths.call(void 0, options.projectRoot, "package.json"));
|
|
1054
1052
|
const dependenciesKeys = Object.keys(_nullishCoalesce(dependencies, () => ( {}))).flatMap((p) => [
|
|
1055
1053
|
p,
|
|
1056
1054
|
getTypeDependencyPackageName(p)
|
|
@@ -1086,13 +1084,13 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
1086
1084
|
},
|
|
1087
1085
|
dtsRollup: {
|
|
1088
1086
|
enabled: true,
|
|
1089
|
-
untrimmedFilePath:
|
|
1087
|
+
untrimmedFilePath: _chunkE7YOJ4JGjs.joinPaths.call(void 0, options.outdir, `${outfile}.d.ts`)
|
|
1090
1088
|
},
|
|
1091
1089
|
tsdocMetadata: {
|
|
1092
1090
|
enabled: false
|
|
1093
1091
|
}
|
|
1094
1092
|
},
|
|
1095
|
-
packageJsonFullPath:
|
|
1093
|
+
packageJsonFullPath: _chunkE7YOJ4JGjs.joinPaths.call(void 0, options.projectRoot, "package.json"),
|
|
1096
1094
|
configObjectFullPath: void 0
|
|
1097
1095
|
});
|
|
1098
1096
|
const extractorResult = _apiextractor.Extractor.invoke(extractorConfig, {
|
|
@@ -1100,7 +1098,7 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
1100
1098
|
localBuild: true
|
|
1101
1099
|
});
|
|
1102
1100
|
if (extractorResult.succeeded === false) {
|
|
1103
|
-
|
|
1101
|
+
_chunkE7YOJ4JGjs.writeError.call(void 0, `API Extractor completed with ${extractorResult.errorCount} ${extractorResult.errorCount === 1 ? "error" : "errors"}`);
|
|
1104
1102
|
throw new Error("API Extractor completed with errors");
|
|
1105
1103
|
}
|
|
1106
1104
|
}
|
|
@@ -1119,12 +1117,12 @@ var tscPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (options, r
|
|
|
1119
1117
|
const sourceRoot = resolvedOptions.sourceRoot.replaceAll(resolvedOptions.projectRoot, "");
|
|
1120
1118
|
const typeOutDir = resolvedOptions.outdir;
|
|
1121
1119
|
const entryPoint = resolvedOptions.entryPoints[0].replace(sourceRoot, "").replace(/\.ts$/, "");
|
|
1122
|
-
const bundlePath =
|
|
1120
|
+
const bundlePath = _chunkE7YOJ4JGjs.joinPaths.call(void 0, resolvedOptions.outdir, entryPoint);
|
|
1123
1121
|
let dtsPath;
|
|
1124
|
-
if (_fs.existsSync.call(void 0,
|
|
1125
|
-
dtsPath =
|
|
1126
|
-
} else if (_fs.existsSync.call(void 0,
|
|
1127
|
-
dtsPath =
|
|
1122
|
+
if (_fs.existsSync.call(void 0, _chunkE7YOJ4JGjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
|
|
1123
|
+
dtsPath = _chunkE7YOJ4JGjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`);
|
|
1124
|
+
} else if (_fs.existsSync.call(void 0, _chunkE7YOJ4JGjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
|
|
1125
|
+
dtsPath = _chunkE7YOJ4JGjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`);
|
|
1128
1126
|
}
|
|
1129
1127
|
const ext = resolvedOptions.outExtension.dts || resolvedOptions.format === "esm" ? "d.mts" : "d.ts";
|
|
1130
1128
|
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
@@ -1279,8 +1277,8 @@ var depsCheckPlugin = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (bund
|
|
|
1279
1277
|
const filteredMissingDeps = missingDependencies.filter((dep) => {
|
|
1280
1278
|
return !missingIgnore.some((pattern) => dep.match(pattern)) && !peerDependencies.includes(dep);
|
|
1281
1279
|
});
|
|
1282
|
-
|
|
1283
|
-
|
|
1280
|
+
_chunkE7YOJ4JGjs.writeWarning.call(void 0, `Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`);
|
|
1281
|
+
_chunkE7YOJ4JGjs.writeError.call(void 0, `Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`);
|
|
1284
1282
|
if (filteredMissingDeps.length > 0) {
|
|
1285
1283
|
throw new Error(`Missing dependencies detected - please install them:
|
|
1286
1284
|
${JSON.stringify(filteredMissingDeps)}
|
|
@@ -1374,13 +1372,13 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1374
1372
|
if (!workspaceRoot3) {
|
|
1375
1373
|
throw new Error("Cannot find Nx workspace root");
|
|
1376
1374
|
}
|
|
1377
|
-
const config = await
|
|
1378
|
-
|
|
1379
|
-
const stopwatch =
|
|
1375
|
+
const config = await _chunkBCL7PY4Ijs.getConfig.call(void 0, workspaceRoot3.dir);
|
|
1376
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
1377
|
+
const stopwatch = _chunkE7YOJ4JGjs.getStopwatch.call(void 0, "Build options resolution");
|
|
1380
1378
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
1381
1379
|
exitOnError: true
|
|
1382
1380
|
});
|
|
1383
|
-
const projectJsonPath =
|
|
1381
|
+
const projectJsonPath = _chunkE7YOJ4JGjs.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "project.json");
|
|
1384
1382
|
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
1385
1383
|
throw new Error("Cannot find project.json configuration");
|
|
1386
1384
|
}
|
|
@@ -1394,7 +1392,7 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1394
1392
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
|
|
1395
1393
|
options.name ??= `${projectName}-${options.format}`;
|
|
1396
1394
|
options.target ??= DEFAULT_TARGET;
|
|
1397
|
-
const packageJsonPath =
|
|
1395
|
+
const packageJsonPath = _chunkE7YOJ4JGjs.joinPaths.call(void 0, workspaceRoot3.dir, options.projectRoot, "package.json");
|
|
1398
1396
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1399
1397
|
throw new Error("Cannot find package.json configuration");
|
|
1400
1398
|
}
|
|
@@ -1419,20 +1417,20 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1419
1417
|
".node"
|
|
1420
1418
|
],
|
|
1421
1419
|
...userOptions,
|
|
1422
|
-
tsconfig:
|
|
1420
|
+
tsconfig: _chunkE7YOJ4JGjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
1423
1421
|
format: options.format || "cjs",
|
|
1424
1422
|
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
|
|
1425
1423
|
"./src/index.ts"
|
|
1426
1424
|
], userOptions.emitOnAll),
|
|
1427
|
-
outdir: userOptions.outputPath ||
|
|
1425
|
+
outdir: userOptions.outputPath || _chunkE7YOJ4JGjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
1428
1426
|
plugins: [],
|
|
1429
1427
|
name: userOptions.name || projectName,
|
|
1430
1428
|
projectConfigurations,
|
|
1431
1429
|
projectName,
|
|
1432
1430
|
projectGraph,
|
|
1433
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot ||
|
|
1431
|
+
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkE7YOJ4JGjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
1434
1432
|
minify: userOptions.minify || !userOptions.debug,
|
|
1435
|
-
verbose: userOptions.verbose ||
|
|
1433
|
+
verbose: userOptions.verbose || _chunkE7YOJ4JGjs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
1436
1434
|
includeSrc: userOptions.includeSrc === true,
|
|
1437
1435
|
metafile: userOptions.metafile !== false,
|
|
1438
1436
|
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
@@ -1468,8 +1466,8 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1468
1466
|
}, {})
|
|
1469
1467
|
},
|
|
1470
1468
|
inject: [
|
|
1471
|
-
options.format === "cjs" && options.injectShims ?
|
|
1472
|
-
options.format === "esm" && options.injectShims && options.platform === "node" ?
|
|
1469
|
+
options.format === "cjs" && options.injectShims ? _chunkE7YOJ4JGjs.joinPaths.call(void 0, __dirname, "../assets/cjs_shims.js") : "",
|
|
1470
|
+
options.format === "esm" && options.injectShims && options.platform === "node" ? _chunkE7YOJ4JGjs.joinPaths.call(void 0, __dirname, "../assets/esm_shims.js") : "",
|
|
1473
1471
|
..._nullishCoalesce(options.inject, () => ( []))
|
|
1474
1472
|
].filter(Boolean)
|
|
1475
1473
|
};
|
|
@@ -1478,14 +1476,14 @@ var resolveOptions = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1478
1476
|
return result;
|
|
1479
1477
|
}, "resolveOptions");
|
|
1480
1478
|
async function generatePackageJson(context2) {
|
|
1481
|
-
if (context2.options.generatePackageJson !== false && _fs.existsSync.call(void 0,
|
|
1482
|
-
|
|
1483
|
-
const stopwatch =
|
|
1484
|
-
const packageJsonPath =
|
|
1479
|
+
if (context2.options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkE7YOJ4JGjs.joinPaths.call(void 0, context2.options.projectRoot, "package.json"))) {
|
|
1480
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context2.options.config);
|
|
1481
|
+
const stopwatch = _chunkE7YOJ4JGjs.getStopwatch.call(void 0, "Write package.json file");
|
|
1482
|
+
const packageJsonPath = _chunkE7YOJ4JGjs.joinPaths.call(void 0, context2.options.projectRoot, "project.json");
|
|
1485
1483
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1486
1484
|
throw new Error("Cannot find package.json configuration");
|
|
1487
1485
|
}
|
|
1488
|
-
const packageJsonFile = await _promises2.default.readFile(
|
|
1486
|
+
const packageJsonFile = await _promises2.default.readFile(_chunkE7YOJ4JGjs.joinPaths.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, "package.json"), "utf8");
|
|
1489
1487
|
let packageJson = JSON.parse(packageJsonFile);
|
|
1490
1488
|
if (!packageJson) {
|
|
1491
1489
|
throw new Error("Cannot find package.json configuration file");
|
|
@@ -1524,7 +1522,7 @@ async function generatePackageJson(context2) {
|
|
|
1524
1522
|
}
|
|
1525
1523
|
return ret;
|
|
1526
1524
|
}, packageJson.exports);
|
|
1527
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
1525
|
+
await _devkit.writeJsonFile.call(void 0, _chunkE7YOJ4JGjs.joinPaths.call(void 0, context2.options.outdir, "package.json"), packageJson);
|
|
1528
1526
|
stopwatch();
|
|
1529
1527
|
}
|
|
1530
1528
|
return context2;
|
|
@@ -1550,8 +1548,8 @@ async function generateContext(getOptions) {
|
|
|
1550
1548
|
}
|
|
1551
1549
|
_chunkJ5SB6L2Ljs.__name.call(void 0, generateContext, "generateContext");
|
|
1552
1550
|
async function executeEsBuild(context2) {
|
|
1553
|
-
|
|
1554
|
-
const stopwatch =
|
|
1551
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, ` \u{1F680} Running ${context2.options.name} build`, context2.options.config);
|
|
1552
|
+
const stopwatch = _chunkE7YOJ4JGjs.getStopwatch.call(void 0, `${context2.options.name} build`);
|
|
1555
1553
|
if (process.env.WATCH === "true") {
|
|
1556
1554
|
const ctx = await esbuild2.context(context2.options);
|
|
1557
1555
|
watch(ctx, context2.options);
|
|
@@ -1567,8 +1565,8 @@ async function executeEsBuild(context2) {
|
|
|
1567
1565
|
_chunkJ5SB6L2Ljs.__name.call(void 0, executeEsBuild, "executeEsBuild");
|
|
1568
1566
|
async function copyBuildAssets(context2) {
|
|
1569
1567
|
if (_optionalChain([context2, 'access', _66 => _66.result, 'optionalAccess', _67 => _67.errors, 'access', _68 => _68.length]) === 0) {
|
|
1570
|
-
|
|
1571
|
-
const stopwatch =
|
|
1568
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
|
|
1569
|
+
const stopwatch = _chunkE7YOJ4JGjs.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
|
|
1572
1570
|
await copyAssets(context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.sourceRoot, true, false);
|
|
1573
1571
|
stopwatch();
|
|
1574
1572
|
}
|
|
@@ -1578,9 +1576,9 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
|
1578
1576
|
async function reportResults(context2) {
|
|
1579
1577
|
if (_optionalChain([context2, 'access', _69 => _69.result, 'optionalAccess', _70 => _70.errors, 'access', _71 => _71.length]) === 0) {
|
|
1580
1578
|
if (context2.result.warnings.length > 0) {
|
|
1581
|
-
|
|
1579
|
+
_chunkE7YOJ4JGjs.writeWarning.call(void 0, ` \u{1F6A7} The following warnings occurred during the build: ${context2.result.warnings.map((warning) => warning.text).join("\n")}`, context2.options.config);
|
|
1582
1580
|
}
|
|
1583
|
-
|
|
1581
|
+
_chunkE7YOJ4JGjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${context2.options.name} build completed successfully`, context2.options.config);
|
|
1584
1582
|
}
|
|
1585
1583
|
}
|
|
1586
1584
|
_chunkJ5SB6L2Ljs.__name.call(void 0, reportResults, "reportResults");
|
|
@@ -1616,8 +1614,8 @@ async function dependencyCheck(options) {
|
|
|
1616
1614
|
_chunkJ5SB6L2Ljs.__name.call(void 0, dependencyCheck, "dependencyCheck");
|
|
1617
1615
|
async function cleanOutputPath(context2) {
|
|
1618
1616
|
if (context2.options.clean !== false && context2.options.outdir) {
|
|
1619
|
-
|
|
1620
|
-
const stopwatch =
|
|
1617
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${context2.options.name} output path: ${context2.options.outdir}`, context2.options.config);
|
|
1618
|
+
const stopwatch = _chunkE7YOJ4JGjs.getStopwatch.call(void 0, `${context2.options.name} output clean`);
|
|
1621
1619
|
await cleanDirectories(context2.options.name, context2.options.outdir, context2.options.config);
|
|
1622
1620
|
stopwatch();
|
|
1623
1621
|
}
|
|
@@ -1625,8 +1623,8 @@ async function cleanOutputPath(context2) {
|
|
|
1625
1623
|
}
|
|
1626
1624
|
_chunkJ5SB6L2Ljs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
|
|
1627
1625
|
async function build3(options) {
|
|
1628
|
-
|
|
1629
|
-
const stopwatch =
|
|
1626
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, ` \u26A1 Executing Storm ESBuild pipeline`);
|
|
1627
|
+
const stopwatch = _chunkE7YOJ4JGjs.getStopwatch.call(void 0, "ESBuild pipeline");
|
|
1630
1628
|
try {
|
|
1631
1629
|
const opts = Array.isArray(options) ? options : [
|
|
1632
1630
|
options
|
|
@@ -1636,9 +1634,9 @@ async function build3(options) {
|
|
|
1636
1634
|
}
|
|
1637
1635
|
void transduce.async(opts, dependencyCheck);
|
|
1638
1636
|
await transduce.async(await createOptions(opts), pipe.async(generateContext, cleanOutputPath, generatePackageJson, executeEsBuild, copyBuildAssets, reportResults));
|
|
1639
|
-
|
|
1637
|
+
_chunkE7YOJ4JGjs.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
|
|
1640
1638
|
} catch (error) {
|
|
1641
|
-
|
|
1639
|
+
_chunkE7YOJ4JGjs.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
|
|
1642
1640
|
throw error;
|
|
1643
1641
|
} finally {
|
|
1644
1642
|
stopwatch();
|
|
@@ -1666,9 +1664,9 @@ var watch = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (context2, opti
|
|
|
1666
1664
|
return context2.rebuild();
|
|
1667
1665
|
});
|
|
1668
1666
|
if (rebuildResult instanceof Error) {
|
|
1669
|
-
|
|
1667
|
+
_chunkE7YOJ4JGjs.writeError.call(void 0, rebuildResult.message);
|
|
1670
1668
|
}
|
|
1671
|
-
|
|
1669
|
+
_chunkE7YOJ4JGjs.writeTrace.call(void 0, `${Date.now() - timeBefore}ms [${_nullishCoalesce(options.name, () => ( ""))}]`);
|
|
1672
1670
|
}, 10);
|
|
1673
1671
|
changeWatcher.on("change", fastRebuild);
|
|
1674
1672
|
return void 0;
|
|
@@ -1676,7 +1674,7 @@ var watch = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (context2, opti
|
|
|
1676
1674
|
|
|
1677
1675
|
// ../workspace-tools/src/executors/esbuild/executor.ts
|
|
1678
1676
|
async function esbuildExecutorFn(options, context2, config) {
|
|
1679
|
-
|
|
1677
|
+
_chunkE7YOJ4JGjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
|
|
1680
1678
|
if (!_optionalChain([context2, 'access', _72 => _72.projectsConfigurations, 'optionalAccess', _73 => _73.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _74 => _74.projectsConfigurations, 'access', _75 => _75.projects, 'access', _76 => _76[context2.projectName], 'optionalAccess', _77 => _77.root])) {
|
|
1681
1679
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
1682
1680
|
}
|
|
@@ -1730,7 +1728,7 @@ async function sizeLimitExecutorFn(options, context2, config) {
|
|
|
1730
1728
|
if (!_optionalChain([context2, 'optionalAccess', _86 => _86.projectName]) || !_optionalChain([context2, 'access', _87 => _87.projectsConfigurations, 'optionalAccess', _88 => _88.projects]) || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
1731
1729
|
throw new Error("The Size-Limit process failed because the context is not valid. Please run this command from a workspace.");
|
|
1732
1730
|
}
|
|
1733
|
-
|
|
1731
|
+
_chunkE7YOJ4JGjs.writeInfo.call(void 0, `\u{1F4CF} Running Size-Limit on ${context2.projectName}`, config);
|
|
1734
1732
|
_sizelimit2.default.call(void 0, [
|
|
1735
1733
|
_file2.default,
|
|
1736
1734
|
_esbuild3.default,
|
|
@@ -1738,7 +1736,7 @@ async function sizeLimitExecutorFn(options, context2, config) {
|
|
|
1738
1736
|
], {
|
|
1739
1737
|
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access', _89 => _89.projectsConfigurations, 'access', _90 => _90.projects, 'access', _91 => _91[context2.projectName], 'optionalAccess', _92 => _92.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0, _nullishCoalesce(_optionalChain([context2, 'access', _93 => _93.projectsConfigurations, 'access', _94 => _94.projects, 'access', _95 => _95[context2.projectName], 'optionalAccess', _96 => _96.root]), () => ( "./")), "src")))
|
|
1740
1738
|
}).then((result) => {
|
|
1741
|
-
|
|
1739
|
+
_chunkE7YOJ4JGjs.writeInfo.call(void 0, `\u{1F4CF} ${context2.projectName} Size-Limit result: ${JSON.stringify(result)}`, config);
|
|
1742
1740
|
});
|
|
1743
1741
|
return {
|
|
1744
1742
|
success: true
|
|
@@ -1801,13 +1799,13 @@ var resolveOptions2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1801
1799
|
if (!workspaceRoot3) {
|
|
1802
1800
|
throw new Error("Cannot find Nx workspace root");
|
|
1803
1801
|
}
|
|
1804
|
-
const config = await
|
|
1805
|
-
|
|
1806
|
-
const stopwatch =
|
|
1802
|
+
const config = await _chunkBCL7PY4Ijs.getConfig.call(void 0, workspaceRoot3.dir);
|
|
1803
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
1804
|
+
const stopwatch = _chunkE7YOJ4JGjs.getStopwatch.call(void 0, "Build options resolution");
|
|
1807
1805
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
1808
1806
|
exitOnError: true
|
|
1809
1807
|
});
|
|
1810
|
-
const projectJsonPath =
|
|
1808
|
+
const projectJsonPath = _chunkE7YOJ4JGjs.joinPaths.call(void 0, workspaceRoot3.dir, projectRoot, "project.json");
|
|
1811
1809
|
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
1812
1810
|
throw new Error("Cannot find project.json configuration");
|
|
1813
1811
|
}
|
|
@@ -1821,7 +1819,7 @@ var resolveOptions2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1821
1819
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS2);
|
|
1822
1820
|
options.name ??= `${projectName}-${options.format}`;
|
|
1823
1821
|
options.target ??= DEFAULT_TARGET;
|
|
1824
|
-
const packageJsonPath =
|
|
1822
|
+
const packageJsonPath = _chunkE7YOJ4JGjs.joinPaths.call(void 0, workspaceRoot3.dir, options.projectRoot, "package.json");
|
|
1825
1823
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1826
1824
|
throw new Error("Cannot find package.json configuration");
|
|
1827
1825
|
}
|
|
@@ -1830,20 +1828,20 @@ var resolveOptions2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1830
1828
|
...options,
|
|
1831
1829
|
config,
|
|
1832
1830
|
...userOptions,
|
|
1833
|
-
tsconfig:
|
|
1831
|
+
tsconfig: _chunkE7YOJ4JGjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
1834
1832
|
format: options.format || "cjs",
|
|
1835
1833
|
entryPoints: await getEntryPoints(config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
|
|
1836
1834
|
"./src/index.ts"
|
|
1837
1835
|
], userOptions.emitOnAll),
|
|
1838
|
-
outdir: userOptions.outputPath ||
|
|
1836
|
+
outdir: userOptions.outputPath || _chunkE7YOJ4JGjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
1839
1837
|
plugins: [],
|
|
1840
1838
|
name: userOptions.name || projectName,
|
|
1841
1839
|
projectConfigurations,
|
|
1842
1840
|
projectName,
|
|
1843
1841
|
projectGraph,
|
|
1844
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot ||
|
|
1842
|
+
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkE7YOJ4JGjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
1845
1843
|
minify: userOptions.minify || !userOptions.debug,
|
|
1846
|
-
verbose: userOptions.verbose ||
|
|
1844
|
+
verbose: userOptions.verbose || _chunkE7YOJ4JGjs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
1847
1845
|
includeSrc: userOptions.includeSrc === true,
|
|
1848
1846
|
metafile: userOptions.metafile !== false,
|
|
1849
1847
|
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
@@ -1877,14 +1875,14 @@ var resolveOptions2 = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, async
|
|
|
1877
1875
|
return result;
|
|
1878
1876
|
}, "resolveOptions");
|
|
1879
1877
|
async function generatePackageJson2(options) {
|
|
1880
|
-
if (options.generatePackageJson !== false && _fs.existsSync.call(void 0,
|
|
1881
|
-
|
|
1882
|
-
const stopwatch =
|
|
1883
|
-
const packageJsonPath =
|
|
1878
|
+
if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkE7YOJ4JGjs.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
|
|
1879
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", options.config);
|
|
1880
|
+
const stopwatch = _chunkE7YOJ4JGjs.getStopwatch.call(void 0, "Write package.json file");
|
|
1881
|
+
const packageJsonPath = _chunkE7YOJ4JGjs.joinPaths.call(void 0, options.projectRoot, "project.json");
|
|
1884
1882
|
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
1885
1883
|
throw new Error("Cannot find package.json configuration");
|
|
1886
1884
|
}
|
|
1887
|
-
const packageJsonFile = await _promises2.default.readFile(
|
|
1885
|
+
const packageJsonFile = await _promises2.default.readFile(_chunkE7YOJ4JGjs.joinPaths.call(void 0, options.config.workspaceRoot, options.projectRoot, "package.json"), "utf8");
|
|
1888
1886
|
if (!packageJsonFile) {
|
|
1889
1887
|
throw new Error("Cannot find package.json configuration file");
|
|
1890
1888
|
}
|
|
@@ -1923,15 +1921,15 @@ async function generatePackageJson2(options) {
|
|
|
1923
1921
|
}
|
|
1924
1922
|
return ret;
|
|
1925
1923
|
}, packageJson.exports);
|
|
1926
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
1924
|
+
await _devkit.writeJsonFile.call(void 0, _chunkE7YOJ4JGjs.joinPaths.call(void 0, options.outdir, "package.json"), packageJson);
|
|
1927
1925
|
stopwatch();
|
|
1928
1926
|
}
|
|
1929
1927
|
return options;
|
|
1930
1928
|
}
|
|
1931
1929
|
_chunkJ5SB6L2Ljs.__name.call(void 0, generatePackageJson2, "generatePackageJson");
|
|
1932
1930
|
async function executeTSDown(options) {
|
|
1933
|
-
|
|
1934
|
-
const stopwatch =
|
|
1931
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, ` \u{1F680} Running ${options.name} build`, options.config);
|
|
1932
|
+
const stopwatch = _chunkE7YOJ4JGjs.getStopwatch.call(void 0, `${options.name} build`);
|
|
1935
1933
|
await _tsdown.build.call(void 0, {
|
|
1936
1934
|
...options,
|
|
1937
1935
|
entry: options.entryPoints,
|
|
@@ -1943,21 +1941,21 @@ async function executeTSDown(options) {
|
|
|
1943
1941
|
}
|
|
1944
1942
|
_chunkJ5SB6L2Ljs.__name.call(void 0, executeTSDown, "executeTSDown");
|
|
1945
1943
|
async function copyBuildAssets2(options) {
|
|
1946
|
-
|
|
1947
|
-
const stopwatch =
|
|
1944
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${options.outdir}`, options.config);
|
|
1945
|
+
const stopwatch = _chunkE7YOJ4JGjs.getStopwatch.call(void 0, `${options.name} asset copy`);
|
|
1948
1946
|
await copyAssets(options.config, _nullishCoalesce(options.assets, () => ( [])), options.outdir, options.projectRoot, options.sourceRoot, true, false);
|
|
1949
1947
|
stopwatch();
|
|
1950
1948
|
return options;
|
|
1951
1949
|
}
|
|
1952
1950
|
_chunkJ5SB6L2Ljs.__name.call(void 0, copyBuildAssets2, "copyBuildAssets");
|
|
1953
1951
|
async function reportResults2(options) {
|
|
1954
|
-
|
|
1952
|
+
_chunkE7YOJ4JGjs.writeSuccess.call(void 0, ` \u{1F4E6} The ${options.name} build completed successfully`, options.config);
|
|
1955
1953
|
}
|
|
1956
1954
|
_chunkJ5SB6L2Ljs.__name.call(void 0, reportResults2, "reportResults");
|
|
1957
1955
|
async function cleanOutputPath2(options) {
|
|
1958
1956
|
if (options.clean !== false && options.outdir) {
|
|
1959
|
-
|
|
1960
|
-
const stopwatch =
|
|
1957
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${options.name} output path: ${options.outdir}`, options.config);
|
|
1958
|
+
const stopwatch = _chunkE7YOJ4JGjs.getStopwatch.call(void 0, `${options.name} output clean`);
|
|
1961
1959
|
await cleanDirectories2(options.name, options.outdir, options.config);
|
|
1962
1960
|
stopwatch();
|
|
1963
1961
|
}
|
|
@@ -1965,8 +1963,8 @@ async function cleanOutputPath2(options) {
|
|
|
1965
1963
|
}
|
|
1966
1964
|
_chunkJ5SB6L2Ljs.__name.call(void 0, cleanOutputPath2, "cleanOutputPath");
|
|
1967
1965
|
async function build4(options) {
|
|
1968
|
-
|
|
1969
|
-
const stopwatch =
|
|
1966
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, ` \u26A1 Executing Storm TSDown pipeline`);
|
|
1967
|
+
const stopwatch = _chunkE7YOJ4JGjs.getStopwatch.call(void 0, "TSDown pipeline");
|
|
1970
1968
|
try {
|
|
1971
1969
|
const opts = Array.isArray(options) ? options : [
|
|
1972
1970
|
options
|
|
@@ -1984,11 +1982,11 @@ async function build4(options) {
|
|
|
1984
1982
|
await reportResults2(opt);
|
|
1985
1983
|
}));
|
|
1986
1984
|
} else {
|
|
1987
|
-
|
|
1985
|
+
_chunkE7YOJ4JGjs.writeWarning.call(void 0, " \u{1F6A7} No options were passed to TSBuild. Please check the parameters passed to the `build` function.");
|
|
1988
1986
|
}
|
|
1989
|
-
|
|
1987
|
+
_chunkE7YOJ4JGjs.writeSuccess.call(void 0, " \u{1F3C1} TSDown pipeline build completed successfully");
|
|
1990
1988
|
} catch (error) {
|
|
1991
|
-
|
|
1989
|
+
_chunkE7YOJ4JGjs.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
|
|
1992
1990
|
throw error;
|
|
1993
1991
|
} finally {
|
|
1994
1992
|
stopwatch();
|
|
@@ -1998,7 +1996,7 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, build4, "build");
|
|
|
1998
1996
|
|
|
1999
1997
|
// ../workspace-tools/src/executors/tsdown/executor.ts
|
|
2000
1998
|
async function tsdownExecutorFn(options, context2, config) {
|
|
2001
|
-
|
|
1999
|
+
_chunkE7YOJ4JGjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm TSDown build executor on the workspace", config);
|
|
2002
2000
|
if (!_optionalChain([context2, 'access', _99 => _99.projectsConfigurations, 'optionalAccess', _100 => _100.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _101 => _101.projectsConfigurations, 'access', _102 => _102.projects, 'access', _103 => _103[context2.projectName], 'optionalAccess', _104 => _104.root])) {
|
|
2003
2001
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
2004
2002
|
}
|
|
@@ -2034,11 +2032,11 @@ var _fsextra = require('fs-extra');
|
|
|
2034
2032
|
var _TypiaProgrammerjs = require('typia/lib/programmers/TypiaProgrammer.js');
|
|
2035
2033
|
async function typiaExecutorFn(options, _, config) {
|
|
2036
2034
|
if (options.clean !== false) {
|
|
2037
|
-
|
|
2035
|
+
_chunkE7YOJ4JGjs.writeInfo.call(void 0, `\u{1F9F9} Cleaning output path: ${options.outputPath}`, config);
|
|
2038
2036
|
_fsextra.removeSync.call(void 0, options.outputPath);
|
|
2039
2037
|
}
|
|
2040
2038
|
await Promise.all(options.entry.map((entry) => {
|
|
2041
|
-
|
|
2039
|
+
_chunkE7YOJ4JGjs.writeInfo.call(void 0, `\u{1F680} Running Typia on entry: ${entry}`, config);
|
|
2042
2040
|
return _TypiaProgrammerjs.TypiaProgrammer.build({
|
|
2043
2041
|
input: entry,
|
|
2044
2042
|
output: options.outputPath,
|
|
@@ -2069,7 +2067,7 @@ var executor_default9 = withRunExecutor("Typia runtime validation generator", ty
|
|
|
2069
2067
|
|
|
2070
2068
|
var _jiti = require('jiti');
|
|
2071
2069
|
async function unbuildExecutorFn(options, context2, config) {
|
|
2072
|
-
|
|
2070
|
+
_chunkE7YOJ4JGjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
|
|
2073
2071
|
if (!_optionalChain([context2, 'access', _113 => _113.projectsConfigurations, 'optionalAccess', _114 => _114.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
2074
2072
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace root directory.");
|
|
2075
2073
|
}
|
|
@@ -2080,7 +2078,7 @@ async function unbuildExecutorFn(options, context2, config) {
|
|
|
2080
2078
|
throw new Error("The Build process failed because the project's source root is not valid. Please run this command from a workspace root directory.");
|
|
2081
2079
|
}
|
|
2082
2080
|
const jiti = _jiti.createJiti.call(void 0, config.workspaceRoot, {
|
|
2083
|
-
fsCache: config.skipCache ? false :
|
|
2081
|
+
fsCache: config.skipCache ? false : _chunkE7YOJ4JGjs.joinPaths.call(void 0, config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti"),
|
|
2084
2082
|
interopDefault: true
|
|
2085
2083
|
});
|
|
2086
2084
|
const stormUnbuild = await jiti.import(jiti.esmResolve("@storm-software/unbuild/build"));
|
|
@@ -2093,7 +2091,7 @@ async function unbuildExecutorFn(options, context2, config) {
|
|
|
2093
2091
|
}, {
|
|
2094
2092
|
stubOptions: {
|
|
2095
2093
|
jiti: {
|
|
2096
|
-
fsCache: config.skipCache ? false :
|
|
2094
|
+
fsCache: config.skipCache ? false : _chunkE7YOJ4JGjs.joinPaths.call(void 0, config.workspaceRoot, config.directories.cache || "node_modules/.cache/storm", "jiti")
|
|
2097
2095
|
}
|
|
2098
2096
|
},
|
|
2099
2097
|
rollup: {
|
|
@@ -2140,34 +2138,34 @@ var executor_default10 = withRunExecutor("TypeScript Unbuild build", unbuildExec
|
|
|
2140
2138
|
var withRunGenerator = /* @__PURE__ */ _chunkJ5SB6L2Ljs.__name.call(void 0, (name, generatorFn, generatorOptions = {
|
|
2141
2139
|
skipReadingConfig: false
|
|
2142
2140
|
}) => async (tree, _options) => {
|
|
2143
|
-
const stopwatch =
|
|
2141
|
+
const stopwatch = _chunkE7YOJ4JGjs.getStopwatch.call(void 0, name);
|
|
2144
2142
|
let options = _options;
|
|
2145
2143
|
let config;
|
|
2146
2144
|
try {
|
|
2147
|
-
|
|
2145
|
+
_chunkE7YOJ4JGjs.writeInfo.call(void 0, `\u26A1 Running the ${name} generator...
|
|
2148
2146
|
|
|
2149
2147
|
`, config);
|
|
2150
|
-
const workspaceRoot3 =
|
|
2148
|
+
const workspaceRoot3 = _chunkE7YOJ4JGjs.findWorkspaceRoot.call(void 0, );
|
|
2151
2149
|
if (!generatorOptions.skipReadingConfig) {
|
|
2152
|
-
|
|
2150
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
2153
2151
|
- workspaceRoot: ${workspaceRoot3}`, config);
|
|
2154
|
-
config = await
|
|
2152
|
+
config = await _chunkBCL7PY4Ijs.getConfig.call(void 0, workspaceRoot3);
|
|
2155
2153
|
}
|
|
2156
2154
|
if (_optionalChain([generatorOptions, 'optionalAccess', _115 => _115.hooks, 'optionalAccess', _116 => _116.applyDefaultOptions])) {
|
|
2157
|
-
|
|
2155
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
2158
2156
|
options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
|
|
2159
|
-
|
|
2157
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
2160
2158
|
}
|
|
2161
|
-
|
|
2159
|
+
_chunkE7YOJ4JGjs.writeTrace.call(void 0, `Generator schema options \u2699\uFE0F
|
|
2162
2160
|
${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`, config);
|
|
2163
2161
|
const tokenized = await applyWorkspaceTokens(options, {
|
|
2164
2162
|
workspaceRoot: tree.root,
|
|
2165
2163
|
config
|
|
2166
2164
|
}, applyWorkspaceBaseTokens);
|
|
2167
2165
|
if (_optionalChain([generatorOptions, 'optionalAccess', _117 => _117.hooks, 'optionalAccess', _118 => _118.preProcess])) {
|
|
2168
|
-
|
|
2166
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
2169
2167
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
2170
|
-
|
|
2168
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
2171
2169
|
}
|
|
2172
2170
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
2173
2171
|
if (result) {
|
|
@@ -2180,18 +2178,18 @@ ${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${
|
|
|
2180
2178
|
}
|
|
2181
2179
|
}
|
|
2182
2180
|
if (_optionalChain([generatorOptions, 'optionalAccess', _128 => _128.hooks, 'optionalAccess', _129 => _129.postProcess])) {
|
|
2183
|
-
|
|
2181
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
2184
2182
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
2185
|
-
|
|
2183
|
+
_chunkE7YOJ4JGjs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
2186
2184
|
}
|
|
2187
2185
|
return () => {
|
|
2188
|
-
|
|
2186
|
+
_chunkE7YOJ4JGjs.writeSuccess.call(void 0, `Completed running the ${name} generator!
|
|
2189
2187
|
`, config);
|
|
2190
2188
|
};
|
|
2191
2189
|
} catch (error) {
|
|
2192
2190
|
return () => {
|
|
2193
|
-
|
|
2194
|
-
|
|
2191
|
+
_chunkE7YOJ4JGjs.writeFatal.call(void 0, "A fatal error occurred while running the generator - the process was forced to terminate", config);
|
|
2192
|
+
_chunkE7YOJ4JGjs.writeError.call(void 0, `An exception was thrown in the generator's process
|
|
2195
2193
|
- Details: ${error.message}
|
|
2196
2194
|
- Stacktrace: ${error.stack}`, config);
|
|
2197
2195
|
};
|
|
@@ -2237,7 +2235,7 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2237
2235
|
const projectConfig = {
|
|
2238
2236
|
root: normalized.directory,
|
|
2239
2237
|
projectType: "library",
|
|
2240
|
-
sourceRoot:
|
|
2238
|
+
sourceRoot: _chunkE7YOJ4JGjs.joinPaths.call(void 0, _nullishCoalesce(normalized.directory, () => ( "")), "src"),
|
|
2241
2239
|
targets: {
|
|
2242
2240
|
build: {
|
|
2243
2241
|
executor: options.buildExecutor,
|
|
@@ -2246,11 +2244,11 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2246
2244
|
],
|
|
2247
2245
|
options: {
|
|
2248
2246
|
entry: [
|
|
2249
|
-
|
|
2247
|
+
_chunkE7YOJ4JGjs.joinPaths.call(void 0, normalized.projectRoot, "src", "index.ts")
|
|
2250
2248
|
],
|
|
2251
2249
|
outputPath: getOutputPath(normalized),
|
|
2252
|
-
tsconfig:
|
|
2253
|
-
project:
|
|
2250
|
+
tsconfig: _chunkE7YOJ4JGjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json"),
|
|
2251
|
+
project: _chunkE7YOJ4JGjs.joinPaths.call(void 0, normalized.projectRoot, "package.json"),
|
|
2254
2252
|
defaultConfiguration: "production",
|
|
2255
2253
|
platform: "neutral",
|
|
2256
2254
|
assets: [
|
|
@@ -2304,7 +2302,7 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2304
2302
|
if (!normalized.importPath) {
|
|
2305
2303
|
normalized.importPath = normalized.name;
|
|
2306
2304
|
}
|
|
2307
|
-
const packageJsonPath =
|
|
2305
|
+
const packageJsonPath = _chunkE7YOJ4JGjs.joinPaths.call(void 0, normalized.projectRoot, "package.json");
|
|
2308
2306
|
if (tree.exists(packageJsonPath)) {
|
|
2309
2307
|
_devkit.updateJson.call(void 0, tree, packageJsonPath, (json) => {
|
|
2310
2308
|
if (!normalized.importPath) {
|
|
@@ -2361,10 +2359,10 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2361
2359
|
}));
|
|
2362
2360
|
}
|
|
2363
2361
|
_js.addTsConfigPath.call(void 0, tree, normalized.importPath, [
|
|
2364
|
-
|
|
2362
|
+
_chunkE7YOJ4JGjs.joinPaths.call(void 0, normalized.projectRoot, "./src", `index.${normalized.js ? "js" : "ts"}`)
|
|
2365
2363
|
]);
|
|
2366
|
-
_js.addTsConfigPath.call(void 0, tree,
|
|
2367
|
-
|
|
2364
|
+
_js.addTsConfigPath.call(void 0, tree, _chunkE7YOJ4JGjs.joinPaths.call(void 0, normalized.importPath, "/*"), [
|
|
2365
|
+
_chunkE7YOJ4JGjs.joinPaths.call(void 0, normalized.projectRoot, "./src", "/*")
|
|
2368
2366
|
]);
|
|
2369
2367
|
if (tree.exists("package.json")) {
|
|
2370
2368
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
@@ -2375,7 +2373,7 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
2375
2373
|
description = packageJson.description;
|
|
2376
2374
|
}
|
|
2377
2375
|
}
|
|
2378
|
-
const tsconfigPath =
|
|
2376
|
+
const tsconfigPath = _chunkE7YOJ4JGjs.joinPaths.call(void 0, normalized.projectRoot, "tsconfig.json");
|
|
2379
2377
|
if (tree.exists(tsconfigPath)) {
|
|
2380
2378
|
_devkit.updateJson.call(void 0, tree, tsconfigPath, (json) => {
|
|
2381
2379
|
json.composite ??= true;
|
|
@@ -2413,7 +2411,7 @@ function getOutputPath(options) {
|
|
|
2413
2411
|
} else {
|
|
2414
2412
|
parts.push(options.projectRoot);
|
|
2415
2413
|
}
|
|
2416
|
-
return
|
|
2414
|
+
return _chunkE7YOJ4JGjs.joinPaths.call(void 0, ...parts);
|
|
2417
2415
|
}
|
|
2418
2416
|
_chunkJ5SB6L2Ljs.__name.call(void 0, getOutputPath, "getOutputPath");
|
|
2419
2417
|
function createProjectTsConfigJson(tree, options) {
|
|
@@ -2422,7 +2420,7 @@ function createProjectTsConfigJson(tree, options) {
|
|
|
2422
2420
|
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _141 => _141.tsconfigOptions]), () => ( {})),
|
|
2423
2421
|
compilerOptions: {
|
|
2424
2422
|
...options.rootProject ? _js.tsConfigBaseOptions : {},
|
|
2425
|
-
outDir:
|
|
2423
|
+
outDir: _chunkE7YOJ4JGjs.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
|
|
2426
2424
|
noEmit: true,
|
|
2427
2425
|
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _142 => _142.tsconfigOptions, 'optionalAccess', _143 => _143.compilerOptions]), () => ( {}))
|
|
2428
2426
|
},
|
|
@@ -2442,7 +2440,7 @@ function createProjectTsConfigJson(tree, options) {
|
|
|
2442
2440
|
"src/**/*.test.ts"
|
|
2443
2441
|
]
|
|
2444
2442
|
};
|
|
2445
|
-
_devkit.writeJson.call(void 0, tree,
|
|
2443
|
+
_devkit.writeJson.call(void 0, tree, _chunkE7YOJ4JGjs.joinPaths.call(void 0, options.projectRoot, "tsconfig.json"), tsconfig);
|
|
2446
2444
|
}
|
|
2447
2445
|
_chunkJ5SB6L2Ljs.__name.call(void 0, createProjectTsConfigJson, "createProjectTsConfigJson");
|
|
2448
2446
|
async function normalizeOptions(tree, options, config) {
|
|
@@ -2502,7 +2500,7 @@ _chunkJ5SB6L2Ljs.__name.call(void 0, normalizeOptions, "normalizeOptions");
|
|
|
2502
2500
|
|
|
2503
2501
|
// ../workspace-tools/src/generators/browser-library/generator.ts
|
|
2504
2502
|
async function browserLibraryGeneratorFn(tree, schema, config) {
|
|
2505
|
-
const filesDir =
|
|
2503
|
+
const filesDir = _chunkE7YOJ4JGjs.joinPaths.call(void 0, __dirname, "src", "generators", "browser-library", "files");
|
|
2506
2504
|
const tsLibraryGeneratorOptions = {
|
|
2507
2505
|
buildExecutor: "@storm-software/workspace-tools:unbuild",
|
|
2508
2506
|
platform: "browser",
|
|
@@ -2574,19 +2572,19 @@ var generator_default = withRunGenerator("TypeScript Library Creator (Browser Pl
|
|
|
2574
2572
|
|
|
2575
2573
|
var _zodtojsonschema = require('zod-to-json-schema');
|
|
2576
2574
|
async function configSchemaGeneratorFn(tree, options, config) {
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0,
|
|
2575
|
+
_chunkE7YOJ4JGjs.writeInfo.call(void 0, "\u{1F4E6} Running Storm Workspace Configuration JSON Schema generator", config);
|
|
2576
|
+
_chunkE7YOJ4JGjs.writeTrace.call(void 0, `Determining the Storm Workspace Configuration JSON Schema...`, config);
|
|
2577
|
+
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0, _chunkE7YOJ4JGjs.StormConfigSchema, {
|
|
2580
2578
|
name: "StormWorkspaceConfiguration"
|
|
2581
2579
|
});
|
|
2582
|
-
|
|
2583
|
-
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _152 => _152.workspaceRoot]), () => (
|
|
2584
|
-
|
|
2580
|
+
_chunkE7YOJ4JGjs.writeTrace.call(void 0, jsonSchema, config);
|
|
2581
|
+
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _152 => _152.workspaceRoot]), () => ( _chunkE7YOJ4JGjs.findWorkspaceRoot.call(void 0, ))), _optionalChain([options, 'access', _153 => _153.outputFile, 'optionalAccess', _154 => _154.startsWith, 'call', _155 => _155("./")]) ? "" : "./");
|
|
2582
|
+
_chunkE7YOJ4JGjs.writeTrace.call(void 0, `\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`, config);
|
|
2585
2583
|
_devkit.writeJson.call(void 0, tree, outputPath, jsonSchema, {
|
|
2586
2584
|
spaces: 2
|
|
2587
2585
|
});
|
|
2588
2586
|
await _devkit.formatFiles.call(void 0, tree);
|
|
2589
|
-
|
|
2587
|
+
_chunkE7YOJ4JGjs.writeSuccess.call(void 0, "\u{1F680} Storm Configuration JSON Schema creation has completed successfully!", config);
|
|
2590
2588
|
return {
|
|
2591
2589
|
success: true
|
|
2592
2590
|
};
|
|
@@ -2607,7 +2605,7 @@ var generator_default2 = withRunGenerator("Configuration Schema Creator", config
|
|
|
2607
2605
|
// ../workspace-tools/src/generators/neutral-library/generator.ts
|
|
2608
2606
|
|
|
2609
2607
|
async function neutralLibraryGeneratorFn(tree, schema, config) {
|
|
2610
|
-
const filesDir =
|
|
2608
|
+
const filesDir = _chunkE7YOJ4JGjs.joinPaths.call(void 0, __dirname, "src", "generators", "neutral-library", "files");
|
|
2611
2609
|
const tsLibraryGeneratorOptions = {
|
|
2612
2610
|
...schema,
|
|
2613
2611
|
platform: "neutral",
|
|
@@ -2650,7 +2648,7 @@ var generator_default3 = withRunGenerator("TypeScript Library Creator (Neutral P
|
|
|
2650
2648
|
// ../workspace-tools/src/generators/node-library/generator.ts
|
|
2651
2649
|
|
|
2652
2650
|
async function nodeLibraryGeneratorFn(tree, schema, config) {
|
|
2653
|
-
const filesDir =
|
|
2651
|
+
const filesDir = _chunkE7YOJ4JGjs.joinPaths.call(void 0, __dirname, "src", "generators", "node-library", "files");
|
|
2654
2652
|
const tsLibraryGeneratorOptions = {
|
|
2655
2653
|
platform: "node",
|
|
2656
2654
|
devDependencies: {
|