@storm-software/workspace-tools 1.62.29 → 1.62.30
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/index.js +110 -85
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/executors/tsup/executor.js +76 -51
- package/src/executors/tsup-browser/executor.js +78 -53
- package/src/executors/tsup-neutral/executor.js +78 -53
- package/src/executors/tsup-node/executor.js +79 -54
- package/src/utils/index.js +49 -24
package/package.json
CHANGED
|
@@ -122127,12 +122127,12 @@ var require_install_packages_task = __commonJS({
|
|
|
122127
122127
|
var child_process_1 = require("child_process");
|
|
122128
122128
|
var path_1 = require("path");
|
|
122129
122129
|
var nx_1 = require_nx();
|
|
122130
|
-
var { detectPackageManager, getPackageManagerCommand, joinPathFragments:
|
|
122130
|
+
var { detectPackageManager, getPackageManagerCommand, joinPathFragments: joinPathFragments3 } = (0, nx_1.requireNx)();
|
|
122131
122131
|
function installPackagesTask(tree, alwaysRun = false, cwd = "", packageManager = detectPackageManager(cwd)) {
|
|
122132
|
-
if (!tree.listChanges().find((f7) => f7.path ===
|
|
122132
|
+
if (!tree.listChanges().find((f7) => f7.path === joinPathFragments3(cwd, "package.json")) && !alwaysRun) {
|
|
122133
122133
|
return;
|
|
122134
122134
|
}
|
|
122135
|
-
const packageJsonValue = tree.read(
|
|
122135
|
+
const packageJsonValue = tree.read(joinPathFragments3(cwd, "package.json"), "utf-8");
|
|
122136
122136
|
let storedPackageJsonValue = global["__packageJsonInstallCache__"];
|
|
122137
122137
|
if (storedPackageJsonValue != packageJsonValue || alwaysRun) {
|
|
122138
122138
|
global["__packageJsonInstallCache__"] = packageJsonValue;
|
|
@@ -387342,7 +387342,7 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
387342
387342
|
var nx_1 = require_nx();
|
|
387343
387343
|
var get_workspace_layout_1 = require_get_workspace_layout();
|
|
387344
387344
|
var names_1 = require_names();
|
|
387345
|
-
var { joinPathFragments:
|
|
387345
|
+
var { joinPathFragments: joinPathFragments3, logger, normalizePath, output, readJson: readJson2, stripIndents, workspaceRoot } = (0, nx_1.requireNx)();
|
|
387346
387346
|
async function determineProjectNameAndRootOptions(tree, options8) {
|
|
387347
387347
|
if (!options8.projectNameAndRootFormat && (process.env.NX_INTERACTIVE !== "true" || !isTTY())) {
|
|
387348
387348
|
options8.projectNameAndRootFormat = "derived";
|
|
@@ -387469,14 +387469,14 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
387469
387469
|
if (options8.directory === relativeCwd || options8.directory.startsWith(`${relativeCwd}/`)) {
|
|
387470
387470
|
projectRoot = options8.directory;
|
|
387471
387471
|
} else {
|
|
387472
|
-
projectRoot =
|
|
387472
|
+
projectRoot = joinPathFragments3(relativeCwd, options8.directory);
|
|
387473
387473
|
}
|
|
387474
387474
|
} else if (options8.rootProject) {
|
|
387475
387475
|
projectRoot = ".";
|
|
387476
387476
|
} else {
|
|
387477
387477
|
projectRoot = relativeCwd;
|
|
387478
387478
|
if (!relativeCwd.endsWith(options8.name)) {
|
|
387479
|
-
projectRoot =
|
|
387479
|
+
projectRoot = joinPathFragments3(relativeCwd, options8.name);
|
|
387480
387480
|
}
|
|
387481
387481
|
}
|
|
387482
387482
|
let importPath = void 0;
|
|
@@ -387509,7 +387509,7 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
387509
387509
|
const projectSimpleName = name;
|
|
387510
387510
|
let projectRoot = projectDirectoryWithoutLayout;
|
|
387511
387511
|
if (projectDirectoryWithoutLayout !== ".") {
|
|
387512
|
-
projectRoot =
|
|
387512
|
+
projectRoot = joinPathFragments3(layoutDirectory, projectRoot);
|
|
387513
387513
|
}
|
|
387514
387514
|
let importPath;
|
|
387515
387515
|
if (options8.projectType === "library") {
|
|
@@ -446540,7 +446540,7 @@ __export(executor_exports, {
|
|
|
446540
446540
|
});
|
|
446541
446541
|
module.exports = __toCommonJS(executor_exports);
|
|
446542
446542
|
var import_node_fs = require("node:fs");
|
|
446543
|
-
var
|
|
446543
|
+
var import_devkit2 = __toESM(require_devkit());
|
|
446544
446544
|
var import_js = __toESM(require_src5());
|
|
446545
446545
|
var import_fs_extra = __toESM(require_lib4());
|
|
446546
446546
|
|
|
@@ -452972,7 +452972,6 @@ function getExtraDependencies(projectName, graph) {
|
|
|
452972
452972
|
// packages/workspace-tools/src/utils/run-tsup-build.ts
|
|
452973
452973
|
var import_node_path2 = require("node:path");
|
|
452974
452974
|
var import_esbuild_decorators = __toESM(require_src6());
|
|
452975
|
-
var import_devkit2 = __toESM(require_devkit());
|
|
452976
452975
|
var import_get_custom_transformers_factory = __toESM(require_get_custom_transformers_factory());
|
|
452977
452976
|
var import_normalize_options = __toESM(require_normalize_options());
|
|
452978
452977
|
|
|
@@ -453163,7 +453162,7 @@ var applyDefaultOptions = (options8) => {
|
|
|
453163
453162
|
return options8;
|
|
453164
453163
|
};
|
|
453165
453164
|
var runTsupBuild = async (context, config, options8) => {
|
|
453166
|
-
const { writeInfo, writeWarning, findWorkspaceRoot } = await import("@storm-software/config-tools");
|
|
453165
|
+
const { writeInfo, writeTrace, writeWarning, findWorkspaceRoot } = await import("@storm-software/config-tools");
|
|
453167
453166
|
const workspaceRoot = config?.workspaceRoot ?? findWorkspaceRoot();
|
|
453168
453167
|
const stormEnv = Object.keys(options8.env ?? {}).filter((key2) => key2.startsWith("STORM_")).reduce((ret, key2) => {
|
|
453169
453168
|
ret[key2] = options8.env?.[key2];
|
|
@@ -453176,6 +453175,32 @@ var runTsupBuild = async (context, config, options8) => {
|
|
|
453176
453175
|
})
|
|
453177
453176
|
);
|
|
453178
453177
|
options8.plugins?.push(environmentPlugin(stormEnv));
|
|
453178
|
+
const dtsTsConfig = getNormalizedTsConfig(
|
|
453179
|
+
workspaceRoot,
|
|
453180
|
+
options8.outputPath,
|
|
453181
|
+
createTypeScriptCompilationOptions(
|
|
453182
|
+
(0, import_normalize_options.normalizeOptions)(
|
|
453183
|
+
{
|
|
453184
|
+
...options8,
|
|
453185
|
+
watch: false,
|
|
453186
|
+
main: context.main,
|
|
453187
|
+
transformers: []
|
|
453188
|
+
},
|
|
453189
|
+
workspaceRoot,
|
|
453190
|
+
context.sourceRoot,
|
|
453191
|
+
workspaceRoot
|
|
453192
|
+
),
|
|
453193
|
+
context.projectName
|
|
453194
|
+
)
|
|
453195
|
+
);
|
|
453196
|
+
writeTrace(
|
|
453197
|
+
config,
|
|
453198
|
+
`\u2699\uFE0F TSC (Type Declarations) Build options:
|
|
453199
|
+
${Object.keys(dtsTsConfig.options).map(
|
|
453200
|
+
(key2) => `${key2}: ${!dtsTsConfig.options[key2] || _isPrimitive(dtsTsConfig.options[key2]) ? dtsTsConfig.options[key2] : JSON.stringify(dtsTsConfig.options[key2])}`
|
|
453201
|
+
).join("\n")}
|
|
453202
|
+
`
|
|
453203
|
+
);
|
|
453179
453204
|
const getConfigOptions = {
|
|
453180
453205
|
...options8,
|
|
453181
453206
|
entry: {
|
|
@@ -453193,24 +453218,7 @@ var runTsupBuild = async (context, config, options8) => {
|
|
|
453193
453218
|
return ret;
|
|
453194
453219
|
}, {})
|
|
453195
453220
|
},
|
|
453196
|
-
dtsTsConfig
|
|
453197
|
-
workspaceRoot,
|
|
453198
|
-
options8.outputPath,
|
|
453199
|
-
createTypeScriptCompilationOptions(
|
|
453200
|
-
(0, import_normalize_options.normalizeOptions)(
|
|
453201
|
-
{
|
|
453202
|
-
...options8,
|
|
453203
|
-
watch: false,
|
|
453204
|
-
main: context.main,
|
|
453205
|
-
transformers: []
|
|
453206
|
-
},
|
|
453207
|
-
workspaceRoot,
|
|
453208
|
-
context.sourceRoot,
|
|
453209
|
-
workspaceRoot
|
|
453210
|
-
),
|
|
453211
|
-
context.projectName
|
|
453212
|
-
)
|
|
453213
|
-
),
|
|
453221
|
+
dtsTsConfig,
|
|
453214
453222
|
banner: options8.banner ? {
|
|
453215
453223
|
js: `
|
|
453216
453224
|
|
|
@@ -453261,7 +453269,8 @@ Error: ${rawTsconfig.error.messageText}` : ""}`
|
|
|
453261
453269
|
...rawTsconfig.config,
|
|
453262
453270
|
compilerOptions: {
|
|
453263
453271
|
...rawTsconfig.config?.compilerOptions,
|
|
453264
|
-
|
|
453272
|
+
rootDir: workspaceRoot,
|
|
453273
|
+
baseUrl: workspaceRoot,
|
|
453265
453274
|
outDir: outputPath,
|
|
453266
453275
|
noEmit: false,
|
|
453267
453276
|
emitDeclarationOnly: true,
|
|
@@ -453274,6 +453283,22 @@ Error: ${rawTsconfig.error.messageText}` : ""}`
|
|
|
453274
453283
|
(0, import_node_path2.dirname)(options8.tsConfig)
|
|
453275
453284
|
);
|
|
453276
453285
|
parsedTsconfig.options.pathsBasePath = workspaceRoot;
|
|
453286
|
+
if (parsedTsconfig.options.paths) {
|
|
453287
|
+
parsedTsconfig.options.paths = Object.keys(parsedTsconfig.options.paths).reduce(
|
|
453288
|
+
(ret, key2) => {
|
|
453289
|
+
if (parsedTsconfig.options.paths?.[key2]) {
|
|
453290
|
+
ret[key2] = parsedTsconfig.options.paths[key2]?.map(
|
|
453291
|
+
(path14) => (0, import_node_path2.join)(workspaceRoot, path14)
|
|
453292
|
+
);
|
|
453293
|
+
}
|
|
453294
|
+
return ret;
|
|
453295
|
+
},
|
|
453296
|
+
{}
|
|
453297
|
+
);
|
|
453298
|
+
}
|
|
453299
|
+
if (parsedTsconfig.options.incremental) {
|
|
453300
|
+
parsedTsconfig.options.tsBuildInfoFile = (0, import_node_path2.join)(outputPath, "tsconfig.tsbuildinfo");
|
|
453301
|
+
}
|
|
453277
453302
|
return parsedTsconfig;
|
|
453278
453303
|
}
|
|
453279
453304
|
var build = async (options8, config) => {
|
|
@@ -453388,9 +453413,9 @@ ${Object.keys(options8).map(
|
|
|
453388
453413
|
if (!result.success) {
|
|
453389
453414
|
throw new Error("The Build process failed trying to copy assets");
|
|
453390
453415
|
}
|
|
453391
|
-
const pathToPackageJson = (0,
|
|
453392
|
-
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0,
|
|
453393
|
-
const workspacePackageJson = (0,
|
|
453416
|
+
const pathToPackageJson = (0, import_devkit2.joinPathFragments)(context.root, projectRoot, "package.json");
|
|
453417
|
+
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit2.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
|
|
453418
|
+
const workspacePackageJson = (0, import_devkit2.readJsonFile)((0, import_devkit2.joinPathFragments)(workspaceRoot, "package.json"));
|
|
453394
453419
|
options8.external = options8.external || [];
|
|
453395
453420
|
if (workspacePackageJson?.dependencies) {
|
|
453396
453421
|
options8.external = Object.keys(workspacePackageJson?.dependencies).reduce(
|
|
@@ -453431,7 +453456,7 @@ ${Object.keys(options8).map(
|
|
|
453431
453456
|
writeDebug(config, `\u26A1 Adding implicit dependency: ${key2}`);
|
|
453432
453457
|
const projectConfig = projectConfigs[key2];
|
|
453433
453458
|
if (projectConfig?.targets?.build) {
|
|
453434
|
-
const projectPackageJson = (0,
|
|
453459
|
+
const projectPackageJson = (0, import_devkit2.readJsonFile)(projectConfig.targets?.build.options.project);
|
|
453435
453460
|
if (projectPackageJson?.name && !options8.external?.includes(projectPackageJson.name)) {
|
|
453436
453461
|
ret.push(projectPackageJson.name);
|
|
453437
453462
|
internalDependencies.push(projectPackageJson.name);
|
|
@@ -453468,34 +453493,34 @@ ${externalDependencies.map((dep) => {
|
|
|
453468
453493
|
entryPoints.push(...options8.additionalEntryPoints);
|
|
453469
453494
|
}
|
|
453470
453495
|
if (options8.emitOnAll === true) {
|
|
453471
|
-
entryPoints = globSync((0,
|
|
453496
|
+
entryPoints = globSync((0, import_devkit2.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"), {
|
|
453472
453497
|
withFileTypes: true
|
|
453473
453498
|
}).reduce((ret, filePath) => {
|
|
453474
453499
|
let formattedPath = workspaceRoot.replaceAll("\\", "/");
|
|
453475
453500
|
if (formattedPath.toUpperCase().startsWith("C:")) {
|
|
453476
453501
|
formattedPath = formattedPath.substring(2);
|
|
453477
453502
|
}
|
|
453478
|
-
let propertyKey = (0,
|
|
453503
|
+
let propertyKey = (0, import_devkit2.joinPathFragments)(filePath.path, removeExtension(filePath.name)).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
453479
453504
|
if (propertyKey) {
|
|
453480
453505
|
while (propertyKey.startsWith("/")) {
|
|
453481
453506
|
propertyKey = propertyKey.substring(1);
|
|
453482
453507
|
}
|
|
453483
453508
|
writeDebug(
|
|
453484
453509
|
config,
|
|
453485
|
-
`Trying to add entry point ${propertyKey} at "${(0,
|
|
453510
|
+
`Trying to add entry point ${propertyKey} at "${(0, import_devkit2.joinPathFragments)(
|
|
453486
453511
|
filePath.path,
|
|
453487
453512
|
filePath.name
|
|
453488
453513
|
)}"`
|
|
453489
453514
|
);
|
|
453490
453515
|
if (!ret.includes(propertyKey)) {
|
|
453491
|
-
ret.push((0,
|
|
453516
|
+
ret.push((0, import_devkit2.joinPathFragments)(filePath.path, filePath.name));
|
|
453492
453517
|
}
|
|
453493
453518
|
}
|
|
453494
453519
|
return ret;
|
|
453495
453520
|
}, entryPoints);
|
|
453496
453521
|
}
|
|
453497
453522
|
if (options8.generatePackageJson !== false) {
|
|
453498
|
-
const projectGraph = (0,
|
|
453523
|
+
const projectGraph = (0, import_devkit2.readCachedProjectGraph)();
|
|
453499
453524
|
if (options8.bundle === false) {
|
|
453500
453525
|
packageJson.dependencies = void 0;
|
|
453501
453526
|
for (const externalDependency of externalDependencies) {
|
|
@@ -453548,16 +453573,16 @@ ${externalDependencies.map((dep) => {
|
|
|
453548
453573
|
}
|
|
453549
453574
|
packageJson.exports[`./${formattedEntryPoint}`] = {
|
|
453550
453575
|
import: {
|
|
453551
|
-
types: `./${(0,
|
|
453552
|
-
default: `./${(0,
|
|
453576
|
+
types: `./${(0, import_devkit2.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.d.ts`,
|
|
453577
|
+
default: `./${(0, import_devkit2.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.js`
|
|
453553
453578
|
},
|
|
453554
453579
|
require: {
|
|
453555
|
-
types: `./${(0,
|
|
453556
|
-
default: `./${(0,
|
|
453580
|
+
types: `./${(0, import_devkit2.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.d.cts`,
|
|
453581
|
+
default: `./${(0, import_devkit2.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.cjs`
|
|
453557
453582
|
},
|
|
453558
453583
|
default: {
|
|
453559
|
-
types: `./${(0,
|
|
453560
|
-
default: `./${(0,
|
|
453584
|
+
types: `./${(0, import_devkit2.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.d.ts`,
|
|
453585
|
+
default: `./${(0, import_devkit2.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.js`
|
|
453561
453586
|
}
|
|
453562
453587
|
};
|
|
453563
453588
|
}
|
|
@@ -453581,7 +453606,7 @@ ${externalDependencies.map((dep) => {
|
|
|
453581
453606
|
if (distSrc.startsWith("/")) {
|
|
453582
453607
|
distSrc = distSrc.substring(1);
|
|
453583
453608
|
}
|
|
453584
|
-
packageJson.source ??= `${(0,
|
|
453609
|
+
packageJson.source ??= `${(0, import_devkit2.joinPathFragments)(distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
453585
453610
|
}
|
|
453586
453611
|
packageJson.files ??= ["dist/**/*"];
|
|
453587
453612
|
if (options8.includeSrc === true && !packageJson.files.includes("src")) {
|
|
@@ -453598,8 +453623,8 @@ ${externalDependencies.map((dep) => {
|
|
|
453598
453623
|
packageJson.license ??= workspacePackageJson.license;
|
|
453599
453624
|
packageJson.keywords ??= workspacePackageJson.keywords;
|
|
453600
453625
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
453601
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot : (0,
|
|
453602
|
-
const packageJsonPath = (0,
|
|
453626
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : (0, import_devkit2.joinPathFragments)("packages", context.projectName);
|
|
453627
|
+
const packageJsonPath = (0, import_devkit2.joinPathFragments)(context.root, options8.outputPath, "package.json");
|
|
453603
453628
|
writeDebug(config, `\u26A1 Writing package.json file to: ${packageJsonPath}`);
|
|
453604
453629
|
(0, import_node_fs.writeFileSync)(packageJsonPath, JSON.stringify(packageJson));
|
|
453605
453630
|
} else {
|
|
@@ -453607,10 +453632,10 @@ ${externalDependencies.map((dep) => {
|
|
|
453607
453632
|
}
|
|
453608
453633
|
if (options8.includeSrc === true) {
|
|
453609
453634
|
const files = globSync([
|
|
453610
|
-
(0,
|
|
453611
|
-
(0,
|
|
453612
|
-
(0,
|
|
453613
|
-
(0,
|
|
453635
|
+
(0, import_devkit2.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.ts"),
|
|
453636
|
+
(0, import_devkit2.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.tsx"),
|
|
453637
|
+
(0, import_devkit2.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.js"),
|
|
453638
|
+
(0, import_devkit2.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.jsx")
|
|
453614
453639
|
]);
|
|
453615
453640
|
options8.verbose = options8.verbose || getLogLevel(config?.logLevel) >= LogLevel.DEBUG;
|
|
453616
453641
|
await Promise.allSettled(
|
|
@@ -325036,12 +325036,12 @@ var require_install_packages_task = __commonJS({
|
|
|
325036
325036
|
var child_process_1 = require("child_process");
|
|
325037
325037
|
var path_1 = require("path");
|
|
325038
325038
|
var nx_1 = require_nx();
|
|
325039
|
-
var { detectPackageManager, getPackageManagerCommand, joinPathFragments:
|
|
325039
|
+
var { detectPackageManager, getPackageManagerCommand, joinPathFragments: joinPathFragments4 } = (0, nx_1.requireNx)();
|
|
325040
325040
|
function installPackagesTask(tree, alwaysRun = false, cwd = "", packageManager = detectPackageManager(cwd)) {
|
|
325041
|
-
if (!tree.listChanges().find((f7) => f7.path ===
|
|
325041
|
+
if (!tree.listChanges().find((f7) => f7.path === joinPathFragments4(cwd, "package.json")) && !alwaysRun) {
|
|
325042
325042
|
return;
|
|
325043
325043
|
}
|
|
325044
|
-
const packageJsonValue = tree.read(
|
|
325044
|
+
const packageJsonValue = tree.read(joinPathFragments4(cwd, "package.json"), "utf-8");
|
|
325045
325045
|
let storedPackageJsonValue = global["__packageJsonInstallCache__"];
|
|
325046
325046
|
if (storedPackageJsonValue != packageJsonValue || alwaysRun) {
|
|
325047
325047
|
global["__packageJsonInstallCache__"] = packageJsonValue;
|
|
@@ -444495,7 +444495,7 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
444495
444495
|
var nx_1 = require_nx();
|
|
444496
444496
|
var get_workspace_layout_1 = require_get_workspace_layout();
|
|
444497
444497
|
var names_1 = require_names();
|
|
444498
|
-
var { joinPathFragments:
|
|
444498
|
+
var { joinPathFragments: joinPathFragments4, logger, normalizePath, output, readJson: readJson2, stripIndents, workspaceRoot } = (0, nx_1.requireNx)();
|
|
444499
444499
|
async function determineProjectNameAndRootOptions(tree, options8) {
|
|
444500
444500
|
if (!options8.projectNameAndRootFormat && (process.env.NX_INTERACTIVE !== "true" || !isTTY())) {
|
|
444501
444501
|
options8.projectNameAndRootFormat = "derived";
|
|
@@ -444622,14 +444622,14 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
444622
444622
|
if (options8.directory === relativeCwd || options8.directory.startsWith(`${relativeCwd}/`)) {
|
|
444623
444623
|
projectRoot = options8.directory;
|
|
444624
444624
|
} else {
|
|
444625
|
-
projectRoot =
|
|
444625
|
+
projectRoot = joinPathFragments4(relativeCwd, options8.directory);
|
|
444626
444626
|
}
|
|
444627
444627
|
} else if (options8.rootProject) {
|
|
444628
444628
|
projectRoot = ".";
|
|
444629
444629
|
} else {
|
|
444630
444630
|
projectRoot = relativeCwd;
|
|
444631
444631
|
if (!relativeCwd.endsWith(options8.name)) {
|
|
444632
|
-
projectRoot =
|
|
444632
|
+
projectRoot = joinPathFragments4(relativeCwd, options8.name);
|
|
444633
444633
|
}
|
|
444634
444634
|
}
|
|
444635
444635
|
let importPath = void 0;
|
|
@@ -444662,7 +444662,7 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
444662
444662
|
const projectSimpleName = name;
|
|
444663
444663
|
let projectRoot = projectDirectoryWithoutLayout;
|
|
444664
444664
|
if (projectDirectoryWithoutLayout !== ".") {
|
|
444665
|
-
projectRoot =
|
|
444665
|
+
projectRoot = joinPathFragments4(layoutDirectory, projectRoot);
|
|
444666
444666
|
}
|
|
444667
444667
|
let importPath;
|
|
444668
444668
|
if (options8.projectType === "library") {
|
|
@@ -446772,7 +446772,6 @@ ${commentStart} ----------------------------------------------------------------
|
|
|
446772
446772
|
// packages/workspace-tools/src/utils/run-tsup-build.ts
|
|
446773
446773
|
var import_node_path2 = require("node:path");
|
|
446774
446774
|
var import_esbuild_decorators = __toESM(require_src());
|
|
446775
|
-
var import_devkit2 = __toESM(require_devkit());
|
|
446776
446775
|
var import_get_custom_transformers_factory = __toESM(require_get_custom_transformers_factory());
|
|
446777
446776
|
var import_normalize_options = __toESM(require_normalize_options());
|
|
446778
446777
|
|
|
@@ -446979,7 +446978,7 @@ var applyDefaultOptions = (options8) => {
|
|
|
446979
446978
|
return options8;
|
|
446980
446979
|
};
|
|
446981
446980
|
var runTsupBuild = async (context, config, options8) => {
|
|
446982
|
-
const { writeInfo, writeWarning, findWorkspaceRoot } = await import("@storm-software/config-tools");
|
|
446981
|
+
const { writeInfo, writeTrace, writeWarning, findWorkspaceRoot } = await import("@storm-software/config-tools");
|
|
446983
446982
|
const workspaceRoot = config?.workspaceRoot ?? findWorkspaceRoot();
|
|
446984
446983
|
const stormEnv = Object.keys(options8.env ?? {}).filter((key2) => key2.startsWith("STORM_")).reduce((ret, key2) => {
|
|
446985
446984
|
ret[key2] = options8.env?.[key2];
|
|
@@ -446992,6 +446991,32 @@ var runTsupBuild = async (context, config, options8) => {
|
|
|
446992
446991
|
})
|
|
446993
446992
|
);
|
|
446994
446993
|
options8.plugins?.push(environmentPlugin(stormEnv));
|
|
446994
|
+
const dtsTsConfig = getNormalizedTsConfig(
|
|
446995
|
+
workspaceRoot,
|
|
446996
|
+
options8.outputPath,
|
|
446997
|
+
createTypeScriptCompilationOptions(
|
|
446998
|
+
(0, import_normalize_options.normalizeOptions)(
|
|
446999
|
+
{
|
|
447000
|
+
...options8,
|
|
447001
|
+
watch: false,
|
|
447002
|
+
main: context.main,
|
|
447003
|
+
transformers: []
|
|
447004
|
+
},
|
|
447005
|
+
workspaceRoot,
|
|
447006
|
+
context.sourceRoot,
|
|
447007
|
+
workspaceRoot
|
|
447008
|
+
),
|
|
447009
|
+
context.projectName
|
|
447010
|
+
)
|
|
447011
|
+
);
|
|
447012
|
+
writeTrace(
|
|
447013
|
+
config,
|
|
447014
|
+
`\u2699\uFE0F TSC (Type Declarations) Build options:
|
|
447015
|
+
${Object.keys(dtsTsConfig.options).map(
|
|
447016
|
+
(key2) => `${key2}: ${!dtsTsConfig.options[key2] || _isPrimitive(dtsTsConfig.options[key2]) ? dtsTsConfig.options[key2] : JSON.stringify(dtsTsConfig.options[key2])}`
|
|
447017
|
+
).join("\n")}
|
|
447018
|
+
`
|
|
447019
|
+
);
|
|
446995
447020
|
const getConfigOptions = {
|
|
446996
447021
|
...options8,
|
|
446997
447022
|
entry: {
|
|
@@ -447009,24 +447034,7 @@ var runTsupBuild = async (context, config, options8) => {
|
|
|
447009
447034
|
return ret;
|
|
447010
447035
|
}, {})
|
|
447011
447036
|
},
|
|
447012
|
-
dtsTsConfig
|
|
447013
|
-
workspaceRoot,
|
|
447014
|
-
options8.outputPath,
|
|
447015
|
-
createTypeScriptCompilationOptions(
|
|
447016
|
-
(0, import_normalize_options.normalizeOptions)(
|
|
447017
|
-
{
|
|
447018
|
-
...options8,
|
|
447019
|
-
watch: false,
|
|
447020
|
-
main: context.main,
|
|
447021
|
-
transformers: []
|
|
447022
|
-
},
|
|
447023
|
-
workspaceRoot,
|
|
447024
|
-
context.sourceRoot,
|
|
447025
|
-
workspaceRoot
|
|
447026
|
-
),
|
|
447027
|
-
context.projectName
|
|
447028
|
-
)
|
|
447029
|
-
),
|
|
447037
|
+
dtsTsConfig,
|
|
447030
447038
|
banner: options8.banner ? {
|
|
447031
447039
|
js: `
|
|
447032
447040
|
|
|
@@ -447077,7 +447085,8 @@ Error: ${rawTsconfig.error.messageText}` : ""}`
|
|
|
447077
447085
|
...rawTsconfig.config,
|
|
447078
447086
|
compilerOptions: {
|
|
447079
447087
|
...rawTsconfig.config?.compilerOptions,
|
|
447080
|
-
|
|
447088
|
+
rootDir: workspaceRoot,
|
|
447089
|
+
baseUrl: workspaceRoot,
|
|
447081
447090
|
outDir: outputPath,
|
|
447082
447091
|
noEmit: false,
|
|
447083
447092
|
emitDeclarationOnly: true,
|
|
@@ -447090,6 +447099,22 @@ Error: ${rawTsconfig.error.messageText}` : ""}`
|
|
|
447090
447099
|
(0, import_node_path2.dirname)(options8.tsConfig)
|
|
447091
447100
|
);
|
|
447092
447101
|
parsedTsconfig.options.pathsBasePath = workspaceRoot;
|
|
447102
|
+
if (parsedTsconfig.options.paths) {
|
|
447103
|
+
parsedTsconfig.options.paths = Object.keys(parsedTsconfig.options.paths).reduce(
|
|
447104
|
+
(ret, key2) => {
|
|
447105
|
+
if (parsedTsconfig.options.paths?.[key2]) {
|
|
447106
|
+
ret[key2] = parsedTsconfig.options.paths[key2]?.map(
|
|
447107
|
+
(path14) => (0, import_node_path2.join)(workspaceRoot, path14)
|
|
447108
|
+
);
|
|
447109
|
+
}
|
|
447110
|
+
return ret;
|
|
447111
|
+
},
|
|
447112
|
+
{}
|
|
447113
|
+
);
|
|
447114
|
+
}
|
|
447115
|
+
if (parsedTsconfig.options.incremental) {
|
|
447116
|
+
parsedTsconfig.options.tsBuildInfoFile = (0, import_node_path2.join)(outputPath, "tsconfig.tsbuildinfo");
|
|
447117
|
+
}
|
|
447093
447118
|
return parsedTsconfig;
|
|
447094
447119
|
}
|
|
447095
447120
|
var build = async (options8, config) => {
|
|
@@ -447141,7 +447166,7 @@ var createTypeScriptCompilationOptions = (normalizedOptions, projectName) => {
|
|
|
447141
447166
|
|
|
447142
447167
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
447143
447168
|
var import_node_fs = require("node:fs");
|
|
447144
|
-
var
|
|
447169
|
+
var import_devkit2 = __toESM(require_devkit());
|
|
447145
447170
|
var import_js = __toESM(require_src6());
|
|
447146
447171
|
var import_fs_extra = __toESM(require_lib5());
|
|
447147
447172
|
|
|
@@ -453427,9 +453452,9 @@ ${Object.keys(options8).map(
|
|
|
453427
453452
|
if (!result.success) {
|
|
453428
453453
|
throw new Error("The Build process failed trying to copy assets");
|
|
453429
453454
|
}
|
|
453430
|
-
const pathToPackageJson = (0,
|
|
453431
|
-
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0,
|
|
453432
|
-
const workspacePackageJson = (0,
|
|
453455
|
+
const pathToPackageJson = (0, import_devkit2.joinPathFragments)(context.root, projectRoot, "package.json");
|
|
453456
|
+
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit2.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
|
|
453457
|
+
const workspacePackageJson = (0, import_devkit2.readJsonFile)((0, import_devkit2.joinPathFragments)(workspaceRoot, "package.json"));
|
|
453433
453458
|
options8.external = options8.external || [];
|
|
453434
453459
|
if (workspacePackageJson?.dependencies) {
|
|
453435
453460
|
options8.external = Object.keys(workspacePackageJson?.dependencies).reduce(
|
|
@@ -453470,7 +453495,7 @@ ${Object.keys(options8).map(
|
|
|
453470
453495
|
writeDebug(config, `\u26A1 Adding implicit dependency: ${key2}`);
|
|
453471
453496
|
const projectConfig = projectConfigs[key2];
|
|
453472
453497
|
if (projectConfig?.targets?.build) {
|
|
453473
|
-
const projectPackageJson = (0,
|
|
453498
|
+
const projectPackageJson = (0, import_devkit2.readJsonFile)(projectConfig.targets?.build.options.project);
|
|
453474
453499
|
if (projectPackageJson?.name && !options8.external?.includes(projectPackageJson.name)) {
|
|
453475
453500
|
ret.push(projectPackageJson.name);
|
|
453476
453501
|
internalDependencies.push(projectPackageJson.name);
|
|
@@ -453507,34 +453532,34 @@ ${externalDependencies.map((dep) => {
|
|
|
453507
453532
|
entryPoints.push(...options8.additionalEntryPoints);
|
|
453508
453533
|
}
|
|
453509
453534
|
if (options8.emitOnAll === true) {
|
|
453510
|
-
entryPoints = globSync((0,
|
|
453535
|
+
entryPoints = globSync((0, import_devkit2.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"), {
|
|
453511
453536
|
withFileTypes: true
|
|
453512
453537
|
}).reduce((ret, filePath) => {
|
|
453513
453538
|
let formattedPath = workspaceRoot.replaceAll("\\", "/");
|
|
453514
453539
|
if (formattedPath.toUpperCase().startsWith("C:")) {
|
|
453515
453540
|
formattedPath = formattedPath.substring(2);
|
|
453516
453541
|
}
|
|
453517
|
-
let propertyKey = (0,
|
|
453542
|
+
let propertyKey = (0, import_devkit2.joinPathFragments)(filePath.path, removeExtension(filePath.name)).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
453518
453543
|
if (propertyKey) {
|
|
453519
453544
|
while (propertyKey.startsWith("/")) {
|
|
453520
453545
|
propertyKey = propertyKey.substring(1);
|
|
453521
453546
|
}
|
|
453522
453547
|
writeDebug(
|
|
453523
453548
|
config,
|
|
453524
|
-
`Trying to add entry point ${propertyKey} at "${(0,
|
|
453549
|
+
`Trying to add entry point ${propertyKey} at "${(0, import_devkit2.joinPathFragments)(
|
|
453525
453550
|
filePath.path,
|
|
453526
453551
|
filePath.name
|
|
453527
453552
|
)}"`
|
|
453528
453553
|
);
|
|
453529
453554
|
if (!ret.includes(propertyKey)) {
|
|
453530
|
-
ret.push((0,
|
|
453555
|
+
ret.push((0, import_devkit2.joinPathFragments)(filePath.path, filePath.name));
|
|
453531
453556
|
}
|
|
453532
453557
|
}
|
|
453533
453558
|
return ret;
|
|
453534
453559
|
}, entryPoints);
|
|
453535
453560
|
}
|
|
453536
453561
|
if (options8.generatePackageJson !== false) {
|
|
453537
|
-
const projectGraph = (0,
|
|
453562
|
+
const projectGraph = (0, import_devkit2.readCachedProjectGraph)();
|
|
453538
453563
|
if (options8.bundle === false) {
|
|
453539
453564
|
packageJson.dependencies = void 0;
|
|
453540
453565
|
for (const externalDependency of externalDependencies) {
|
|
@@ -453587,16 +453612,16 @@ ${externalDependencies.map((dep) => {
|
|
|
453587
453612
|
}
|
|
453588
453613
|
packageJson.exports[`./${formattedEntryPoint}`] = {
|
|
453589
453614
|
import: {
|
|
453590
|
-
types: `./${(0,
|
|
453591
|
-
default: `./${(0,
|
|
453615
|
+
types: `./${(0, import_devkit2.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.d.ts`,
|
|
453616
|
+
default: `./${(0, import_devkit2.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.js`
|
|
453592
453617
|
},
|
|
453593
453618
|
require: {
|
|
453594
|
-
types: `./${(0,
|
|
453595
|
-
default: `./${(0,
|
|
453619
|
+
types: `./${(0, import_devkit2.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.d.cts`,
|
|
453620
|
+
default: `./${(0, import_devkit2.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.cjs`
|
|
453596
453621
|
},
|
|
453597
453622
|
default: {
|
|
453598
|
-
types: `./${(0,
|
|
453599
|
-
default: `./${(0,
|
|
453623
|
+
types: `./${(0, import_devkit2.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.d.ts`,
|
|
453624
|
+
default: `./${(0, import_devkit2.joinPathFragments)(distPaths[0] ?? "./", formattedEntryPoint)}.js`
|
|
453600
453625
|
}
|
|
453601
453626
|
};
|
|
453602
453627
|
}
|
|
@@ -453620,7 +453645,7 @@ ${externalDependencies.map((dep) => {
|
|
|
453620
453645
|
if (distSrc.startsWith("/")) {
|
|
453621
453646
|
distSrc = distSrc.substring(1);
|
|
453622
453647
|
}
|
|
453623
|
-
packageJson.source ??= `${(0,
|
|
453648
|
+
packageJson.source ??= `${(0, import_devkit2.joinPathFragments)(distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
453624
453649
|
}
|
|
453625
453650
|
packageJson.files ??= ["dist/**/*"];
|
|
453626
453651
|
if (options8.includeSrc === true && !packageJson.files.includes("src")) {
|
|
@@ -453637,8 +453662,8 @@ ${externalDependencies.map((dep) => {
|
|
|
453637
453662
|
packageJson.license ??= workspacePackageJson.license;
|
|
453638
453663
|
packageJson.keywords ??= workspacePackageJson.keywords;
|
|
453639
453664
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
453640
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot : (0,
|
|
453641
|
-
const packageJsonPath = (0,
|
|
453665
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : (0, import_devkit2.joinPathFragments)("packages", context.projectName);
|
|
453666
|
+
const packageJsonPath = (0, import_devkit2.joinPathFragments)(context.root, options8.outputPath, "package.json");
|
|
453642
453667
|
writeDebug(config, `\u26A1 Writing package.json file to: ${packageJsonPath}`);
|
|
453643
453668
|
(0, import_node_fs.writeFileSync)(packageJsonPath, JSON.stringify(packageJson));
|
|
453644
453669
|
} else {
|
|
@@ -453646,10 +453671,10 @@ ${externalDependencies.map((dep) => {
|
|
|
453646
453671
|
}
|
|
453647
453672
|
if (options8.includeSrc === true) {
|
|
453648
453673
|
const files = globSync([
|
|
453649
|
-
(0,
|
|
453650
|
-
(0,
|
|
453651
|
-
(0,
|
|
453652
|
-
(0,
|
|
453674
|
+
(0, import_devkit2.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.ts"),
|
|
453675
|
+
(0, import_devkit2.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.tsx"),
|
|
453676
|
+
(0, import_devkit2.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.js"),
|
|
453677
|
+
(0, import_devkit2.joinPathFragments)(workspaceRoot, options8.outputPath, "src/**/*.jsx")
|
|
453653
453678
|
]);
|
|
453654
453679
|
options8.verbose = options8.verbose || getLogLevel(config?.logLevel) >= LogLevel.DEBUG;
|
|
453655
453680
|
await Promise.allSettled(
|
|
@@ -453706,7 +453731,7 @@ var _isFunction3 = (value) => {
|
|
|
453706
453731
|
};
|
|
453707
453732
|
|
|
453708
453733
|
// packages/workspace-tools/src/executors/tsup-browser/get-config.ts
|
|
453709
|
-
var
|
|
453734
|
+
var import_devkit3 = __toESM(require_devkit());
|
|
453710
453735
|
var browserConfig = ({
|
|
453711
453736
|
entry,
|
|
453712
453737
|
outDir,
|
|
@@ -453731,7 +453756,7 @@ var browserConfig = ({
|
|
|
453731
453756
|
minify = false,
|
|
453732
453757
|
getTransform
|
|
453733
453758
|
}) => {
|
|
453734
|
-
const outputPath = (0,
|
|
453759
|
+
const outputPath = (0, import_devkit3.joinPathFragments)(outDir, "dist");
|
|
453735
453760
|
const options8 = {
|
|
453736
453761
|
name: "modern",
|
|
453737
453762
|
entry,
|