@storm-software/projen 0.20.6 → 0.20.7
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 +7 -0
- package/README.md +1 -1
- package/dist/{chunk-TYOWZHER.js → chunk-656I6FOT.js} +385 -28
- package/dist/{chunk-U4QTJCVT.mjs → chunk-AGW5GBNS.mjs} +367 -10
- package/dist/generators.js +2 -2
- package/dist/generators.mjs +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +1 -1
- package/dist/src/generators/init/generator.js +2 -2
- package/dist/src/generators/init/generator.mjs +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Storm Ops - Projen
|
|
4
4
|
|
|
5
|
+
## [0.20.6](https://github.com/storm-software/storm-ops/releases/tag/projen%400.20.6) (2025-09-21)
|
|
6
|
+
|
|
7
|
+
### Miscellaneous
|
|
8
|
+
|
|
9
|
+
- **monorepo:** Update workspace package links
|
|
10
|
+
([91c9879c3](https://github.com/storm-software/storm-ops/commit/91c9879c3))
|
|
11
|
+
|
|
5
12
|
## [0.20.5](https://github.com/storm-software/storm-ops/releases/tag/projen%400.20.5) (2025-09-21)
|
|
6
13
|
|
|
7
14
|
### Miscellaneous
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
23
23
|
|
|
24
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
|
@@ -2358,6 +2358,7 @@ var DEFAULT_COMPILED_BANNER = `/*****************************************
|
|
|
2358
2358
|
*****************************************/
|
|
2359
2359
|
`;
|
|
2360
2360
|
var DEFAULT_ENVIRONMENT = "production";
|
|
2361
|
+
var DEFAULT_TARGET = "esnext";
|
|
2361
2362
|
var DEFAULT_ORGANIZATION = "storm-software";
|
|
2362
2363
|
|
|
2363
2364
|
// ../build-tools/src/plugins/index.ts
|
|
@@ -2393,7 +2394,7 @@ _chunkPZ7N3OYJjs.init_cjs_shims.call(void 0, );
|
|
|
2393
2394
|
var _copyassetshandler = require('@nx/js/src/utils/assets/copy-assets-handler');
|
|
2394
2395
|
var _glob = require('glob');
|
|
2395
2396
|
|
|
2396
|
-
var copyAssets = async (config5, assets, outputPath, projectRoot, sourceRoot,
|
|
2397
|
+
var copyAssets = async (config5, assets, outputPath, projectRoot, sourceRoot, generatePackageJson3 = true, includeSrc = false, banner, footer) => {
|
|
2397
2398
|
const pendingAssets = Array.from(_nullishCoalesce(assets, () => ( [])));
|
|
2398
2399
|
pendingAssets.push({
|
|
2399
2400
|
input: projectRoot,
|
|
@@ -2405,7 +2406,7 @@ var copyAssets = async (config5, assets, outputPath, projectRoot, sourceRoot, ge
|
|
|
2405
2406
|
glob: "LICENSE",
|
|
2406
2407
|
output: "."
|
|
2407
2408
|
});
|
|
2408
|
-
if (
|
|
2409
|
+
if (generatePackageJson3 === false) {
|
|
2409
2410
|
pendingAssets.push({
|
|
2410
2411
|
input: projectRoot,
|
|
2411
2412
|
glob: "package.json",
|
|
@@ -2612,6 +2613,26 @@ var addWorkspacePackageJsonFields = async (workspaceConfig, projectRoot, sourceR
|
|
|
2612
2613
|
packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkGZV7AWC7js.joinPaths.call(void 0, "packages", projectName);
|
|
2613
2614
|
return packageJson;
|
|
2614
2615
|
};
|
|
2616
|
+
var addPackageJsonExport = (file, type = "module", sourceRoot) => {
|
|
2617
|
+
let entry = file.replaceAll("\\", "/");
|
|
2618
|
+
if (sourceRoot) {
|
|
2619
|
+
entry = entry.replace(sourceRoot, "");
|
|
2620
|
+
}
|
|
2621
|
+
return {
|
|
2622
|
+
import: {
|
|
2623
|
+
types: `./dist/${entry}.d.${type === "module" ? "ts" : "mts"}`,
|
|
2624
|
+
default: `./dist/${entry}.${type === "module" ? "js" : "mjs"}`
|
|
2625
|
+
},
|
|
2626
|
+
require: {
|
|
2627
|
+
types: `./dist/${entry}.d.${type === "commonjs" ? "ts" : "cts"}`,
|
|
2628
|
+
default: `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
|
|
2629
|
+
},
|
|
2630
|
+
default: {
|
|
2631
|
+
types: `./dist/${entry}.d.${type !== "fixed" ? "ts" : "mts"}`,
|
|
2632
|
+
default: `./dist/${entry}.${type !== "fixed" ? "js" : "mjs"}`
|
|
2633
|
+
}
|
|
2634
|
+
};
|
|
2635
|
+
};
|
|
2615
2636
|
|
|
2616
2637
|
// ../build-tools/src/utilities/get-entry-points.ts
|
|
2617
2638
|
_chunkPZ7N3OYJjs.init_cjs_shims.call(void 0, );
|
|
@@ -3057,7 +3078,7 @@ async function esbuildExecutorFn(options, context, config5) {
|
|
|
3057
3078
|
name: context.projectName,
|
|
3058
3079
|
sourceRoot: _optionalChain([context, 'access', _138 => _138.projectsConfigurations, 'access', _139 => _139.projects, 'optionalAccess', _140 => _140[context.projectName], 'optionalAccess', _141 => _141.sourceRoot]),
|
|
3059
3080
|
format: options.format,
|
|
3060
|
-
platform: options.
|
|
3081
|
+
platform: options.platform
|
|
3061
3082
|
});
|
|
3062
3083
|
return {
|
|
3063
3084
|
success: true
|
|
@@ -3238,6 +3259,342 @@ var executor_default7 = withRunExecutor(
|
|
|
3238
3259
|
}
|
|
3239
3260
|
);
|
|
3240
3261
|
|
|
3262
|
+
// ../workspace-tools/src/executors/tsdown/executor.ts
|
|
3263
|
+
_chunkPZ7N3OYJjs.init_cjs_shims.call(void 0, );
|
|
3264
|
+
|
|
3265
|
+
// ../tsdown/src/build.ts
|
|
3266
|
+
_chunkPZ7N3OYJjs.init_cjs_shims.call(void 0, );
|
|
3267
|
+
|
|
3268
|
+
|
|
3269
|
+
|
|
3270
|
+
|
|
3271
|
+
|
|
3272
|
+
|
|
3273
|
+
|
|
3274
|
+
|
|
3275
|
+
var _tsdown = require('tsdown');
|
|
3276
|
+
|
|
3277
|
+
// ../tsdown/src/clean.ts
|
|
3278
|
+
_chunkPZ7N3OYJjs.init_cjs_shims.call(void 0, );
|
|
3279
|
+
|
|
3280
|
+
async function cleanDirectories2(name = "TSDown", directory, config5) {
|
|
3281
|
+
await _promises.rm.call(void 0, directory, { recursive: true, force: true });
|
|
3282
|
+
}
|
|
3283
|
+
|
|
3284
|
+
// ../tsdown/src/config.ts
|
|
3285
|
+
_chunkPZ7N3OYJjs.init_cjs_shims.call(void 0, );
|
|
3286
|
+
function getDefaultOptions(config5) {
|
|
3287
|
+
return {
|
|
3288
|
+
entry: ["./src/*.ts"],
|
|
3289
|
+
platform: "node",
|
|
3290
|
+
target: "esnext",
|
|
3291
|
+
mode: "production",
|
|
3292
|
+
dts: true,
|
|
3293
|
+
unused: {
|
|
3294
|
+
level: "error",
|
|
3295
|
+
ignore: ["typescript"]
|
|
3296
|
+
},
|
|
3297
|
+
publint: true,
|
|
3298
|
+
fixedExtension: true,
|
|
3299
|
+
...config5
|
|
3300
|
+
};
|
|
3301
|
+
}
|
|
3302
|
+
function toTSDownFormat(format4) {
|
|
3303
|
+
if (!format4 || Array.isArray(format4) && format4.length === 0) {
|
|
3304
|
+
return ["cjs", "es"];
|
|
3305
|
+
} else if (format4 === "esm") {
|
|
3306
|
+
return "es";
|
|
3307
|
+
} else if (Array.isArray(format4)) {
|
|
3308
|
+
return format4.map((f) => f === "esm" ? "es" : f);
|
|
3309
|
+
}
|
|
3310
|
+
return format4;
|
|
3311
|
+
}
|
|
3312
|
+
|
|
3313
|
+
// ../tsdown/src/build.ts
|
|
3314
|
+
var resolveOptions = async (userOptions) => {
|
|
3315
|
+
const options = getDefaultOptions(userOptions);
|
|
3316
|
+
const workspaceRoot3 = findWorkspaceRoot(options.projectRoot);
|
|
3317
|
+
if (!workspaceRoot3) {
|
|
3318
|
+
throw new Error("Cannot find Nx workspace root");
|
|
3319
|
+
}
|
|
3320
|
+
const workspaceConfig = await getWorkspaceConfig(options.debug === true, {
|
|
3321
|
+
workspaceRoot: workspaceRoot3
|
|
3322
|
+
});
|
|
3323
|
+
writeDebug(" \u2699\uFE0F Resolving build options", workspaceConfig);
|
|
3324
|
+
const stopwatch = getStopwatch("Build options resolution");
|
|
3325
|
+
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
3326
|
+
exitOnError: true
|
|
3327
|
+
});
|
|
3328
|
+
const projectJsonPath = _chunkGZV7AWC7js.joinPaths.call(void 0,
|
|
3329
|
+
workspaceRoot3,
|
|
3330
|
+
options.projectRoot,
|
|
3331
|
+
"project.json"
|
|
3332
|
+
);
|
|
3333
|
+
if (!_fs.existsSync.call(void 0, projectJsonPath)) {
|
|
3334
|
+
throw new Error("Cannot find project.json configuration");
|
|
3335
|
+
}
|
|
3336
|
+
const projectJsonFile = await _promises2.default.readFile(projectJsonPath, "utf8");
|
|
3337
|
+
const projectJson = JSON.parse(projectJsonFile);
|
|
3338
|
+
const projectName = projectJson.name;
|
|
3339
|
+
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
3340
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _153 => _153.projects, 'optionalAccess', _154 => _154[projectName]])) {
|
|
3341
|
+
throw new Error(
|
|
3342
|
+
"The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project."
|
|
3343
|
+
);
|
|
3344
|
+
}
|
|
3345
|
+
const packageJsonPath = _chunkGZV7AWC7js.joinPaths.call(void 0,
|
|
3346
|
+
workspaceRoot3,
|
|
3347
|
+
options.projectRoot,
|
|
3348
|
+
"package.json"
|
|
3349
|
+
);
|
|
3350
|
+
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
3351
|
+
throw new Error("Cannot find package.json configuration");
|
|
3352
|
+
}
|
|
3353
|
+
const debug = _nullishCoalesce(options.debug, () => ( (options.mode || workspaceConfig.mode) === "development"));
|
|
3354
|
+
const sourceRoot = projectJson.sourceRoot || _chunkGZV7AWC7js.joinPaths.call(void 0, options.projectRoot, "src");
|
|
3355
|
+
const result = {
|
|
3356
|
+
name: projectName,
|
|
3357
|
+
mode: "production",
|
|
3358
|
+
target: DEFAULT_TARGET,
|
|
3359
|
+
generatePackageJson: true,
|
|
3360
|
+
outDir: _chunkGZV7AWC7js.joinPaths.call(void 0, "dist", options.projectRoot),
|
|
3361
|
+
minify: !debug,
|
|
3362
|
+
plugins: [],
|
|
3363
|
+
assets: [],
|
|
3364
|
+
dts: true,
|
|
3365
|
+
shims: true,
|
|
3366
|
+
silent: !debug,
|
|
3367
|
+
logLevel: workspaceConfig.logLevel === "success" || workspaceConfig.logLevel === "debug" || workspaceConfig.logLevel === "trace" || workspaceConfig.logLevel === "all" ? "info" : workspaceConfig.logLevel === "fatal" ? "error" : workspaceConfig.logLevel,
|
|
3368
|
+
sourcemap: debug ? "inline" : false,
|
|
3369
|
+
clean: false,
|
|
3370
|
+
fixedExtension: true,
|
|
3371
|
+
nodeProtocol: true,
|
|
3372
|
+
tsconfig: _chunkGZV7AWC7js.joinPaths.call(void 0, options.projectRoot, "tsconfig.json"),
|
|
3373
|
+
debug,
|
|
3374
|
+
sourceRoot,
|
|
3375
|
+
cwd: workspaceConfig.workspaceRoot,
|
|
3376
|
+
entry: {
|
|
3377
|
+
["index"]: _chunkGZV7AWC7js.joinPaths.call(void 0, sourceRoot, "index.ts")
|
|
3378
|
+
},
|
|
3379
|
+
workspace: true,
|
|
3380
|
+
...options,
|
|
3381
|
+
treeshake: options.treeShaking !== false,
|
|
3382
|
+
format: toTSDownFormat(options.format),
|
|
3383
|
+
workspaceConfig,
|
|
3384
|
+
projectName,
|
|
3385
|
+
projectGraph,
|
|
3386
|
+
projectConfigurations
|
|
3387
|
+
};
|
|
3388
|
+
result.env = _defu2.default.call(void 0,
|
|
3389
|
+
options.env,
|
|
3390
|
+
getEnv("tsdown", result)
|
|
3391
|
+
);
|
|
3392
|
+
stopwatch();
|
|
3393
|
+
return result;
|
|
3394
|
+
};
|
|
3395
|
+
async function generatePackageJson2(options) {
|
|
3396
|
+
if (options.generatePackageJson !== false && _fs.existsSync.call(void 0, _chunkGZV7AWC7js.joinPaths.call(void 0, options.projectRoot, "package.json"))) {
|
|
3397
|
+
writeDebug(" \u270D\uFE0F Writing package.json file", options.workspaceConfig);
|
|
3398
|
+
const stopwatch = getStopwatch("Write package.json file");
|
|
3399
|
+
const packageJsonPath = _chunkGZV7AWC7js.joinPaths.call(void 0, options.projectRoot, "project.json");
|
|
3400
|
+
if (!_fs.existsSync.call(void 0, packageJsonPath)) {
|
|
3401
|
+
throw new Error("Cannot find package.json configuration");
|
|
3402
|
+
}
|
|
3403
|
+
const packageJsonFile = await _promises2.default.readFile(
|
|
3404
|
+
_chunkGZV7AWC7js.joinPaths.call(void 0,
|
|
3405
|
+
options.workspaceConfig.workspaceRoot,
|
|
3406
|
+
options.projectRoot,
|
|
3407
|
+
"package.json"
|
|
3408
|
+
),
|
|
3409
|
+
"utf8"
|
|
3410
|
+
);
|
|
3411
|
+
if (!packageJsonFile) {
|
|
3412
|
+
throw new Error("Cannot find package.json configuration file");
|
|
3413
|
+
}
|
|
3414
|
+
let packageJson = JSON.parse(packageJsonFile);
|
|
3415
|
+
packageJson = await addPackageDependencies(
|
|
3416
|
+
options.workspaceConfig.workspaceRoot,
|
|
3417
|
+
options.projectRoot,
|
|
3418
|
+
options.projectName,
|
|
3419
|
+
packageJson
|
|
3420
|
+
);
|
|
3421
|
+
packageJson = await addWorkspacePackageJsonFields(
|
|
3422
|
+
options.workspaceConfig,
|
|
3423
|
+
options.projectRoot,
|
|
3424
|
+
options.sourceRoot,
|
|
3425
|
+
options.projectName,
|
|
3426
|
+
false,
|
|
3427
|
+
packageJson
|
|
3428
|
+
);
|
|
3429
|
+
packageJson.exports ??= {};
|
|
3430
|
+
packageJson.exports["./package.json"] ??= "./package.json";
|
|
3431
|
+
packageJson.exports["."] ??= addPackageJsonExport(
|
|
3432
|
+
"index",
|
|
3433
|
+
packageJson.type,
|
|
3434
|
+
options.sourceRoot
|
|
3435
|
+
);
|
|
3436
|
+
let entry = [{ in: "./src/index.ts", out: "./src/index.ts" }];
|
|
3437
|
+
if (options.entry) {
|
|
3438
|
+
if (Array.isArray(options.entry)) {
|
|
3439
|
+
entry = options.entry.map(
|
|
3440
|
+
(entryPoint) => typeof entryPoint === "string" ? { in: entryPoint, out: entryPoint } : entryPoint
|
|
3441
|
+
);
|
|
3442
|
+
}
|
|
3443
|
+
for (const entryPoint of entry) {
|
|
3444
|
+
const split = entryPoint.out.split(".");
|
|
3445
|
+
split.pop();
|
|
3446
|
+
const entry2 = split.join(".").replaceAll("\\", "/");
|
|
3447
|
+
packageJson.exports[`./${entry2}`] ??= addPackageJsonExport(
|
|
3448
|
+
entry2,
|
|
3449
|
+
options.fixedExtension ? "fixed" : packageJson.type,
|
|
3450
|
+
options.sourceRoot
|
|
3451
|
+
);
|
|
3452
|
+
}
|
|
3453
|
+
}
|
|
3454
|
+
packageJson.main = !options.fixedExtension && packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
|
|
3455
|
+
packageJson.module = !options.fixedExtension && packageJson.type === "module" ? "./dist/index.js" : "./dist/index.mjs";
|
|
3456
|
+
packageJson.types = `./dist/index.d.${!options.fixedExtension ? "ts" : "mts"}`;
|
|
3457
|
+
packageJson.exports = Object.keys(packageJson.exports).reduce(
|
|
3458
|
+
(ret, key) => {
|
|
3459
|
+
if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
|
|
3460
|
+
ret[key.replace("/index", "")] = packageJson.exports[key];
|
|
3461
|
+
}
|
|
3462
|
+
return ret;
|
|
3463
|
+
},
|
|
3464
|
+
packageJson.exports
|
|
3465
|
+
);
|
|
3466
|
+
await _devkit.writeJsonFile.call(void 0, _chunkGZV7AWC7js.joinPaths.call(void 0, options.outDir, "package.json"), packageJson);
|
|
3467
|
+
stopwatch();
|
|
3468
|
+
}
|
|
3469
|
+
return options;
|
|
3470
|
+
}
|
|
3471
|
+
async function executeTSDown(options) {
|
|
3472
|
+
writeDebug(` \u{1F680} Running ${options.name} build`, options.workspaceConfig);
|
|
3473
|
+
const stopwatch = getStopwatch(`${options.name} build`);
|
|
3474
|
+
await _tsdown.build.call(void 0, {
|
|
3475
|
+
...options,
|
|
3476
|
+
entry: options.entry,
|
|
3477
|
+
config: false
|
|
3478
|
+
});
|
|
3479
|
+
stopwatch();
|
|
3480
|
+
return options;
|
|
3481
|
+
}
|
|
3482
|
+
async function copyBuildAssets2(options) {
|
|
3483
|
+
writeDebug(
|
|
3484
|
+
` \u{1F4CB} Copying asset files to output directory: ${options.outDir}`,
|
|
3485
|
+
options.workspaceConfig
|
|
3486
|
+
);
|
|
3487
|
+
const stopwatch = getStopwatch(`${options.name} asset copy`);
|
|
3488
|
+
await copyAssets(
|
|
3489
|
+
options.workspaceConfig,
|
|
3490
|
+
_nullishCoalesce(options.assets, () => ( [])),
|
|
3491
|
+
options.outDir,
|
|
3492
|
+
options.projectRoot,
|
|
3493
|
+
options.sourceRoot,
|
|
3494
|
+
true,
|
|
3495
|
+
false
|
|
3496
|
+
);
|
|
3497
|
+
stopwatch();
|
|
3498
|
+
return options;
|
|
3499
|
+
}
|
|
3500
|
+
async function reportResults2(options) {
|
|
3501
|
+
writeSuccess(
|
|
3502
|
+
` \u{1F4E6} The ${options.name} build completed successfully`,
|
|
3503
|
+
options.workspaceConfig
|
|
3504
|
+
);
|
|
3505
|
+
}
|
|
3506
|
+
async function cleanOutputPath2(options) {
|
|
3507
|
+
if (options.clean !== false && options.workspaceConfig) {
|
|
3508
|
+
writeDebug(
|
|
3509
|
+
` \u{1F9F9} Cleaning ${options.name} output path: ${options.workspaceConfig}`,
|
|
3510
|
+
options.workspaceConfig
|
|
3511
|
+
);
|
|
3512
|
+
const stopwatch = getStopwatch(`${options.name} output clean`);
|
|
3513
|
+
await cleanDirectories2(
|
|
3514
|
+
options.name,
|
|
3515
|
+
options.outDir,
|
|
3516
|
+
options.workspaceConfig
|
|
3517
|
+
);
|
|
3518
|
+
stopwatch();
|
|
3519
|
+
}
|
|
3520
|
+
return options;
|
|
3521
|
+
}
|
|
3522
|
+
async function build2(options) {
|
|
3523
|
+
writeDebug(` \u26A1 Executing Storm TSDown pipeline`);
|
|
3524
|
+
const stopwatch = getStopwatch("TSDown pipeline");
|
|
3525
|
+
try {
|
|
3526
|
+
const opts = Array.isArray(options) ? options : [options];
|
|
3527
|
+
if (opts.length === 0) {
|
|
3528
|
+
throw new Error("No build options were provided");
|
|
3529
|
+
}
|
|
3530
|
+
const resolved = await Promise.all(
|
|
3531
|
+
opts.map(async (opt) => await resolveOptions(opt))
|
|
3532
|
+
);
|
|
3533
|
+
if (resolved.length > 0) {
|
|
3534
|
+
await cleanOutputPath2(resolved[0]);
|
|
3535
|
+
await generatePackageJson2(resolved[0]);
|
|
3536
|
+
await Promise.all(
|
|
3537
|
+
resolved.map(async (opt) => {
|
|
3538
|
+
await executeTSDown(opt);
|
|
3539
|
+
await copyBuildAssets2(opt);
|
|
3540
|
+
await reportResults2(opt);
|
|
3541
|
+
})
|
|
3542
|
+
);
|
|
3543
|
+
} else {
|
|
3544
|
+
writeWarning(
|
|
3545
|
+
" \u{1F6A7} No options were passed to TSBuild. Please check the parameters passed to the `build` function."
|
|
3546
|
+
);
|
|
3547
|
+
}
|
|
3548
|
+
writeSuccess(" \u{1F3C1} TSDown pipeline build completed successfully");
|
|
3549
|
+
} catch (error) {
|
|
3550
|
+
writeFatal(
|
|
3551
|
+
"Fatal errors that the build process could not recover from have occured. The build process has been terminated."
|
|
3552
|
+
);
|
|
3553
|
+
throw error;
|
|
3554
|
+
} finally {
|
|
3555
|
+
stopwatch();
|
|
3556
|
+
}
|
|
3557
|
+
}
|
|
3558
|
+
|
|
3559
|
+
// ../workspace-tools/src/executors/tsdown/executor.ts
|
|
3560
|
+
async function tsdownExecutorFn(options, context, config5) {
|
|
3561
|
+
writeInfo("\u{1F4E6} Running Storm TSDown executor on the workspace", config5);
|
|
3562
|
+
if (!_optionalChain([context, 'access', _155 => _155.projectsConfigurations, 'optionalAccess', _156 => _156.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName] || !_optionalChain([context, 'access', _157 => _157.projectsConfigurations, 'access', _158 => _158.projects, 'access', _159 => _159[context.projectName], 'optionalAccess', _160 => _160.root])) {
|
|
3563
|
+
throw new Error(
|
|
3564
|
+
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
3565
|
+
);
|
|
3566
|
+
}
|
|
3567
|
+
await build2({
|
|
3568
|
+
...options,
|
|
3569
|
+
projectRoot: (
|
|
3570
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3571
|
+
_optionalChain([context, 'access', _161 => _161.projectsConfigurations, 'access', _162 => _162.projects, 'optionalAccess', _163 => _163[context.projectName], 'access', _164 => _164.root])
|
|
3572
|
+
),
|
|
3573
|
+
name: context.projectName,
|
|
3574
|
+
sourceRoot: _optionalChain([context, 'access', _165 => _165.projectsConfigurations, 'access', _166 => _166.projects, 'optionalAccess', _167 => _167[context.projectName], 'optionalAccess', _168 => _168.sourceRoot]),
|
|
3575
|
+
format: options.format,
|
|
3576
|
+
platform: options.platform
|
|
3577
|
+
});
|
|
3578
|
+
return {
|
|
3579
|
+
success: true
|
|
3580
|
+
};
|
|
3581
|
+
}
|
|
3582
|
+
var executor_default8 = withRunExecutor(
|
|
3583
|
+
"Storm TSDown build",
|
|
3584
|
+
tsdownExecutorFn,
|
|
3585
|
+
{
|
|
3586
|
+
skipReadingConfig: false,
|
|
3587
|
+
hooks: {
|
|
3588
|
+
applyDefaultOptions: async (options) => {
|
|
3589
|
+
options.entry ??= ["src/index.ts"];
|
|
3590
|
+
options.outputPath ??= "dist/{projectRoot}";
|
|
3591
|
+
options.tsconfig ??= "{projectRoot}/tsconfig.json";
|
|
3592
|
+
return options;
|
|
3593
|
+
}
|
|
3594
|
+
}
|
|
3595
|
+
}
|
|
3596
|
+
);
|
|
3597
|
+
|
|
3241
3598
|
// ../workspace-tools/src/executors/typia/executor.ts
|
|
3242
3599
|
_chunkPZ7N3OYJjs.init_cjs_shims.call(void 0, );
|
|
3243
3600
|
var _fsextra = require('fs-extra');
|
|
@@ -3261,7 +3618,7 @@ async function typiaExecutorFn(options, _, config5) {
|
|
|
3261
3618
|
success: true
|
|
3262
3619
|
};
|
|
3263
3620
|
}
|
|
3264
|
-
var
|
|
3621
|
+
var executor_default9 = withRunExecutor(
|
|
3265
3622
|
"Typia runtime validation generator",
|
|
3266
3623
|
typiaExecutorFn,
|
|
3267
3624
|
{
|
|
@@ -3284,7 +3641,7 @@ _chunkPZ7N3OYJjs.init_cjs_shims.call(void 0, );
|
|
|
3284
3641
|
var _jiti = require('jiti');
|
|
3285
3642
|
async function unbuildExecutorFn(options, context, config5) {
|
|
3286
3643
|
writeInfo("\u{1F4E6} Running Storm Unbuild executor on the workspace", config5);
|
|
3287
|
-
if (!_optionalChain([context, 'access',
|
|
3644
|
+
if (!_optionalChain([context, 'access', _169 => _169.projectsConfigurations, 'optionalAccess', _170 => _170.projects]) || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
3288
3645
|
throw new Error(
|
|
3289
3646
|
"The Build process failed because the context is not valid. Please run this command from a workspace root directory."
|
|
3290
3647
|
);
|
|
@@ -3351,7 +3708,7 @@ async function unbuildExecutorFn(options, context, config5) {
|
|
|
3351
3708
|
success: true
|
|
3352
3709
|
};
|
|
3353
3710
|
}
|
|
3354
|
-
var
|
|
3711
|
+
var executor_default10 = withRunExecutor(
|
|
3355
3712
|
"TypeScript Unbuild build",
|
|
3356
3713
|
unbuildExecutorFn,
|
|
3357
3714
|
{
|
|
@@ -3403,7 +3760,7 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
3403
3760
|
);
|
|
3404
3761
|
config5 = await getConfig(workspaceRoot3);
|
|
3405
3762
|
}
|
|
3406
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
3763
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _171 => _171.hooks, 'optionalAccess', _172 => _172.applyDefaultOptions])) {
|
|
3407
3764
|
writeDebug("Running the applyDefaultOptions hook...", config5);
|
|
3408
3765
|
options = await Promise.resolve(
|
|
3409
3766
|
generatorOptions.hooks.applyDefaultOptions(options, config5)
|
|
@@ -3420,7 +3777,7 @@ ${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${
|
|
|
3420
3777
|
{ workspaceRoot: tree.root, config: config5 },
|
|
3421
3778
|
applyWorkspaceBaseTokens
|
|
3422
3779
|
);
|
|
3423
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
3780
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _173 => _173.hooks, 'optionalAccess', _174 => _174.preProcess])) {
|
|
3424
3781
|
writeDebug("Running the preProcess hook...", config5);
|
|
3425
3782
|
await Promise.resolve(
|
|
3426
3783
|
generatorOptions.hooks.preProcess(tokenized, config5)
|
|
@@ -3431,15 +3788,15 @@ ${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${
|
|
|
3431
3788
|
generatorFn(tree, tokenized, config5)
|
|
3432
3789
|
);
|
|
3433
3790
|
if (result) {
|
|
3434
|
-
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess',
|
|
3791
|
+
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _175 => _175.error, 'optionalAccess', _176 => _176.message]) && typeof _optionalChain([result, 'optionalAccess', _177 => _177.error, 'optionalAccess', _178 => _178.message]) === "string" && _optionalChain([result, 'optionalAccess', _179 => _179.error, 'optionalAccess', _180 => _180.name]) && typeof _optionalChain([result, 'optionalAccess', _181 => _181.error, 'optionalAccess', _182 => _182.name]) === "string") {
|
|
3435
3792
|
throw new Error(`The ${name} generator failed to run`, {
|
|
3436
|
-
cause: _optionalChain([result, 'optionalAccess',
|
|
3793
|
+
cause: _optionalChain([result, 'optionalAccess', _183 => _183.error])
|
|
3437
3794
|
});
|
|
3438
3795
|
} else if (result.success && result.data) {
|
|
3439
3796
|
return result;
|
|
3440
3797
|
}
|
|
3441
3798
|
}
|
|
3442
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
3799
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _184 => _184.hooks, 'optionalAccess', _185 => _185.postProcess])) {
|
|
3443
3800
|
writeDebug("Running the postProcess hook...", config5);
|
|
3444
3801
|
await Promise.resolve(generatorOptions.hooks.postProcess(config5));
|
|
3445
3802
|
writeDebug("Completed the postProcess hook", config5);
|
|
@@ -3573,15 +3930,15 @@ async function typeScriptLibraryGeneratorFn(tree, options, config5) {
|
|
|
3573
3930
|
_devkit.addProjectConfiguration.call(void 0, tree, normalized.name, projectConfig);
|
|
3574
3931
|
let repository = {
|
|
3575
3932
|
type: "github",
|
|
3576
|
-
url: _optionalChain([config5, 'optionalAccess',
|
|
3933
|
+
url: _optionalChain([config5, 'optionalAccess', _186 => _186.repository]) || `https://github.com/${(typeof _optionalChain([config5, 'optionalAccess', _187 => _187.organization]) === "string" ? _optionalChain([config5, 'optionalAccess', _188 => _188.organization]) : _optionalChain([config5, 'optionalAccess', _189 => _189.organization, 'optionalAccess', _190 => _190.name])) || "storm-software"}/${_optionalChain([config5, 'optionalAccess', _191 => _191.namespace]) || _optionalChain([config5, 'optionalAccess', _192 => _192.name]) || "repository"}.git`
|
|
3577
3934
|
};
|
|
3578
3935
|
let description = options.description || "A package developed by Storm Software used to create modern, scalable web applications.";
|
|
3579
3936
|
if (tree.exists("package.json")) {
|
|
3580
3937
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
3581
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
3938
|
+
if (_optionalChain([packageJson, 'optionalAccess', _193 => _193.repository])) {
|
|
3582
3939
|
repository = packageJson.repository;
|
|
3583
3940
|
}
|
|
3584
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
3941
|
+
if (_optionalChain([packageJson, 'optionalAccess', _194 => _194.description])) {
|
|
3585
3942
|
description = packageJson.description;
|
|
3586
3943
|
}
|
|
3587
3944
|
}
|
|
@@ -3636,9 +3993,9 @@ async function typeScriptLibraryGeneratorFn(tree, options, config5) {
|
|
|
3636
3993
|
_devkit.updateJson.call(void 0, tree, "package.json", (json) => ({
|
|
3637
3994
|
...json,
|
|
3638
3995
|
pnpm: {
|
|
3639
|
-
..._optionalChain([json, 'optionalAccess',
|
|
3996
|
+
..._optionalChain([json, 'optionalAccess', _195 => _195.pnpm]),
|
|
3640
3997
|
overrides: {
|
|
3641
|
-
..._optionalChain([json, 'optionalAccess',
|
|
3998
|
+
..._optionalChain([json, 'optionalAccess', _196 => _196.pnpm, 'optionalAccess', _197 => _197.overrides]),
|
|
3642
3999
|
[_nullishCoalesce(normalized.importPath, () => ( ""))]: "workspace:*"
|
|
3643
4000
|
}
|
|
3644
4001
|
}
|
|
@@ -3656,10 +4013,10 @@ async function typeScriptLibraryGeneratorFn(tree, options, config5) {
|
|
|
3656
4013
|
]);
|
|
3657
4014
|
if (tree.exists("package.json")) {
|
|
3658
4015
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
3659
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
4016
|
+
if (_optionalChain([packageJson, 'optionalAccess', _198 => _198.repository])) {
|
|
3660
4017
|
repository = packageJson.repository;
|
|
3661
4018
|
}
|
|
3662
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
4019
|
+
if (_optionalChain([packageJson, 'optionalAccess', _199 => _199.description])) {
|
|
3663
4020
|
description = packageJson.description;
|
|
3664
4021
|
}
|
|
3665
4022
|
}
|
|
@@ -3696,22 +4053,22 @@ function getOutputPath(options) {
|
|
|
3696
4053
|
function createProjectTsConfigJson(tree, options) {
|
|
3697
4054
|
const tsconfig = {
|
|
3698
4055
|
extends: options.rootProject ? void 0 : _js.getRelativePathToRootTsConfig.call(void 0, tree, options.projectRoot),
|
|
3699
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4056
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _200 => _200.tsconfigOptions]), () => ( {})),
|
|
3700
4057
|
compilerOptions: {
|
|
3701
4058
|
...options.rootProject ? _js.tsConfigBaseOptions : {},
|
|
3702
4059
|
outDir: _chunkGZV7AWC7js.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
|
|
3703
4060
|
noEmit: true,
|
|
3704
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4061
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _201 => _201.tsconfigOptions, 'optionalAccess', _202 => _202.compilerOptions]), () => ( {}))
|
|
3705
4062
|
},
|
|
3706
|
-
files: [..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4063
|
+
files: [..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _203 => _203.tsconfigOptions, 'optionalAccess', _204 => _204.files]), () => ( []))],
|
|
3707
4064
|
include: [
|
|
3708
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4065
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _205 => _205.tsconfigOptions, 'optionalAccess', _206 => _206.include]), () => ( [])),
|
|
3709
4066
|
"src/**/*.ts",
|
|
3710
4067
|
"src/**/*.js",
|
|
3711
4068
|
"bin/**/*"
|
|
3712
4069
|
],
|
|
3713
4070
|
exclude: [
|
|
3714
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
4071
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _207 => _207.tsconfigOptions, 'optionalAccess', _208 => _208.exclude]), () => ( [])),
|
|
3715
4072
|
"jest.config.ts",
|
|
3716
4073
|
"src/**/*.spec.ts",
|
|
3717
4074
|
"src/**/*.test.ts"
|
|
@@ -3721,8 +4078,8 @@ function createProjectTsConfigJson(tree, options) {
|
|
|
3721
4078
|
}
|
|
3722
4079
|
async function normalizeOptions(tree, options, config5) {
|
|
3723
4080
|
let importPath = options.importPath;
|
|
3724
|
-
if (!importPath && _optionalChain([config5, 'optionalAccess',
|
|
3725
|
-
importPath = `@${_optionalChain([config5, 'optionalAccess',
|
|
4081
|
+
if (!importPath && _optionalChain([config5, 'optionalAccess', _209 => _209.namespace])) {
|
|
4082
|
+
importPath = `@${_optionalChain([config5, 'optionalAccess', _210 => _210.namespace])}/${options.name}`;
|
|
3726
4083
|
}
|
|
3727
4084
|
if (options.publishable) {
|
|
3728
4085
|
if (!importPath) {
|
|
@@ -3888,7 +4245,7 @@ async function configSchemaGeneratorFn(tree, options, config5) {
|
|
|
3888
4245
|
);
|
|
3889
4246
|
}
|
|
3890
4247
|
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(
|
|
3891
|
-
_nullishCoalesce(_optionalChain([config5, 'optionalAccess',
|
|
4248
|
+
_nullishCoalesce(_optionalChain([config5, 'optionalAccess', _211 => _211.workspaceRoot]), () => ( findWorkspaceRoot())),
|
|
3892
4249
|
options.outputFile.startsWith("./") ? "" : "./"
|
|
3893
4250
|
);
|
|
3894
4251
|
writeTrace(
|
|
@@ -4481,8 +4838,8 @@ var CHANGELOG_COMMIT_TYPES_OBJECT = Object.freeze(
|
|
|
4481
4838
|
ret[key] = {
|
|
4482
4839
|
...commitType.changelog,
|
|
4483
4840
|
type: key,
|
|
4484
|
-
section: _optionalChain([commitType, 'access',
|
|
4485
|
-
hidden: _optionalChain([commitType, 'access',
|
|
4841
|
+
section: _optionalChain([commitType, 'access', _212 => _212.changelog, 'optionalAccess', _213 => _213.title]) || commitType.title,
|
|
4842
|
+
hidden: _optionalChain([commitType, 'access', _214 => _214.changelog, 'optionalAccess', _215 => _215.hidden])
|
|
4486
4843
|
};
|
|
4487
4844
|
return ret;
|
|
4488
4845
|
},
|
|
@@ -2359,6 +2359,7 @@ var DEFAULT_COMPILED_BANNER = `/*****************************************
|
|
|
2359
2359
|
*****************************************/
|
|
2360
2360
|
`;
|
|
2361
2361
|
var DEFAULT_ENVIRONMENT = "production";
|
|
2362
|
+
var DEFAULT_TARGET = "esnext";
|
|
2362
2363
|
var DEFAULT_ORGANIZATION = "storm-software";
|
|
2363
2364
|
|
|
2364
2365
|
// ../build-tools/src/plugins/index.ts
|
|
@@ -2394,7 +2395,7 @@ init_esm_shims();
|
|
|
2394
2395
|
import { CopyAssetsHandler } from "@nx/js/src/utils/assets/copy-assets-handler";
|
|
2395
2396
|
import { glob } from "glob";
|
|
2396
2397
|
import { readFile as readFile2, writeFile } from "node:fs/promises";
|
|
2397
|
-
var copyAssets = async (config5, assets, outputPath, projectRoot, sourceRoot,
|
|
2398
|
+
var copyAssets = async (config5, assets, outputPath, projectRoot, sourceRoot, generatePackageJson3 = true, includeSrc = false, banner, footer) => {
|
|
2398
2399
|
const pendingAssets = Array.from(assets ?? []);
|
|
2399
2400
|
pendingAssets.push({
|
|
2400
2401
|
input: projectRoot,
|
|
@@ -2406,7 +2407,7 @@ var copyAssets = async (config5, assets, outputPath, projectRoot, sourceRoot, ge
|
|
|
2406
2407
|
glob: "LICENSE",
|
|
2407
2408
|
output: "."
|
|
2408
2409
|
});
|
|
2409
|
-
if (
|
|
2410
|
+
if (generatePackageJson3 === false) {
|
|
2410
2411
|
pendingAssets.push({
|
|
2411
2412
|
input: projectRoot,
|
|
2412
2413
|
glob: "package.json",
|
|
@@ -2613,6 +2614,26 @@ var addWorkspacePackageJsonFields = async (workspaceConfig, projectRoot, sourceR
|
|
|
2613
2614
|
packageJson.repository.directory ??= projectRoot ? projectRoot : joinPaths("packages", projectName);
|
|
2614
2615
|
return packageJson;
|
|
2615
2616
|
};
|
|
2617
|
+
var addPackageJsonExport = (file, type = "module", sourceRoot) => {
|
|
2618
|
+
let entry = file.replaceAll("\\", "/");
|
|
2619
|
+
if (sourceRoot) {
|
|
2620
|
+
entry = entry.replace(sourceRoot, "");
|
|
2621
|
+
}
|
|
2622
|
+
return {
|
|
2623
|
+
import: {
|
|
2624
|
+
types: `./dist/${entry}.d.${type === "module" ? "ts" : "mts"}`,
|
|
2625
|
+
default: `./dist/${entry}.${type === "module" ? "js" : "mjs"}`
|
|
2626
|
+
},
|
|
2627
|
+
require: {
|
|
2628
|
+
types: `./dist/${entry}.d.${type === "commonjs" ? "ts" : "cts"}`,
|
|
2629
|
+
default: `./dist/${entry}.${type === "commonjs" ? "js" : "cjs"}`
|
|
2630
|
+
},
|
|
2631
|
+
default: {
|
|
2632
|
+
types: `./dist/${entry}.d.${type !== "fixed" ? "ts" : "mts"}`,
|
|
2633
|
+
default: `./dist/${entry}.${type !== "fixed" ? "js" : "mjs"}`
|
|
2634
|
+
}
|
|
2635
|
+
};
|
|
2636
|
+
};
|
|
2616
2637
|
|
|
2617
2638
|
// ../build-tools/src/utilities/get-entry-points.ts
|
|
2618
2639
|
init_esm_shims();
|
|
@@ -3058,7 +3079,7 @@ async function esbuildExecutorFn(options, context, config5) {
|
|
|
3058
3079
|
name: context.projectName,
|
|
3059
3080
|
sourceRoot: context.projectsConfigurations.projects?.[context.projectName]?.sourceRoot,
|
|
3060
3081
|
format: options.format,
|
|
3061
|
-
platform: options.
|
|
3082
|
+
platform: options.platform
|
|
3062
3083
|
});
|
|
3063
3084
|
return {
|
|
3064
3085
|
success: true
|
|
@@ -3239,6 +3260,342 @@ var executor_default7 = withRunExecutor(
|
|
|
3239
3260
|
}
|
|
3240
3261
|
);
|
|
3241
3262
|
|
|
3263
|
+
// ../workspace-tools/src/executors/tsdown/executor.ts
|
|
3264
|
+
init_esm_shims();
|
|
3265
|
+
|
|
3266
|
+
// ../tsdown/src/build.ts
|
|
3267
|
+
init_esm_shims();
|
|
3268
|
+
import {
|
|
3269
|
+
createProjectGraphAsync as createProjectGraphAsync4,
|
|
3270
|
+
readProjectsConfigurationFromProjectGraph as readProjectsConfigurationFromProjectGraph3,
|
|
3271
|
+
writeJsonFile as writeJsonFile2
|
|
3272
|
+
} from "@nx/devkit";
|
|
3273
|
+
import defu5 from "defu";
|
|
3274
|
+
import { existsSync as existsSync11 } from "node:fs";
|
|
3275
|
+
import hf3 from "node:fs/promises";
|
|
3276
|
+
import { build as tsdown } from "tsdown";
|
|
3277
|
+
|
|
3278
|
+
// ../tsdown/src/clean.ts
|
|
3279
|
+
init_esm_shims();
|
|
3280
|
+
import { rm as rm2 } from "node:fs/promises";
|
|
3281
|
+
async function cleanDirectories2(name = "TSDown", directory, config5) {
|
|
3282
|
+
await rm2(directory, { recursive: true, force: true });
|
|
3283
|
+
}
|
|
3284
|
+
|
|
3285
|
+
// ../tsdown/src/config.ts
|
|
3286
|
+
init_esm_shims();
|
|
3287
|
+
function getDefaultOptions(config5) {
|
|
3288
|
+
return {
|
|
3289
|
+
entry: ["./src/*.ts"],
|
|
3290
|
+
platform: "node",
|
|
3291
|
+
target: "esnext",
|
|
3292
|
+
mode: "production",
|
|
3293
|
+
dts: true,
|
|
3294
|
+
unused: {
|
|
3295
|
+
level: "error",
|
|
3296
|
+
ignore: ["typescript"]
|
|
3297
|
+
},
|
|
3298
|
+
publint: true,
|
|
3299
|
+
fixedExtension: true,
|
|
3300
|
+
...config5
|
|
3301
|
+
};
|
|
3302
|
+
}
|
|
3303
|
+
function toTSDownFormat(format4) {
|
|
3304
|
+
if (!format4 || Array.isArray(format4) && format4.length === 0) {
|
|
3305
|
+
return ["cjs", "es"];
|
|
3306
|
+
} else if (format4 === "esm") {
|
|
3307
|
+
return "es";
|
|
3308
|
+
} else if (Array.isArray(format4)) {
|
|
3309
|
+
return format4.map((f) => f === "esm" ? "es" : f);
|
|
3310
|
+
}
|
|
3311
|
+
return format4;
|
|
3312
|
+
}
|
|
3313
|
+
|
|
3314
|
+
// ../tsdown/src/build.ts
|
|
3315
|
+
var resolveOptions = async (userOptions) => {
|
|
3316
|
+
const options = getDefaultOptions(userOptions);
|
|
3317
|
+
const workspaceRoot3 = findWorkspaceRoot(options.projectRoot);
|
|
3318
|
+
if (!workspaceRoot3) {
|
|
3319
|
+
throw new Error("Cannot find Nx workspace root");
|
|
3320
|
+
}
|
|
3321
|
+
const workspaceConfig = await getWorkspaceConfig(options.debug === true, {
|
|
3322
|
+
workspaceRoot: workspaceRoot3
|
|
3323
|
+
});
|
|
3324
|
+
writeDebug(" \u2699\uFE0F Resolving build options", workspaceConfig);
|
|
3325
|
+
const stopwatch = getStopwatch("Build options resolution");
|
|
3326
|
+
const projectGraph = await createProjectGraphAsync4({
|
|
3327
|
+
exitOnError: true
|
|
3328
|
+
});
|
|
3329
|
+
const projectJsonPath = joinPaths(
|
|
3330
|
+
workspaceRoot3,
|
|
3331
|
+
options.projectRoot,
|
|
3332
|
+
"project.json"
|
|
3333
|
+
);
|
|
3334
|
+
if (!existsSync11(projectJsonPath)) {
|
|
3335
|
+
throw new Error("Cannot find project.json configuration");
|
|
3336
|
+
}
|
|
3337
|
+
const projectJsonFile = await hf3.readFile(projectJsonPath, "utf8");
|
|
3338
|
+
const projectJson = JSON.parse(projectJsonFile);
|
|
3339
|
+
const projectName = projectJson.name;
|
|
3340
|
+
const projectConfigurations = readProjectsConfigurationFromProjectGraph3(projectGraph);
|
|
3341
|
+
if (!projectConfigurations?.projects?.[projectName]) {
|
|
3342
|
+
throw new Error(
|
|
3343
|
+
"The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project."
|
|
3344
|
+
);
|
|
3345
|
+
}
|
|
3346
|
+
const packageJsonPath = joinPaths(
|
|
3347
|
+
workspaceRoot3,
|
|
3348
|
+
options.projectRoot,
|
|
3349
|
+
"package.json"
|
|
3350
|
+
);
|
|
3351
|
+
if (!existsSync11(packageJsonPath)) {
|
|
3352
|
+
throw new Error("Cannot find package.json configuration");
|
|
3353
|
+
}
|
|
3354
|
+
const debug = options.debug ?? (options.mode || workspaceConfig.mode) === "development";
|
|
3355
|
+
const sourceRoot = projectJson.sourceRoot || joinPaths(options.projectRoot, "src");
|
|
3356
|
+
const result = {
|
|
3357
|
+
name: projectName,
|
|
3358
|
+
mode: "production",
|
|
3359
|
+
target: DEFAULT_TARGET,
|
|
3360
|
+
generatePackageJson: true,
|
|
3361
|
+
outDir: joinPaths("dist", options.projectRoot),
|
|
3362
|
+
minify: !debug,
|
|
3363
|
+
plugins: [],
|
|
3364
|
+
assets: [],
|
|
3365
|
+
dts: true,
|
|
3366
|
+
shims: true,
|
|
3367
|
+
silent: !debug,
|
|
3368
|
+
logLevel: workspaceConfig.logLevel === "success" || workspaceConfig.logLevel === "debug" || workspaceConfig.logLevel === "trace" || workspaceConfig.logLevel === "all" ? "info" : workspaceConfig.logLevel === "fatal" ? "error" : workspaceConfig.logLevel,
|
|
3369
|
+
sourcemap: debug ? "inline" : false,
|
|
3370
|
+
clean: false,
|
|
3371
|
+
fixedExtension: true,
|
|
3372
|
+
nodeProtocol: true,
|
|
3373
|
+
tsconfig: joinPaths(options.projectRoot, "tsconfig.json"),
|
|
3374
|
+
debug,
|
|
3375
|
+
sourceRoot,
|
|
3376
|
+
cwd: workspaceConfig.workspaceRoot,
|
|
3377
|
+
entry: {
|
|
3378
|
+
["index"]: joinPaths(sourceRoot, "index.ts")
|
|
3379
|
+
},
|
|
3380
|
+
workspace: true,
|
|
3381
|
+
...options,
|
|
3382
|
+
treeshake: options.treeShaking !== false,
|
|
3383
|
+
format: toTSDownFormat(options.format),
|
|
3384
|
+
workspaceConfig,
|
|
3385
|
+
projectName,
|
|
3386
|
+
projectGraph,
|
|
3387
|
+
projectConfigurations
|
|
3388
|
+
};
|
|
3389
|
+
result.env = defu5(
|
|
3390
|
+
options.env,
|
|
3391
|
+
getEnv("tsdown", result)
|
|
3392
|
+
);
|
|
3393
|
+
stopwatch();
|
|
3394
|
+
return result;
|
|
3395
|
+
};
|
|
3396
|
+
async function generatePackageJson2(options) {
|
|
3397
|
+
if (options.generatePackageJson !== false && existsSync11(joinPaths(options.projectRoot, "package.json"))) {
|
|
3398
|
+
writeDebug(" \u270D\uFE0F Writing package.json file", options.workspaceConfig);
|
|
3399
|
+
const stopwatch = getStopwatch("Write package.json file");
|
|
3400
|
+
const packageJsonPath = joinPaths(options.projectRoot, "project.json");
|
|
3401
|
+
if (!existsSync11(packageJsonPath)) {
|
|
3402
|
+
throw new Error("Cannot find package.json configuration");
|
|
3403
|
+
}
|
|
3404
|
+
const packageJsonFile = await hf3.readFile(
|
|
3405
|
+
joinPaths(
|
|
3406
|
+
options.workspaceConfig.workspaceRoot,
|
|
3407
|
+
options.projectRoot,
|
|
3408
|
+
"package.json"
|
|
3409
|
+
),
|
|
3410
|
+
"utf8"
|
|
3411
|
+
);
|
|
3412
|
+
if (!packageJsonFile) {
|
|
3413
|
+
throw new Error("Cannot find package.json configuration file");
|
|
3414
|
+
}
|
|
3415
|
+
let packageJson = JSON.parse(packageJsonFile);
|
|
3416
|
+
packageJson = await addPackageDependencies(
|
|
3417
|
+
options.workspaceConfig.workspaceRoot,
|
|
3418
|
+
options.projectRoot,
|
|
3419
|
+
options.projectName,
|
|
3420
|
+
packageJson
|
|
3421
|
+
);
|
|
3422
|
+
packageJson = await addWorkspacePackageJsonFields(
|
|
3423
|
+
options.workspaceConfig,
|
|
3424
|
+
options.projectRoot,
|
|
3425
|
+
options.sourceRoot,
|
|
3426
|
+
options.projectName,
|
|
3427
|
+
false,
|
|
3428
|
+
packageJson
|
|
3429
|
+
);
|
|
3430
|
+
packageJson.exports ??= {};
|
|
3431
|
+
packageJson.exports["./package.json"] ??= "./package.json";
|
|
3432
|
+
packageJson.exports["."] ??= addPackageJsonExport(
|
|
3433
|
+
"index",
|
|
3434
|
+
packageJson.type,
|
|
3435
|
+
options.sourceRoot
|
|
3436
|
+
);
|
|
3437
|
+
let entry = [{ in: "./src/index.ts", out: "./src/index.ts" }];
|
|
3438
|
+
if (options.entry) {
|
|
3439
|
+
if (Array.isArray(options.entry)) {
|
|
3440
|
+
entry = options.entry.map(
|
|
3441
|
+
(entryPoint) => typeof entryPoint === "string" ? { in: entryPoint, out: entryPoint } : entryPoint
|
|
3442
|
+
);
|
|
3443
|
+
}
|
|
3444
|
+
for (const entryPoint of entry) {
|
|
3445
|
+
const split = entryPoint.out.split(".");
|
|
3446
|
+
split.pop();
|
|
3447
|
+
const entry2 = split.join(".").replaceAll("\\", "/");
|
|
3448
|
+
packageJson.exports[`./${entry2}`] ??= addPackageJsonExport(
|
|
3449
|
+
entry2,
|
|
3450
|
+
options.fixedExtension ? "fixed" : packageJson.type,
|
|
3451
|
+
options.sourceRoot
|
|
3452
|
+
);
|
|
3453
|
+
}
|
|
3454
|
+
}
|
|
3455
|
+
packageJson.main = !options.fixedExtension && packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
|
|
3456
|
+
packageJson.module = !options.fixedExtension && packageJson.type === "module" ? "./dist/index.js" : "./dist/index.mjs";
|
|
3457
|
+
packageJson.types = `./dist/index.d.${!options.fixedExtension ? "ts" : "mts"}`;
|
|
3458
|
+
packageJson.exports = Object.keys(packageJson.exports).reduce(
|
|
3459
|
+
(ret, key) => {
|
|
3460
|
+
if (key.endsWith("/index") && !ret[key.replace("/index", "")]) {
|
|
3461
|
+
ret[key.replace("/index", "")] = packageJson.exports[key];
|
|
3462
|
+
}
|
|
3463
|
+
return ret;
|
|
3464
|
+
},
|
|
3465
|
+
packageJson.exports
|
|
3466
|
+
);
|
|
3467
|
+
await writeJsonFile2(joinPaths(options.outDir, "package.json"), packageJson);
|
|
3468
|
+
stopwatch();
|
|
3469
|
+
}
|
|
3470
|
+
return options;
|
|
3471
|
+
}
|
|
3472
|
+
async function executeTSDown(options) {
|
|
3473
|
+
writeDebug(` \u{1F680} Running ${options.name} build`, options.workspaceConfig);
|
|
3474
|
+
const stopwatch = getStopwatch(`${options.name} build`);
|
|
3475
|
+
await tsdown({
|
|
3476
|
+
...options,
|
|
3477
|
+
entry: options.entry,
|
|
3478
|
+
config: false
|
|
3479
|
+
});
|
|
3480
|
+
stopwatch();
|
|
3481
|
+
return options;
|
|
3482
|
+
}
|
|
3483
|
+
async function copyBuildAssets2(options) {
|
|
3484
|
+
writeDebug(
|
|
3485
|
+
` \u{1F4CB} Copying asset files to output directory: ${options.outDir}`,
|
|
3486
|
+
options.workspaceConfig
|
|
3487
|
+
);
|
|
3488
|
+
const stopwatch = getStopwatch(`${options.name} asset copy`);
|
|
3489
|
+
await copyAssets(
|
|
3490
|
+
options.workspaceConfig,
|
|
3491
|
+
options.assets ?? [],
|
|
3492
|
+
options.outDir,
|
|
3493
|
+
options.projectRoot,
|
|
3494
|
+
options.sourceRoot,
|
|
3495
|
+
true,
|
|
3496
|
+
false
|
|
3497
|
+
);
|
|
3498
|
+
stopwatch();
|
|
3499
|
+
return options;
|
|
3500
|
+
}
|
|
3501
|
+
async function reportResults2(options) {
|
|
3502
|
+
writeSuccess(
|
|
3503
|
+
` \u{1F4E6} The ${options.name} build completed successfully`,
|
|
3504
|
+
options.workspaceConfig
|
|
3505
|
+
);
|
|
3506
|
+
}
|
|
3507
|
+
async function cleanOutputPath2(options) {
|
|
3508
|
+
if (options.clean !== false && options.workspaceConfig) {
|
|
3509
|
+
writeDebug(
|
|
3510
|
+
` \u{1F9F9} Cleaning ${options.name} output path: ${options.workspaceConfig}`,
|
|
3511
|
+
options.workspaceConfig
|
|
3512
|
+
);
|
|
3513
|
+
const stopwatch = getStopwatch(`${options.name} output clean`);
|
|
3514
|
+
await cleanDirectories2(
|
|
3515
|
+
options.name,
|
|
3516
|
+
options.outDir,
|
|
3517
|
+
options.workspaceConfig
|
|
3518
|
+
);
|
|
3519
|
+
stopwatch();
|
|
3520
|
+
}
|
|
3521
|
+
return options;
|
|
3522
|
+
}
|
|
3523
|
+
async function build2(options) {
|
|
3524
|
+
writeDebug(` \u26A1 Executing Storm TSDown pipeline`);
|
|
3525
|
+
const stopwatch = getStopwatch("TSDown pipeline");
|
|
3526
|
+
try {
|
|
3527
|
+
const opts = Array.isArray(options) ? options : [options];
|
|
3528
|
+
if (opts.length === 0) {
|
|
3529
|
+
throw new Error("No build options were provided");
|
|
3530
|
+
}
|
|
3531
|
+
const resolved = await Promise.all(
|
|
3532
|
+
opts.map(async (opt) => await resolveOptions(opt))
|
|
3533
|
+
);
|
|
3534
|
+
if (resolved.length > 0) {
|
|
3535
|
+
await cleanOutputPath2(resolved[0]);
|
|
3536
|
+
await generatePackageJson2(resolved[0]);
|
|
3537
|
+
await Promise.all(
|
|
3538
|
+
resolved.map(async (opt) => {
|
|
3539
|
+
await executeTSDown(opt);
|
|
3540
|
+
await copyBuildAssets2(opt);
|
|
3541
|
+
await reportResults2(opt);
|
|
3542
|
+
})
|
|
3543
|
+
);
|
|
3544
|
+
} else {
|
|
3545
|
+
writeWarning(
|
|
3546
|
+
" \u{1F6A7} No options were passed to TSBuild. Please check the parameters passed to the `build` function."
|
|
3547
|
+
);
|
|
3548
|
+
}
|
|
3549
|
+
writeSuccess(" \u{1F3C1} TSDown pipeline build completed successfully");
|
|
3550
|
+
} catch (error) {
|
|
3551
|
+
writeFatal(
|
|
3552
|
+
"Fatal errors that the build process could not recover from have occured. The build process has been terminated."
|
|
3553
|
+
);
|
|
3554
|
+
throw error;
|
|
3555
|
+
} finally {
|
|
3556
|
+
stopwatch();
|
|
3557
|
+
}
|
|
3558
|
+
}
|
|
3559
|
+
|
|
3560
|
+
// ../workspace-tools/src/executors/tsdown/executor.ts
|
|
3561
|
+
async function tsdownExecutorFn(options, context, config5) {
|
|
3562
|
+
writeInfo("\u{1F4E6} Running Storm TSDown executor on the workspace", config5);
|
|
3563
|
+
if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName] || !context.projectsConfigurations.projects[context.projectName]?.root) {
|
|
3564
|
+
throw new Error(
|
|
3565
|
+
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
3566
|
+
);
|
|
3567
|
+
}
|
|
3568
|
+
await build2({
|
|
3569
|
+
...options,
|
|
3570
|
+
projectRoot: (
|
|
3571
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3572
|
+
context.projectsConfigurations.projects?.[context.projectName].root
|
|
3573
|
+
),
|
|
3574
|
+
name: context.projectName,
|
|
3575
|
+
sourceRoot: context.projectsConfigurations.projects?.[context.projectName]?.sourceRoot,
|
|
3576
|
+
format: options.format,
|
|
3577
|
+
platform: options.platform
|
|
3578
|
+
});
|
|
3579
|
+
return {
|
|
3580
|
+
success: true
|
|
3581
|
+
};
|
|
3582
|
+
}
|
|
3583
|
+
var executor_default8 = withRunExecutor(
|
|
3584
|
+
"Storm TSDown build",
|
|
3585
|
+
tsdownExecutorFn,
|
|
3586
|
+
{
|
|
3587
|
+
skipReadingConfig: false,
|
|
3588
|
+
hooks: {
|
|
3589
|
+
applyDefaultOptions: async (options) => {
|
|
3590
|
+
options.entry ??= ["src/index.ts"];
|
|
3591
|
+
options.outputPath ??= "dist/{projectRoot}";
|
|
3592
|
+
options.tsconfig ??= "{projectRoot}/tsconfig.json";
|
|
3593
|
+
return options;
|
|
3594
|
+
}
|
|
3595
|
+
}
|
|
3596
|
+
}
|
|
3597
|
+
);
|
|
3598
|
+
|
|
3242
3599
|
// ../workspace-tools/src/executors/typia/executor.ts
|
|
3243
3600
|
init_esm_shims();
|
|
3244
3601
|
import { removeSync } from "fs-extra";
|
|
@@ -3262,7 +3619,7 @@ async function typiaExecutorFn(options, _, config5) {
|
|
|
3262
3619
|
success: true
|
|
3263
3620
|
};
|
|
3264
3621
|
}
|
|
3265
|
-
var
|
|
3622
|
+
var executor_default9 = withRunExecutor(
|
|
3266
3623
|
"Typia runtime validation generator",
|
|
3267
3624
|
typiaExecutorFn,
|
|
3268
3625
|
{
|
|
@@ -3281,7 +3638,7 @@ var executor_default8 = withRunExecutor(
|
|
|
3281
3638
|
|
|
3282
3639
|
// ../workspace-tools/src/executors/unbuild/executor.ts
|
|
3283
3640
|
init_esm_shims();
|
|
3284
|
-
import { defu as
|
|
3641
|
+
import { defu as defu6 } from "defu";
|
|
3285
3642
|
import { createJiti } from "jiti";
|
|
3286
3643
|
async function unbuildExecutorFn(options, context, config5) {
|
|
3287
3644
|
writeInfo("\u{1F4E6} Running Storm Unbuild executor on the workspace", config5);
|
|
@@ -3312,7 +3669,7 @@ async function unbuildExecutorFn(options, context, config5) {
|
|
|
3312
3669
|
jiti.esmResolve("@storm-software/unbuild/build")
|
|
3313
3670
|
);
|
|
3314
3671
|
await stormUnbuild.build(
|
|
3315
|
-
|
|
3672
|
+
defu6(
|
|
3316
3673
|
{
|
|
3317
3674
|
...options,
|
|
3318
3675
|
projectRoot: context.projectsConfigurations.projects[context.projectName].root,
|
|
@@ -3352,7 +3709,7 @@ async function unbuildExecutorFn(options, context, config5) {
|
|
|
3352
3709
|
success: true
|
|
3353
3710
|
};
|
|
3354
3711
|
}
|
|
3355
|
-
var
|
|
3712
|
+
var executor_default10 = withRunExecutor(
|
|
3356
3713
|
"TypeScript Unbuild build",
|
|
3357
3714
|
unbuildExecutorFn,
|
|
3358
3715
|
{
|
|
@@ -5115,7 +5472,7 @@ import {
|
|
|
5115
5472
|
readJsonFile as readJsonFile2,
|
|
5116
5473
|
workspaceRoot as workspaceRoot2
|
|
5117
5474
|
} from "@nx/devkit";
|
|
5118
|
-
import { existsSync as
|
|
5475
|
+
import { existsSync as existsSync12 } from "node:fs";
|
|
5119
5476
|
import { join as join4 } from "node:path";
|
|
5120
5477
|
import {
|
|
5121
5478
|
getNpmLockfileDependencies,
|
|
@@ -5144,8 +5501,8 @@ init_esm_shims();
|
|
|
5144
5501
|
import {
|
|
5145
5502
|
readJsonFile as readJsonFile3
|
|
5146
5503
|
} from "@nx/devkit";
|
|
5147
|
-
import
|
|
5148
|
-
import { existsSync as
|
|
5504
|
+
import defu7 from "defu";
|
|
5505
|
+
import { existsSync as existsSync13 } from "node:fs";
|
|
5149
5506
|
import { dirname as dirname2, join as join5 } from "node:path";
|
|
5150
5507
|
|
|
5151
5508
|
// ../workspace-tools/src/utils/typia-transform.ts
|
package/dist/generators.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-JEFKKWZ2.js');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk656I6FOTjs = require('./chunk-656I6FOT.js');
|
|
5
5
|
require('./chunk-GZV7AWC7.js');
|
|
6
6
|
require('./chunk-PZ7N3OYJ.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.initGeneratorFn =
|
|
9
|
+
exports.initGeneratorFn = _chunk656I6FOTjs.initGeneratorFn;
|
package/dist/generators.mjs
CHANGED
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _chunk43C4WGNJjs = require('./chunk-43C4WGNJ.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk656I6FOTjs = require('./chunk-656I6FOT.js');
|
|
8
8
|
require('./chunk-GZV7AWC7.js');
|
|
9
9
|
|
|
10
10
|
|
|
@@ -16,10 +16,10 @@ var _chunkPZ7N3OYJjs = require('./chunk-PZ7N3OYJ.js');
|
|
|
16
16
|
// index.ts
|
|
17
17
|
var index_exports = {};
|
|
18
18
|
_chunkPZ7N3OYJjs.__export.call(void 0, index_exports, {
|
|
19
|
-
initGeneratorFn: () =>
|
|
19
|
+
initGeneratorFn: () => _chunk656I6FOTjs.initGeneratorFn
|
|
20
20
|
});
|
|
21
21
|
_chunkPZ7N3OYJjs.init_cjs_shims.call(void 0, );
|
|
22
22
|
_chunkPZ7N3OYJjs.__reExport.call(void 0, index_exports, _chunkPZ7N3OYJjs.__toESM.call(void 0, _chunk43C4WGNJjs.require_components.call(void 0, )));
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
exports.initGeneratorFn =
|
|
25
|
+
exports.initGeneratorFn = _chunk656I6FOTjs.initGeneratorFn;
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk656I6FOTjs = require('../../../chunk-656I6FOT.js');
|
|
5
5
|
require('../../../chunk-GZV7AWC7.js');
|
|
6
6
|
require('../../../chunk-PZ7N3OYJ.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.default =
|
|
10
|
+
exports.default = _chunk656I6FOTjs.generator_default; exports.initGeneratorFn = _chunk656I6FOTjs.initGeneratorFn;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/projen",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.7",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "Tools for managing Projen configuration automation within a Nx workspace.",
|
|
6
6
|
"repository": {
|
|
@@ -142,5 +142,5 @@
|
|
|
142
142
|
"publishConfig": { "access": "public" },
|
|
143
143
|
"executors": "./executors.json",
|
|
144
144
|
"generators": "./generators.json",
|
|
145
|
-
"gitHead": "
|
|
145
|
+
"gitHead": "c450e05dc6b3593507d81704a07cc2c8b64770c6"
|
|
146
146
|
}
|