@storm-software/workspace-tools 1.39.0 → 1.40.1
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 +21 -0
- package/README.md +2 -1
- package/index.js +133 -197
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +38 -72
- package/src/executors/tsup/executor.js +94 -141
- package/src/executors/tsup-browser/executor.js +99 -152
- package/src/executors/tsup-neutral/executor.js +96 -142
- package/src/executors/tsup-node/executor.js +95 -141
- package/src/generators/browser-library/generator.js +35 -49
- package/src/generators/config-schema/generator.js +17 -31
- package/src/generators/neutral-library/generator.js +35 -49
- package/src/generators/node-library/generator.js +35 -49
- package/src/generators/preset/generator.js +36 -55
|
@@ -41898,9 +41898,9 @@ var require_generator = __commonJS({
|
|
|
41898
41898
|
}
|
|
41899
41899
|
});
|
|
41900
41900
|
|
|
41901
|
-
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
41901
|
+
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_verdaccio@5.27.0/node_modules/@nx/eslint/src/utils/flat-config.js
|
|
41902
41902
|
var require_flat_config = __commonJS({
|
|
41903
|
-
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
41903
|
+
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_verdaccio@5.27.0/node_modules/@nx/eslint/src/utils/flat-config.js"(exports) {
|
|
41904
41904
|
"use strict";
|
|
41905
41905
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41906
41906
|
exports.useFlatConfig = void 0;
|
|
@@ -41911,9 +41911,9 @@ var require_flat_config = __commonJS({
|
|
|
41911
41911
|
}
|
|
41912
41912
|
});
|
|
41913
41913
|
|
|
41914
|
-
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
41914
|
+
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_verdaccio@5.27.0/node_modules/@nx/eslint/src/generators/utils/flat-config/ast-utils.js
|
|
41915
41915
|
var require_ast_utils2 = __commonJS({
|
|
41916
|
-
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
41916
|
+
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_verdaccio@5.27.0/node_modules/@nx/eslint/src/generators/utils/flat-config/ast-utils.js"(exports) {
|
|
41917
41917
|
"use strict";
|
|
41918
41918
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41919
41919
|
exports.generateAst = exports.mapFilePath = exports.mapFilePaths = exports.generateFlatOverride = exports.generateRequire = exports.stringifyNodeList = exports.generatePluginExtendsElement = exports.generateSpreadElement = exports.createNodeList = exports.addCompatToFlatConfig = exports.addPluginsToExportsBlock = exports.removeCompatExtends = exports.removePlugin = exports.addBlockToFlatConfigExport = exports.addImportToFlatConfig = exports.replaceOverride = exports.hasOverride = exports.removeOverridesFromLintConfig = void 0;
|
|
@@ -42385,9 +42385,9 @@ const compat = new FlatCompat({
|
|
|
42385
42385
|
}
|
|
42386
42386
|
});
|
|
42387
42387
|
|
|
42388
|
-
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
42388
|
+
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_verdaccio@5.27.0/node_modules/@nx/eslint/src/generators/utils/eslint-file.js
|
|
42389
42389
|
var require_eslint_file = __commonJS({
|
|
42390
|
-
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
42390
|
+
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_verdaccio@5.27.0/node_modules/@nx/eslint/src/generators/utils/eslint-file.js"(exports) {
|
|
42391
42391
|
"use strict";
|
|
42392
42392
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42393
42393
|
exports.getPluginImport = exports.addIgnoresToLintConfig = exports.addPluginsToLintConfig = exports.addExtendsToLintConfig = exports.replaceOverridesInLintConfig = exports.lintConfigHasOverride = exports.updateOverrideInLintConfig = exports.addOverrideToLintConfig = exports.updateRelativePathsInConfig = exports.isEslintConfigSupported = exports.findEslintFile = exports.baseEsLintFlatConfigFile = exports.baseEsLintConfigFile = exports.eslintConfigFileWhitelist = void 0;
|
|
@@ -42646,9 +42646,9 @@ var require_eslint_file = __commonJS({
|
|
|
42646
42646
|
}
|
|
42647
42647
|
});
|
|
42648
42648
|
|
|
42649
|
-
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
42649
|
+
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_verdaccio@5.27.0/node_modules/@nx/eslint/package.json
|
|
42650
42650
|
var require_package4 = __commonJS({
|
|
42651
|
-
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
42651
|
+
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_verdaccio@5.27.0/node_modules/@nx/eslint/package.json"(exports, module2) {
|
|
42652
42652
|
module2.exports = {
|
|
42653
42653
|
name: "@nx/eslint",
|
|
42654
42654
|
version: "17.0.3",
|
|
@@ -42703,9 +42703,9 @@ var require_package4 = __commonJS({
|
|
|
42703
42703
|
}
|
|
42704
42704
|
});
|
|
42705
42705
|
|
|
42706
|
-
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
42706
|
+
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_verdaccio@5.27.0/node_modules/@nx/eslint/src/utils/versions.js
|
|
42707
42707
|
var require_versions4 = __commonJS({
|
|
42708
|
-
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
42708
|
+
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_verdaccio@5.27.0/node_modules/@nx/eslint/src/utils/versions.js"(exports) {
|
|
42709
42709
|
"use strict";
|
|
42710
42710
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42711
42711
|
exports.typescriptESLintVersion = exports.eslintConfigPrettierVersion = exports.eslintrcVersion = exports.eslintVersion = exports.nxVersion = void 0;
|
|
@@ -42717,9 +42717,9 @@ var require_versions4 = __commonJS({
|
|
|
42717
42717
|
}
|
|
42718
42718
|
});
|
|
42719
42719
|
|
|
42720
|
-
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
42720
|
+
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_verdaccio@5.27.0/node_modules/@nx/eslint/src/generators/init/global-eslint-config.js
|
|
42721
42721
|
var require_global_eslint_config = __commonJS({
|
|
42722
|
-
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
42722
|
+
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_verdaccio@5.27.0/node_modules/@nx/eslint/src/generators/init/global-eslint-config.js"(exports) {
|
|
42723
42723
|
"use strict";
|
|
42724
42724
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42725
42725
|
exports.getGlobalFlatEslintConfiguration = exports.getGlobalEsLintConfiguration = exports.javaScriptOverride = exports.typeScriptOverride = void 0;
|
|
@@ -42805,9 +42805,9 @@ var require_global_eslint_config = __commonJS({
|
|
|
42805
42805
|
}
|
|
42806
42806
|
});
|
|
42807
42807
|
|
|
42808
|
-
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
42808
|
+
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_verdaccio@5.27.0/node_modules/@nx/eslint/src/generators/init/init.js
|
|
42809
42809
|
var require_init2 = __commonJS({
|
|
42810
|
-
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
42810
|
+
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_verdaccio@5.27.0/node_modules/@nx/eslint/src/generators/init/init.js"(exports) {
|
|
42811
42811
|
"use strict";
|
|
42812
42812
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42813
42813
|
exports.lintInitGenerator = void 0;
|
|
@@ -42871,9 +42871,9 @@ var require_init2 = __commonJS({
|
|
|
42871
42871
|
}
|
|
42872
42872
|
});
|
|
42873
42873
|
|
|
42874
|
-
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
42874
|
+
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_verdaccio@5.27.0/node_modules/@nx/eslint/src/generators/init/init-migration.js
|
|
42875
42875
|
var require_init_migration = __commonJS({
|
|
42876
|
-
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
42876
|
+
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_verdaccio@5.27.0/node_modules/@nx/eslint/src/generators/init/init-migration.js"(exports) {
|
|
42877
42877
|
"use strict";
|
|
42878
42878
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42879
42879
|
exports.findLintTarget = exports.migrateConfigToMonorepoStyle = void 0;
|
|
@@ -42962,9 +42962,9 @@ var require_init_migration = __commonJS({
|
|
|
42962
42962
|
}
|
|
42963
42963
|
});
|
|
42964
42964
|
|
|
42965
|
-
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
42965
|
+
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_verdaccio@5.27.0/node_modules/@nx/eslint/src/generators/lint-project/lint-project.js
|
|
42966
42966
|
var require_lint_project = __commonJS({
|
|
42967
|
-
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
42967
|
+
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.0_nx@17.0.3_verdaccio@5.27.0/node_modules/@nx/eslint/src/generators/lint-project/lint-project.js"(exports) {
|
|
42968
42968
|
"use strict";
|
|
42969
42969
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42970
42970
|
exports.lintProjectGenerator = exports.mapLintPattern = void 0;
|
|
@@ -132064,6 +132064,8 @@ ${commentStart} ----------------------------------------------------------------
|
|
|
132064
132064
|
};
|
|
132065
132065
|
|
|
132066
132066
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
132067
|
+
var import_fs4 = require("fs");
|
|
132068
|
+
var import_path4 = require("path");
|
|
132067
132069
|
var import_esbuild_decorators = __toESM(require_src());
|
|
132068
132070
|
var import_devkit2 = __toESM(require_devkit());
|
|
132069
132071
|
var import_js = __toESM(require_src2());
|
|
@@ -132112,7 +132114,6 @@ var environmentPlugin = (data) => ({
|
|
|
132112
132114
|
});
|
|
132113
132115
|
|
|
132114
132116
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
132115
|
-
var import_fs4 = require("fs");
|
|
132116
132117
|
var import_fs_extra = __toESM(require_lib6());
|
|
132117
132118
|
var import_promises2 = require("fs/promises");
|
|
132118
132119
|
|
|
@@ -138292,7 +138293,6 @@ glob.glob = glob;
|
|
|
138292
138293
|
|
|
138293
138294
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
138294
138295
|
var import_fileutils = require("nx/src/utils/fileutils");
|
|
138295
|
-
var import_path4 = require("path");
|
|
138296
138296
|
var import_prettier = require("prettier");
|
|
138297
138297
|
var import_tsup = __toESM(require_dist6());
|
|
138298
138298
|
var ts = __toESM(require("typescript"));
|
|
@@ -138329,15 +138329,7 @@ function defaultConfig({
|
|
|
138329
138329
|
name: "default",
|
|
138330
138330
|
entry,
|
|
138331
138331
|
format: format2,
|
|
138332
|
-
target: platform !== "node" ? [
|
|
138333
|
-
"chrome91",
|
|
138334
|
-
"firefox90",
|
|
138335
|
-
"edge91",
|
|
138336
|
-
"safari15",
|
|
138337
|
-
"ios15",
|
|
138338
|
-
"opera77",
|
|
138339
|
-
"esnext"
|
|
138340
|
-
] : ["esnext", "node20"],
|
|
138332
|
+
target: platform !== "node" ? ["chrome91", "firefox90", "edge91", "safari15", "ios15", "opera77", "esnext"] : ["esnext", "node20"],
|
|
138341
138333
|
tsconfig,
|
|
138342
138334
|
splitting,
|
|
138343
138335
|
generatePackageJson,
|
|
@@ -138366,13 +138358,7 @@ function defaultConfig({
|
|
|
138366
138358
|
}
|
|
138367
138359
|
}
|
|
138368
138360
|
},
|
|
138369
|
-
|
|
138370
|
-
terserOptions: {
|
|
138371
|
-
compress: true,
|
|
138372
|
-
ecma: 2020,
|
|
138373
|
-
keep_classnames: true,
|
|
138374
|
-
keep_fnames: true
|
|
138375
|
-
},*/
|
|
138361
|
+
minify: false,
|
|
138376
138362
|
apiReport,
|
|
138377
138363
|
docModel,
|
|
138378
138364
|
tsdocMetadata,
|
|
@@ -138384,13 +138370,7 @@ function defaultConfig({
|
|
|
138384
138370
|
outExtension
|
|
138385
138371
|
};
|
|
138386
138372
|
}
|
|
138387
|
-
function getConfig(workspaceRoot, projectRoot, getConfigFn, {
|
|
138388
|
-
outputPath,
|
|
138389
|
-
tsConfig,
|
|
138390
|
-
additionalEntryPoints,
|
|
138391
|
-
platform,
|
|
138392
|
-
...rest
|
|
138393
|
-
}) {
|
|
138373
|
+
function getConfig(workspaceRoot, projectRoot, getConfigFn, { outputPath, tsConfig, additionalEntryPoints, platform, ...rest }) {
|
|
138394
138374
|
return getConfigFn({
|
|
138395
138375
|
...rest,
|
|
138396
138376
|
outDir: outputPath,
|
|
@@ -138505,9 +138485,7 @@ ${Object.keys(options).map(
|
|
|
138505
138485
|
}
|
|
138506
138486
|
const pathToPackageJson = (0, import_path4.join)(context.root, projectRoot, "package.json");
|
|
138507
138487
|
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit2.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
|
|
138508
|
-
const workspacePackageJson = (0, import_devkit2.readJsonFile)(
|
|
138509
|
-
(0, import_path4.join)(workspaceRoot, "package.json")
|
|
138510
|
-
);
|
|
138488
|
+
const workspacePackageJson = (0, import_devkit2.readJsonFile)((0, import_path4.join)(workspaceRoot, "package.json"));
|
|
138511
138489
|
options.external = options.external || [];
|
|
138512
138490
|
if (workspacePackageJson?.dependencies) {
|
|
138513
138491
|
options.external = Object.keys(workspacePackageJson?.dependencies).reduce(
|
|
@@ -138520,42 +138498,40 @@ ${Object.keys(options).map(
|
|
|
138520
138498
|
options.external
|
|
138521
138499
|
);
|
|
138522
138500
|
}
|
|
138523
|
-
|
|
138524
|
-
|
|
138525
|
-
|
|
138526
|
-
|
|
138527
|
-
|
|
138528
|
-
|
|
138529
|
-
|
|
138530
|
-
|
|
138531
|
-
|
|
138501
|
+
const externalDependencies = options.external.reduce(
|
|
138502
|
+
(ret, name) => {
|
|
138503
|
+
if (!packageJson?.devDependencies?.[name]) {
|
|
138504
|
+
const externalNode = context.projectGraph.externalNodes[`npm:${name}`];
|
|
138505
|
+
if (externalNode) {
|
|
138506
|
+
ret.push({
|
|
138507
|
+
name,
|
|
138508
|
+
outputs: [],
|
|
138509
|
+
node: externalNode
|
|
138510
|
+
});
|
|
138511
|
+
}
|
|
138532
138512
|
}
|
|
138533
|
-
|
|
138534
|
-
|
|
138535
|
-
|
|
138513
|
+
return ret;
|
|
138514
|
+
},
|
|
138515
|
+
[]
|
|
138516
|
+
);
|
|
138536
138517
|
const implicitDependencies = context.projectsConfigurations.projects[context.projectName].implicitDependencies;
|
|
138537
138518
|
const internalDependencies = [];
|
|
138538
138519
|
const projectConfigs = await Promise.resolve(getProjectConfigurations());
|
|
138539
138520
|
console.log("Project Configs:");
|
|
138540
138521
|
console.log(projectConfigs);
|
|
138541
138522
|
if (implicitDependencies && implicitDependencies.length > 0) {
|
|
138542
|
-
options.external = implicitDependencies.reduce(
|
|
138543
|
-
(
|
|
138544
|
-
|
|
138545
|
-
|
|
138546
|
-
|
|
138547
|
-
|
|
138548
|
-
|
|
138549
|
-
);
|
|
138550
|
-
if (projectPackageJson?.name && !options.external.includes(projectPackageJson.name)) {
|
|
138551
|
-
ret.push(projectPackageJson.name);
|
|
138552
|
-
internalDependencies.push(projectPackageJson.name);
|
|
138553
|
-
}
|
|
138523
|
+
options.external = implicitDependencies.reduce((ret, key) => {
|
|
138524
|
+
console.log(`\u26A1 Adding implicit dependency: ${key}`);
|
|
138525
|
+
const projectConfig = projectConfigs[key];
|
|
138526
|
+
if (projectConfig?.targets?.build) {
|
|
138527
|
+
const projectPackageJson = (0, import_devkit2.readJsonFile)(projectConfig.targets?.build.options.project);
|
|
138528
|
+
if (projectPackageJson?.name && !options.external.includes(projectPackageJson.name)) {
|
|
138529
|
+
ret.push(projectPackageJson.name);
|
|
138530
|
+
internalDependencies.push(projectPackageJson.name);
|
|
138554
138531
|
}
|
|
138555
|
-
|
|
138556
|
-
|
|
138557
|
-
|
|
138558
|
-
);
|
|
138532
|
+
}
|
|
138533
|
+
return ret;
|
|
138534
|
+
}, options.external);
|
|
138559
138535
|
}
|
|
138560
138536
|
if (options.bundle === false) {
|
|
138561
138537
|
for (const thirdPartyDependency of getExternalDependencies(
|
|
@@ -138606,10 +138582,7 @@ ${externalDependencies.map((dep) => {
|
|
|
138606
138582
|
if (formattedPath.toUpperCase().startsWith("C:")) {
|
|
138607
138583
|
formattedPath = formattedPath.substring(2);
|
|
138608
138584
|
}
|
|
138609
|
-
let propertyKey = (0, import_devkit2.joinPathFragments)(
|
|
138610
|
-
filePath.path,
|
|
138611
|
-
removeExtension(filePath.name)
|
|
138612
|
-
).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
138585
|
+
let propertyKey = (0, import_devkit2.joinPathFragments)(filePath.path, removeExtension(filePath.name)).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
138613
138586
|
if (propertyKey) {
|
|
138614
138587
|
while (propertyKey.startsWith("/")) {
|
|
138615
138588
|
propertyKey = propertyKey.substring(1);
|
|
@@ -138628,24 +138601,24 @@ ${externalDependencies.map((dep) => {
|
|
|
138628
138601
|
}, {});
|
|
138629
138602
|
if (options.generatePackageJson !== false) {
|
|
138630
138603
|
const projectGraph = (0, import_devkit2.readCachedProjectGraph)();
|
|
138631
|
-
|
|
138632
|
-
|
|
138604
|
+
packageJson.dependencies = void 0;
|
|
138605
|
+
for (const externalDependency of externalDependencies) {
|
|
138633
138606
|
const packageConfig = externalDependency.node.data;
|
|
138634
138607
|
if (packageConfig?.packageName && !!(projectGraph.externalNodes[externalDependency.node.name]?.type === "npm")) {
|
|
138635
138608
|
const { packageName, version } = packageConfig;
|
|
138636
138609
|
if (workspacePackageJson.dependencies?.[packageName] || workspacePackageJson.devDependencies?.[packageName] || packageJson?.devDependencies?.[packageName]) {
|
|
138637
|
-
return;
|
|
138610
|
+
return null;
|
|
138638
138611
|
}
|
|
138639
138612
|
packageJson.dependencies ??= {};
|
|
138640
|
-
packageJson.dependencies[packageName] =
|
|
138613
|
+
packageJson.dependencies[packageName] = projectGraph.nodes[externalDependency.node.name] ? "latest" : version;
|
|
138641
138614
|
}
|
|
138642
|
-
}
|
|
138643
|
-
|
|
138615
|
+
}
|
|
138616
|
+
for (const packageName of internalDependencies) {
|
|
138644
138617
|
if (!packageJson?.devDependencies?.[packageName]) {
|
|
138645
138618
|
packageJson.dependencies ??= {};
|
|
138646
138619
|
packageJson.dependencies[packageName] = "latest";
|
|
138647
138620
|
}
|
|
138648
|
-
}
|
|
138621
|
+
}
|
|
138649
138622
|
const distPaths = !options?.getConfig || _isFunction(options.getConfig) ? ["dist/"] : Object.keys(options.getConfig).map((key) => `${key}/`);
|
|
138650
138623
|
packageJson.type = "module";
|
|
138651
138624
|
if (distPaths.length > 0) {
|
|
@@ -138678,30 +138651,27 @@ ${externalDependencies.map((dep) => {
|
|
|
138678
138651
|
},
|
|
138679
138652
|
"./package.json": "./package.json"
|
|
138680
138653
|
};
|
|
138681
|
-
packageJson.exports = Object.keys(entry).reduce(
|
|
138682
|
-
|
|
138683
|
-
|
|
138684
|
-
|
|
138685
|
-
|
|
138686
|
-
|
|
138687
|
-
|
|
138688
|
-
|
|
138689
|
-
|
|
138690
|
-
|
|
138691
|
-
|
|
138692
|
-
|
|
138693
|
-
|
|
138694
|
-
|
|
138695
|
-
|
|
138696
|
-
|
|
138697
|
-
|
|
138698
|
-
|
|
138699
|
-
|
|
138700
|
-
|
|
138701
|
-
|
|
138702
|
-
},
|
|
138703
|
-
packageJson.exports
|
|
138704
|
-
);
|
|
138654
|
+
packageJson.exports = Object.keys(entry).reduce((ret, key) => {
|
|
138655
|
+
let packageJsonKey = key.startsWith("./") ? key : `./${key}`;
|
|
138656
|
+
packageJsonKey = packageJsonKey.replaceAll("/index", "");
|
|
138657
|
+
if (!ret[packageJsonKey]) {
|
|
138658
|
+
ret[packageJsonKey] = {
|
|
138659
|
+
import: {
|
|
138660
|
+
types: `./${distPaths[0]}index.d.ts`,
|
|
138661
|
+
default: `./${distPaths[0]}${key}.js`
|
|
138662
|
+
},
|
|
138663
|
+
require: {
|
|
138664
|
+
types: `./${distPaths[0]}index.d.cts`,
|
|
138665
|
+
default: `./${distPaths[0]}${key}.cjs`
|
|
138666
|
+
},
|
|
138667
|
+
default: {
|
|
138668
|
+
types: `./${distPaths[0]}index.d.ts`,
|
|
138669
|
+
default: `./${distPaths[0]}${key}.js`
|
|
138670
|
+
}
|
|
138671
|
+
};
|
|
138672
|
+
}
|
|
138673
|
+
return ret;
|
|
138674
|
+
}, packageJson.exports);
|
|
138705
138675
|
packageJson.funding ??= workspacePackageJson.funding;
|
|
138706
138676
|
packageJson.types ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
|
|
138707
138677
|
packageJson.typings ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
|
|
@@ -138710,16 +138680,15 @@ ${externalDependencies.map((dep) => {
|
|
|
138710
138680
|
};
|
|
138711
138681
|
packageJson.main ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.cjs`;
|
|
138712
138682
|
packageJson.module ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.js`;
|
|
138713
|
-
options.platform && options.platform !== "node"
|
|
138683
|
+
if (options.platform && options.platform !== "node") {
|
|
138684
|
+
packageJson.browser ??= `${distPaths[0]}index.global.js`;
|
|
138685
|
+
}
|
|
138714
138686
|
if (options.includeSrc === true) {
|
|
138715
138687
|
let distSrc = sourceRoot.replace(projectRoot, "");
|
|
138716
138688
|
if (distSrc.startsWith("/")) {
|
|
138717
138689
|
distSrc = distSrc.substring(1);
|
|
138718
138690
|
}
|
|
138719
|
-
packageJson.source ??= `${(0, import_path4.join)(distSrc, "index.ts").replaceAll(
|
|
138720
|
-
"\\",
|
|
138721
|
-
"/"
|
|
138722
|
-
)}`;
|
|
138691
|
+
packageJson.source ??= `${(0, import_path4.join)(distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
138723
138692
|
}
|
|
138724
138693
|
packageJson.sideEffects ??= false;
|
|
138725
138694
|
packageJson.files ??= ["dist/**/*"];
|
|
@@ -138738,11 +138707,7 @@ ${externalDependencies.map((dep) => {
|
|
|
138738
138707
|
packageJson.keywords ??= workspacePackageJson.keywords;
|
|
138739
138708
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
138740
138709
|
packageJson.repository.directory ??= projectRoot ? projectRoot : (0, import_path4.join)("packages", context.projectName);
|
|
138741
|
-
const packageJsonPath = (0, import_path4.join)(
|
|
138742
|
-
context.root,
|
|
138743
|
-
options.outputPath,
|
|
138744
|
-
"package.json"
|
|
138745
|
-
);
|
|
138710
|
+
const packageJsonPath = (0, import_path4.join)(context.root, options.outputPath, "package.json");
|
|
138746
138711
|
console.log(`\u26A1 Writing package.json file to: ${packageJsonPath}`);
|
|
138747
138712
|
(0, import_fs4.writeFileSync)(
|
|
138748
138713
|
packageJsonPath,
|
|
@@ -138806,7 +138771,7 @@ ${(0, import_fs4.readFileSync)(file, "utf-8")}`,
|
|
|
138806
138771
|
...options,
|
|
138807
138772
|
watch: false,
|
|
138808
138773
|
main: options.entry,
|
|
138809
|
-
transformers: []
|
|
138774
|
+
transformers: ["typia/lib/transform"]
|
|
138810
138775
|
},
|
|
138811
138776
|
context.root,
|
|
138812
138777
|
sourceRoot,
|
|
@@ -138842,9 +138807,7 @@ ${options.banner}
|
|
|
138842
138807
|
await build(config);
|
|
138843
138808
|
}
|
|
138844
138809
|
} else {
|
|
138845
|
-
console.log(
|
|
138846
|
-
"The Build process did not run because no `getConfig` parameter was provided"
|
|
138847
|
-
);
|
|
138810
|
+
console.log("The Build process did not run because no `getConfig` parameter was provided");
|
|
138848
138811
|
}
|
|
138849
138812
|
console.log("\u26A1 The Build process has completed successfully");
|
|
138850
138813
|
return {
|
|
@@ -138872,11 +138835,8 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
138872
138835
|
esModuleInterop: true,
|
|
138873
138836
|
downlevelIteration: true,
|
|
138874
138837
|
forceConsistentCasingInFileNames: true,
|
|
138875
|
-
strict: true,
|
|
138876
|
-
skipLibCheck: true,
|
|
138877
138838
|
declaration: true,
|
|
138878
138839
|
declarationMap: true,
|
|
138879
|
-
emitDeclarationOnly: true,
|
|
138880
138840
|
declarationDir: (0, import_path4.join)(workspaceRoot, "tmp", ".tsup", "declaration")
|
|
138881
138841
|
}
|
|
138882
138842
|
},
|
|
@@ -138885,10 +138845,7 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
138885
138845
|
);
|
|
138886
138846
|
tsConfig.options.pathsBasePath = workspaceRoot;
|
|
138887
138847
|
if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {
|
|
138888
|
-
tsConfig.options.tsBuildInfoFile = (0, import_devkit2.joinPathFragments)(
|
|
138889
|
-
outputPath,
|
|
138890
|
-
"tsconfig.tsbuildinfo"
|
|
138891
|
-
);
|
|
138848
|
+
tsConfig.options.tsBuildInfoFile = (0, import_devkit2.joinPathFragments)(outputPath, "tsconfig.tsbuildinfo");
|
|
138892
138849
|
}
|
|
138893
138850
|
return tsConfig;
|
|
138894
138851
|
}
|
|
@@ -138928,19 +138885,15 @@ var applyDefaultOptions = (options) => {
|
|
|
138928
138885
|
options.define ??= {};
|
|
138929
138886
|
options.env ??= {};
|
|
138930
138887
|
options.verbose ??= !!process.env.CI;
|
|
138931
|
-
options.getConfig ??= {
|
|
138888
|
+
options.getConfig ??= { dist: defaultConfig };
|
|
138932
138889
|
return options;
|
|
138933
138890
|
};
|
|
138934
|
-
var executor_default = withRunExecutor(
|
|
138935
|
-
|
|
138936
|
-
|
|
138937
|
-
|
|
138938
|
-
skipReadingConfig: false,
|
|
138939
|
-
hooks: {
|
|
138940
|
-
applyDefaultOptions
|
|
138941
|
-
}
|
|
138891
|
+
var executor_default = withRunExecutor("TypeScript Build using tsup", tsupExecutorFn, {
|
|
138892
|
+
skipReadingConfig: false,
|
|
138893
|
+
hooks: {
|
|
138894
|
+
applyDefaultOptions
|
|
138942
138895
|
}
|
|
138943
|
-
);
|
|
138896
|
+
});
|
|
138944
138897
|
var _isPrimitive = (value) => {
|
|
138945
138898
|
try {
|
|
138946
138899
|
return value === void 0 || value === null || typeof value !== "object" && typeof value !== "function";
|
|
@@ -138950,7 +138903,7 @@ var _isPrimitive = (value) => {
|
|
|
138950
138903
|
};
|
|
138951
138904
|
var _isFunction = (value) => {
|
|
138952
138905
|
try {
|
|
138953
|
-
return value instanceof Function || typeof value === "function" || !!(value
|
|
138906
|
+
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
138954
138907
|
} catch (e) {
|
|
138955
138908
|
return false;
|
|
138956
138909
|
}
|
|
@@ -138980,7 +138933,7 @@ function neutralConfig({
|
|
|
138980
138933
|
dtsTsConfig,
|
|
138981
138934
|
getTransform
|
|
138982
138935
|
}) {
|
|
138983
|
-
|
|
138936
|
+
const outputPath = (0, import_devkit3.joinPathFragments)(outDir, "dist");
|
|
138984
138937
|
const options = {
|
|
138985
138938
|
name: "neutral",
|
|
138986
138939
|
entry,
|
|
@@ -139004,6 +138957,7 @@ function neutralConfig({
|
|
|
139004
138957
|
define: define2,
|
|
139005
138958
|
env,
|
|
139006
138959
|
dts: false,
|
|
138960
|
+
minify: false,
|
|
139007
138961
|
experimentalDts: {
|
|
139008
138962
|
entry,
|
|
139009
138963
|
compilerOptions: {
|