@storm-software/workspace-tools 1.62.12 → 1.62.13
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/index.js +23 -22
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/executors/tsup/executor.js +23 -22
- package/src/executors/tsup-browser/executor.js +23 -22
- package/src/executors/tsup-neutral/executor.js +23 -22
- package/src/executors/tsup-node/executor.js +23 -22
- package/src/utils/index.js +23 -22
package/src/utils/index.js
CHANGED
|
@@ -452291,7 +452291,7 @@ ${outro}`;
|
|
|
452291
452291
|
await promises3.mkdir(node_path.dirname(fileName), { recursive: true });
|
|
452292
452292
|
return promises3.writeFile(fileName, outputFile.type === "asset" ? outputFile.source : outputFile.code);
|
|
452293
452293
|
}
|
|
452294
|
-
function
|
|
452294
|
+
function defineConfig2(options8) {
|
|
452295
452295
|
return options8;
|
|
452296
452296
|
}
|
|
452297
452297
|
exports2.blue = blue;
|
|
@@ -452300,7 +452300,7 @@ ${outro}`;
|
|
|
452300
452300
|
exports2.createFilter = createFilter;
|
|
452301
452301
|
exports2.cyan = cyan$1;
|
|
452302
452302
|
exports2.cyan$1 = cyan;
|
|
452303
|
-
exports2.defineConfig =
|
|
452303
|
+
exports2.defineConfig = defineConfig2;
|
|
452304
452304
|
exports2.ensureArray = ensureArray$1;
|
|
452305
452305
|
exports2.getAugmentedNamespace = getAugmentedNamespace;
|
|
452306
452306
|
exports2.getNewArray = getNewArray;
|
|
@@ -458869,7 +458869,7 @@ var require_dist6 = __commonJS({
|
|
|
458869
458869
|
}
|
|
458870
458870
|
};
|
|
458871
458871
|
};
|
|
458872
|
-
var
|
|
458872
|
+
var defineConfig2 = (options8) => options8;
|
|
458873
458873
|
var isTaskkillCmdProcessNotFoundError = (err) => {
|
|
458874
458874
|
return process.platform === "win32" && "cmd" in err && "code" in err && typeof err.cmd === "string" && err.cmd.startsWith("taskkill") && err.code === 128;
|
|
458875
458875
|
};
|
|
@@ -459174,7 +459174,7 @@ var require_dist6 = __commonJS({
|
|
|
459174
459174
|
);
|
|
459175
459175
|
}
|
|
459176
459176
|
exports2.build = build2;
|
|
459177
|
-
exports2.defineConfig =
|
|
459177
|
+
exports2.defineConfig = defineConfig2;
|
|
459178
459178
|
}
|
|
459179
459179
|
});
|
|
459180
459180
|
|
|
@@ -466610,6 +466610,7 @@ async function resolveTSConfig(id = process.cwd(), options8 = {}) {
|
|
|
466610
466610
|
}
|
|
466611
466611
|
|
|
466612
466612
|
// packages/workspace-tools/src/utils/run-tsup-build.ts
|
|
466613
|
+
var import_tsup = __toESM(require_dist6());
|
|
466613
466614
|
var applyDefaultOptions = (options8) => {
|
|
466614
466615
|
options8.entry ??= "{sourceRoot}/index.ts";
|
|
466615
466616
|
options8.outputPath ??= "dist/{projectRoot}";
|
|
@@ -466644,8 +466645,7 @@ var applyDefaultOptions = (options8) => {
|
|
|
466644
466645
|
return options8;
|
|
466645
466646
|
};
|
|
466646
466647
|
var runTsupBuild = async (context, config, options8) => {
|
|
466647
|
-
const { writeInfo, writeWarning, findWorkspaceRoot } = await import("@storm-software/config-tools");
|
|
466648
|
-
const { build: tsup, defineConfig } = await Promise.resolve().then(() => __toESM(require_dist6()));
|
|
466648
|
+
const { writeInfo, writeDebug, writeWarning, findWorkspaceRoot } = await import("@storm-software/config-tools");
|
|
466649
466649
|
const workspaceRoot = config?.workspaceRoot ?? findWorkspaceRoot();
|
|
466650
466650
|
const stormEnv = Object.keys(options8.env ?? {}).filter((key2) => key2.startsWith("STORM_")).reduce((ret, key2) => {
|
|
466651
466651
|
ret[key2] = options8.env?.[key2];
|
|
@@ -466658,6 +466658,13 @@ var runTsupBuild = async (context, config, options8) => {
|
|
|
466658
466658
|
})
|
|
466659
466659
|
);
|
|
466660
466660
|
options8.plugins?.push(environmentPlugin(stormEnv));
|
|
466661
|
+
let tsconfig = await readTSConfig(options8.tsConfig);
|
|
466662
|
+
if (!tsconfig) {
|
|
466663
|
+
tsconfig = await readTSConfig(context.projectRoot);
|
|
466664
|
+
if (!tsconfig) {
|
|
466665
|
+
throw new Error("No tsconfig file found");
|
|
466666
|
+
}
|
|
466667
|
+
}
|
|
466661
466668
|
const getConfigOptions = {
|
|
466662
466669
|
...options8,
|
|
466663
466670
|
entry: {
|
|
@@ -466672,8 +466679,8 @@ var runTsupBuild = async (context, config, options8) => {
|
|
|
466672
466679
|
__STORM_CONFIG: JSON.stringify(stormEnv),
|
|
466673
466680
|
...stormEnv
|
|
466674
466681
|
},
|
|
466675
|
-
dtsTsConfig:
|
|
466676
|
-
|
|
466682
|
+
dtsTsConfig: getNormalizedTsConfig(
|
|
466683
|
+
tsconfig,
|
|
466677
466684
|
workspaceRoot,
|
|
466678
466685
|
options8.outputPath,
|
|
466679
466686
|
createTypeScriptCompilationOptions(
|
|
@@ -466707,17 +466714,18 @@ ${options8.banner}
|
|
|
466707
466714
|
};
|
|
466708
466715
|
if (options8.getConfig) {
|
|
466709
466716
|
writeInfo(config, "\u26A1 Running the Build process");
|
|
466717
|
+
writeDebug(config, JSON.stringify(getConfigOptions));
|
|
466710
466718
|
const getConfigFns = [options8.getConfig];
|
|
466711
|
-
const tsupConfig = defineConfig(
|
|
466719
|
+
const tsupConfig = (0, import_tsup.defineConfig)(
|
|
466712
466720
|
getConfigFns.map(
|
|
466713
466721
|
(getConfigFn) => getConfig(workspaceRoot, context.projectRoot, getConfigFn, getConfigOptions)
|
|
466714
466722
|
)
|
|
466715
466723
|
);
|
|
466716
466724
|
if (_isFunction(tsupConfig)) {
|
|
466717
466725
|
const tsupOptions = await Promise.resolve(tsupConfig({}));
|
|
466718
|
-
await build(
|
|
466726
|
+
await build(tsupOptions, config);
|
|
466719
466727
|
} else {
|
|
466720
|
-
await build(
|
|
466728
|
+
await build(tsupConfig, config);
|
|
466721
466729
|
}
|
|
466722
466730
|
} else {
|
|
466723
466731
|
writeWarning(
|
|
@@ -466726,14 +466734,7 @@ ${options8.banner}
|
|
|
466726
466734
|
);
|
|
466727
466735
|
}
|
|
466728
466736
|
};
|
|
466729
|
-
|
|
466730
|
-
let config = await readTSConfig(options8.tsConfig);
|
|
466731
|
-
if (!config) {
|
|
466732
|
-
config = await readTSConfig(context.projectRoot);
|
|
466733
|
-
if (!config) {
|
|
466734
|
-
throw new Error("No tsconfig file found");
|
|
466735
|
-
}
|
|
466736
|
-
}
|
|
466737
|
+
function getNormalizedTsConfig(config, workspaceRoot, outputPath, options8) {
|
|
466737
466738
|
const tsConfig = (0, import_typescript.parseJsonConfigFileContent)(
|
|
466738
466739
|
{
|
|
466739
466740
|
...config,
|
|
@@ -466760,10 +466761,10 @@ async function getNormalizedTsConfig(context, workspaceRoot, outputPath, options
|
|
|
466760
466761
|
}
|
|
466761
466762
|
return tsConfig;
|
|
466762
466763
|
}
|
|
466763
|
-
var build = async (
|
|
466764
|
+
var build = async (options8, config) => {
|
|
466764
466765
|
const { writeDebug } = await import("@storm-software/config-tools");
|
|
466765
466766
|
if (Array.isArray(options8)) {
|
|
466766
|
-
await Promise.all(options8.map((buildOptions) => build(
|
|
466767
|
+
await Promise.all(options8.map((buildOptions) => build(buildOptions, config)));
|
|
466767
466768
|
} else {
|
|
466768
466769
|
let tsupOptions = options8;
|
|
466769
466770
|
if (_isFunction(tsupOptions)) {
|
|
@@ -466777,7 +466778,7 @@ ${!_isFunction(tsupOptions) ? Object.keys(tsupOptions).map(
|
|
|
466777
466778
|
).join("\n") : "<function>"}
|
|
466778
466779
|
`
|
|
466779
466780
|
);
|
|
466780
|
-
await
|
|
466781
|
+
await (0, import_tsup.build)(tsupOptions);
|
|
466781
466782
|
}
|
|
466782
466783
|
};
|
|
466783
466784
|
var _isPrimitive = (value) => {
|