@storm-software/workspace-tools 1.36.4 → 1.36.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/index.js +95 -93
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +42 -41
- package/src/executors/tsup/executor.js +38 -37
- package/src/executors/tsup-browser/executor.js +41 -40
- package/src/executors/tsup-neutral/executor.js +41 -40
- package/src/executors/tsup-node/executor.js +41 -39
|
@@ -12458,12 +12458,12 @@ var require_install_packages_task = __commonJS({
|
|
|
12458
12458
|
var child_process_1 = require("child_process");
|
|
12459
12459
|
var path_1 = require("path");
|
|
12460
12460
|
var nx_1 = require_nx();
|
|
12461
|
-
var { detectPackageManager, getPackageManagerCommand, joinPathFragments:
|
|
12461
|
+
var { detectPackageManager, getPackageManagerCommand, joinPathFragments: joinPathFragments4 } = (0, nx_1.requireNx)();
|
|
12462
12462
|
function installPackagesTask(tree, alwaysRun = false, cwd = "", packageManager = detectPackageManager(cwd)) {
|
|
12463
|
-
if (!tree.listChanges().find((f) => f.path ===
|
|
12463
|
+
if (!tree.listChanges().find((f) => f.path === joinPathFragments4(cwd, "package.json")) && !alwaysRun) {
|
|
12464
12464
|
return;
|
|
12465
12465
|
}
|
|
12466
|
-
const packageJsonValue = tree.read(
|
|
12466
|
+
const packageJsonValue = tree.read(joinPathFragments4(cwd, "package.json"), "utf-8");
|
|
12467
12467
|
let storedPackageJsonValue = global["__packageJsonInstallCache__"];
|
|
12468
12468
|
if (storedPackageJsonValue != packageJsonValue || alwaysRun) {
|
|
12469
12469
|
global["__packageJsonInstallCache__"] = packageJsonValue;
|
|
@@ -39538,7 +39538,7 @@ var require_boolean = __commonJS({
|
|
|
39538
39538
|
"node_modules/.pnpm/enquirer@2.3.6/node_modules/enquirer/lib/types/boolean.js"(exports, module2) {
|
|
39539
39539
|
"use strict";
|
|
39540
39540
|
var Prompt = require_prompt();
|
|
39541
|
-
var { isPrimitive
|
|
39541
|
+
var { isPrimitive, hasColor } = require_utils8();
|
|
39542
39542
|
var BooleanPrompt = class extends Prompt {
|
|
39543
39543
|
constructor(options) {
|
|
39544
39544
|
super(options);
|
|
@@ -39569,7 +39569,7 @@ var require_boolean = __commonJS({
|
|
|
39569
39569
|
return /^[fn0]/i.test(input);
|
|
39570
39570
|
}
|
|
39571
39571
|
isValue(value) {
|
|
39572
|
-
return
|
|
39572
|
+
return isPrimitive(value) && (this.isTrue(value) || this.isFalse(value));
|
|
39573
39573
|
}
|
|
39574
39574
|
async hint() {
|
|
39575
39575
|
if (this.state.status === "pending") {
|
|
@@ -39744,11 +39744,11 @@ var require_string2 = __commonJS({
|
|
|
39744
39744
|
"use strict";
|
|
39745
39745
|
var Prompt = require_prompt();
|
|
39746
39746
|
var placeholder = require_placeholder();
|
|
39747
|
-
var { isPrimitive
|
|
39747
|
+
var { isPrimitive } = require_utils8();
|
|
39748
39748
|
var StringPrompt = class extends Prompt {
|
|
39749
39749
|
constructor(options) {
|
|
39750
39750
|
super(options);
|
|
39751
|
-
this.initial =
|
|
39751
|
+
this.initial = isPrimitive(this.initial) ? String(this.initial) : "";
|
|
39752
39752
|
if (this.initial)
|
|
39753
39753
|
this.cursorHide();
|
|
39754
39754
|
this.state.prevCursor = 0;
|
|
@@ -41382,7 +41382,7 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
41382
41382
|
var nx_1 = require_nx();
|
|
41383
41383
|
var get_workspace_layout_1 = require_get_workspace_layout();
|
|
41384
41384
|
var names_1 = require_names();
|
|
41385
|
-
var { joinPathFragments:
|
|
41385
|
+
var { joinPathFragments: joinPathFragments4, normalizePath, logger, readJson, stripIndents, workspaceRoot } = (0, nx_1.requireNx)();
|
|
41386
41386
|
var deprecationWarning = stripIndents`
|
|
41387
41387
|
In Nx 18, generating projects will no longer derive the name and root.
|
|
41388
41388
|
Please provide the exact project name and root in the future.`;
|
|
@@ -41458,14 +41458,14 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
41458
41458
|
if (directory === relativeCwd || directory.startsWith(`${relativeCwd}/`)) {
|
|
41459
41459
|
asProvidedProjectDirectory = directory;
|
|
41460
41460
|
} else {
|
|
41461
|
-
asProvidedProjectDirectory =
|
|
41461
|
+
asProvidedProjectDirectory = joinPathFragments4(relativeCwd, directory);
|
|
41462
41462
|
}
|
|
41463
41463
|
} else if (options.rootProject) {
|
|
41464
41464
|
asProvidedProjectDirectory = ".";
|
|
41465
41465
|
} else {
|
|
41466
41466
|
asProvidedProjectDirectory = relativeCwd;
|
|
41467
41467
|
if (!relativeCwd.endsWith(asProvidedProjectName) && !relativeCwd.endsWith(options.name)) {
|
|
41468
|
-
asProvidedProjectDirectory =
|
|
41468
|
+
asProvidedProjectDirectory = joinPathFragments4(relativeCwd, asProvidedProjectName);
|
|
41469
41469
|
}
|
|
41470
41470
|
}
|
|
41471
41471
|
if (asProvidedProjectName.startsWith("@")) {
|
|
@@ -41498,7 +41498,7 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
41498
41498
|
const derivedSimpleProjectName = name;
|
|
41499
41499
|
let derivedProjectDirectory = derivedProjectDirectoryWithoutLayout;
|
|
41500
41500
|
if (derivedProjectDirectoryWithoutLayout !== ".") {
|
|
41501
|
-
derivedProjectDirectory =
|
|
41501
|
+
derivedProjectDirectory = joinPathFragments4(layoutDirectory, derivedProjectDirectory);
|
|
41502
41502
|
}
|
|
41503
41503
|
let derivedImportPath;
|
|
41504
41504
|
if (options.projectType === "library") {
|
|
@@ -110474,7 +110474,7 @@ ${commentStart} ----------------------------------------------------------------
|
|
|
110474
110474
|
|
|
110475
110475
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
110476
110476
|
var import_esbuild_decorators = __toESM(require_src());
|
|
110477
|
-
var
|
|
110477
|
+
var import_devkit2 = __toESM(require_devkit());
|
|
110478
110478
|
var import_js = __toESM(require_src2());
|
|
110479
110479
|
var import_normalize_options = __toESM(require_normalize_options());
|
|
110480
110480
|
var import_tsc = __toESM(require_tsc_impl());
|
|
@@ -116708,6 +116708,7 @@ var import_tsup = __toESM(require_dist6());
|
|
|
116708
116708
|
var ts = __toESM(require("typescript"));
|
|
116709
116709
|
|
|
116710
116710
|
// packages/workspace-tools/src/base/get-tsup-config.ts
|
|
116711
|
+
var import_devkit = __toESM(require_devkit());
|
|
116711
116712
|
function defaultConfig({
|
|
116712
116713
|
entry,
|
|
116713
116714
|
outDir,
|
|
@@ -116752,7 +116753,7 @@ function defaultConfig({
|
|
|
116752
116753
|
} : false,
|
|
116753
116754
|
projectRoot,
|
|
116754
116755
|
workspaceRoot,
|
|
116755
|
-
outDir,
|
|
116756
|
+
outDir: (0, import_devkit.joinPathFragments)(outDir, "dist"),
|
|
116756
116757
|
silent: !verbose,
|
|
116757
116758
|
metafile: true,
|
|
116758
116759
|
shims,
|
|
@@ -116768,7 +116769,7 @@ function defaultConfig({
|
|
|
116768
116769
|
...dtsTsConfig,
|
|
116769
116770
|
options: {
|
|
116770
116771
|
...dtsTsConfig.options,
|
|
116771
|
-
outDir
|
|
116772
|
+
outDir: (0, import_devkit.joinPathFragments)(outDir, "dist")
|
|
116772
116773
|
}
|
|
116773
116774
|
}
|
|
116774
116775
|
},
|
|
@@ -116856,7 +116857,7 @@ async function tsupExecutorFn(options, context) {
|
|
|
116856
116857
|
options.verbose && console.log(
|
|
116857
116858
|
`\u2699\uFE0F Executor options:
|
|
116858
116859
|
${Object.keys(options).map(
|
|
116859
|
-
(key) => `${key}: ${!options[key] ||
|
|
116860
|
+
(key) => `${key}: ${!options[key] || _isPrimitive(options[key]) ? options[key] : JSON.stringify(options[key])}`
|
|
116860
116861
|
).join("\n")}
|
|
116861
116862
|
`
|
|
116862
116863
|
);
|
|
@@ -116905,8 +116906,8 @@ ${Object.keys(options).map(
|
|
|
116905
116906
|
throw new Error("The Build process failed trying to copy assets");
|
|
116906
116907
|
}
|
|
116907
116908
|
const pathToPackageJson = (0, import_path4.join)(context.root, projectRoot, "package.json");
|
|
116908
|
-
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0,
|
|
116909
|
-
const workspacePackageJson = (0,
|
|
116909
|
+
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit2.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
|
|
116910
|
+
const workspacePackageJson = (0, import_devkit2.readJsonFile)(
|
|
116910
116911
|
(0, import_path4.join)(workspaceRoot, "package.json")
|
|
116911
116912
|
);
|
|
116912
116913
|
options.external = options.external || [];
|
|
@@ -116945,7 +116946,7 @@ ${Object.keys(options).map(
|
|
|
116945
116946
|
console.log(`\u26A1 Adding implicit dependency: ${key}`);
|
|
116946
116947
|
const projectConfig = projectConfigs[key];
|
|
116947
116948
|
if (projectConfig?.targets?.build) {
|
|
116948
|
-
const projectPackageJson = (0,
|
|
116949
|
+
const projectPackageJson = (0, import_devkit2.readJsonFile)(
|
|
116949
116950
|
projectConfig.targets?.build.options.project
|
|
116950
116951
|
);
|
|
116951
116952
|
if (projectPackageJson?.name && !options.external.includes(projectPackageJson.name)) {
|
|
@@ -116995,7 +116996,7 @@ ${externalDependencies.map((dep) => {
|
|
|
116995
116996
|
entryPoints.push(options.entry);
|
|
116996
116997
|
}
|
|
116997
116998
|
if (options.emitOnAll === true) {
|
|
116998
|
-
entryPoints.push((0,
|
|
116999
|
+
entryPoints.push((0, import_devkit2.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
|
|
116999
117000
|
}
|
|
117000
117001
|
if (options.additionalEntryPoints) {
|
|
117001
117002
|
entryPoints.push(...options.additionalEntryPoints);
|
|
@@ -117007,7 +117008,7 @@ ${externalDependencies.map((dep) => {
|
|
|
117007
117008
|
if (formattedPath.toUpperCase().startsWith("C:")) {
|
|
117008
117009
|
formattedPath = formattedPath.substring(2);
|
|
117009
117010
|
}
|
|
117010
|
-
let propertyKey = (0,
|
|
117011
|
+
let propertyKey = (0, import_devkit2.joinPathFragments)(
|
|
117011
117012
|
filePath.path,
|
|
117012
117013
|
removeExtension(filePath.name)
|
|
117013
117014
|
).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
@@ -117016,19 +117017,19 @@ ${externalDependencies.map((dep) => {
|
|
|
117016
117017
|
propertyKey = propertyKey.substring(1);
|
|
117017
117018
|
}
|
|
117018
117019
|
console.debug(
|
|
117019
|
-
`Trying to add entry point ${propertyKey} at "${(0,
|
|
117020
|
+
`Trying to add entry point ${propertyKey} at "${(0, import_devkit2.joinPathFragments)(
|
|
117020
117021
|
filePath.path,
|
|
117021
117022
|
filePath.name
|
|
117022
117023
|
)}"`
|
|
117023
117024
|
);
|
|
117024
117025
|
if (!(propertyKey in ret)) {
|
|
117025
|
-
ret[propertyKey] = (0,
|
|
117026
|
+
ret[propertyKey] = (0, import_devkit2.joinPathFragments)(filePath.path, filePath.name);
|
|
117026
117027
|
}
|
|
117027
117028
|
}
|
|
117028
117029
|
return ret;
|
|
117029
117030
|
}, {});
|
|
117030
117031
|
if (options.generatePackageJson !== false) {
|
|
117031
|
-
const projectGraph = (0,
|
|
117032
|
+
const projectGraph = (0, import_devkit2.readCachedProjectGraph)();
|
|
117032
117033
|
delete packageJson.dependencies;
|
|
117033
117034
|
externalDependencies.forEach((externalDependency) => {
|
|
117034
117035
|
const packageConfig = externalDependency.node.data;
|
|
@@ -117048,7 +117049,7 @@ ${externalDependencies.map((dep) => {
|
|
|
117048
117049
|
}
|
|
117049
117050
|
});
|
|
117050
117051
|
console.log(JSON.stringify(options.getConfig));
|
|
117051
|
-
const distPaths = !options?.getConfig || _isFunction(options.getConfig) ? [""] : Object.keys(options.getConfig).map((key) => `${key}/`);
|
|
117052
|
+
const distPaths = !options?.getConfig || _isFunction(options.getConfig) ? ["dist/"] : Object.keys(options.getConfig).map((key) => `${key}/`);
|
|
117052
117053
|
packageJson.type = "module";
|
|
117053
117054
|
if (distPaths.length > 0) {
|
|
117054
117055
|
packageJson.exports ??= {
|
|
@@ -117156,10 +117157,10 @@ ${externalDependencies.map((dep) => {
|
|
|
117156
117157
|
}
|
|
117157
117158
|
if (options.includeSrc === true) {
|
|
117158
117159
|
const files = globSync([
|
|
117159
|
-
(0,
|
|
117160
|
-
(0,
|
|
117161
|
-
(0,
|
|
117162
|
-
(0,
|
|
117160
|
+
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.ts"),
|
|
117161
|
+
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.tsx"),
|
|
117162
|
+
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.js"),
|
|
117163
|
+
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.jsx")
|
|
117163
117164
|
]);
|
|
117164
117165
|
await Promise.allSettled(
|
|
117165
117166
|
files.map(
|
|
@@ -117282,7 +117283,7 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
117282
117283
|
);
|
|
117283
117284
|
tsConfig.options.pathsBasePath = workspaceRoot;
|
|
117284
117285
|
if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {
|
|
117285
|
-
tsConfig.options.tsBuildInfoFile = (0,
|
|
117286
|
+
tsConfig.options.tsBuildInfoFile = (0, import_devkit2.joinPathFragments)(
|
|
117286
117287
|
outputPath,
|
|
117287
117288
|
"tsconfig.tsbuildinfo"
|
|
117288
117289
|
);
|
|
@@ -117297,13 +117298,6 @@ var build = async (options) => {
|
|
|
117297
117298
|
await (0, import_tsup.build)(options);
|
|
117298
117299
|
}
|
|
117299
117300
|
};
|
|
117300
|
-
var isPrimitive = (value) => {
|
|
117301
|
-
try {
|
|
117302
|
-
return value === void 0 || value === null || typeof value !== "object" && typeof value !== "function";
|
|
117303
|
-
} catch (e) {
|
|
117304
|
-
return false;
|
|
117305
|
-
}
|
|
117306
|
-
};
|
|
117307
117301
|
var applyDefaultOptions = (options) => {
|
|
117308
117302
|
options.entry ??= "{sourceRoot}/index.ts";
|
|
117309
117303
|
options.outputPath ??= "dist/{projectRoot}";
|
|
@@ -117329,7 +117323,7 @@ var applyDefaultOptions = (options) => {
|
|
|
117329
117323
|
options.define ??= {};
|
|
117330
117324
|
options.env ??= {};
|
|
117331
117325
|
options.verbose ??= !!process.env.CI;
|
|
117332
|
-
options.getConfig ??= defaultConfig;
|
|
117326
|
+
options.getConfig ??= { "dist": defaultConfig };
|
|
117333
117327
|
return options;
|
|
117334
117328
|
};
|
|
117335
117329
|
var executor_default = withRunExecutor(
|
|
@@ -117342,6 +117336,13 @@ var executor_default = withRunExecutor(
|
|
|
117342
117336
|
}
|
|
117343
117337
|
}
|
|
117344
117338
|
);
|
|
117339
|
+
var _isPrimitive = (value) => {
|
|
117340
|
+
try {
|
|
117341
|
+
return value === void 0 || value === null || typeof value !== "object" && typeof value !== "function";
|
|
117342
|
+
} catch (e) {
|
|
117343
|
+
return false;
|
|
117344
|
+
}
|
|
117345
|
+
};
|
|
117345
117346
|
var _isFunction = (value) => {
|
|
117346
117347
|
try {
|
|
117347
117348
|
return value instanceof Function || typeof value === "function" || !!(value && value.constructor && value?.call && value?.apply);
|
|
@@ -117351,7 +117352,7 @@ var _isFunction = (value) => {
|
|
|
117351
117352
|
};
|
|
117352
117353
|
|
|
117353
117354
|
// packages/workspace-tools/src/executors/tsup-browser/get-config.ts
|
|
117354
|
-
var
|
|
117355
|
+
var import_devkit3 = __toESM(require_devkit());
|
|
117355
117356
|
function modernBrowserConfig({
|
|
117356
117357
|
entry,
|
|
117357
117358
|
outDir,
|
|
@@ -117375,7 +117376,7 @@ function modernBrowserConfig({
|
|
|
117375
117376
|
generatePackageJson,
|
|
117376
117377
|
dtsTsConfig
|
|
117377
117378
|
}) {
|
|
117378
|
-
let outputPath = (0,
|
|
117379
|
+
let outputPath = (0, import_devkit3.joinPathFragments)(outDir, "dist", "modern");
|
|
117379
117380
|
return {
|
|
117380
117381
|
name: "modern",
|
|
117381
117382
|
entry,
|
|
@@ -117454,7 +117455,7 @@ function legacyBrowserConfig({
|
|
|
117454
117455
|
generatePackageJson,
|
|
117455
117456
|
dtsTsConfig
|
|
117456
117457
|
}) {
|
|
117457
|
-
let outputPath = (0,
|
|
117458
|
+
let outputPath = (0, import_devkit3.joinPathFragments)(outDir, "dist", "legacy");
|
|
117458
117459
|
return {
|
|
117459
117460
|
name: "legacy",
|
|
117460
117461
|
entry,
|
|
@@ -12458,12 +12458,12 @@ var require_install_packages_task = __commonJS({
|
|
|
12458
12458
|
var child_process_1 = require("child_process");
|
|
12459
12459
|
var path_1 = require("path");
|
|
12460
12460
|
var nx_1 = require_nx();
|
|
12461
|
-
var { detectPackageManager, getPackageManagerCommand, joinPathFragments:
|
|
12461
|
+
var { detectPackageManager, getPackageManagerCommand, joinPathFragments: joinPathFragments4 } = (0, nx_1.requireNx)();
|
|
12462
12462
|
function installPackagesTask(tree, alwaysRun = false, cwd = "", packageManager = detectPackageManager(cwd)) {
|
|
12463
|
-
if (!tree.listChanges().find((f) => f.path ===
|
|
12463
|
+
if (!tree.listChanges().find((f) => f.path === joinPathFragments4(cwd, "package.json")) && !alwaysRun) {
|
|
12464
12464
|
return;
|
|
12465
12465
|
}
|
|
12466
|
-
const packageJsonValue = tree.read(
|
|
12466
|
+
const packageJsonValue = tree.read(joinPathFragments4(cwd, "package.json"), "utf-8");
|
|
12467
12467
|
let storedPackageJsonValue = global["__packageJsonInstallCache__"];
|
|
12468
12468
|
if (storedPackageJsonValue != packageJsonValue || alwaysRun) {
|
|
12469
12469
|
global["__packageJsonInstallCache__"] = packageJsonValue;
|
|
@@ -39538,7 +39538,7 @@ var require_boolean = __commonJS({
|
|
|
39538
39538
|
"node_modules/.pnpm/enquirer@2.3.6/node_modules/enquirer/lib/types/boolean.js"(exports, module2) {
|
|
39539
39539
|
"use strict";
|
|
39540
39540
|
var Prompt = require_prompt();
|
|
39541
|
-
var { isPrimitive
|
|
39541
|
+
var { isPrimitive, hasColor } = require_utils8();
|
|
39542
39542
|
var BooleanPrompt = class extends Prompt {
|
|
39543
39543
|
constructor(options) {
|
|
39544
39544
|
super(options);
|
|
@@ -39569,7 +39569,7 @@ var require_boolean = __commonJS({
|
|
|
39569
39569
|
return /^[fn0]/i.test(input);
|
|
39570
39570
|
}
|
|
39571
39571
|
isValue(value) {
|
|
39572
|
-
return
|
|
39572
|
+
return isPrimitive(value) && (this.isTrue(value) || this.isFalse(value));
|
|
39573
39573
|
}
|
|
39574
39574
|
async hint() {
|
|
39575
39575
|
if (this.state.status === "pending") {
|
|
@@ -39744,11 +39744,11 @@ var require_string2 = __commonJS({
|
|
|
39744
39744
|
"use strict";
|
|
39745
39745
|
var Prompt = require_prompt();
|
|
39746
39746
|
var placeholder = require_placeholder();
|
|
39747
|
-
var { isPrimitive
|
|
39747
|
+
var { isPrimitive } = require_utils8();
|
|
39748
39748
|
var StringPrompt = class extends Prompt {
|
|
39749
39749
|
constructor(options) {
|
|
39750
39750
|
super(options);
|
|
39751
|
-
this.initial =
|
|
39751
|
+
this.initial = isPrimitive(this.initial) ? String(this.initial) : "";
|
|
39752
39752
|
if (this.initial)
|
|
39753
39753
|
this.cursorHide();
|
|
39754
39754
|
this.state.prevCursor = 0;
|
|
@@ -41382,7 +41382,7 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
41382
41382
|
var nx_1 = require_nx();
|
|
41383
41383
|
var get_workspace_layout_1 = require_get_workspace_layout();
|
|
41384
41384
|
var names_1 = require_names();
|
|
41385
|
-
var { joinPathFragments:
|
|
41385
|
+
var { joinPathFragments: joinPathFragments4, normalizePath, logger, readJson, stripIndents, workspaceRoot } = (0, nx_1.requireNx)();
|
|
41386
41386
|
var deprecationWarning = stripIndents`
|
|
41387
41387
|
In Nx 18, generating projects will no longer derive the name and root.
|
|
41388
41388
|
Please provide the exact project name and root in the future.`;
|
|
@@ -41458,14 +41458,14 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
41458
41458
|
if (directory === relativeCwd || directory.startsWith(`${relativeCwd}/`)) {
|
|
41459
41459
|
asProvidedProjectDirectory = directory;
|
|
41460
41460
|
} else {
|
|
41461
|
-
asProvidedProjectDirectory =
|
|
41461
|
+
asProvidedProjectDirectory = joinPathFragments4(relativeCwd, directory);
|
|
41462
41462
|
}
|
|
41463
41463
|
} else if (options.rootProject) {
|
|
41464
41464
|
asProvidedProjectDirectory = ".";
|
|
41465
41465
|
} else {
|
|
41466
41466
|
asProvidedProjectDirectory = relativeCwd;
|
|
41467
41467
|
if (!relativeCwd.endsWith(asProvidedProjectName) && !relativeCwd.endsWith(options.name)) {
|
|
41468
|
-
asProvidedProjectDirectory =
|
|
41468
|
+
asProvidedProjectDirectory = joinPathFragments4(relativeCwd, asProvidedProjectName);
|
|
41469
41469
|
}
|
|
41470
41470
|
}
|
|
41471
41471
|
if (asProvidedProjectName.startsWith("@")) {
|
|
@@ -41498,7 +41498,7 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
41498
41498
|
const derivedSimpleProjectName = name;
|
|
41499
41499
|
let derivedProjectDirectory = derivedProjectDirectoryWithoutLayout;
|
|
41500
41500
|
if (derivedProjectDirectoryWithoutLayout !== ".") {
|
|
41501
|
-
derivedProjectDirectory =
|
|
41501
|
+
derivedProjectDirectory = joinPathFragments4(layoutDirectory, derivedProjectDirectory);
|
|
41502
41502
|
}
|
|
41503
41503
|
let derivedImportPath;
|
|
41504
41504
|
if (options.projectType === "library") {
|
|
@@ -110474,7 +110474,7 @@ ${commentStart} ----------------------------------------------------------------
|
|
|
110474
110474
|
|
|
110475
110475
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
110476
110476
|
var import_esbuild_decorators = __toESM(require_src());
|
|
110477
|
-
var
|
|
110477
|
+
var import_devkit2 = __toESM(require_devkit());
|
|
110478
110478
|
var import_js = __toESM(require_src2());
|
|
110479
110479
|
var import_normalize_options = __toESM(require_normalize_options());
|
|
110480
110480
|
var import_tsc = __toESM(require_tsc_impl());
|
|
@@ -116708,6 +116708,7 @@ var import_tsup = __toESM(require_dist6());
|
|
|
116708
116708
|
var ts = __toESM(require("typescript"));
|
|
116709
116709
|
|
|
116710
116710
|
// packages/workspace-tools/src/base/get-tsup-config.ts
|
|
116711
|
+
var import_devkit = __toESM(require_devkit());
|
|
116711
116712
|
function defaultConfig({
|
|
116712
116713
|
entry,
|
|
116713
116714
|
outDir,
|
|
@@ -116752,7 +116753,7 @@ function defaultConfig({
|
|
|
116752
116753
|
} : false,
|
|
116753
116754
|
projectRoot,
|
|
116754
116755
|
workspaceRoot,
|
|
116755
|
-
outDir,
|
|
116756
|
+
outDir: (0, import_devkit.joinPathFragments)(outDir, "dist"),
|
|
116756
116757
|
silent: !verbose,
|
|
116757
116758
|
metafile: true,
|
|
116758
116759
|
shims,
|
|
@@ -116768,7 +116769,7 @@ function defaultConfig({
|
|
|
116768
116769
|
...dtsTsConfig,
|
|
116769
116770
|
options: {
|
|
116770
116771
|
...dtsTsConfig.options,
|
|
116771
|
-
outDir
|
|
116772
|
+
outDir: (0, import_devkit.joinPathFragments)(outDir, "dist")
|
|
116772
116773
|
}
|
|
116773
116774
|
}
|
|
116774
116775
|
},
|
|
@@ -116856,7 +116857,7 @@ async function tsupExecutorFn(options, context) {
|
|
|
116856
116857
|
options.verbose && console.log(
|
|
116857
116858
|
`\u2699\uFE0F Executor options:
|
|
116858
116859
|
${Object.keys(options).map(
|
|
116859
|
-
(key) => `${key}: ${!options[key] ||
|
|
116860
|
+
(key) => `${key}: ${!options[key] || _isPrimitive(options[key]) ? options[key] : JSON.stringify(options[key])}`
|
|
116860
116861
|
).join("\n")}
|
|
116861
116862
|
`
|
|
116862
116863
|
);
|
|
@@ -116905,8 +116906,8 @@ ${Object.keys(options).map(
|
|
|
116905
116906
|
throw new Error("The Build process failed trying to copy assets");
|
|
116906
116907
|
}
|
|
116907
116908
|
const pathToPackageJson = (0, import_path4.join)(context.root, projectRoot, "package.json");
|
|
116908
|
-
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0,
|
|
116909
|
-
const workspacePackageJson = (0,
|
|
116909
|
+
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit2.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
|
|
116910
|
+
const workspacePackageJson = (0, import_devkit2.readJsonFile)(
|
|
116910
116911
|
(0, import_path4.join)(workspaceRoot, "package.json")
|
|
116911
116912
|
);
|
|
116912
116913
|
options.external = options.external || [];
|
|
@@ -116945,7 +116946,7 @@ ${Object.keys(options).map(
|
|
|
116945
116946
|
console.log(`\u26A1 Adding implicit dependency: ${key}`);
|
|
116946
116947
|
const projectConfig = projectConfigs[key];
|
|
116947
116948
|
if (projectConfig?.targets?.build) {
|
|
116948
|
-
const projectPackageJson = (0,
|
|
116949
|
+
const projectPackageJson = (0, import_devkit2.readJsonFile)(
|
|
116949
116950
|
projectConfig.targets?.build.options.project
|
|
116950
116951
|
);
|
|
116951
116952
|
if (projectPackageJson?.name && !options.external.includes(projectPackageJson.name)) {
|
|
@@ -116995,7 +116996,7 @@ ${externalDependencies.map((dep) => {
|
|
|
116995
116996
|
entryPoints.push(options.entry);
|
|
116996
116997
|
}
|
|
116997
116998
|
if (options.emitOnAll === true) {
|
|
116998
|
-
entryPoints.push((0,
|
|
116999
|
+
entryPoints.push((0, import_devkit2.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
|
|
116999
117000
|
}
|
|
117000
117001
|
if (options.additionalEntryPoints) {
|
|
117001
117002
|
entryPoints.push(...options.additionalEntryPoints);
|
|
@@ -117007,7 +117008,7 @@ ${externalDependencies.map((dep) => {
|
|
|
117007
117008
|
if (formattedPath.toUpperCase().startsWith("C:")) {
|
|
117008
117009
|
formattedPath = formattedPath.substring(2);
|
|
117009
117010
|
}
|
|
117010
|
-
let propertyKey = (0,
|
|
117011
|
+
let propertyKey = (0, import_devkit2.joinPathFragments)(
|
|
117011
117012
|
filePath.path,
|
|
117012
117013
|
removeExtension(filePath.name)
|
|
117013
117014
|
).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
@@ -117016,19 +117017,19 @@ ${externalDependencies.map((dep) => {
|
|
|
117016
117017
|
propertyKey = propertyKey.substring(1);
|
|
117017
117018
|
}
|
|
117018
117019
|
console.debug(
|
|
117019
|
-
`Trying to add entry point ${propertyKey} at "${(0,
|
|
117020
|
+
`Trying to add entry point ${propertyKey} at "${(0, import_devkit2.joinPathFragments)(
|
|
117020
117021
|
filePath.path,
|
|
117021
117022
|
filePath.name
|
|
117022
117023
|
)}"`
|
|
117023
117024
|
);
|
|
117024
117025
|
if (!(propertyKey in ret)) {
|
|
117025
|
-
ret[propertyKey] = (0,
|
|
117026
|
+
ret[propertyKey] = (0, import_devkit2.joinPathFragments)(filePath.path, filePath.name);
|
|
117026
117027
|
}
|
|
117027
117028
|
}
|
|
117028
117029
|
return ret;
|
|
117029
117030
|
}, {});
|
|
117030
117031
|
if (options.generatePackageJson !== false) {
|
|
117031
|
-
const projectGraph = (0,
|
|
117032
|
+
const projectGraph = (0, import_devkit2.readCachedProjectGraph)();
|
|
117032
117033
|
delete packageJson.dependencies;
|
|
117033
117034
|
externalDependencies.forEach((externalDependency) => {
|
|
117034
117035
|
const packageConfig = externalDependency.node.data;
|
|
@@ -117048,7 +117049,7 @@ ${externalDependencies.map((dep) => {
|
|
|
117048
117049
|
}
|
|
117049
117050
|
});
|
|
117050
117051
|
console.log(JSON.stringify(options.getConfig));
|
|
117051
|
-
const distPaths = !options?.getConfig || _isFunction(options.getConfig) ? [""] : Object.keys(options.getConfig).map((key) => `${key}/`);
|
|
117052
|
+
const distPaths = !options?.getConfig || _isFunction(options.getConfig) ? ["dist/"] : Object.keys(options.getConfig).map((key) => `${key}/`);
|
|
117052
117053
|
packageJson.type = "module";
|
|
117053
117054
|
if (distPaths.length > 0) {
|
|
117054
117055
|
packageJson.exports ??= {
|
|
@@ -117156,10 +117157,10 @@ ${externalDependencies.map((dep) => {
|
|
|
117156
117157
|
}
|
|
117157
117158
|
if (options.includeSrc === true) {
|
|
117158
117159
|
const files = globSync([
|
|
117159
|
-
(0,
|
|
117160
|
-
(0,
|
|
117161
|
-
(0,
|
|
117162
|
-
(0,
|
|
117160
|
+
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.ts"),
|
|
117161
|
+
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.tsx"),
|
|
117162
|
+
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.js"),
|
|
117163
|
+
(0, import_devkit2.joinPathFragments)(context.root, options.outputPath, "src/**/*.jsx")
|
|
117163
117164
|
]);
|
|
117164
117165
|
await Promise.allSettled(
|
|
117165
117166
|
files.map(
|
|
@@ -117282,7 +117283,7 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
117282
117283
|
);
|
|
117283
117284
|
tsConfig.options.pathsBasePath = workspaceRoot;
|
|
117284
117285
|
if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {
|
|
117285
|
-
tsConfig.options.tsBuildInfoFile = (0,
|
|
117286
|
+
tsConfig.options.tsBuildInfoFile = (0, import_devkit2.joinPathFragments)(
|
|
117286
117287
|
outputPath,
|
|
117287
117288
|
"tsconfig.tsbuildinfo"
|
|
117288
117289
|
);
|
|
@@ -117297,13 +117298,6 @@ var build = async (options) => {
|
|
|
117297
117298
|
await (0, import_tsup.build)(options);
|
|
117298
117299
|
}
|
|
117299
117300
|
};
|
|
117300
|
-
var isPrimitive = (value) => {
|
|
117301
|
-
try {
|
|
117302
|
-
return value === void 0 || value === null || typeof value !== "object" && typeof value !== "function";
|
|
117303
|
-
} catch (e) {
|
|
117304
|
-
return false;
|
|
117305
|
-
}
|
|
117306
|
-
};
|
|
117307
117301
|
var applyDefaultOptions = (options) => {
|
|
117308
117302
|
options.entry ??= "{sourceRoot}/index.ts";
|
|
117309
117303
|
options.outputPath ??= "dist/{projectRoot}";
|
|
@@ -117329,7 +117323,7 @@ var applyDefaultOptions = (options) => {
|
|
|
117329
117323
|
options.define ??= {};
|
|
117330
117324
|
options.env ??= {};
|
|
117331
117325
|
options.verbose ??= !!process.env.CI;
|
|
117332
|
-
options.getConfig ??= defaultConfig;
|
|
117326
|
+
options.getConfig ??= { "dist": defaultConfig };
|
|
117333
117327
|
return options;
|
|
117334
117328
|
};
|
|
117335
117329
|
var executor_default = withRunExecutor(
|
|
@@ -117342,6 +117336,13 @@ var executor_default = withRunExecutor(
|
|
|
117342
117336
|
}
|
|
117343
117337
|
}
|
|
117344
117338
|
);
|
|
117339
|
+
var _isPrimitive = (value) => {
|
|
117340
|
+
try {
|
|
117341
|
+
return value === void 0 || value === null || typeof value !== "object" && typeof value !== "function";
|
|
117342
|
+
} catch (e) {
|
|
117343
|
+
return false;
|
|
117344
|
+
}
|
|
117345
|
+
};
|
|
117345
117346
|
var _isFunction = (value) => {
|
|
117346
117347
|
try {
|
|
117347
117348
|
return value instanceof Function || typeof value === "function" || !!(value && value.constructor && value?.call && value?.apply);
|
|
@@ -117351,7 +117352,7 @@ var _isFunction = (value) => {
|
|
|
117351
117352
|
};
|
|
117352
117353
|
|
|
117353
117354
|
// packages/workspace-tools/src/executors/tsup-neutral/get-config.ts
|
|
117354
|
-
var
|
|
117355
|
+
var import_devkit3 = __toESM(require_devkit());
|
|
117355
117356
|
function modernNeutralConfig({
|
|
117356
117357
|
entry,
|
|
117357
117358
|
outDir,
|
|
@@ -117375,7 +117376,7 @@ function modernNeutralConfig({
|
|
|
117375
117376
|
generatePackageJson,
|
|
117376
117377
|
dtsTsConfig
|
|
117377
117378
|
}) {
|
|
117378
|
-
let outputPath = (0,
|
|
117379
|
+
let outputPath = (0, import_devkit3.joinPathFragments)(outDir, "dist", "modern");
|
|
117379
117380
|
return {
|
|
117380
117381
|
name: "modern",
|
|
117381
117382
|
entry,
|
|
@@ -117454,7 +117455,7 @@ function legacyNeutralConfig({
|
|
|
117454
117455
|
generatePackageJson,
|
|
117455
117456
|
dtsTsConfig
|
|
117456
117457
|
}) {
|
|
117457
|
-
let outputPath = (0,
|
|
117458
|
+
let outputPath = (0, import_devkit3.joinPathFragments)(outDir, "dist", "legacy");
|
|
117458
117459
|
return {
|
|
117459
117460
|
name: "legacy",
|
|
117460
117461
|
entry,
|