@storm-software/workspace-tools 1.43.4 → 1.43.6
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 +15 -0
- package/index.js +477 -461
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +51 -20
- package/src/executors/design-tokens/executor.js +50 -19
- package/src/executors/tsup/executor.js +457 -441
- package/src/executors/tsup-browser/executor.js +457 -441
- package/src/executors/tsup-neutral/executor.js +457 -441
- package/src/executors/tsup-node/executor.js +457 -441
- package/src/generators/browser-library/generator.js +50 -19
- package/src/generators/config-schema/generator.js +55 -24
- package/src/generators/neutral-library/generator.js +50 -19
- package/src/generators/node-library/generator.js +50 -19
- package/src/generators/preset/generator.js +50 -19
|
@@ -44822,9 +44822,9 @@ var require_brace_expansion2 = __commonJS({
|
|
|
44822
44822
|
}
|
|
44823
44823
|
});
|
|
44824
44824
|
|
|
44825
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
44825
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/chunk-EPAEWGCP.js
|
|
44826
44826
|
var require_chunk_EPAEWGCP = __commonJS({
|
|
44827
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
44827
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/chunk-EPAEWGCP.js"(exports) {
|
|
44828
44828
|
"use strict";
|
|
44829
44829
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44830
44830
|
var version = "8.0.0";
|
|
@@ -46471,9 +46471,9 @@ var require_resolve_from2 = __commonJS({
|
|
|
46471
46471
|
}
|
|
46472
46472
|
});
|
|
46473
46473
|
|
|
46474
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
46474
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/chunk-GQ77QZBO.js
|
|
46475
46475
|
var require_chunk_GQ77QZBO = __commonJS({
|
|
46476
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
46476
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/chunk-GQ77QZBO.js"(exports) {
|
|
46477
46477
|
"use strict";
|
|
46478
46478
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46479
46479
|
function _interopRequireDefault(obj) {
|
|
@@ -46751,9 +46751,9 @@ var require_chunk_GQ77QZBO = __commonJS({
|
|
|
46751
46751
|
}
|
|
46752
46752
|
});
|
|
46753
46753
|
|
|
46754
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
46754
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/chunk-UIX4URMV.js
|
|
46755
46755
|
var require_chunk_UIX4URMV = __commonJS({
|
|
46756
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
46756
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/chunk-UIX4URMV.js"(exports) {
|
|
46757
46757
|
"use strict";
|
|
46758
46758
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46759
46759
|
function _interopRequireWildcard(obj) {
|
|
@@ -47246,8 +47246,8 @@ var require_dist2 = __commonJS({
|
|
|
47246
47246
|
loadTsConfig: () => loadTsConfig2
|
|
47247
47247
|
});
|
|
47248
47248
|
module2.exports = __toCommonJS2(src_exports);
|
|
47249
|
-
var
|
|
47250
|
-
var
|
|
47249
|
+
var import_path2 = __toESM2(require("path"), 1);
|
|
47250
|
+
var import_fs2 = __toESM2(require("fs"), 1);
|
|
47251
47251
|
var singleComment = Symbol("singleComment");
|
|
47252
47252
|
var multiComment = Symbol("multiComment");
|
|
47253
47253
|
var stripWithoutWhitespace = () => "";
|
|
@@ -47342,29 +47342,29 @@ var require_dist2 = __commonJS({
|
|
|
47342
47342
|
}
|
|
47343
47343
|
}
|
|
47344
47344
|
var req = false ? createRequire(import_meta.url) : require;
|
|
47345
|
-
var findUp = (name, startDir, stopDir =
|
|
47345
|
+
var findUp = (name, startDir, stopDir = import_path2.default.parse(startDir).root) => {
|
|
47346
47346
|
let dir = startDir;
|
|
47347
47347
|
while (dir !== stopDir) {
|
|
47348
|
-
const file =
|
|
47349
|
-
if (
|
|
47348
|
+
const file = import_path2.default.join(dir, name);
|
|
47349
|
+
if (import_fs2.default.existsSync(file))
|
|
47350
47350
|
return file;
|
|
47351
47351
|
if (!file.endsWith(".json")) {
|
|
47352
47352
|
const fileWithExt = file + ".json";
|
|
47353
|
-
if (
|
|
47353
|
+
if (import_fs2.default.existsSync(fileWithExt))
|
|
47354
47354
|
return fileWithExt;
|
|
47355
47355
|
}
|
|
47356
|
-
dir =
|
|
47356
|
+
dir = import_path2.default.dirname(dir);
|
|
47357
47357
|
}
|
|
47358
47358
|
return null;
|
|
47359
47359
|
};
|
|
47360
47360
|
var resolveTsConfigFromFile = (cwd, filename) => {
|
|
47361
|
-
if (
|
|
47362
|
-
return
|
|
47361
|
+
if (import_path2.default.isAbsolute(filename))
|
|
47362
|
+
return import_fs2.default.existsSync(filename) ? filename : null;
|
|
47363
47363
|
return findUp(filename, cwd);
|
|
47364
47364
|
};
|
|
47365
47365
|
var resolveTsConfigFromExtends = (cwd, name) => {
|
|
47366
|
-
if (
|
|
47367
|
-
return
|
|
47366
|
+
if (import_path2.default.isAbsolute(name))
|
|
47367
|
+
return import_fs2.default.existsSync(name) ? name : null;
|
|
47368
47368
|
if (name.startsWith("."))
|
|
47369
47369
|
return findUp(name, cwd);
|
|
47370
47370
|
const id = req.resolve(name, { paths: [cwd] });
|
|
@@ -47372,14 +47372,14 @@ var require_dist2 = __commonJS({
|
|
|
47372
47372
|
};
|
|
47373
47373
|
var loadTsConfigInternal = (dir = process.cwd(), name = "tsconfig.json", isExtends = false) => {
|
|
47374
47374
|
var _a, _b;
|
|
47375
|
-
dir =
|
|
47375
|
+
dir = import_path2.default.resolve(dir);
|
|
47376
47376
|
const id = isExtends ? resolveTsConfigFromExtends(dir, name) : resolveTsConfigFromFile(dir, name);
|
|
47377
47377
|
if (!id)
|
|
47378
47378
|
return null;
|
|
47379
|
-
const data = jsoncParse(
|
|
47380
|
-
const configDir =
|
|
47379
|
+
const data = jsoncParse(import_fs2.default.readFileSync(id, "utf-8"));
|
|
47380
|
+
const configDir = import_path2.default.dirname(id);
|
|
47381
47381
|
if ((_a = data.compilerOptions) == null ? void 0 : _a.baseUrl) {
|
|
47382
|
-
data.compilerOptions.baseUrl =
|
|
47382
|
+
data.compilerOptions.baseUrl = import_path2.default.join(
|
|
47383
47383
|
configDir,
|
|
47384
47384
|
data.compilerOptions.baseUrl
|
|
47385
47385
|
);
|
|
@@ -47456,17 +47456,17 @@ var require_dist3 = __commonJS({
|
|
|
47456
47456
|
tsconfigPathsToRegExp: () => tsconfigPathsToRegExp
|
|
47457
47457
|
});
|
|
47458
47458
|
module2.exports = __toCommonJS2(src_exports);
|
|
47459
|
-
var
|
|
47460
|
-
var
|
|
47459
|
+
var import_fs2 = __toESM2(require("fs"), 1);
|
|
47460
|
+
var import_path2 = __toESM2(require("path"), 1);
|
|
47461
47461
|
var import_url3 = require("url");
|
|
47462
47462
|
var import_esbuild = require("esbuild");
|
|
47463
47463
|
var import_load_tsconfig = require_dist2();
|
|
47464
|
-
var
|
|
47465
|
-
var
|
|
47464
|
+
var import_fs3 = __toESM2(require("fs"), 1);
|
|
47465
|
+
var import_path3 = __toESM2(require("path"), 1);
|
|
47466
47466
|
var getPkgType = () => {
|
|
47467
47467
|
try {
|
|
47468
47468
|
const pkg = JSON.parse(
|
|
47469
|
-
|
|
47469
|
+
import_fs3.default.readFileSync(import_path3.default.resolve("package.json"), "utf-8")
|
|
47470
47470
|
);
|
|
47471
47471
|
return pkg.type;
|
|
47472
47472
|
} catch (error) {
|
|
@@ -47475,7 +47475,7 @@ var require_dist3 = __commonJS({
|
|
|
47475
47475
|
function guessFormat(inputFile) {
|
|
47476
47476
|
if (!usingDynamicImport)
|
|
47477
47477
|
return "cjs";
|
|
47478
|
-
const ext2 =
|
|
47478
|
+
const ext2 = import_path3.default.extname(inputFile);
|
|
47479
47479
|
const type = getPkgType();
|
|
47480
47480
|
if (ext2 === ".js") {
|
|
47481
47481
|
return type === "module" ? "esm" : "cjs";
|
|
@@ -47532,7 +47532,7 @@ var require_dist3 = __commonJS({
|
|
|
47532
47532
|
name: "bundle-require:external",
|
|
47533
47533
|
setup(ctx) {
|
|
47534
47534
|
ctx.onResolve({ filter: /.*/ }, async (args) => {
|
|
47535
|
-
if (args.path[0] === "." ||
|
|
47535
|
+
if (args.path[0] === "." || import_path2.default.isAbsolute(args.path)) {
|
|
47536
47536
|
return;
|
|
47537
47537
|
}
|
|
47538
47538
|
if (match2(args.path, external)) {
|
|
@@ -47561,11 +47561,11 @@ var require_dist3 = __commonJS({
|
|
|
47561
47561
|
"import.meta.url": IMPORT_META_URL_VAR_NAME
|
|
47562
47562
|
};
|
|
47563
47563
|
ctx.onLoad({ filter: JS_EXT_RE }, async (args) => {
|
|
47564
|
-
const contents = await
|
|
47564
|
+
const contents = await import_fs2.default.promises.readFile(args.path, "utf-8");
|
|
47565
47565
|
const injectLines = [
|
|
47566
47566
|
`const ${FILENAME_VAR_NAME} = ${JSON.stringify(args.path)};`,
|
|
47567
47567
|
`const ${DIRNAME_VAR_NAME} = ${JSON.stringify(
|
|
47568
|
-
|
|
47568
|
+
import_path2.default.dirname(args.path)
|
|
47569
47569
|
)};`,
|
|
47570
47570
|
`const ${IMPORT_META_URL_VAR_NAME} = ${JSON.stringify(
|
|
47571
47571
|
(0, import_url3.pathToFileURL)(args.path).href
|
|
@@ -47573,7 +47573,7 @@ var require_dist3 = __commonJS({
|
|
|
47573
47573
|
];
|
|
47574
47574
|
return {
|
|
47575
47575
|
contents: injectLines.join("") + contents,
|
|
47576
|
-
loader: inferLoader(
|
|
47576
|
+
loader: inferLoader(import_path2.default.extname(args.path))
|
|
47577
47577
|
};
|
|
47578
47578
|
});
|
|
47579
47579
|
}
|
|
@@ -47599,7 +47599,7 @@ var require_dist3 = __commonJS({
|
|
|
47599
47599
|
const { text } = result.outputFiles[0];
|
|
47600
47600
|
const getOutputFile = options.getOutputFile || defaultGetOutputFile;
|
|
47601
47601
|
const outfile = getOutputFile(options.filepath, format2);
|
|
47602
|
-
await
|
|
47602
|
+
await import_fs2.default.promises.writeFile(outfile, text, "utf8");
|
|
47603
47603
|
let mod;
|
|
47604
47604
|
const req = options.require || dynamicImport;
|
|
47605
47605
|
try {
|
|
@@ -47609,7 +47609,7 @@ var require_dist3 = __commonJS({
|
|
|
47609
47609
|
);
|
|
47610
47610
|
} finally {
|
|
47611
47611
|
if (!preserveTemporaryFile) {
|
|
47612
|
-
await
|
|
47612
|
+
await import_fs2.default.promises.unlink(outfile);
|
|
47613
47613
|
}
|
|
47614
47614
|
}
|
|
47615
47615
|
return {
|
|
@@ -47687,9 +47687,9 @@ var require_dist3 = __commonJS({
|
|
|
47687
47687
|
}
|
|
47688
47688
|
});
|
|
47689
47689
|
|
|
47690
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
47690
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/chunk-7G76EW2R.js
|
|
47691
47691
|
var require_chunk_7G76EW2R = __commonJS({
|
|
47692
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
47692
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/chunk-7G76EW2R.js"(exports) {
|
|
47693
47693
|
"use strict";
|
|
47694
47694
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47695
47695
|
function _interopRequireDefault(obj) {
|
|
@@ -101426,9 +101426,9 @@ var require_chokidar = __commonJS({
|
|
|
101426
101426
|
}
|
|
101427
101427
|
});
|
|
101428
101428
|
|
|
101429
|
-
// node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
101429
|
+
// node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/index.js
|
|
101430
101430
|
var require_dist6 = __commonJS({
|
|
101431
|
-
"node_modules/.pnpm/tsup@8.0.0_patch_hash=
|
|
101431
|
+
"node_modules/.pnpm/tsup@8.0.0_patch_hash=xmhwxzi2nqhltf2r7syhjyoc7i_@microsoft+api-extractor@7.38.3_@swc+core@1._6zprvhhd4zzf6xxclnutwtxcvy/node_modules/tsup/dist/index.js"(exports) {
|
|
101432
101432
|
"use strict";
|
|
101433
101433
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
101434
101434
|
function _interopRequireDefault(obj) {
|
|
@@ -103762,10 +103762,7 @@ var require_dist6 = __commonJS({
|
|
|
103762
103762
|
const program = _typescript2.default.createProgram({
|
|
103763
103763
|
rootNames: compilerOptions.fileNames,
|
|
103764
103764
|
options: compilerOptions.options,
|
|
103765
|
-
host
|
|
103766
|
-
...host,
|
|
103767
|
-
jsDocParsingMode: _typescript2.default.JSDocParsingMode?.ParseAll !== void 0 ? _typescript2.default.JSDocParsingMode.ParseAll : 0
|
|
103768
|
-
}
|
|
103765
|
+
host
|
|
103769
103766
|
});
|
|
103770
103767
|
const fileMapping = emitDtsFiles(program, host, options);
|
|
103771
103768
|
if (!fileMapping || fileMapping.size === 0) {
|
|
@@ -126332,9 +126329,9 @@ __export(executor_exports, {
|
|
|
126332
126329
|
tsupExecutorFn: () => tsupExecutorFn
|
|
126333
126330
|
});
|
|
126334
126331
|
module.exports = __toCommonJS(executor_exports);
|
|
126335
|
-
var
|
|
126332
|
+
var import_node_fs3 = require("node:fs");
|
|
126336
126333
|
var import_promises2 = require("node:fs/promises");
|
|
126337
|
-
var
|
|
126334
|
+
var import_node_path3 = require("node:path");
|
|
126338
126335
|
var import_esbuild_decorators = __toESM(require_src());
|
|
126339
126336
|
var import_devkit2 = __toESM(require_devkit());
|
|
126340
126337
|
var import_js = __toESM(require_src2());
|
|
@@ -126404,17 +126401,17 @@ var LogLevelLabel = {
|
|
|
126404
126401
|
};
|
|
126405
126402
|
|
|
126406
126403
|
// packages/config-tools/src/utilities/find-up.ts
|
|
126407
|
-
var
|
|
126408
|
-
var
|
|
126404
|
+
var import_node_fs = require("node:fs");
|
|
126405
|
+
var import_node_path = require("node:path");
|
|
126409
126406
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
126410
126407
|
var depth = 0;
|
|
126411
126408
|
function findFolderUp(startPath, endFileNames) {
|
|
126412
126409
|
const _startPath = startPath ?? process.cwd();
|
|
126413
|
-
if (endFileNames.some((endFileName) => (0,
|
|
126410
|
+
if (endFileNames.some((endFileName) => (0, import_node_fs.existsSync)((0, import_node_path.join)(_startPath, endFileName)))) {
|
|
126414
126411
|
return _startPath;
|
|
126415
126412
|
}
|
|
126416
126413
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
126417
|
-
const parent = (0,
|
|
126414
|
+
const parent = (0, import_node_path.join)(_startPath, "..");
|
|
126418
126415
|
return findFolderUp(parent, endFileNames);
|
|
126419
126416
|
}
|
|
126420
126417
|
return void 0;
|
|
@@ -126473,8 +126470,8 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
|
126473
126470
|
}
|
|
126474
126471
|
|
|
126475
126472
|
// packages/config-tools/src/utilities/get-default-config.ts
|
|
126476
|
-
var
|
|
126477
|
-
var
|
|
126473
|
+
var import_node_fs2 = require("node:fs");
|
|
126474
|
+
var import_node_path2 = require("node:path");
|
|
126478
126475
|
|
|
126479
126476
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
126480
126477
|
var util;
|
|
@@ -130143,8 +130140,8 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
130143
130140
|
let license = DefaultStormConfig.license;
|
|
130144
130141
|
let homepage = DefaultStormConfig.homepage;
|
|
130145
130142
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
130146
|
-
if ((0,
|
|
130147
|
-
const file = (0,
|
|
130143
|
+
if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
|
|
130144
|
+
const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
|
|
130148
130145
|
encoding: "utf-8"
|
|
130149
130146
|
});
|
|
130150
130147
|
if (file) {
|
|
@@ -130245,12 +130242,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
|
130245
130242
|
console.error(
|
|
130246
130243
|
`
|
|
130247
130244
|
|
|
130245
|
+
|
|
130248
130246
|
${chalk.bold.hex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6")(
|
|
130249
130247
|
">"
|
|
130250
130248
|
)} ${chalk.bold.bgHex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6").white(" \u{1F480} Fatal ")} ${chalk.reset.hex(
|
|
130251
130249
|
config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
|
|
130252
130250
|
)(message)}
|
|
130253
130251
|
|
|
130252
|
+
|
|
130254
130253
|
`
|
|
130255
130254
|
);
|
|
130256
130255
|
};
|
|
@@ -130260,12 +130259,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
|
130260
130259
|
console.error(
|
|
130261
130260
|
`
|
|
130262
130261
|
|
|
130262
|
+
|
|
130263
130263
|
${chalk.bold.hex(config?.colors?.error ? config.colors.error : "#7d1a1a")(
|
|
130264
130264
|
">"
|
|
130265
130265
|
)} ${chalk.bold.bgHex(config?.colors?.error ? config.colors.error : "#7d1a1a").white(" \u{1F6D1} Error ")} ${chalk.reset.hex(
|
|
130266
130266
|
config?.colors?.error ? config.colors.error : "#7d1a1a"
|
|
130267
130267
|
)(message)}
|
|
130268
130268
|
|
|
130269
|
+
|
|
130269
130270
|
`
|
|
130270
130271
|
);
|
|
130271
130272
|
};
|
|
@@ -130275,12 +130276,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
|
130275
130276
|
console.warn(
|
|
130276
130277
|
`
|
|
130277
130278
|
|
|
130279
|
+
|
|
130278
130280
|
${chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")(
|
|
130279
130281
|
">"
|
|
130280
130282
|
)} ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").white(" \u26A0\uFE0F Warn ")} ${chalk.reset.hex(
|
|
130281
130283
|
config?.colors?.warning ? config.colors.warning : "#fcc419"
|
|
130282
130284
|
)(message)}
|
|
130283
130285
|
|
|
130286
|
+
|
|
130284
130287
|
`
|
|
130285
130288
|
);
|
|
130286
130289
|
};
|
|
@@ -130290,12 +130293,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
|
130290
130293
|
console.info(
|
|
130291
130294
|
`
|
|
130292
130295
|
|
|
130296
|
+
|
|
130293
130297
|
${chalk.bold.hex(config?.colors?.info ? config.colors.info : "#0ea5e9")(
|
|
130294
130298
|
">"
|
|
130295
130299
|
)} ${chalk.bold.bgHex(config?.colors?.info ? config.colors.info : "#0ea5e9").white(" \u{1F4EC} Info ")} ${chalk.reset.hex(
|
|
130296
130300
|
config?.colors?.info ? config.colors.info : "#0ea5e9"
|
|
130297
130301
|
)(message)}
|
|
130298
130302
|
|
|
130303
|
+
|
|
130299
130304
|
`
|
|
130300
130305
|
);
|
|
130301
130306
|
};
|
|
@@ -130305,12 +130310,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
|
130305
130310
|
console.info(
|
|
130306
130311
|
`
|
|
130307
130312
|
|
|
130313
|
+
|
|
130308
130314
|
${chalk.bold.hex(config?.colors?.success ? config.colors.success : "#087f5b")(
|
|
130309
130315
|
">"
|
|
130310
130316
|
)} ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").white(" \u{1F389} Success ")} ${chalk.reset.hex(
|
|
130311
130317
|
config?.colors?.success ? config.colors.success : "#087f5b"
|
|
130312
130318
|
)(message)}
|
|
130313
130319
|
|
|
130320
|
+
|
|
130314
130321
|
`
|
|
130315
130322
|
);
|
|
130316
130323
|
};
|
|
@@ -130320,12 +130327,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
|
130320
130327
|
console.debug(
|
|
130321
130328
|
`
|
|
130322
130329
|
|
|
130330
|
+
|
|
130323
130331
|
${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(
|
|
130324
130332
|
">"
|
|
130325
130333
|
)} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F9EA} Debug ")} ${chalk.reset.hex(
|
|
130326
130334
|
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
130327
130335
|
)(message)}
|
|
130328
130336
|
|
|
130337
|
+
|
|
130329
130338
|
`
|
|
130330
130339
|
);
|
|
130331
130340
|
};
|
|
@@ -130334,12 +130343,14 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
|
130334
130343
|
console.log(
|
|
130335
130344
|
`
|
|
130336
130345
|
|
|
130346
|
+
|
|
130337
130347
|
${chalk.bold.hex(config?.colors?.primary ? config.colors.primary : "#1fb2a6")(
|
|
130338
130348
|
">"
|
|
130339
130349
|
)} ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").white(" \u{1F4E2} System ")} ${chalk.bold.hex(
|
|
130340
130350
|
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
130341
130351
|
)(message)}
|
|
130342
130352
|
|
|
130353
|
+
|
|
130343
130354
|
`
|
|
130344
130355
|
);
|
|
130345
130356
|
};
|
|
@@ -130499,16 +130510,6 @@ var setConfigEnv = (config) => {
|
|
|
130499
130510
|
}
|
|
130500
130511
|
};
|
|
130501
130512
|
|
|
130502
|
-
// packages/config-tools/src/utilities/prepare-workspace.ts
|
|
130503
|
-
var prepareWorkspace = async () => {
|
|
130504
|
-
const _STORM_CONFIG = getDefaultConfig({
|
|
130505
|
-
...await getConfigFile(),
|
|
130506
|
-
...getConfigEnv()
|
|
130507
|
-
});
|
|
130508
|
-
setConfigEnv(_STORM_CONFIG);
|
|
130509
|
-
return _STORM_CONFIG;
|
|
130510
|
-
};
|
|
130511
|
-
|
|
130512
130513
|
// packages/config-tools/src/env/get-env.ts
|
|
130513
130514
|
var getExtensionEnv = (extensionName) => {
|
|
130514
130515
|
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
@@ -130576,6 +130577,32 @@ var getConfigEnv = () => {
|
|
|
130576
130577
|
}, config);
|
|
130577
130578
|
};
|
|
130578
130579
|
|
|
130580
|
+
// packages/config-tools/src/create-storm-config.ts
|
|
130581
|
+
var loadStormConfig = async (workspaceRoot) => {
|
|
130582
|
+
let config = {};
|
|
130583
|
+
let _workspaceRoot = workspaceRoot;
|
|
130584
|
+
if (!_workspaceRoot) {
|
|
130585
|
+
_workspaceRoot = findWorkspaceRoot();
|
|
130586
|
+
}
|
|
130587
|
+
const configFile = await getDefaultConfig(
|
|
130588
|
+
{
|
|
130589
|
+
...await getConfigFile(_workspaceRoot),
|
|
130590
|
+
...getConfigEnv()
|
|
130591
|
+
},
|
|
130592
|
+
_workspaceRoot
|
|
130593
|
+
);
|
|
130594
|
+
if (configFile) {
|
|
130595
|
+
config = StormConfigSchema.parse(configFile);
|
|
130596
|
+
} else {
|
|
130597
|
+
writeWarning(
|
|
130598
|
+
config,
|
|
130599
|
+
"No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.config.js` file to the root of your workspace if it is not."
|
|
130600
|
+
);
|
|
130601
|
+
}
|
|
130602
|
+
setConfigEnv(config);
|
|
130603
|
+
return config;
|
|
130604
|
+
};
|
|
130605
|
+
|
|
130579
130606
|
// node_modules/.pnpm/esbuild-plugin-define@0.4.0_esbuild@0.19.5/node_modules/esbuild-plugin-define/dist/mjs/utils.js
|
|
130580
130607
|
var makeKey = (...inputs) => inputs.filter((input) => !!input).join(".");
|
|
130581
130608
|
function convertToDefineObject(data) {
|
|
@@ -133180,10 +133207,10 @@ var LRUCache = class _LRUCache {
|
|
|
133180
133207
|
};
|
|
133181
133208
|
|
|
133182
133209
|
// node_modules/.pnpm/path-scurry@1.10.1/node_modules/path-scurry/dist/mjs/index.js
|
|
133183
|
-
var
|
|
133210
|
+
var import_path = require("path");
|
|
133184
133211
|
var import_url = require("url");
|
|
133185
133212
|
var actualFS = __toESM(require("fs"), 1);
|
|
133186
|
-
var
|
|
133213
|
+
var import_fs = require("fs");
|
|
133187
133214
|
var import_promises = require("fs/promises");
|
|
133188
133215
|
|
|
133189
133216
|
// node_modules/.pnpm/minipass@7.0.4/node_modules/minipass/dist/esm/index.js
|
|
@@ -134065,12 +134092,12 @@ var Minipass = class extends import_events.EventEmitter {
|
|
|
134065
134092
|
};
|
|
134066
134093
|
|
|
134067
134094
|
// node_modules/.pnpm/path-scurry@1.10.1/node_modules/path-scurry/dist/mjs/index.js
|
|
134068
|
-
var realpathSync =
|
|
134095
|
+
var realpathSync = import_fs.realpathSync.native;
|
|
134069
134096
|
var defaultFS = {
|
|
134070
|
-
lstatSync:
|
|
134071
|
-
readdir:
|
|
134072
|
-
readdirSync:
|
|
134073
|
-
readlinkSync:
|
|
134097
|
+
lstatSync: import_fs.lstatSync,
|
|
134098
|
+
readdir: import_fs.readdir,
|
|
134099
|
+
readdirSync: import_fs.readdirSync,
|
|
134100
|
+
readlinkSync: import_fs.readlinkSync,
|
|
134074
134101
|
realpathSync,
|
|
134075
134102
|
promises: {
|
|
134076
134103
|
lstat: import_promises.lstat,
|
|
@@ -135066,7 +135093,7 @@ var PathWin32 = class _PathWin32 extends PathBase {
|
|
|
135066
135093
|
* @internal
|
|
135067
135094
|
*/
|
|
135068
135095
|
getRootString(path2) {
|
|
135069
|
-
return
|
|
135096
|
+
return import_path.win32.parse(path2).root;
|
|
135070
135097
|
}
|
|
135071
135098
|
/**
|
|
135072
135099
|
* @internal
|
|
@@ -135706,7 +135733,7 @@ var PathScurryWin32 = class extends PathScurryBase {
|
|
|
135706
135733
|
sep = "\\";
|
|
135707
135734
|
constructor(cwd = process.cwd(), opts = {}) {
|
|
135708
135735
|
const { nocase = true } = opts;
|
|
135709
|
-
super(cwd,
|
|
135736
|
+
super(cwd, import_path.win32, "\\", { ...opts, nocase });
|
|
135710
135737
|
this.nocase = nocase;
|
|
135711
135738
|
for (let p = this.cwd; p; p = p.parent) {
|
|
135712
135739
|
p.nocase = this.nocase;
|
|
@@ -135716,7 +135743,7 @@ var PathScurryWin32 = class extends PathScurryBase {
|
|
|
135716
135743
|
* @internal
|
|
135717
135744
|
*/
|
|
135718
135745
|
parseRootPath(dir) {
|
|
135719
|
-
return
|
|
135746
|
+
return import_path.win32.parse(dir).root.toUpperCase();
|
|
135720
135747
|
}
|
|
135721
135748
|
/**
|
|
135722
135749
|
* @internal
|
|
@@ -135738,7 +135765,7 @@ var PathScurryPosix = class extends PathScurryBase {
|
|
|
135738
135765
|
sep = "/";
|
|
135739
135766
|
constructor(cwd = process.cwd(), opts = {}) {
|
|
135740
135767
|
const { nocase = false } = opts;
|
|
135741
|
-
super(cwd,
|
|
135768
|
+
super(cwd, import_path.posix, "/", { ...opts, nocase });
|
|
135742
135769
|
this.nocase = nocase;
|
|
135743
135770
|
}
|
|
135744
135771
|
/**
|
|
@@ -136912,7 +136939,7 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
|
|
|
136912
136939
|
- projectName: ${projectName}
|
|
136913
136940
|
`
|
|
136914
136941
|
);
|
|
136915
|
-
config = await
|
|
136942
|
+
config = await loadStormConfig(workspaceRoot);
|
|
136916
136943
|
writeTrace(
|
|
136917
136944
|
config,
|
|
136918
136945
|
`Loaded Storm config into env:
|
|
@@ -137116,416 +137143,405 @@ var getTypiaTransform = (program, diagnostics) => (0, import_transform.default)(
|
|
|
137116
137143
|
|
|
137117
137144
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
137118
137145
|
async function tsupExecutorFn(options, context, config) {
|
|
137119
|
-
|
|
137120
|
-
|
|
137121
|
-
|
|
137122
|
-
|
|
137123
|
-
`\u2699\uFE0F Executor options:
|
|
137146
|
+
writeInfo(config, "\u{1F4E6} Running Storm build executor on the workspace");
|
|
137147
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && writeDebug(
|
|
137148
|
+
config,
|
|
137149
|
+
`\u2699\uFE0F Executor options:
|
|
137124
137150
|
${Object.keys(options).map(
|
|
137125
|
-
|
|
137126
|
-
|
|
137151
|
+
(key) => `${key}: ${!options[key] || _isPrimitive(options[key]) ? options[key] : JSON.stringify(options[key])}`
|
|
137152
|
+
).join("\n")}
|
|
137127
137153
|
`
|
|
137154
|
+
);
|
|
137155
|
+
if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
137156
|
+
throw new Error(
|
|
137157
|
+
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
137128
137158
|
);
|
|
137129
|
-
|
|
137130
|
-
|
|
137131
|
-
|
|
137132
|
-
|
|
137133
|
-
|
|
137134
|
-
|
|
137135
|
-
|
|
137136
|
-
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
|
|
137137
|
-
if (options.clean !== false) {
|
|
137138
|
-
if (getLogLevel(config?.logLevel) >= LogLevel.DEBUG) {
|
|
137139
|
-
writeInfo(config, `\u{1F9F9} Cleaning output path: ${options.outputPath}`);
|
|
137140
|
-
}
|
|
137141
|
-
(0, import_fs_extra.removeSync)(options.outputPath);
|
|
137159
|
+
}
|
|
137160
|
+
const workspaceRoot = getWorkspaceRoot();
|
|
137161
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
137162
|
+
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
|
|
137163
|
+
if (options.clean !== false) {
|
|
137164
|
+
if (getLogLevel(config?.logLevel) >= LogLevel.DEBUG) {
|
|
137165
|
+
writeInfo(config, `\u{1F9F9} Cleaning output path: ${options.outputPath}`);
|
|
137142
137166
|
}
|
|
137143
|
-
|
|
137167
|
+
(0, import_fs_extra.removeSync)(options.outputPath);
|
|
137168
|
+
}
|
|
137169
|
+
const assets = Array.from(options.assets);
|
|
137170
|
+
assets.push({
|
|
137171
|
+
input: projectRoot,
|
|
137172
|
+
glob: "*.md",
|
|
137173
|
+
output: "/"
|
|
137174
|
+
});
|
|
137175
|
+
assets.push({
|
|
137176
|
+
input: "",
|
|
137177
|
+
glob: "LICENSE",
|
|
137178
|
+
output: "."
|
|
137179
|
+
});
|
|
137180
|
+
if (options.generatePackageJson === false) {
|
|
137144
137181
|
assets.push({
|
|
137145
137182
|
input: projectRoot,
|
|
137146
|
-
glob: "
|
|
137147
|
-
output: "
|
|
137183
|
+
glob: "**/package.json",
|
|
137184
|
+
output: "."
|
|
137148
137185
|
});
|
|
137186
|
+
}
|
|
137187
|
+
if (options.includeSrc === true) {
|
|
137149
137188
|
assets.push({
|
|
137150
|
-
input:
|
|
137151
|
-
glob: "
|
|
137152
|
-
output: "
|
|
137189
|
+
input: sourceRoot,
|
|
137190
|
+
glob: "**/{*.ts,*.tsx,*.js,*.jsx}",
|
|
137191
|
+
output: "src/"
|
|
137153
137192
|
});
|
|
137154
|
-
|
|
137155
|
-
|
|
137156
|
-
|
|
137157
|
-
|
|
137158
|
-
|
|
137159
|
-
|
|
137160
|
-
|
|
137161
|
-
|
|
137162
|
-
|
|
137163
|
-
|
|
137164
|
-
|
|
137165
|
-
|
|
137166
|
-
|
|
137167
|
-
|
|
137168
|
-
|
|
137169
|
-
|
|
137170
|
-
|
|
137171
|
-
);
|
|
137172
|
-
if (!result.success) {
|
|
137173
|
-
throw new Error("The Build process failed trying to copy assets");
|
|
137174
|
-
}
|
|
137175
|
-
const pathToPackageJson = (0, import_node_path.join)(context.root, projectRoot, "package.json");
|
|
137176
|
-
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit2.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
|
|
137177
|
-
const workspacePackageJson = (0, import_devkit2.readJsonFile)((0, import_node_path.join)(workspaceRoot, "package.json"));
|
|
137178
|
-
options.external = options.external || [];
|
|
137179
|
-
if (workspacePackageJson?.dependencies) {
|
|
137180
|
-
options.external = Object.keys(workspacePackageJson?.dependencies).reduce(
|
|
137181
|
-
(ret, key) => {
|
|
137182
|
-
if (!ret.includes(key)) {
|
|
137183
|
-
ret.push(key);
|
|
137184
|
-
}
|
|
137185
|
-
return ret;
|
|
137186
|
-
},
|
|
137187
|
-
options.external
|
|
137188
|
-
);
|
|
137189
|
-
}
|
|
137190
|
-
const externalDependencies = options.external.reduce(
|
|
137191
|
-
(ret, name) => {
|
|
137192
|
-
if (!packageJson?.devDependencies?.[name]) {
|
|
137193
|
-
const externalNode = context.projectGraph.externalNodes[`npm:${name}`];
|
|
137194
|
-
if (externalNode) {
|
|
137195
|
-
ret.push({
|
|
137196
|
-
name,
|
|
137197
|
-
outputs: [],
|
|
137198
|
-
node: externalNode
|
|
137199
|
-
});
|
|
137200
|
-
}
|
|
137193
|
+
}
|
|
137194
|
+
const result = await (0, import_js.copyAssets)(
|
|
137195
|
+
{ assets, watch: options.watch, outputPath: options.outputPath },
|
|
137196
|
+
context
|
|
137197
|
+
);
|
|
137198
|
+
if (!result.success) {
|
|
137199
|
+
throw new Error("The Build process failed trying to copy assets");
|
|
137200
|
+
}
|
|
137201
|
+
const pathToPackageJson = (0, import_node_path3.join)(context.root, projectRoot, "package.json");
|
|
137202
|
+
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit2.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
|
|
137203
|
+
const workspacePackageJson = (0, import_devkit2.readJsonFile)((0, import_node_path3.join)(workspaceRoot, "package.json"));
|
|
137204
|
+
options.external = options.external || [];
|
|
137205
|
+
if (workspacePackageJson?.dependencies) {
|
|
137206
|
+
options.external = Object.keys(workspacePackageJson?.dependencies).reduce(
|
|
137207
|
+
(ret, key) => {
|
|
137208
|
+
if (!ret.includes(key)) {
|
|
137209
|
+
ret.push(key);
|
|
137201
137210
|
}
|
|
137202
137211
|
return ret;
|
|
137203
137212
|
},
|
|
137204
|
-
|
|
137213
|
+
options.external
|
|
137205
137214
|
);
|
|
137206
|
-
|
|
137207
|
-
|
|
137208
|
-
|
|
137209
|
-
|
|
137210
|
-
|
|
137211
|
-
|
|
137212
|
-
|
|
137213
|
-
|
|
137214
|
-
|
|
137215
|
-
|
|
137216
|
-
|
|
137217
|
-
}
|
|
137218
|
-
const projectConfig = projectConfigs[key];
|
|
137219
|
-
if (projectConfig?.targets?.build) {
|
|
137220
|
-
const projectPackageJson = (0, import_devkit2.readJsonFile)(projectConfig.targets?.build.options.project);
|
|
137221
|
-
if (projectPackageJson?.name && !options.external.includes(projectPackageJson.name)) {
|
|
137222
|
-
ret.push(projectPackageJson.name);
|
|
137223
|
-
internalDependencies.push(projectPackageJson.name);
|
|
137224
|
-
}
|
|
137225
|
-
}
|
|
137226
|
-
return ret;
|
|
137227
|
-
}, options.external);
|
|
137228
|
-
}
|
|
137229
|
-
if (options.bundle === false) {
|
|
137230
|
-
for (const thirdPartyDependency of getExternalDependencies(
|
|
137231
|
-
context.projectName,
|
|
137232
|
-
context.projectGraph
|
|
137233
|
-
)) {
|
|
137234
|
-
const packageConfig = thirdPartyDependency.node.data;
|
|
137235
|
-
if (packageConfig?.packageName) {
|
|
137236
|
-
options.external.push(packageConfig.packageName);
|
|
137237
|
-
if (!packageJson?.devDependencies?.[packageConfig.packageName]) {
|
|
137238
|
-
externalDependencies.push(thirdPartyDependency);
|
|
137239
|
-
}
|
|
137215
|
+
}
|
|
137216
|
+
const externalDependencies = options.external.reduce(
|
|
137217
|
+
(ret, name) => {
|
|
137218
|
+
if (!packageJson?.devDependencies?.[name]) {
|
|
137219
|
+
const externalNode = context.projectGraph.externalNodes[`npm:${name}`];
|
|
137220
|
+
if (externalNode) {
|
|
137221
|
+
ret.push({
|
|
137222
|
+
name,
|
|
137223
|
+
outputs: [],
|
|
137224
|
+
node: externalNode
|
|
137225
|
+
});
|
|
137240
137226
|
}
|
|
137241
137227
|
}
|
|
137242
|
-
|
|
137243
|
-
|
|
137244
|
-
|
|
137245
|
-
|
|
137246
|
-
|
|
137247
|
-
|
|
137248
|
-
|
|
137249
|
-
|
|
137250
|
-
|
|
137251
|
-
|
|
137252
|
-
|
|
137253
|
-
|
|
137254
|
-
|
|
137255
|
-
|
|
137256
|
-
|
|
137257
|
-
|
|
137258
|
-
|
|
137259
|
-
|
|
137260
|
-
|
|
137261
|
-
|
|
137262
|
-
|
|
137263
|
-
|
|
137264
|
-
if (options.entry) {
|
|
137265
|
-
entryPoints.push(options.entry);
|
|
137266
|
-
}
|
|
137267
|
-
if (options.emitOnAll === true) {
|
|
137268
|
-
entryPoints.push((0, import_devkit2.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
|
|
137269
|
-
}
|
|
137270
|
-
if (options.additionalEntryPoints) {
|
|
137271
|
-
entryPoints.push(...options.additionalEntryPoints);
|
|
137272
|
-
}
|
|
137273
|
-
const entry = globSync(entryPoints, {
|
|
137274
|
-
withFileTypes: true
|
|
137275
|
-
}).reduce((ret, filePath) => {
|
|
137276
|
-
let formattedPath = workspaceRoot.replaceAll("\\", "/");
|
|
137277
|
-
if (formattedPath.toUpperCase().startsWith("C:")) {
|
|
137278
|
-
formattedPath = formattedPath.substring(2);
|
|
137279
|
-
}
|
|
137280
|
-
let propertyKey = (0, import_devkit2.joinPathFragments)(filePath.path, removeExtension(filePath.name)).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
137281
|
-
if (propertyKey) {
|
|
137282
|
-
while (propertyKey.startsWith("/")) {
|
|
137283
|
-
propertyKey = propertyKey.substring(1);
|
|
137284
|
-
}
|
|
137285
|
-
if (getLogLevel(config?.logLevel) >= LogLevel.DEBUG) {
|
|
137286
|
-
console.debug(
|
|
137287
|
-
`Trying to add entry point ${propertyKey} at "${(0, import_devkit2.joinPathFragments)(
|
|
137288
|
-
filePath.path,
|
|
137289
|
-
filePath.name
|
|
137290
|
-
)}"`
|
|
137291
|
-
);
|
|
137292
|
-
}
|
|
137293
|
-
if (!(propertyKey in ret)) {
|
|
137294
|
-
ret[propertyKey] = (0, import_devkit2.joinPathFragments)(filePath.path, filePath.name);
|
|
137228
|
+
return ret;
|
|
137229
|
+
},
|
|
137230
|
+
[]
|
|
137231
|
+
);
|
|
137232
|
+
const implicitDependencies = context.projectsConfigurations.projects[context.projectName].implicitDependencies;
|
|
137233
|
+
const internalDependencies = [];
|
|
137234
|
+
const projectConfigs = await Promise.resolve(getProjectConfigurations());
|
|
137235
|
+
if (getLogLevel(config?.logLevel) >= LogLevel.TRACE) {
|
|
137236
|
+
writeDebug(config, "Project Configs:");
|
|
137237
|
+
console.log(projectConfigs);
|
|
137238
|
+
}
|
|
137239
|
+
if (implicitDependencies && implicitDependencies.length > 0) {
|
|
137240
|
+
options.external = implicitDependencies.reduce((ret, key) => {
|
|
137241
|
+
if (getLogLevel(config?.logLevel) >= LogLevel.DEBUG) {
|
|
137242
|
+
writeDebug(config, `\u26A1 Adding implicit dependency: ${key}`);
|
|
137243
|
+
}
|
|
137244
|
+
const projectConfig = projectConfigs[key];
|
|
137245
|
+
if (projectConfig?.targets?.build) {
|
|
137246
|
+
const projectPackageJson = (0, import_devkit2.readJsonFile)(projectConfig.targets?.build.options.project);
|
|
137247
|
+
if (projectPackageJson?.name && !options.external.includes(projectPackageJson.name)) {
|
|
137248
|
+
ret.push(projectPackageJson.name);
|
|
137249
|
+
internalDependencies.push(projectPackageJson.name);
|
|
137295
137250
|
}
|
|
137296
137251
|
}
|
|
137297
137252
|
return ret;
|
|
137298
|
-
},
|
|
137299
|
-
|
|
137300
|
-
|
|
137301
|
-
|
|
137302
|
-
|
|
137303
|
-
|
|
137304
|
-
|
|
137305
|
-
|
|
137306
|
-
|
|
137307
|
-
|
|
137308
|
-
|
|
137309
|
-
|
|
137310
|
-
packageJson.dependencies[packageName] = projectGraph.nodes[externalDependency.node.name] ? "latest" : version;
|
|
137253
|
+
}, options.external);
|
|
137254
|
+
}
|
|
137255
|
+
if (options.bundle === false) {
|
|
137256
|
+
for (const thirdPartyDependency of getExternalDependencies(
|
|
137257
|
+
context.projectName,
|
|
137258
|
+
context.projectGraph
|
|
137259
|
+
)) {
|
|
137260
|
+
const packageConfig = thirdPartyDependency.node.data;
|
|
137261
|
+
if (packageConfig?.packageName) {
|
|
137262
|
+
options.external.push(packageConfig.packageName);
|
|
137263
|
+
if (!packageJson?.devDependencies?.[packageConfig.packageName]) {
|
|
137264
|
+
externalDependencies.push(thirdPartyDependency);
|
|
137311
137265
|
}
|
|
137312
137266
|
}
|
|
137313
|
-
|
|
137314
|
-
|
|
137315
|
-
|
|
137316
|
-
|
|
137267
|
+
}
|
|
137268
|
+
}
|
|
137269
|
+
writeTrace(
|
|
137270
|
+
config,
|
|
137271
|
+
`Building with the following dependencies marked as external:
|
|
137272
|
+
${externalDependencies.map((dep) => {
|
|
137273
|
+
return `name: ${dep.name}, node: ${dep.node}, outputs: ${dep.outputs}`;
|
|
137274
|
+
}).join("\n")}`
|
|
137275
|
+
);
|
|
137276
|
+
const prettierOptions = {
|
|
137277
|
+
plugins: ["prettier-plugin-packagejson"],
|
|
137278
|
+
trailingComma: "none",
|
|
137279
|
+
tabWidth: 2,
|
|
137280
|
+
semi: true,
|
|
137281
|
+
singleQuote: false,
|
|
137282
|
+
quoteProps: "preserve",
|
|
137283
|
+
insertPragma: false,
|
|
137284
|
+
bracketSameLine: true,
|
|
137285
|
+
printWidth: 80,
|
|
137286
|
+
bracketSpacing: true,
|
|
137287
|
+
arrowParens: "avoid",
|
|
137288
|
+
endOfLine: "lf"
|
|
137289
|
+
};
|
|
137290
|
+
const entryPoints = [];
|
|
137291
|
+
if (options.entry) {
|
|
137292
|
+
entryPoints.push(options.entry);
|
|
137293
|
+
}
|
|
137294
|
+
if (options.emitOnAll === true) {
|
|
137295
|
+
entryPoints.push((0, import_devkit2.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
|
|
137296
|
+
}
|
|
137297
|
+
if (options.additionalEntryPoints) {
|
|
137298
|
+
entryPoints.push(...options.additionalEntryPoints);
|
|
137299
|
+
}
|
|
137300
|
+
const entry = globSync(entryPoints, {
|
|
137301
|
+
withFileTypes: true
|
|
137302
|
+
}).reduce((ret, filePath) => {
|
|
137303
|
+
let formattedPath = workspaceRoot.replaceAll("\\", "/");
|
|
137304
|
+
if (formattedPath.toUpperCase().startsWith("C:")) {
|
|
137305
|
+
formattedPath = formattedPath.substring(2);
|
|
137306
|
+
}
|
|
137307
|
+
let propertyKey = (0, import_devkit2.joinPathFragments)(filePath.path, removeExtension(filePath.name)).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
137308
|
+
if (propertyKey) {
|
|
137309
|
+
while (propertyKey.startsWith("/")) {
|
|
137310
|
+
propertyKey = propertyKey.substring(1);
|
|
137311
|
+
}
|
|
137312
|
+
writeDebug(
|
|
137313
|
+
config,
|
|
137314
|
+
`Trying to add entry point ${propertyKey} at "${(0, import_devkit2.joinPathFragments)(
|
|
137315
|
+
filePath.path,
|
|
137316
|
+
filePath.name
|
|
137317
|
+
)}"`
|
|
137318
|
+
);
|
|
137319
|
+
if (!(propertyKey in ret)) {
|
|
137320
|
+
ret[propertyKey] = (0, import_devkit2.joinPathFragments)(filePath.path, filePath.name);
|
|
137321
|
+
}
|
|
137322
|
+
}
|
|
137323
|
+
return ret;
|
|
137324
|
+
}, {});
|
|
137325
|
+
if (options.generatePackageJson !== false) {
|
|
137326
|
+
const projectGraph = (0, import_devkit2.readCachedProjectGraph)();
|
|
137327
|
+
packageJson.dependencies = void 0;
|
|
137328
|
+
for (const externalDependency of externalDependencies) {
|
|
137329
|
+
const packageConfig = externalDependency.node.data;
|
|
137330
|
+
if (packageConfig?.packageName && !!(projectGraph.externalNodes[externalDependency.node.name]?.type === "npm")) {
|
|
137331
|
+
const { packageName, version } = packageConfig;
|
|
137332
|
+
if (workspacePackageJson.dependencies?.[packageName] || workspacePackageJson.devDependencies?.[packageName] || packageJson?.devDependencies?.[packageName]) {
|
|
137333
|
+
return null;
|
|
137317
137334
|
}
|
|
137335
|
+
packageJson.dependencies ??= {};
|
|
137336
|
+
packageJson.dependencies[packageName] = projectGraph.nodes[externalDependency.node.name] ? "latest" : version;
|
|
137337
|
+
}
|
|
137338
|
+
}
|
|
137339
|
+
for (const packageName of internalDependencies) {
|
|
137340
|
+
if (!packageJson?.devDependencies?.[packageName]) {
|
|
137341
|
+
packageJson.dependencies ??= {};
|
|
137342
|
+
packageJson.dependencies[packageName] = "latest";
|
|
137318
137343
|
}
|
|
137319
|
-
|
|
137320
|
-
|
|
137321
|
-
|
|
137322
|
-
|
|
137323
|
-
|
|
137344
|
+
}
|
|
137345
|
+
const distPaths = !options?.getConfig || _isFunction(options.getConfig) ? ["dist/"] : Object.keys(options.getConfig).map((key) => `${key}/`);
|
|
137346
|
+
packageJson.type = "module";
|
|
137347
|
+
if (distPaths.length > 0) {
|
|
137348
|
+
packageJson.exports ??= {
|
|
137349
|
+
".": {
|
|
137350
|
+
import: {
|
|
137351
|
+
types: `./${distPaths[0]}index.d.ts`,
|
|
137352
|
+
default: `./${distPaths[0]}index.js`
|
|
137353
|
+
},
|
|
137354
|
+
require: {
|
|
137355
|
+
types: `./${distPaths[0]}index.d.cts`,
|
|
137356
|
+
default: `./${distPaths[0]}index.cjs`
|
|
137357
|
+
},
|
|
137358
|
+
default: {
|
|
137359
|
+
types: `./${distPaths[0]}index.d.ts`,
|
|
137360
|
+
default: `./${distPaths[0]}index.js`
|
|
137361
|
+
},
|
|
137362
|
+
...(options.additionalEntryPoints ?? []).map((entryPoint) => ({
|
|
137363
|
+
[removeExtension(entryPoint).replace(sourceRoot, "")]: {
|
|
137364
|
+
types: (0, import_node_path3.join)(
|
|
137365
|
+
`./${distPaths[0]}`,
|
|
137366
|
+
`${removeExtension(entryPoint.replace(sourceRoot, ""))}.d.ts`
|
|
137367
|
+
),
|
|
137368
|
+
default: (0, import_node_path3.join)(
|
|
137369
|
+
`./${distPaths[0]}`,
|
|
137370
|
+
`${removeExtension(entryPoint.replace(sourceRoot, ""))}.js`
|
|
137371
|
+
)
|
|
137372
|
+
}
|
|
137373
|
+
}))
|
|
137374
|
+
},
|
|
137375
|
+
"./package.json": "./package.json"
|
|
137376
|
+
};
|
|
137377
|
+
packageJson.exports = Object.keys(entry).reduce((ret, key) => {
|
|
137378
|
+
let packageJsonKey = key.startsWith("./") ? key : `./${key}`;
|
|
137379
|
+
packageJsonKey = packageJsonKey.replaceAll("/index", "");
|
|
137380
|
+
if (!ret[packageJsonKey]) {
|
|
137381
|
+
ret[packageJsonKey] = {
|
|
137324
137382
|
import: {
|
|
137325
137383
|
types: `./${distPaths[0]}index.d.ts`,
|
|
137326
|
-
default: `./${distPaths[0]}
|
|
137384
|
+
default: `./${distPaths[0]}${key}.js`
|
|
137327
137385
|
},
|
|
137328
137386
|
require: {
|
|
137329
137387
|
types: `./${distPaths[0]}index.d.cts`,
|
|
137330
|
-
default: `./${distPaths[0]}
|
|
137388
|
+
default: `./${distPaths[0]}${key}.cjs`
|
|
137331
137389
|
},
|
|
137332
137390
|
default: {
|
|
137333
137391
|
types: `./${distPaths[0]}index.d.ts`,
|
|
137334
|
-
default: `./${distPaths[0]}
|
|
137335
|
-
}
|
|
137336
|
-
|
|
137337
|
-
[removeExtension(entryPoint).replace(sourceRoot, "")]: {
|
|
137338
|
-
types: (0, import_node_path.join)(
|
|
137339
|
-
`./${distPaths[0]}`,
|
|
137340
|
-
`${removeExtension(entryPoint.replace(sourceRoot, ""))}.d.ts`
|
|
137341
|
-
),
|
|
137342
|
-
default: (0, import_node_path.join)(
|
|
137343
|
-
`./${distPaths[0]}`,
|
|
137344
|
-
`${removeExtension(entryPoint.replace(sourceRoot, ""))}.js`
|
|
137345
|
-
)
|
|
137346
|
-
}
|
|
137347
|
-
}))
|
|
137348
|
-
},
|
|
137349
|
-
"./package.json": "./package.json"
|
|
137350
|
-
};
|
|
137351
|
-
packageJson.exports = Object.keys(entry).reduce((ret, key) => {
|
|
137352
|
-
let packageJsonKey = key.startsWith("./") ? key : `./${key}`;
|
|
137353
|
-
packageJsonKey = packageJsonKey.replaceAll("/index", "");
|
|
137354
|
-
if (!ret[packageJsonKey]) {
|
|
137355
|
-
ret[packageJsonKey] = {
|
|
137356
|
-
import: {
|
|
137357
|
-
types: `./${distPaths[0]}index.d.ts`,
|
|
137358
|
-
default: `./${distPaths[0]}${key}.js`
|
|
137359
|
-
},
|
|
137360
|
-
require: {
|
|
137361
|
-
types: `./${distPaths[0]}index.d.cts`,
|
|
137362
|
-
default: `./${distPaths[0]}${key}.cjs`
|
|
137363
|
-
},
|
|
137364
|
-
default: {
|
|
137365
|
-
types: `./${distPaths[0]}index.d.ts`,
|
|
137366
|
-
default: `./${distPaths[0]}${key}.js`
|
|
137367
|
-
}
|
|
137368
|
-
};
|
|
137369
|
-
}
|
|
137370
|
-
return ret;
|
|
137371
|
-
}, packageJson.exports);
|
|
137372
|
-
packageJson.funding ??= workspacePackageJson.funding;
|
|
137373
|
-
packageJson.types ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
|
|
137374
|
-
packageJson.typings ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
|
|
137375
|
-
packageJson.typescript ??= {
|
|
137376
|
-
definition: `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`
|
|
137377
|
-
};
|
|
137378
|
-
packageJson.main ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.cjs`;
|
|
137379
|
-
packageJson.module ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.js`;
|
|
137380
|
-
if (options.platform && options.platform !== "node") {
|
|
137381
|
-
packageJson.browser ??= `${distPaths[0]}index.global.js`;
|
|
137382
|
-
}
|
|
137383
|
-
if (options.includeSrc === true) {
|
|
137384
|
-
let distSrc = sourceRoot.replace(projectRoot, "");
|
|
137385
|
-
if (distSrc.startsWith("/")) {
|
|
137386
|
-
distSrc = distSrc.substring(1);
|
|
137387
|
-
}
|
|
137388
|
-
packageJson.source ??= `${(0, import_node_path.join)(distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
137389
|
-
}
|
|
137390
|
-
packageJson.sideEffects ??= false;
|
|
137391
|
-
packageJson.files ??= ["dist/**/*"];
|
|
137392
|
-
if (options.includeSrc === true && !packageJson.files.includes("src")) {
|
|
137393
|
-
packageJson.files.push("src/**/*");
|
|
137392
|
+
default: `./${distPaths[0]}${key}.js`
|
|
137393
|
+
}
|
|
137394
|
+
};
|
|
137394
137395
|
}
|
|
137395
|
-
|
|
137396
|
-
packageJson.
|
|
137397
|
-
|
|
137398
|
-
}
|
|
137399
|
-
packageJson.
|
|
137400
|
-
packageJson.
|
|
137401
|
-
|
|
137402
|
-
|
|
137403
|
-
packageJson.
|
|
137404
|
-
packageJson.
|
|
137405
|
-
|
|
137406
|
-
|
|
137407
|
-
|
|
137408
|
-
if (
|
|
137409
|
-
|
|
137410
|
-
|
|
137411
|
-
|
|
137412
|
-
|
|
137413
|
-
|
|
137414
|
-
|
|
137415
|
-
|
|
137416
|
-
|
|
137417
|
-
)
|
|
137418
|
-
|
|
137419
|
-
|
|
137420
|
-
|
|
137421
|
-
|
|
137422
|
-
|
|
137423
|
-
|
|
137424
|
-
|
|
137425
|
-
|
|
137426
|
-
|
|
137427
|
-
|
|
137428
|
-
|
|
137429
|
-
|
|
137430
|
-
|
|
137431
|
-
|
|
137432
|
-
|
|
137433
|
-
|
|
137434
|
-
|
|
137435
|
-
|
|
137436
|
-
|
|
137437
|
-
|
|
137438
|
-
|
|
137439
|
-
"utf-8"
|
|
137440
|
-
)
|
|
137441
|
-
)
|
|
137442
|
-
);
|
|
137443
|
-
}
|
|
137444
|
-
const stormEnv = Object.keys(options.env).filter((key) => key.startsWith("STORM_")).reduce((ret, key) => {
|
|
137445
|
-
ret[key] = options.env[key];
|
|
137446
|
-
return ret;
|
|
137447
|
-
}, {});
|
|
137448
|
-
options.plugins.push(
|
|
137449
|
-
(0, import_esbuild_decorators.esbuildDecorators)({
|
|
137450
|
-
tsconfig: options.tsConfig,
|
|
137451
|
-
cwd: workspaceRoot
|
|
137396
|
+
return ret;
|
|
137397
|
+
}, packageJson.exports);
|
|
137398
|
+
packageJson.funding ??= workspacePackageJson.funding;
|
|
137399
|
+
packageJson.types ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
|
|
137400
|
+
packageJson.typings ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
|
|
137401
|
+
packageJson.typescript ??= {
|
|
137402
|
+
definition: `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`
|
|
137403
|
+
};
|
|
137404
|
+
packageJson.main ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.cjs`;
|
|
137405
|
+
packageJson.module ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.js`;
|
|
137406
|
+
if (options.platform && options.platform !== "node") {
|
|
137407
|
+
packageJson.browser ??= `${distPaths[0]}index.global.js`;
|
|
137408
|
+
}
|
|
137409
|
+
if (options.includeSrc === true) {
|
|
137410
|
+
let distSrc = sourceRoot.replace(projectRoot, "");
|
|
137411
|
+
if (distSrc.startsWith("/")) {
|
|
137412
|
+
distSrc = distSrc.substring(1);
|
|
137413
|
+
}
|
|
137414
|
+
packageJson.source ??= `${(0, import_node_path3.join)(distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
137415
|
+
}
|
|
137416
|
+
packageJson.sideEffects ??= false;
|
|
137417
|
+
packageJson.files ??= ["dist/**/*"];
|
|
137418
|
+
if (options.includeSrc === true && !packageJson.files.includes("src")) {
|
|
137419
|
+
packageJson.files.push("src/**/*");
|
|
137420
|
+
}
|
|
137421
|
+
}
|
|
137422
|
+
packageJson.publishConfig ??= {
|
|
137423
|
+
access: "public"
|
|
137424
|
+
};
|
|
137425
|
+
packageJson.description ??= workspacePackageJson.description;
|
|
137426
|
+
packageJson.homepage ??= workspacePackageJson.homepage;
|
|
137427
|
+
packageJson.bugs ??= workspacePackageJson.bugs;
|
|
137428
|
+
packageJson.author ??= workspacePackageJson.author;
|
|
137429
|
+
packageJson.license ??= workspacePackageJson.license;
|
|
137430
|
+
packageJson.keywords ??= workspacePackageJson.keywords;
|
|
137431
|
+
packageJson.repository ??= workspacePackageJson.repository;
|
|
137432
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : (0, import_node_path3.join)("packages", context.projectName);
|
|
137433
|
+
const packageJsonPath = (0, import_node_path3.join)(context.root, options.outputPath, "package.json");
|
|
137434
|
+
writeDebug(config, `\u26A1 Writing package.json file to: ${packageJsonPath}`);
|
|
137435
|
+
(0, import_node_fs3.writeFileSync)(
|
|
137436
|
+
packageJsonPath,
|
|
137437
|
+
await (0, import_prettier.format)(JSON.stringify(packageJson), {
|
|
137438
|
+
...prettierOptions,
|
|
137439
|
+
parser: "json"
|
|
137452
137440
|
})
|
|
137453
137441
|
);
|
|
137454
|
-
|
|
137455
|
-
|
|
137456
|
-
|
|
137457
|
-
|
|
137458
|
-
|
|
137459
|
-
|
|
137460
|
-
|
|
137461
|
-
|
|
137462
|
-
|
|
137463
|
-
|
|
137464
|
-
|
|
137465
|
-
|
|
137466
|
-
|
|
137467
|
-
|
|
137468
|
-
(0,
|
|
137442
|
+
} else {
|
|
137443
|
+
writeWarning(config, "Skipping writing to package.json file");
|
|
137444
|
+
}
|
|
137445
|
+
if (options.includeSrc === true) {
|
|
137446
|
+
const files = globSync([
|
|
137447
|
+
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.ts"),
|
|
137448
|
+
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.tsx"),
|
|
137449
|
+
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.js"),
|
|
137450
|
+
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.jsx")
|
|
137451
|
+
]);
|
|
137452
|
+
await Promise.allSettled(
|
|
137453
|
+
files.map(
|
|
137454
|
+
async (file) => (0, import_promises2.writeFile)(
|
|
137455
|
+
file,
|
|
137456
|
+
await (0, import_prettier.format)(
|
|
137457
|
+
`${options.banner ? options.banner.startsWith("//") ? options.banner : `// ${options.banner}` : ""}
|
|
137458
|
+
|
|
137459
|
+
${(0, import_node_fs3.readFileSync)(file, "utf-8")}`,
|
|
137469
137460
|
{
|
|
137470
|
-
...
|
|
137471
|
-
|
|
137472
|
-
|
|
137473
|
-
transformers: options.skipTypia ? [] : ["typia/lib/transform"]
|
|
137474
|
-
},
|
|
137475
|
-
context.root,
|
|
137476
|
-
sourceRoot,
|
|
137477
|
-
workspaceRoot
|
|
137461
|
+
...prettierOptions,
|
|
137462
|
+
parser: "typescript"
|
|
137463
|
+
}
|
|
137478
137464
|
),
|
|
137479
|
-
|
|
137465
|
+
"utf-8"
|
|
137480
137466
|
)
|
|
137481
|
-
)
|
|
137482
|
-
|
|
137483
|
-
|
|
137467
|
+
)
|
|
137468
|
+
);
|
|
137469
|
+
}
|
|
137470
|
+
const stormEnv = Object.keys(options.env).filter((key) => key.startsWith("STORM_")).reduce((ret, key) => {
|
|
137471
|
+
ret[key] = options.env[key];
|
|
137472
|
+
return ret;
|
|
137473
|
+
}, {});
|
|
137474
|
+
options.plugins.push(
|
|
137475
|
+
(0, import_esbuild_decorators.esbuildDecorators)({
|
|
137476
|
+
tsconfig: options.tsConfig,
|
|
137477
|
+
cwd: workspaceRoot
|
|
137478
|
+
})
|
|
137479
|
+
);
|
|
137480
|
+
options.plugins.push(environmentPlugin(stormEnv));
|
|
137481
|
+
const getConfigOptions = {
|
|
137482
|
+
...options,
|
|
137483
|
+
define: {
|
|
137484
|
+
__STORM_CONFIG: JSON.stringify(stormEnv)
|
|
137485
|
+
},
|
|
137486
|
+
env: {
|
|
137487
|
+
__STORM_CONFIG: JSON.stringify(stormEnv),
|
|
137488
|
+
...stormEnv
|
|
137489
|
+
},
|
|
137490
|
+
dtsTsConfig: getNormalizedTsConfig(
|
|
137491
|
+
context.root,
|
|
137492
|
+
options.outputPath,
|
|
137493
|
+
(0, import_tsc.createTypeScriptCompilationOptions)(
|
|
137494
|
+
(0, import_normalize_options.normalizeOptions)(
|
|
137495
|
+
{
|
|
137496
|
+
...options,
|
|
137497
|
+
watch: false,
|
|
137498
|
+
main: options.entry,
|
|
137499
|
+
transformers: options.skipTypia ? [] : ["typia/lib/transform"]
|
|
137500
|
+
},
|
|
137501
|
+
context.root,
|
|
137502
|
+
sourceRoot,
|
|
137503
|
+
workspaceRoot
|
|
137504
|
+
),
|
|
137505
|
+
context
|
|
137506
|
+
)
|
|
137507
|
+
),
|
|
137508
|
+
banner: options.banner ? {
|
|
137509
|
+
js: `${options.banner}
|
|
137484
137510
|
|
|
137485
137511
|
`,
|
|
137486
|
-
|
|
137512
|
+
css: `/*
|
|
137487
137513
|
${options.banner}
|
|
137488
137514
|
*/
|
|
137489
137515
|
|
|
137490
137516
|
`
|
|
137491
|
-
|
|
137492
|
-
|
|
137493
|
-
|
|
137494
|
-
|
|
137495
|
-
|
|
137496
|
-
|
|
137497
|
-
|
|
137498
|
-
|
|
137499
|
-
|
|
137500
|
-
|
|
137501
|
-
|
|
137502
|
-
|
|
137503
|
-
|
|
137504
|
-
|
|
137505
|
-
);
|
|
137506
|
-
|
|
137507
|
-
|
|
137508
|
-
} else {
|
|
137509
|
-
await build(tsupConfig, config);
|
|
137510
|
-
}
|
|
137511
|
-
} else if (getLogLevel(config?.logLevel) >= LogLevel.WARN) {
|
|
137512
|
-
writeWarning(
|
|
137513
|
-
config,
|
|
137514
|
-
"The Build process did not run because no `getConfig` parameter was provided"
|
|
137515
|
-
);
|
|
137516
|
-
}
|
|
137517
|
-
if (getLogLevel(config?.logLevel) >= LogLevel.INFO) {
|
|
137518
|
-
writeSuccess(config, "\u26A1 The Build process has completed successfully");
|
|
137517
|
+
} : void 0,
|
|
137518
|
+
outputPath: options.outputPath,
|
|
137519
|
+
entry,
|
|
137520
|
+
getTransform: options.skipTypia ? void 0 : getTypiaTransform
|
|
137521
|
+
};
|
|
137522
|
+
if (options.getConfig) {
|
|
137523
|
+
writeInfo(config, "\u26A1 Running the Build process");
|
|
137524
|
+
const getConfigFns = _isFunction(options.getConfig) ? [options.getConfig] : Object.keys(options.getConfig).map((key) => options.getConfig[key]);
|
|
137525
|
+
const tsupConfig = (0, import_tsup.defineConfig)(
|
|
137526
|
+
getConfigFns.map(
|
|
137527
|
+
(getConfigFn) => getConfig(context.root, projectRoot, getConfigFn, getConfigOptions)
|
|
137528
|
+
)
|
|
137529
|
+
);
|
|
137530
|
+
if (_isFunction(tsupConfig)) {
|
|
137531
|
+
await build(await Promise.resolve(tsupConfig({})), config);
|
|
137532
|
+
} else {
|
|
137533
|
+
await build(tsupConfig, config);
|
|
137519
137534
|
}
|
|
137520
|
-
|
|
137521
|
-
|
|
137522
|
-
|
|
137523
|
-
|
|
137524
|
-
|
|
137525
|
-
return {
|
|
137526
|
-
success: false
|
|
137527
|
-
};
|
|
137535
|
+
} else if (getLogLevel(config?.logLevel) >= LogLevel.WARN) {
|
|
137536
|
+
writeWarning(
|
|
137537
|
+
config,
|
|
137538
|
+
"The Build process did not run because no `getConfig` parameter was provided"
|
|
137539
|
+
);
|
|
137528
137540
|
}
|
|
137541
|
+
writeSuccess(config, "\u26A1 The Build process has completed successfully");
|
|
137542
|
+
return {
|
|
137543
|
+
success: true
|
|
137544
|
+
};
|
|
137529
137545
|
}
|
|
137530
137546
|
function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
137531
137547
|
const config = ts.readConfigFile(options.tsConfig, ts.sys.readFile).config;
|
|
@@ -137545,11 +137561,11 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
137545
137561
|
emitDeclarationOnly: true,
|
|
137546
137562
|
declaration: true,
|
|
137547
137563
|
declarationMap: true,
|
|
137548
|
-
declarationDir: (0,
|
|
137564
|
+
declarationDir: (0, import_node_path3.join)(workspaceRoot, "tmp", ".tsup", "declaration")
|
|
137549
137565
|
}
|
|
137550
137566
|
},
|
|
137551
137567
|
ts.sys,
|
|
137552
|
-
(0,
|
|
137568
|
+
(0, import_node_path3.dirname)(options.tsConfig)
|
|
137553
137569
|
);
|
|
137554
137570
|
tsConfig.options.pathsBasePath = workspaceRoot;
|
|
137555
137571
|
if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {
|