@storm-software/workspace-tools 1.62.29 → 1.62.31
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/index.js +112 -87
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/executors/tsup/executor.js +78 -53
- package/src/executors/tsup-browser/executor.js +80 -55
- package/src/executors/tsup-neutral/executor.js +80 -55
- package/src/executors/tsup-node/executor.js +81 -56
- package/src/utils/index.js +51 -26
package/src/utils/index.js
CHANGED
|
@@ -347416,12 +347416,12 @@ var require_install_packages_task = __commonJS({
|
|
|
347416
347416
|
var child_process_1 = require("child_process");
|
|
347417
347417
|
var path_1 = require("path");
|
|
347418
347418
|
var nx_1 = require_nx();
|
|
347419
|
-
var { detectPackageManager, getPackageManagerCommand, joinPathFragments:
|
|
347419
|
+
var { detectPackageManager, getPackageManagerCommand, joinPathFragments: joinPathFragments2 } = (0, nx_1.requireNx)();
|
|
347420
347420
|
function installPackagesTask(tree, alwaysRun = false, cwd = "", packageManager = detectPackageManager(cwd)) {
|
|
347421
|
-
if (!tree.listChanges().find((f7) => f7.path ===
|
|
347421
|
+
if (!tree.listChanges().find((f7) => f7.path === joinPathFragments2(cwd, "package.json")) && !alwaysRun) {
|
|
347422
347422
|
return;
|
|
347423
347423
|
}
|
|
347424
|
-
const packageJsonValue = tree.read(
|
|
347424
|
+
const packageJsonValue = tree.read(joinPathFragments2(cwd, "package.json"), "utf-8");
|
|
347425
347425
|
let storedPackageJsonValue = global["__packageJsonInstallCache__"];
|
|
347426
347426
|
if (storedPackageJsonValue != packageJsonValue || alwaysRun) {
|
|
347427
347427
|
global["__packageJsonInstallCache__"] = packageJsonValue;
|
|
@@ -457050,7 +457050,6 @@ var pnpmVersion = "8.10.2";
|
|
|
457050
457050
|
// packages/workspace-tools/src/utils/run-tsup-build.ts
|
|
457051
457051
|
var import_node_path2 = require("node:path");
|
|
457052
457052
|
var import_esbuild_decorators = __toESM(require_src());
|
|
457053
|
-
var import_devkit2 = __toESM(require_devkit());
|
|
457054
457053
|
var import_get_custom_transformers_factory = __toESM(require_get_custom_transformers_factory());
|
|
457055
457054
|
var import_normalize_options = __toESM(require_normalize_options());
|
|
457056
457055
|
|
|
@@ -457241,7 +457240,7 @@ var applyDefaultOptions = (options8) => {
|
|
|
457241
457240
|
return options8;
|
|
457242
457241
|
};
|
|
457243
457242
|
var runTsupBuild = async (context, config, options8) => {
|
|
457244
|
-
const { writeInfo, writeWarning, findWorkspaceRoot } = await import("@storm-software/config-tools");
|
|
457243
|
+
const { writeInfo, writeTrace, writeWarning, findWorkspaceRoot } = await import("@storm-software/config-tools");
|
|
457245
457244
|
const workspaceRoot = config?.workspaceRoot ?? findWorkspaceRoot();
|
|
457246
457245
|
const stormEnv = Object.keys(options8.env ?? {}).filter((key2) => key2.startsWith("STORM_")).reduce((ret, key2) => {
|
|
457247
457246
|
ret[key2] = options8.env?.[key2];
|
|
@@ -457254,6 +457253,32 @@ var runTsupBuild = async (context, config, options8) => {
|
|
|
457254
457253
|
})
|
|
457255
457254
|
);
|
|
457256
457255
|
options8.plugins?.push(environmentPlugin(stormEnv));
|
|
457256
|
+
const dtsTsConfig = getNormalizedTsConfig(
|
|
457257
|
+
workspaceRoot,
|
|
457258
|
+
options8.outputPath,
|
|
457259
|
+
createTypeScriptCompilationOptions(
|
|
457260
|
+
(0, import_normalize_options.normalizeOptions)(
|
|
457261
|
+
{
|
|
457262
|
+
...options8,
|
|
457263
|
+
watch: false,
|
|
457264
|
+
main: context.main,
|
|
457265
|
+
transformers: []
|
|
457266
|
+
},
|
|
457267
|
+
workspaceRoot,
|
|
457268
|
+
context.sourceRoot,
|
|
457269
|
+
workspaceRoot
|
|
457270
|
+
),
|
|
457271
|
+
context.projectName
|
|
457272
|
+
)
|
|
457273
|
+
);
|
|
457274
|
+
writeTrace(
|
|
457275
|
+
config,
|
|
457276
|
+
`\u2699\uFE0F TSC (Type Declarations) Build options:
|
|
457277
|
+
${Object.keys(dtsTsConfig.options).map(
|
|
457278
|
+
(key2) => `${key2}: ${!dtsTsConfig.options[key2] || _isPrimitive(dtsTsConfig.options[key2]) ? dtsTsConfig.options[key2] : JSON.stringify(dtsTsConfig.options[key2])}`
|
|
457279
|
+
).join("\n")}
|
|
457280
|
+
`
|
|
457281
|
+
);
|
|
457257
457282
|
const getConfigOptions = {
|
|
457258
457283
|
...options8,
|
|
457259
457284
|
entry: {
|
|
@@ -457271,24 +457296,7 @@ var runTsupBuild = async (context, config, options8) => {
|
|
|
457271
457296
|
return ret;
|
|
457272
457297
|
}, {})
|
|
457273
457298
|
},
|
|
457274
|
-
dtsTsConfig
|
|
457275
|
-
workspaceRoot,
|
|
457276
|
-
options8.outputPath,
|
|
457277
|
-
createTypeScriptCompilationOptions(
|
|
457278
|
-
(0, import_normalize_options.normalizeOptions)(
|
|
457279
|
-
{
|
|
457280
|
-
...options8,
|
|
457281
|
-
watch: false,
|
|
457282
|
-
main: context.main,
|
|
457283
|
-
transformers: []
|
|
457284
|
-
},
|
|
457285
|
-
workspaceRoot,
|
|
457286
|
-
context.sourceRoot,
|
|
457287
|
-
workspaceRoot
|
|
457288
|
-
),
|
|
457289
|
-
context.projectName
|
|
457290
|
-
)
|
|
457291
|
-
),
|
|
457299
|
+
dtsTsConfig,
|
|
457292
457300
|
banner: options8.banner ? {
|
|
457293
457301
|
js: `
|
|
457294
457302
|
|
|
@@ -457339,19 +457347,36 @@ Error: ${rawTsconfig.error.messageText}` : ""}`
|
|
|
457339
457347
|
...rawTsconfig.config,
|
|
457340
457348
|
compilerOptions: {
|
|
457341
457349
|
...rawTsconfig.config?.compilerOptions,
|
|
457342
|
-
|
|
457350
|
+
rootDir: workspaceRoot.replaceAll("\\", "/"),
|
|
457351
|
+
baseUrl: workspaceRoot.replaceAll("\\", "/"),
|
|
457343
457352
|
outDir: outputPath,
|
|
457344
457353
|
noEmit: false,
|
|
457345
457354
|
emitDeclarationOnly: true,
|
|
457346
457355
|
declaration: true,
|
|
457347
457356
|
declarationMap: true,
|
|
457348
|
-
declarationDir: (0, import_node_path2.join)(workspaceRoot, "tmp", ".tsup", "declaration")
|
|
457357
|
+
declarationDir: (0, import_node_path2.join)(workspaceRoot.replaceAll("\\", "/"), "tmp", ".tsup", "declaration")
|
|
457349
457358
|
}
|
|
457350
457359
|
},
|
|
457351
457360
|
import_typescript.sys,
|
|
457352
457361
|
(0, import_node_path2.dirname)(options8.tsConfig)
|
|
457353
457362
|
);
|
|
457354
|
-
parsedTsconfig.options.pathsBasePath = workspaceRoot;
|
|
457363
|
+
parsedTsconfig.options.pathsBasePath = workspaceRoot.replaceAll("\\", "/");
|
|
457364
|
+
if (parsedTsconfig.options.paths) {
|
|
457365
|
+
parsedTsconfig.options.paths = Object.keys(parsedTsconfig.options.paths).reduce(
|
|
457366
|
+
(ret, key2) => {
|
|
457367
|
+
if (parsedTsconfig.options.paths?.[key2]) {
|
|
457368
|
+
ret[key2] = parsedTsconfig.options.paths[key2]?.map(
|
|
457369
|
+
(path13) => (0, import_node_path2.join)(workspaceRoot.replaceAll("\\", "/"), path13)
|
|
457370
|
+
);
|
|
457371
|
+
}
|
|
457372
|
+
return ret;
|
|
457373
|
+
},
|
|
457374
|
+
{}
|
|
457375
|
+
);
|
|
457376
|
+
}
|
|
457377
|
+
if (parsedTsconfig.options.incremental) {
|
|
457378
|
+
parsedTsconfig.options.tsBuildInfoFile = (0, import_node_path2.join)(outputPath, "tsconfig.tsbuildinfo");
|
|
457379
|
+
}
|
|
457355
457380
|
return parsedTsconfig;
|
|
457356
457381
|
}
|
|
457357
457382
|
var build = async (options8, config) => {
|