@storm-software/workspace-tools 1.30.1 → 1.30.3
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 +14 -0
- package/index.js +88 -82
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/executors/tsup/executor.js +52 -82
- package/src/executors/tsup/get-config.js +3 -2
- package/src/executors/tsup/schema.d.ts +1 -1
- package/src/executors/tsup/schema.json +2 -2
- package/src/executors/tsup-browser/executor.js +52 -82
- package/src/executors/tsup-neutral/executor.js +52 -82
- package/src/executors/tsup-node/executor.js +52 -82
- package/src/utils/index.js +60 -0
package/package.json
CHANGED
|
@@ -18464,46 +18464,6 @@ var require_devkit = __commonJS({
|
|
|
18464
18464
|
}
|
|
18465
18465
|
});
|
|
18466
18466
|
|
|
18467
|
-
// node_modules/.pnpm/@nx+esbuild@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_esbuild@0.19._qd2wqrdgtfa7fy24o2frhwj6em/node_modules/@nx/esbuild/src/executors/esbuild/lib/get-extra-dependencies.js
|
|
18468
|
-
var require_get_extra_dependencies = __commonJS({
|
|
18469
|
-
"node_modules/.pnpm/@nx+esbuild@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_esbuild@0.19._qd2wqrdgtfa7fy24o2frhwj6em/node_modules/@nx/esbuild/src/executors/esbuild/lib/get-extra-dependencies.js"(exports) {
|
|
18470
|
-
"use strict";
|
|
18471
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18472
|
-
exports.getExtraDependencies = void 0;
|
|
18473
|
-
function getExtraDependencies2(projectName, graph) {
|
|
18474
|
-
const deps = /* @__PURE__ */ new Map();
|
|
18475
|
-
recur(projectName);
|
|
18476
|
-
function recur(currProjectName) {
|
|
18477
|
-
const allDeps = graph.dependencies[currProjectName];
|
|
18478
|
-
const externalDeps = allDeps.reduce((acc, node) => {
|
|
18479
|
-
const found = graph.externalNodes[node.target];
|
|
18480
|
-
if (found)
|
|
18481
|
-
acc.push(found);
|
|
18482
|
-
return acc;
|
|
18483
|
-
}, []);
|
|
18484
|
-
const internalDeps = allDeps.reduce((acc, node) => {
|
|
18485
|
-
const found = graph.nodes[node.target];
|
|
18486
|
-
if (found)
|
|
18487
|
-
acc.push(found);
|
|
18488
|
-
return acc;
|
|
18489
|
-
}, []);
|
|
18490
|
-
for (const externalDep of externalDeps) {
|
|
18491
|
-
deps.set(externalDep.name, {
|
|
18492
|
-
name: externalDep.name,
|
|
18493
|
-
outputs: [],
|
|
18494
|
-
node: externalDep
|
|
18495
|
-
});
|
|
18496
|
-
}
|
|
18497
|
-
for (const internalDep of internalDeps) {
|
|
18498
|
-
recur(internalDep.name);
|
|
18499
|
-
}
|
|
18500
|
-
}
|
|
18501
|
-
return Array.from(deps.values());
|
|
18502
|
-
}
|
|
18503
|
-
exports.getExtraDependencies = getExtraDependencies2;
|
|
18504
|
-
}
|
|
18505
|
-
});
|
|
18506
|
-
|
|
18507
18467
|
// node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/package.json
|
|
18508
18468
|
var require_package2 = __commonJS({
|
|
18509
18469
|
"node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/package.json"(exports, module2) {
|
|
@@ -106595,7 +106555,6 @@ __export(executor_exports, {
|
|
|
106595
106555
|
module.exports = __toCommonJS(executor_exports);
|
|
106596
106556
|
var import_esbuild_decorators = __toESM(require_src());
|
|
106597
106557
|
var import_devkit2 = __toESM(require_devkit());
|
|
106598
|
-
var import_get_extra_dependencies = __toESM(require_get_extra_dependencies());
|
|
106599
106558
|
var import_js = __toESM(require_src2());
|
|
106600
106559
|
var import_normalize_options = __toESM(require_normalize_options());
|
|
106601
106560
|
var import_tsc = __toESM(require_tsc_impl());
|
|
@@ -116979,6 +116938,30 @@ var removeExtension = (filePath) => {
|
|
|
116979
116938
|
return filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
|
|
116980
116939
|
};
|
|
116981
116940
|
|
|
116941
|
+
// packages/workspace-tools/src/utils/get-project-deps.ts
|
|
116942
|
+
function getInternalDependencies(projectName, graph) {
|
|
116943
|
+
const allDeps = graph.dependencies[projectName];
|
|
116944
|
+
return Array.from(
|
|
116945
|
+
allDeps.reduce((acc, node) => {
|
|
116946
|
+
const found = graph.nodes[node.target];
|
|
116947
|
+
if (found)
|
|
116948
|
+
acc.push(found);
|
|
116949
|
+
return acc;
|
|
116950
|
+
}, [])
|
|
116951
|
+
);
|
|
116952
|
+
}
|
|
116953
|
+
function getExternalDependencies(projectName, graph) {
|
|
116954
|
+
const allDeps = graph.dependencies[projectName];
|
|
116955
|
+
return Array.from(
|
|
116956
|
+
allDeps.reduce((acc, node) => {
|
|
116957
|
+
const found = graph.externalNodes[node.target];
|
|
116958
|
+
if (found)
|
|
116959
|
+
acc.push(found);
|
|
116960
|
+
return acc;
|
|
116961
|
+
}, [])
|
|
116962
|
+
);
|
|
116963
|
+
}
|
|
116964
|
+
|
|
116982
116965
|
// packages/workspace-tools/src/executors/tsup/get-config.ts
|
|
116983
116966
|
var import_devkit = __toESM(require_devkit());
|
|
116984
116967
|
var import_tsup = __toESM(require_dist5());
|
|
@@ -117214,13 +117197,14 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
|
|
|
117214
117197
|
tsConfig,
|
|
117215
117198
|
additionalEntryPoints,
|
|
117216
117199
|
platform,
|
|
117200
|
+
emitOnAll = true,
|
|
117217
117201
|
...rest
|
|
117218
117202
|
}) {
|
|
117219
117203
|
const entryPoints = [];
|
|
117220
117204
|
if (rest.entry) {
|
|
117221
117205
|
entryPoints.push(rest.entry);
|
|
117222
117206
|
}
|
|
117223
|
-
if (
|
|
117207
|
+
if (emitOnAll !== false) {
|
|
117224
117208
|
entryPoints.push((0, import_devkit.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
|
|
117225
117209
|
}
|
|
117226
117210
|
if (additionalEntryPoints) {
|
|
@@ -117232,7 +117216,7 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
|
|
|
117232
117216
|
let propertyKey = (0, import_devkit.joinPathFragments)(
|
|
117233
117217
|
filePath.path,
|
|
117234
117218
|
removeExtension(filePath.name)
|
|
117235
|
-
).replaceAll("\\", "/").replaceAll(workspaceRoot.substring(
|
|
117219
|
+
).replaceAll("\\", "/").replaceAll(workspaceRoot.substring(2).replaceAll("\\", "/"), "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
117236
117220
|
if (propertyKey) {
|
|
117237
117221
|
while (propertyKey.startsWith("/")) {
|
|
117238
117222
|
propertyKey = propertyKey.substring(1);
|
|
@@ -117325,7 +117309,7 @@ ${Object.keys(options).map(
|
|
|
117325
117309
|
output: "."
|
|
117326
117310
|
});
|
|
117327
117311
|
}
|
|
117328
|
-
if (options.includeSrc
|
|
117312
|
+
if (options.includeSrc === true) {
|
|
117329
117313
|
assets.push({
|
|
117330
117314
|
input: sourceRoot,
|
|
117331
117315
|
glob: "**/{*.ts,*.tsx,*.js,*.jsx}",
|
|
@@ -117354,28 +117338,6 @@ ${Object.keys(options).map(
|
|
|
117354
117338
|
options.external
|
|
117355
117339
|
);
|
|
117356
117340
|
}
|
|
117357
|
-
const implicitDependencies = context.projectsConfigurations.projects[context.projectName].implicitDependencies;
|
|
117358
|
-
if (implicitDependencies && implicitDependencies.length > 0) {
|
|
117359
|
-
options.external = implicitDependencies.reduce(
|
|
117360
|
-
(ret, key) => {
|
|
117361
|
-
if (Object.keys(context.projectsConfigurations.projects[key]?.targets).length > 0) {
|
|
117362
|
-
const buildTargetName = Object.keys(
|
|
117363
|
-
context.projectsConfigurations.projects[key].targets
|
|
117364
|
-
).find((name) => name.toLowerCase() === "build");
|
|
117365
|
-
if (buildTargetName && context.projectsConfigurations.projects[key].targets[buildTargetName]?.options?.project) {
|
|
117366
|
-
const packageJson = (0, import_devkit2.readJsonFile)(
|
|
117367
|
-
context.projectsConfigurations.projects[key].targets[buildTargetName].options.project
|
|
117368
|
-
);
|
|
117369
|
-
if (packageJson?.name && !options.external.includes(packageJson.name)) {
|
|
117370
|
-
ret.push(packageJson.name);
|
|
117371
|
-
}
|
|
117372
|
-
}
|
|
117373
|
-
}
|
|
117374
|
-
return ret;
|
|
117375
|
-
},
|
|
117376
|
-
options.external
|
|
117377
|
-
);
|
|
117378
|
-
}
|
|
117379
117341
|
let externalDependencies = options.external.reduce((acc, name) => {
|
|
117380
117342
|
const externalNode = context.projectGraph.externalNodes[`npm:${name}`];
|
|
117381
117343
|
if (externalNode) {
|
|
@@ -117387,19 +117349,19 @@ ${Object.keys(options).map(
|
|
|
117387
117349
|
}
|
|
117388
117350
|
return acc;
|
|
117389
117351
|
}, []);
|
|
117390
|
-
|
|
117391
|
-
|
|
117392
|
-
|
|
117393
|
-
|
|
117394
|
-
|
|
117395
|
-
|
|
117396
|
-
|
|
117397
|
-
|
|
117352
|
+
let internalDependencies = [];
|
|
117353
|
+
for (const internalDependency of getInternalDependencies(
|
|
117354
|
+
context.projectName,
|
|
117355
|
+
context.projectGraph
|
|
117356
|
+
)) {
|
|
117357
|
+
const packageConfig = internalDependency.node.data;
|
|
117358
|
+
if (packageConfig?.packageName) {
|
|
117359
|
+
options.external.push(packageConfig.packageName);
|
|
117360
|
+
internalDependencies.push(internalDependency);
|
|
117398
117361
|
}
|
|
117399
|
-
|
|
117400
|
-
}, externalDependencies);
|
|
117362
|
+
}
|
|
117401
117363
|
if (options.bundle === false) {
|
|
117402
|
-
for (const thirdPartyDependency of (
|
|
117364
|
+
for (const thirdPartyDependency of getExternalDependencies(
|
|
117403
117365
|
context.projectName,
|
|
117404
117366
|
context.projectGraph
|
|
117405
117367
|
)) {
|
|
@@ -117435,7 +117397,7 @@ ${Object.keys(options).map(
|
|
|
117435
117397
|
delete packageJson.dependencies;
|
|
117436
117398
|
externalDependencies.forEach((entry) => {
|
|
117437
117399
|
const packageConfig = entry.node.data;
|
|
117438
|
-
if (packageConfig?.packageName &&
|
|
117400
|
+
if (packageConfig?.packageName && !!(projectGraph.externalNodes[entry.node.name]?.type === "npm")) {
|
|
117439
117401
|
const { packageName, version } = packageConfig;
|
|
117440
117402
|
if (workspacePackageJson.dependencies?.[packageName] || workspacePackageJson.devDependencies?.[packageName]) {
|
|
117441
117403
|
return;
|
|
@@ -117444,6 +117406,14 @@ ${Object.keys(options).map(
|
|
|
117444
117406
|
packageJson.dependencies[packageName] = !!projectGraph.nodes[entry.node.name] ? "latest" : version;
|
|
117445
117407
|
}
|
|
117446
117408
|
});
|
|
117409
|
+
internalDependencies.forEach((entry) => {
|
|
117410
|
+
const packageConfig = entry.node.data;
|
|
117411
|
+
if (packageConfig?.packageName) {
|
|
117412
|
+
const { packageName, version } = packageConfig;
|
|
117413
|
+
packageJson.dependencies ??= {};
|
|
117414
|
+
packageJson.dependencies[packageName] = version ? version : "latest";
|
|
117415
|
+
}
|
|
117416
|
+
});
|
|
117447
117417
|
packageJson.type = "module";
|
|
117448
117418
|
packageJson.exports ??= {
|
|
117449
117419
|
".": {
|
|
@@ -117497,7 +117467,7 @@ ${Object.keys(options).map(
|
|
|
117497
117467
|
packageJson.main ??= "dist/legacy/index.cjs";
|
|
117498
117468
|
packageJson.module ??= "dist/legacy/index.js";
|
|
117499
117469
|
options.platform && options.platform !== "node" && (packageJson.browser ??= "dist/modern/index.global.js");
|
|
117500
|
-
if (options.includeSrc
|
|
117470
|
+
if (options.includeSrc === true) {
|
|
117501
117471
|
let distSrc = sourceRoot.replace(projectRoot, "");
|
|
117502
117472
|
if (distSrc.startsWith("/")) {
|
|
117503
117473
|
distSrc = distSrc.substring(1);
|
|
@@ -117509,7 +117479,7 @@ ${Object.keys(options).map(
|
|
|
117509
117479
|
}
|
|
117510
117480
|
packageJson.sideEffects ??= false;
|
|
117511
117481
|
packageJson.files ??= ["dist/**/*"];
|
|
117512
|
-
if (options.includeSrc
|
|
117482
|
+
if (options.includeSrc === true && !packageJson.files.includes("src")) {
|
|
117513
117483
|
packageJson.files.push("src/**/*");
|
|
117514
117484
|
}
|
|
117515
117485
|
packageJson.publishConfig ??= {
|
|
@@ -117537,7 +117507,7 @@ ${Object.keys(options).map(
|
|
|
117537
117507
|
})
|
|
117538
117508
|
);
|
|
117539
117509
|
}
|
|
117540
|
-
if (options.includeSrc
|
|
117510
|
+
if (options.includeSrc === true) {
|
|
117541
117511
|
const files = globSync([
|
|
117542
117512
|
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.ts"),
|
|
117543
117513
|
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.tsx"),
|
|
@@ -117695,7 +117665,7 @@ var applyDefaultOptions = (options) => {
|
|
|
117695
117665
|
options.apiReport ??= true;
|
|
117696
117666
|
options.docModel ??= true;
|
|
117697
117667
|
options.tsdocMetadata ??= true;
|
|
117698
|
-
options.
|
|
117668
|
+
options.emitOnAll ??= true;
|
|
117699
117669
|
options.define ??= {};
|
|
117700
117670
|
options.env ??= {};
|
|
117701
117671
|
options.verbose ??= !!process.env.CI;
|
|
@@ -88611,13 +88611,14 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
|
|
|
88611
88611
|
tsConfig,
|
|
88612
88612
|
additionalEntryPoints,
|
|
88613
88613
|
platform,
|
|
88614
|
+
emitOnAll = true,
|
|
88614
88615
|
...rest
|
|
88615
88616
|
}) {
|
|
88616
88617
|
const entryPoints = [];
|
|
88617
88618
|
if (rest.entry) {
|
|
88618
88619
|
entryPoints.push(rest.entry);
|
|
88619
88620
|
}
|
|
88620
|
-
if (
|
|
88621
|
+
if (emitOnAll !== false) {
|
|
88621
88622
|
entryPoints.push((0, import_devkit.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
|
|
88622
88623
|
}
|
|
88623
88624
|
if (additionalEntryPoints) {
|
|
@@ -88629,7 +88630,7 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
|
|
|
88629
88630
|
let propertyKey = (0, import_devkit.joinPathFragments)(
|
|
88630
88631
|
filePath.path,
|
|
88631
88632
|
removeExtension(filePath.name)
|
|
88632
|
-
).replaceAll("\\", "/").replaceAll(workspaceRoot.substring(
|
|
88633
|
+
).replaceAll("\\", "/").replaceAll(workspaceRoot.substring(2).replaceAll("\\", "/"), "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
88633
88634
|
if (propertyKey) {
|
|
88634
88635
|
while (propertyKey.startsWith("/")) {
|
|
88635
88636
|
propertyKey = propertyKey.substring(1);
|
|
@@ -71,9 +71,9 @@
|
|
|
71
71
|
"description": "Should the source files be added to the distribution folder in an `src` directory.",
|
|
72
72
|
"default": false
|
|
73
73
|
},
|
|
74
|
-
"
|
|
74
|
+
"emitOnAll": {
|
|
75
75
|
"type": "boolean",
|
|
76
|
-
"description": "Should
|
|
76
|
+
"description": "Should each file contained in the package be emitted individually.",
|
|
77
77
|
"default": true
|
|
78
78
|
},
|
|
79
79
|
"generatePackageJson": {
|
|
@@ -26484,46 +26484,6 @@ var require_devkit = __commonJS({
|
|
|
26484
26484
|
}
|
|
26485
26485
|
});
|
|
26486
26486
|
|
|
26487
|
-
// node_modules/.pnpm/@nx+esbuild@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_esbuild@0.19._qd2wqrdgtfa7fy24o2frhwj6em/node_modules/@nx/esbuild/src/executors/esbuild/lib/get-extra-dependencies.js
|
|
26488
|
-
var require_get_extra_dependencies = __commonJS({
|
|
26489
|
-
"node_modules/.pnpm/@nx+esbuild@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_esbuild@0.19._qd2wqrdgtfa7fy24o2frhwj6em/node_modules/@nx/esbuild/src/executors/esbuild/lib/get-extra-dependencies.js"(exports) {
|
|
26490
|
-
"use strict";
|
|
26491
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26492
|
-
exports.getExtraDependencies = void 0;
|
|
26493
|
-
function getExtraDependencies2(projectName, graph) {
|
|
26494
|
-
const deps = /* @__PURE__ */ new Map();
|
|
26495
|
-
recur(projectName);
|
|
26496
|
-
function recur(currProjectName) {
|
|
26497
|
-
const allDeps = graph.dependencies[currProjectName];
|
|
26498
|
-
const externalDeps = allDeps.reduce((acc, node) => {
|
|
26499
|
-
const found = graph.externalNodes[node.target];
|
|
26500
|
-
if (found)
|
|
26501
|
-
acc.push(found);
|
|
26502
|
-
return acc;
|
|
26503
|
-
}, []);
|
|
26504
|
-
const internalDeps = allDeps.reduce((acc, node) => {
|
|
26505
|
-
const found = graph.nodes[node.target];
|
|
26506
|
-
if (found)
|
|
26507
|
-
acc.push(found);
|
|
26508
|
-
return acc;
|
|
26509
|
-
}, []);
|
|
26510
|
-
for (const externalDep of externalDeps) {
|
|
26511
|
-
deps.set(externalDep.name, {
|
|
26512
|
-
name: externalDep.name,
|
|
26513
|
-
outputs: [],
|
|
26514
|
-
node: externalDep
|
|
26515
|
-
});
|
|
26516
|
-
}
|
|
26517
|
-
for (const internalDep of internalDeps) {
|
|
26518
|
-
recur(internalDep.name);
|
|
26519
|
-
}
|
|
26520
|
-
}
|
|
26521
|
-
return Array.from(deps.values());
|
|
26522
|
-
}
|
|
26523
|
-
exports.getExtraDependencies = getExtraDependencies2;
|
|
26524
|
-
}
|
|
26525
|
-
});
|
|
26526
|
-
|
|
26527
26487
|
// node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/package.json
|
|
26528
26488
|
var require_package2 = __commonJS({
|
|
26529
26489
|
"node_modules/.pnpm/@nx+js@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_typescript@5.2.2_verdaccio@5.27.0/node_modules/@nx/js/package.json"(exports, module2) {
|
|
@@ -110772,7 +110732,6 @@ ${commentStart} ----------------------------------------------------------------
|
|
|
110772
110732
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
110773
110733
|
var import_esbuild_decorators = __toESM(require_src());
|
|
110774
110734
|
var import_devkit2 = __toESM(require_devkit());
|
|
110775
|
-
var import_get_extra_dependencies = __toESM(require_get_extra_dependencies());
|
|
110776
110735
|
var import_js = __toESM(require_src2());
|
|
110777
110736
|
var import_normalize_options = __toESM(require_normalize_options());
|
|
110778
110737
|
var import_tsc = __toESM(require_tsc_impl());
|
|
@@ -117010,6 +116969,30 @@ var removeExtension = (filePath) => {
|
|
|
117010
116969
|
return filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
|
|
117011
116970
|
};
|
|
117012
116971
|
|
|
116972
|
+
// packages/workspace-tools/src/utils/get-project-deps.ts
|
|
116973
|
+
function getInternalDependencies(projectName, graph) {
|
|
116974
|
+
const allDeps = graph.dependencies[projectName];
|
|
116975
|
+
return Array.from(
|
|
116976
|
+
allDeps.reduce((acc, node) => {
|
|
116977
|
+
const found = graph.nodes[node.target];
|
|
116978
|
+
if (found)
|
|
116979
|
+
acc.push(found);
|
|
116980
|
+
return acc;
|
|
116981
|
+
}, [])
|
|
116982
|
+
);
|
|
116983
|
+
}
|
|
116984
|
+
function getExternalDependencies(projectName, graph) {
|
|
116985
|
+
const allDeps = graph.dependencies[projectName];
|
|
116986
|
+
return Array.from(
|
|
116987
|
+
allDeps.reduce((acc, node) => {
|
|
116988
|
+
const found = graph.externalNodes[node.target];
|
|
116989
|
+
if (found)
|
|
116990
|
+
acc.push(found);
|
|
116991
|
+
return acc;
|
|
116992
|
+
}, [])
|
|
116993
|
+
);
|
|
116994
|
+
}
|
|
116995
|
+
|
|
117013
116996
|
// packages/workspace-tools/src/executors/tsup/get-config.ts
|
|
117014
116997
|
var import_devkit = __toESM(require_devkit());
|
|
117015
116998
|
var import_tsup = __toESM(require_dist6());
|
|
@@ -117245,13 +117228,14 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
|
|
|
117245
117228
|
tsConfig,
|
|
117246
117229
|
additionalEntryPoints,
|
|
117247
117230
|
platform,
|
|
117231
|
+
emitOnAll = true,
|
|
117248
117232
|
...rest
|
|
117249
117233
|
}) {
|
|
117250
117234
|
const entryPoints = [];
|
|
117251
117235
|
if (rest.entry) {
|
|
117252
117236
|
entryPoints.push(rest.entry);
|
|
117253
117237
|
}
|
|
117254
|
-
if (
|
|
117238
|
+
if (emitOnAll !== false) {
|
|
117255
117239
|
entryPoints.push((0, import_devkit.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
|
|
117256
117240
|
}
|
|
117257
117241
|
if (additionalEntryPoints) {
|
|
@@ -117263,7 +117247,7 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
|
|
|
117263
117247
|
let propertyKey = (0, import_devkit.joinPathFragments)(
|
|
117264
117248
|
filePath.path,
|
|
117265
117249
|
removeExtension(filePath.name)
|
|
117266
|
-
).replaceAll("\\", "/").replaceAll(workspaceRoot.substring(
|
|
117250
|
+
).replaceAll("\\", "/").replaceAll(workspaceRoot.substring(2).replaceAll("\\", "/"), "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
117267
117251
|
if (propertyKey) {
|
|
117268
117252
|
while (propertyKey.startsWith("/")) {
|
|
117269
117253
|
propertyKey = propertyKey.substring(1);
|
|
@@ -117356,7 +117340,7 @@ ${Object.keys(options).map(
|
|
|
117356
117340
|
output: "."
|
|
117357
117341
|
});
|
|
117358
117342
|
}
|
|
117359
|
-
if (options.includeSrc
|
|
117343
|
+
if (options.includeSrc === true) {
|
|
117360
117344
|
assets.push({
|
|
117361
117345
|
input: sourceRoot,
|
|
117362
117346
|
glob: "**/{*.ts,*.tsx,*.js,*.jsx}",
|
|
@@ -117385,28 +117369,6 @@ ${Object.keys(options).map(
|
|
|
117385
117369
|
options.external
|
|
117386
117370
|
);
|
|
117387
117371
|
}
|
|
117388
|
-
const implicitDependencies = context.projectsConfigurations.projects[context.projectName].implicitDependencies;
|
|
117389
|
-
if (implicitDependencies && implicitDependencies.length > 0) {
|
|
117390
|
-
options.external = implicitDependencies.reduce(
|
|
117391
|
-
(ret, key) => {
|
|
117392
|
-
if (Object.keys(context.projectsConfigurations.projects[key]?.targets).length > 0) {
|
|
117393
|
-
const buildTargetName = Object.keys(
|
|
117394
|
-
context.projectsConfigurations.projects[key].targets
|
|
117395
|
-
).find((name) => name.toLowerCase() === "build");
|
|
117396
|
-
if (buildTargetName && context.projectsConfigurations.projects[key].targets[buildTargetName]?.options?.project) {
|
|
117397
|
-
const packageJson = (0, import_devkit2.readJsonFile)(
|
|
117398
|
-
context.projectsConfigurations.projects[key].targets[buildTargetName].options.project
|
|
117399
|
-
);
|
|
117400
|
-
if (packageJson?.name && !options.external.includes(packageJson.name)) {
|
|
117401
|
-
ret.push(packageJson.name);
|
|
117402
|
-
}
|
|
117403
|
-
}
|
|
117404
|
-
}
|
|
117405
|
-
return ret;
|
|
117406
|
-
},
|
|
117407
|
-
options.external
|
|
117408
|
-
);
|
|
117409
|
-
}
|
|
117410
117372
|
let externalDependencies = options.external.reduce((acc, name) => {
|
|
117411
117373
|
const externalNode = context.projectGraph.externalNodes[`npm:${name}`];
|
|
117412
117374
|
if (externalNode) {
|
|
@@ -117418,19 +117380,19 @@ ${Object.keys(options).map(
|
|
|
117418
117380
|
}
|
|
117419
117381
|
return acc;
|
|
117420
117382
|
}, []);
|
|
117421
|
-
|
|
117422
|
-
|
|
117423
|
-
|
|
117424
|
-
|
|
117425
|
-
|
|
117426
|
-
|
|
117427
|
-
|
|
117428
|
-
|
|
117383
|
+
let internalDependencies = [];
|
|
117384
|
+
for (const internalDependency of getInternalDependencies(
|
|
117385
|
+
context.projectName,
|
|
117386
|
+
context.projectGraph
|
|
117387
|
+
)) {
|
|
117388
|
+
const packageConfig = internalDependency.node.data;
|
|
117389
|
+
if (packageConfig?.packageName) {
|
|
117390
|
+
options.external.push(packageConfig.packageName);
|
|
117391
|
+
internalDependencies.push(internalDependency);
|
|
117429
117392
|
}
|
|
117430
|
-
|
|
117431
|
-
}, externalDependencies);
|
|
117393
|
+
}
|
|
117432
117394
|
if (options.bundle === false) {
|
|
117433
|
-
for (const thirdPartyDependency of (
|
|
117395
|
+
for (const thirdPartyDependency of getExternalDependencies(
|
|
117434
117396
|
context.projectName,
|
|
117435
117397
|
context.projectGraph
|
|
117436
117398
|
)) {
|
|
@@ -117466,7 +117428,7 @@ ${Object.keys(options).map(
|
|
|
117466
117428
|
delete packageJson.dependencies;
|
|
117467
117429
|
externalDependencies.forEach((entry) => {
|
|
117468
117430
|
const packageConfig = entry.node.data;
|
|
117469
|
-
if (packageConfig?.packageName &&
|
|
117431
|
+
if (packageConfig?.packageName && !!(projectGraph.externalNodes[entry.node.name]?.type === "npm")) {
|
|
117470
117432
|
const { packageName, version } = packageConfig;
|
|
117471
117433
|
if (workspacePackageJson.dependencies?.[packageName] || workspacePackageJson.devDependencies?.[packageName]) {
|
|
117472
117434
|
return;
|
|
@@ -117475,6 +117437,14 @@ ${Object.keys(options).map(
|
|
|
117475
117437
|
packageJson.dependencies[packageName] = !!projectGraph.nodes[entry.node.name] ? "latest" : version;
|
|
117476
117438
|
}
|
|
117477
117439
|
});
|
|
117440
|
+
internalDependencies.forEach((entry) => {
|
|
117441
|
+
const packageConfig = entry.node.data;
|
|
117442
|
+
if (packageConfig?.packageName) {
|
|
117443
|
+
const { packageName, version } = packageConfig;
|
|
117444
|
+
packageJson.dependencies ??= {};
|
|
117445
|
+
packageJson.dependencies[packageName] = version ? version : "latest";
|
|
117446
|
+
}
|
|
117447
|
+
});
|
|
117478
117448
|
packageJson.type = "module";
|
|
117479
117449
|
packageJson.exports ??= {
|
|
117480
117450
|
".": {
|
|
@@ -117528,7 +117498,7 @@ ${Object.keys(options).map(
|
|
|
117528
117498
|
packageJson.main ??= "dist/legacy/index.cjs";
|
|
117529
117499
|
packageJson.module ??= "dist/legacy/index.js";
|
|
117530
117500
|
options.platform && options.platform !== "node" && (packageJson.browser ??= "dist/modern/index.global.js");
|
|
117531
|
-
if (options.includeSrc
|
|
117501
|
+
if (options.includeSrc === true) {
|
|
117532
117502
|
let distSrc = sourceRoot.replace(projectRoot, "");
|
|
117533
117503
|
if (distSrc.startsWith("/")) {
|
|
117534
117504
|
distSrc = distSrc.substring(1);
|
|
@@ -117540,7 +117510,7 @@ ${Object.keys(options).map(
|
|
|
117540
117510
|
}
|
|
117541
117511
|
packageJson.sideEffects ??= false;
|
|
117542
117512
|
packageJson.files ??= ["dist/**/*"];
|
|
117543
|
-
if (options.includeSrc
|
|
117513
|
+
if (options.includeSrc === true && !packageJson.files.includes("src")) {
|
|
117544
117514
|
packageJson.files.push("src/**/*");
|
|
117545
117515
|
}
|
|
117546
117516
|
packageJson.publishConfig ??= {
|
|
@@ -117568,7 +117538,7 @@ ${Object.keys(options).map(
|
|
|
117568
117538
|
})
|
|
117569
117539
|
);
|
|
117570
117540
|
}
|
|
117571
|
-
if (options.includeSrc
|
|
117541
|
+
if (options.includeSrc === true) {
|
|
117572
117542
|
const files = globSync([
|
|
117573
117543
|
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.ts"),
|
|
117574
117544
|
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.tsx"),
|
|
@@ -117726,7 +117696,7 @@ var applyDefaultOptions = (options) => {
|
|
|
117726
117696
|
options.apiReport ??= true;
|
|
117727
117697
|
options.docModel ??= true;
|
|
117728
117698
|
options.tsdocMetadata ??= true;
|
|
117729
|
-
options.
|
|
117699
|
+
options.emitOnAll ??= true;
|
|
117730
117700
|
options.define ??= {};
|
|
117731
117701
|
options.env ??= {};
|
|
117732
117702
|
options.verbose ??= !!process.env.CI;
|