@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
|
@@ -35455,9 +35455,9 @@ var require_generator = __commonJS({
|
|
|
35455
35455
|
}
|
|
35456
35456
|
});
|
|
35457
35457
|
|
|
35458
|
-
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
35458
|
+
// 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
|
|
35459
35459
|
var require_flat_config = __commonJS({
|
|
35460
|
-
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
35460
|
+
"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) {
|
|
35461
35461
|
"use strict";
|
|
35462
35462
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35463
35463
|
exports.useFlatConfig = void 0;
|
|
@@ -35468,9 +35468,9 @@ var require_flat_config = __commonJS({
|
|
|
35468
35468
|
}
|
|
35469
35469
|
});
|
|
35470
35470
|
|
|
35471
|
-
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
35471
|
+
// 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
|
|
35472
35472
|
var require_ast_utils2 = __commonJS({
|
|
35473
|
-
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
35473
|
+
"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) {
|
|
35474
35474
|
"use strict";
|
|
35475
35475
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35476
35476
|
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;
|
|
@@ -35942,9 +35942,9 @@ const compat = new FlatCompat({
|
|
|
35942
35942
|
}
|
|
35943
35943
|
});
|
|
35944
35944
|
|
|
35945
|
-
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
35945
|
+
// 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
|
|
35946
35946
|
var require_eslint_file = __commonJS({
|
|
35947
|
-
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
35947
|
+
"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) {
|
|
35948
35948
|
"use strict";
|
|
35949
35949
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35950
35950
|
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;
|
|
@@ -36203,9 +36203,9 @@ var require_eslint_file = __commonJS({
|
|
|
36203
36203
|
}
|
|
36204
36204
|
});
|
|
36205
36205
|
|
|
36206
|
-
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
36206
|
+
// 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
|
|
36207
36207
|
var require_package4 = __commonJS({
|
|
36208
|
-
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
36208
|
+
"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) {
|
|
36209
36209
|
module2.exports = {
|
|
36210
36210
|
name: "@nx/eslint",
|
|
36211
36211
|
version: "17.0.3",
|
|
@@ -36260,9 +36260,9 @@ var require_package4 = __commonJS({
|
|
|
36260
36260
|
}
|
|
36261
36261
|
});
|
|
36262
36262
|
|
|
36263
|
-
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
36263
|
+
// 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
|
|
36264
36264
|
var require_versions4 = __commonJS({
|
|
36265
|
-
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
36265
|
+
"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) {
|
|
36266
36266
|
"use strict";
|
|
36267
36267
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36268
36268
|
exports.typescriptESLintVersion = exports.eslintConfigPrettierVersion = exports.eslintrcVersion = exports.eslintVersion = exports.nxVersion = void 0;
|
|
@@ -36274,9 +36274,9 @@ var require_versions4 = __commonJS({
|
|
|
36274
36274
|
}
|
|
36275
36275
|
});
|
|
36276
36276
|
|
|
36277
|
-
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
36277
|
+
// 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
|
|
36278
36278
|
var require_global_eslint_config = __commonJS({
|
|
36279
|
-
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
36279
|
+
"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) {
|
|
36280
36280
|
"use strict";
|
|
36281
36281
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36282
36282
|
exports.getGlobalFlatEslintConfiguration = exports.getGlobalEsLintConfiguration = exports.javaScriptOverride = exports.typeScriptOverride = void 0;
|
|
@@ -36362,9 +36362,9 @@ var require_global_eslint_config = __commonJS({
|
|
|
36362
36362
|
}
|
|
36363
36363
|
});
|
|
36364
36364
|
|
|
36365
|
-
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
36365
|
+
// 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
|
|
36366
36366
|
var require_init2 = __commonJS({
|
|
36367
|
-
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
36367
|
+
"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) {
|
|
36368
36368
|
"use strict";
|
|
36369
36369
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36370
36370
|
exports.lintInitGenerator = void 0;
|
|
@@ -36428,9 +36428,9 @@ var require_init2 = __commonJS({
|
|
|
36428
36428
|
}
|
|
36429
36429
|
});
|
|
36430
36430
|
|
|
36431
|
-
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
36431
|
+
// 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
|
|
36432
36432
|
var require_init_migration = __commonJS({
|
|
36433
|
-
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
36433
|
+
"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) {
|
|
36434
36434
|
"use strict";
|
|
36435
36435
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36436
36436
|
exports.findLintTarget = exports.migrateConfigToMonorepoStyle = void 0;
|
|
@@ -36519,9 +36519,9 @@ var require_init_migration = __commonJS({
|
|
|
36519
36519
|
}
|
|
36520
36520
|
});
|
|
36521
36521
|
|
|
36522
|
-
// node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
36522
|
+
// 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
|
|
36523
36523
|
var require_lint_project = __commonJS({
|
|
36524
|
-
"node_modules/.pnpm/@nx+eslint@17.0.3_@swc-node+register@1.6.8_@swc+core@1.3.96_@types+node@20.9.
|
|
36524
|
+
"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) {
|
|
36525
36525
|
"use strict";
|
|
36526
36526
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36527
36527
|
exports.lintProjectGenerator = exports.mapLintPattern = void 0;
|
|
@@ -127813,6 +127813,8 @@ __export(executor_exports, {
|
|
|
127813
127813
|
tsupExecutorFn: () => tsupExecutorFn
|
|
127814
127814
|
});
|
|
127815
127815
|
module.exports = __toCommonJS(executor_exports);
|
|
127816
|
+
var import_fs4 = require("fs");
|
|
127817
|
+
var import_path4 = require("path");
|
|
127816
127818
|
var import_esbuild_decorators = __toESM(require_src());
|
|
127817
127819
|
var import_devkit2 = __toESM(require_devkit());
|
|
127818
127820
|
var import_js = __toESM(require_src2());
|
|
@@ -127861,7 +127863,6 @@ var environmentPlugin = (data) => ({
|
|
|
127861
127863
|
});
|
|
127862
127864
|
|
|
127863
127865
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
127864
|
-
var import_fs4 = require("fs");
|
|
127865
127866
|
var import_fs_extra = __toESM(require_lib3());
|
|
127866
127867
|
var import_promises2 = require("fs/promises");
|
|
127867
127868
|
|
|
@@ -134041,7 +134042,6 @@ glob.glob = glob;
|
|
|
134041
134042
|
|
|
134042
134043
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
134043
134044
|
var import_fileutils = require("nx/src/utils/fileutils");
|
|
134044
|
-
var import_path4 = require("path");
|
|
134045
134045
|
var import_prettier = require("prettier");
|
|
134046
134046
|
var import_tsup = __toESM(require_dist5());
|
|
134047
134047
|
var ts = __toESM(require("typescript"));
|
|
@@ -138298,15 +138298,7 @@ function defaultConfig({
|
|
|
138298
138298
|
name: "default",
|
|
138299
138299
|
entry,
|
|
138300
138300
|
format: format2,
|
|
138301
|
-
target: platform !== "node" ? [
|
|
138302
|
-
"chrome91",
|
|
138303
|
-
"firefox90",
|
|
138304
|
-
"edge91",
|
|
138305
|
-
"safari15",
|
|
138306
|
-
"ios15",
|
|
138307
|
-
"opera77",
|
|
138308
|
-
"esnext"
|
|
138309
|
-
] : ["esnext", "node20"],
|
|
138301
|
+
target: platform !== "node" ? ["chrome91", "firefox90", "edge91", "safari15", "ios15", "opera77", "esnext"] : ["esnext", "node20"],
|
|
138310
138302
|
tsconfig,
|
|
138311
138303
|
splitting,
|
|
138312
138304
|
generatePackageJson,
|
|
@@ -138335,13 +138327,7 @@ function defaultConfig({
|
|
|
138335
138327
|
}
|
|
138336
138328
|
}
|
|
138337
138329
|
},
|
|
138338
|
-
|
|
138339
|
-
terserOptions: {
|
|
138340
|
-
compress: true,
|
|
138341
|
-
ecma: 2020,
|
|
138342
|
-
keep_classnames: true,
|
|
138343
|
-
keep_fnames: true
|
|
138344
|
-
},*/
|
|
138330
|
+
minify: false,
|
|
138345
138331
|
apiReport,
|
|
138346
138332
|
docModel,
|
|
138347
138333
|
tsdocMetadata,
|
|
@@ -138353,13 +138339,7 @@ function defaultConfig({
|
|
|
138353
138339
|
outExtension
|
|
138354
138340
|
};
|
|
138355
138341
|
}
|
|
138356
|
-
function getConfig(workspaceRoot, projectRoot, getConfigFn, {
|
|
138357
|
-
outputPath,
|
|
138358
|
-
tsConfig,
|
|
138359
|
-
additionalEntryPoints,
|
|
138360
|
-
platform,
|
|
138361
|
-
...rest
|
|
138362
|
-
}) {
|
|
138342
|
+
function getConfig(workspaceRoot, projectRoot, getConfigFn, { outputPath, tsConfig, additionalEntryPoints, platform, ...rest }) {
|
|
138363
138343
|
return getConfigFn({
|
|
138364
138344
|
...rest,
|
|
138365
138345
|
outDir: outputPath,
|
|
@@ -138474,9 +138454,7 @@ ${Object.keys(options).map(
|
|
|
138474
138454
|
}
|
|
138475
138455
|
const pathToPackageJson = (0, import_path4.join)(context.root, projectRoot, "package.json");
|
|
138476
138456
|
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit2.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
|
|
138477
|
-
const workspacePackageJson = (0, import_devkit2.readJsonFile)(
|
|
138478
|
-
(0, import_path4.join)(workspaceRoot, "package.json")
|
|
138479
|
-
);
|
|
138457
|
+
const workspacePackageJson = (0, import_devkit2.readJsonFile)((0, import_path4.join)(workspaceRoot, "package.json"));
|
|
138480
138458
|
options.external = options.external || [];
|
|
138481
138459
|
if (workspacePackageJson?.dependencies) {
|
|
138482
138460
|
options.external = Object.keys(workspacePackageJson?.dependencies).reduce(
|
|
@@ -138489,42 +138467,40 @@ ${Object.keys(options).map(
|
|
|
138489
138467
|
options.external
|
|
138490
138468
|
);
|
|
138491
138469
|
}
|
|
138492
|
-
|
|
138493
|
-
|
|
138494
|
-
|
|
138495
|
-
|
|
138496
|
-
|
|
138497
|
-
|
|
138498
|
-
|
|
138499
|
-
|
|
138500
|
-
|
|
138470
|
+
const externalDependencies = options.external.reduce(
|
|
138471
|
+
(ret, name) => {
|
|
138472
|
+
if (!packageJson?.devDependencies?.[name]) {
|
|
138473
|
+
const externalNode = context.projectGraph.externalNodes[`npm:${name}`];
|
|
138474
|
+
if (externalNode) {
|
|
138475
|
+
ret.push({
|
|
138476
|
+
name,
|
|
138477
|
+
outputs: [],
|
|
138478
|
+
node: externalNode
|
|
138479
|
+
});
|
|
138480
|
+
}
|
|
138501
138481
|
}
|
|
138502
|
-
|
|
138503
|
-
|
|
138504
|
-
|
|
138482
|
+
return ret;
|
|
138483
|
+
},
|
|
138484
|
+
[]
|
|
138485
|
+
);
|
|
138505
138486
|
const implicitDependencies = context.projectsConfigurations.projects[context.projectName].implicitDependencies;
|
|
138506
138487
|
const internalDependencies = [];
|
|
138507
138488
|
const projectConfigs = await Promise.resolve(getProjectConfigurations());
|
|
138508
138489
|
console.log("Project Configs:");
|
|
138509
138490
|
console.log(projectConfigs);
|
|
138510
138491
|
if (implicitDependencies && implicitDependencies.length > 0) {
|
|
138511
|
-
options.external = implicitDependencies.reduce(
|
|
138512
|
-
(
|
|
138513
|
-
|
|
138514
|
-
|
|
138515
|
-
|
|
138516
|
-
|
|
138517
|
-
|
|
138518
|
-
);
|
|
138519
|
-
if (projectPackageJson?.name && !options.external.includes(projectPackageJson.name)) {
|
|
138520
|
-
ret.push(projectPackageJson.name);
|
|
138521
|
-
internalDependencies.push(projectPackageJson.name);
|
|
138522
|
-
}
|
|
138492
|
+
options.external = implicitDependencies.reduce((ret, key) => {
|
|
138493
|
+
console.log(`\u26A1 Adding implicit dependency: ${key}`);
|
|
138494
|
+
const projectConfig = projectConfigs[key];
|
|
138495
|
+
if (projectConfig?.targets?.build) {
|
|
138496
|
+
const projectPackageJson = (0, import_devkit2.readJsonFile)(projectConfig.targets?.build.options.project);
|
|
138497
|
+
if (projectPackageJson?.name && !options.external.includes(projectPackageJson.name)) {
|
|
138498
|
+
ret.push(projectPackageJson.name);
|
|
138499
|
+
internalDependencies.push(projectPackageJson.name);
|
|
138523
138500
|
}
|
|
138524
|
-
|
|
138525
|
-
|
|
138526
|
-
|
|
138527
|
-
);
|
|
138501
|
+
}
|
|
138502
|
+
return ret;
|
|
138503
|
+
}, options.external);
|
|
138528
138504
|
}
|
|
138529
138505
|
if (options.bundle === false) {
|
|
138530
138506
|
for (const thirdPartyDependency of getExternalDependencies(
|
|
@@ -138575,10 +138551,7 @@ ${externalDependencies.map((dep) => {
|
|
|
138575
138551
|
if (formattedPath.toUpperCase().startsWith("C:")) {
|
|
138576
138552
|
formattedPath = formattedPath.substring(2);
|
|
138577
138553
|
}
|
|
138578
|
-
let propertyKey = (0, import_devkit2.joinPathFragments)(
|
|
138579
|
-
filePath.path,
|
|
138580
|
-
removeExtension(filePath.name)
|
|
138581
|
-
).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
138554
|
+
let propertyKey = (0, import_devkit2.joinPathFragments)(filePath.path, removeExtension(filePath.name)).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
138582
138555
|
if (propertyKey) {
|
|
138583
138556
|
while (propertyKey.startsWith("/")) {
|
|
138584
138557
|
propertyKey = propertyKey.substring(1);
|
|
@@ -138597,24 +138570,24 @@ ${externalDependencies.map((dep) => {
|
|
|
138597
138570
|
}, {});
|
|
138598
138571
|
if (options.generatePackageJson !== false) {
|
|
138599
138572
|
const projectGraph = (0, import_devkit2.readCachedProjectGraph)();
|
|
138600
|
-
|
|
138601
|
-
|
|
138573
|
+
packageJson.dependencies = void 0;
|
|
138574
|
+
for (const externalDependency of externalDependencies) {
|
|
138602
138575
|
const packageConfig = externalDependency.node.data;
|
|
138603
138576
|
if (packageConfig?.packageName && !!(projectGraph.externalNodes[externalDependency.node.name]?.type === "npm")) {
|
|
138604
138577
|
const { packageName, version } = packageConfig;
|
|
138605
138578
|
if (workspacePackageJson.dependencies?.[packageName] || workspacePackageJson.devDependencies?.[packageName] || packageJson?.devDependencies?.[packageName]) {
|
|
138606
|
-
return;
|
|
138579
|
+
return null;
|
|
138607
138580
|
}
|
|
138608
138581
|
packageJson.dependencies ??= {};
|
|
138609
|
-
packageJson.dependencies[packageName] =
|
|
138582
|
+
packageJson.dependencies[packageName] = projectGraph.nodes[externalDependency.node.name] ? "latest" : version;
|
|
138610
138583
|
}
|
|
138611
|
-
}
|
|
138612
|
-
|
|
138584
|
+
}
|
|
138585
|
+
for (const packageName of internalDependencies) {
|
|
138613
138586
|
if (!packageJson?.devDependencies?.[packageName]) {
|
|
138614
138587
|
packageJson.dependencies ??= {};
|
|
138615
138588
|
packageJson.dependencies[packageName] = "latest";
|
|
138616
138589
|
}
|
|
138617
|
-
}
|
|
138590
|
+
}
|
|
138618
138591
|
const distPaths = !options?.getConfig || _isFunction(options.getConfig) ? ["dist/"] : Object.keys(options.getConfig).map((key) => `${key}/`);
|
|
138619
138592
|
packageJson.type = "module";
|
|
138620
138593
|
if (distPaths.length > 0) {
|
|
@@ -138647,30 +138620,27 @@ ${externalDependencies.map((dep) => {
|
|
|
138647
138620
|
},
|
|
138648
138621
|
"./package.json": "./package.json"
|
|
138649
138622
|
};
|
|
138650
|
-
packageJson.exports = Object.keys(entry).reduce(
|
|
138651
|
-
|
|
138652
|
-
|
|
138653
|
-
|
|
138654
|
-
|
|
138655
|
-
|
|
138656
|
-
|
|
138657
|
-
|
|
138658
|
-
|
|
138659
|
-
|
|
138660
|
-
|
|
138661
|
-
|
|
138662
|
-
|
|
138663
|
-
|
|
138664
|
-
|
|
138665
|
-
|
|
138666
|
-
|
|
138667
|
-
|
|
138668
|
-
|
|
138669
|
-
|
|
138670
|
-
|
|
138671
|
-
},
|
|
138672
|
-
packageJson.exports
|
|
138673
|
-
);
|
|
138623
|
+
packageJson.exports = Object.keys(entry).reduce((ret, key) => {
|
|
138624
|
+
let packageJsonKey = key.startsWith("./") ? key : `./${key}`;
|
|
138625
|
+
packageJsonKey = packageJsonKey.replaceAll("/index", "");
|
|
138626
|
+
if (!ret[packageJsonKey]) {
|
|
138627
|
+
ret[packageJsonKey] = {
|
|
138628
|
+
import: {
|
|
138629
|
+
types: `./${distPaths[0]}index.d.ts`,
|
|
138630
|
+
default: `./${distPaths[0]}${key}.js`
|
|
138631
|
+
},
|
|
138632
|
+
require: {
|
|
138633
|
+
types: `./${distPaths[0]}index.d.cts`,
|
|
138634
|
+
default: `./${distPaths[0]}${key}.cjs`
|
|
138635
|
+
},
|
|
138636
|
+
default: {
|
|
138637
|
+
types: `./${distPaths[0]}index.d.ts`,
|
|
138638
|
+
default: `./${distPaths[0]}${key}.js`
|
|
138639
|
+
}
|
|
138640
|
+
};
|
|
138641
|
+
}
|
|
138642
|
+
return ret;
|
|
138643
|
+
}, packageJson.exports);
|
|
138674
138644
|
packageJson.funding ??= workspacePackageJson.funding;
|
|
138675
138645
|
packageJson.types ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
|
|
138676
138646
|
packageJson.typings ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
|
|
@@ -138679,16 +138649,15 @@ ${externalDependencies.map((dep) => {
|
|
|
138679
138649
|
};
|
|
138680
138650
|
packageJson.main ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.cjs`;
|
|
138681
138651
|
packageJson.module ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.js`;
|
|
138682
|
-
options.platform && options.platform !== "node"
|
|
138652
|
+
if (options.platform && options.platform !== "node") {
|
|
138653
|
+
packageJson.browser ??= `${distPaths[0]}index.global.js`;
|
|
138654
|
+
}
|
|
138683
138655
|
if (options.includeSrc === true) {
|
|
138684
138656
|
let distSrc = sourceRoot.replace(projectRoot, "");
|
|
138685
138657
|
if (distSrc.startsWith("/")) {
|
|
138686
138658
|
distSrc = distSrc.substring(1);
|
|
138687
138659
|
}
|
|
138688
|
-
packageJson.source ??= `${(0, import_path4.join)(distSrc, "index.ts").replaceAll(
|
|
138689
|
-
"\\",
|
|
138690
|
-
"/"
|
|
138691
|
-
)}`;
|
|
138660
|
+
packageJson.source ??= `${(0, import_path4.join)(distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
138692
138661
|
}
|
|
138693
138662
|
packageJson.sideEffects ??= false;
|
|
138694
138663
|
packageJson.files ??= ["dist/**/*"];
|
|
@@ -138707,11 +138676,7 @@ ${externalDependencies.map((dep) => {
|
|
|
138707
138676
|
packageJson.keywords ??= workspacePackageJson.keywords;
|
|
138708
138677
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
138709
138678
|
packageJson.repository.directory ??= projectRoot ? projectRoot : (0, import_path4.join)("packages", context.projectName);
|
|
138710
|
-
const packageJsonPath = (0, import_path4.join)(
|
|
138711
|
-
context.root,
|
|
138712
|
-
options.outputPath,
|
|
138713
|
-
"package.json"
|
|
138714
|
-
);
|
|
138679
|
+
const packageJsonPath = (0, import_path4.join)(context.root, options.outputPath, "package.json");
|
|
138715
138680
|
console.log(`\u26A1 Writing package.json file to: ${packageJsonPath}`);
|
|
138716
138681
|
(0, import_fs4.writeFileSync)(
|
|
138717
138682
|
packageJsonPath,
|
|
@@ -138775,7 +138740,7 @@ ${(0, import_fs4.readFileSync)(file, "utf-8")}`,
|
|
|
138775
138740
|
...options,
|
|
138776
138741
|
watch: false,
|
|
138777
138742
|
main: options.entry,
|
|
138778
|
-
transformers: []
|
|
138743
|
+
transformers: ["typia/lib/transform"]
|
|
138779
138744
|
},
|
|
138780
138745
|
context.root,
|
|
138781
138746
|
sourceRoot,
|
|
@@ -138811,9 +138776,7 @@ ${options.banner}
|
|
|
138811
138776
|
await build(config);
|
|
138812
138777
|
}
|
|
138813
138778
|
} else {
|
|
138814
|
-
console.log(
|
|
138815
|
-
"The Build process did not run because no `getConfig` parameter was provided"
|
|
138816
|
-
);
|
|
138779
|
+
console.log("The Build process did not run because no `getConfig` parameter was provided");
|
|
138817
138780
|
}
|
|
138818
138781
|
console.log("\u26A1 The Build process has completed successfully");
|
|
138819
138782
|
return {
|
|
@@ -138841,11 +138804,8 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
138841
138804
|
esModuleInterop: true,
|
|
138842
138805
|
downlevelIteration: true,
|
|
138843
138806
|
forceConsistentCasingInFileNames: true,
|
|
138844
|
-
strict: true,
|
|
138845
|
-
skipLibCheck: true,
|
|
138846
138807
|
declaration: true,
|
|
138847
138808
|
declarationMap: true,
|
|
138848
|
-
emitDeclarationOnly: true,
|
|
138849
138809
|
declarationDir: (0, import_path4.join)(workspaceRoot, "tmp", ".tsup", "declaration")
|
|
138850
138810
|
}
|
|
138851
138811
|
},
|
|
@@ -138854,10 +138814,7 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
138854
138814
|
);
|
|
138855
138815
|
tsConfig.options.pathsBasePath = workspaceRoot;
|
|
138856
138816
|
if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {
|
|
138857
|
-
tsConfig.options.tsBuildInfoFile = (0, import_devkit2.joinPathFragments)(
|
|
138858
|
-
outputPath,
|
|
138859
|
-
"tsconfig.tsbuildinfo"
|
|
138860
|
-
);
|
|
138817
|
+
tsConfig.options.tsBuildInfoFile = (0, import_devkit2.joinPathFragments)(outputPath, "tsconfig.tsbuildinfo");
|
|
138861
138818
|
}
|
|
138862
138819
|
return tsConfig;
|
|
138863
138820
|
}
|
|
@@ -138897,19 +138854,15 @@ var applyDefaultOptions = (options) => {
|
|
|
138897
138854
|
options.define ??= {};
|
|
138898
138855
|
options.env ??= {};
|
|
138899
138856
|
options.verbose ??= !!process.env.CI;
|
|
138900
|
-
options.getConfig ??= {
|
|
138857
|
+
options.getConfig ??= { dist: defaultConfig };
|
|
138901
138858
|
return options;
|
|
138902
138859
|
};
|
|
138903
|
-
var executor_default = withRunExecutor(
|
|
138904
|
-
|
|
138905
|
-
|
|
138906
|
-
|
|
138907
|
-
skipReadingConfig: false,
|
|
138908
|
-
hooks: {
|
|
138909
|
-
applyDefaultOptions
|
|
138910
|
-
}
|
|
138860
|
+
var executor_default = withRunExecutor("TypeScript Build using tsup", tsupExecutorFn, {
|
|
138861
|
+
skipReadingConfig: false,
|
|
138862
|
+
hooks: {
|
|
138863
|
+
applyDefaultOptions
|
|
138911
138864
|
}
|
|
138912
|
-
);
|
|
138865
|
+
});
|
|
138913
138866
|
var _isPrimitive = (value) => {
|
|
138914
138867
|
try {
|
|
138915
138868
|
return value === void 0 || value === null || typeof value !== "object" && typeof value !== "function";
|
|
@@ -138919,7 +138872,7 @@ var _isPrimitive = (value) => {
|
|
|
138919
138872
|
};
|
|
138920
138873
|
var _isFunction = (value) => {
|
|
138921
138874
|
try {
|
|
138922
|
-
return value instanceof Function || typeof value === "function" || !!(value
|
|
138875
|
+
return value instanceof Function || typeof value === "function" || !!(value?.constructor && value?.call && value?.apply);
|
|
138923
138876
|
} catch (e) {
|
|
138924
138877
|
return false;
|
|
138925
138878
|
}
|