@storm-software/workspace-tools 1.35.5 → 1.36.0
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 +14624 -14434
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +36185 -188
- package/src/executors/tsup/executor.js +140 -200
- package/src/executors/tsup/schema.d.ts +3 -0
- package/src/executors/tsup-browser/executor.js +293 -193
- package/src/executors/tsup-neutral/executor.js +293 -193
- package/src/executors/tsup-node/executor.js +216 -200
- package/src/executors/tsup/get-config.js +0 -18533
|
@@ -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: joinPathFragments2 } = (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 === joinPathFragments2(cwd, "package.json")) && !alwaysRun) {
|
|
12464
12464
|
return;
|
|
12465
12465
|
}
|
|
12466
|
-
const packageJsonValue = tree.read(
|
|
12466
|
+
const packageJsonValue = tree.read(joinPathFragments2(cwd, "package.json"), "utf-8");
|
|
12467
12467
|
let storedPackageJsonValue = global["__packageJsonInstallCache__"];
|
|
12468
12468
|
if (storedPackageJsonValue != packageJsonValue || alwaysRun) {
|
|
12469
12469
|
global["__packageJsonInstallCache__"] = packageJsonValue;
|
|
@@ -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: joinPathFragments2, 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 = joinPathFragments2(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 = joinPathFragments2(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 = joinPathFragments2(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_devkit = __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());
|
|
@@ -116707,33 +116707,8 @@ var import_prettier = require("prettier");
|
|
|
116707
116707
|
var import_tsup = __toESM(require_dist6());
|
|
116708
116708
|
var ts = __toESM(require("typescript"));
|
|
116709
116709
|
|
|
116710
|
-
// packages/workspace-tools/src/
|
|
116711
|
-
|
|
116712
|
-
return filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
|
|
116713
|
-
};
|
|
116714
|
-
|
|
116715
|
-
// packages/workspace-tools/src/utils/get-project-configurations.ts
|
|
116716
|
-
var import_retrieve_workspace_files = require("nx/src/project-graph/utils/retrieve-workspace-files");
|
|
116717
|
-
var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(
|
|
116718
|
-
getWorkspaceRoot()
|
|
116719
|
-
);
|
|
116720
|
-
|
|
116721
|
-
// packages/workspace-tools/src/utils/get-project-deps.ts
|
|
116722
|
-
function getExternalDependencies(projectName, graph) {
|
|
116723
|
-
const allDeps = graph.dependencies[projectName];
|
|
116724
|
-
return Array.from(
|
|
116725
|
-
allDeps.reduce((acc, node) => {
|
|
116726
|
-
const found = graph.externalNodes[node.target];
|
|
116727
|
-
if (found)
|
|
116728
|
-
acc.push(found);
|
|
116729
|
-
return acc;
|
|
116730
|
-
}, [])
|
|
116731
|
-
);
|
|
116732
|
-
}
|
|
116733
|
-
|
|
116734
|
-
// packages/workspace-tools/src/executors/tsup/get-config.ts
|
|
116735
|
-
var import_devkit = __toESM(require_devkit());
|
|
116736
|
-
function modernConfig({
|
|
116710
|
+
// packages/workspace-tools/src/base/get-tsup-config.ts
|
|
116711
|
+
function defaultConfig({
|
|
116737
116712
|
entry,
|
|
116738
116713
|
outDir,
|
|
116739
116714
|
projectRoot,
|
|
@@ -116756,9 +116731,8 @@ function modernConfig({
|
|
|
116756
116731
|
generatePackageJson,
|
|
116757
116732
|
dtsTsConfig
|
|
116758
116733
|
}) {
|
|
116759
|
-
let outputPath = (0, import_devkit.joinPathFragments)(outDir, "dist", "modern");
|
|
116760
116734
|
return {
|
|
116761
|
-
name: "
|
|
116735
|
+
name: "default",
|
|
116762
116736
|
entry,
|
|
116763
116737
|
format: platform !== "node" ? ["cjs", "esm", "iife"] : ["cjs", "esm"],
|
|
116764
116738
|
target: platform !== "node" ? [
|
|
@@ -116778,7 +116752,7 @@ function modernConfig({
|
|
|
116778
116752
|
} : false,
|
|
116779
116753
|
projectRoot,
|
|
116780
116754
|
workspaceRoot,
|
|
116781
|
-
outDir
|
|
116755
|
+
outDir,
|
|
116782
116756
|
silent: !verbose,
|
|
116783
116757
|
metafile: true,
|
|
116784
116758
|
shims,
|
|
@@ -116794,7 +116768,7 @@ function modernConfig({
|
|
|
116794
116768
|
...dtsTsConfig,
|
|
116795
116769
|
options: {
|
|
116796
116770
|
...dtsTsConfig.options,
|
|
116797
|
-
outDir
|
|
116771
|
+
outDir
|
|
116798
116772
|
}
|
|
116799
116773
|
}
|
|
116800
116774
|
},
|
|
@@ -116815,77 +116789,6 @@ function modernConfig({
|
|
|
116815
116789
|
outExtension
|
|
116816
116790
|
};
|
|
116817
116791
|
}
|
|
116818
|
-
function legacyConfig({
|
|
116819
|
-
entry,
|
|
116820
|
-
outDir,
|
|
116821
|
-
projectRoot,
|
|
116822
|
-
workspaceRoot,
|
|
116823
|
-
tsconfig = "tsconfig.json",
|
|
116824
|
-
splitting,
|
|
116825
|
-
treeshake,
|
|
116826
|
-
debug = false,
|
|
116827
|
-
external,
|
|
116828
|
-
banner = {},
|
|
116829
|
-
platform = "neutral",
|
|
116830
|
-
verbose = false,
|
|
116831
|
-
shims = true,
|
|
116832
|
-
define: define2,
|
|
116833
|
-
env,
|
|
116834
|
-
plugins,
|
|
116835
|
-
generatePackageJson,
|
|
116836
|
-
dtsTsConfig
|
|
116837
|
-
}) {
|
|
116838
|
-
let outputPath = (0, import_devkit.joinPathFragments)(outDir, "dist", "legacy");
|
|
116839
|
-
return {
|
|
116840
|
-
name: "legacy",
|
|
116841
|
-
entry,
|
|
116842
|
-
format: platform !== "node" ? ["cjs", "esm", "iife"] : ["cjs", "esm"],
|
|
116843
|
-
target: platform !== "node" ? ["es2022"] : ["es2022", "node18"],
|
|
116844
|
-
tsconfig,
|
|
116845
|
-
splitting,
|
|
116846
|
-
generatePackageJson,
|
|
116847
|
-
treeshake: treeshake ? {
|
|
116848
|
-
preset: "recommended"
|
|
116849
|
-
} : false,
|
|
116850
|
-
projectRoot,
|
|
116851
|
-
workspaceRoot,
|
|
116852
|
-
outDir: outputPath,
|
|
116853
|
-
silent: !verbose,
|
|
116854
|
-
metafile: true,
|
|
116855
|
-
shims,
|
|
116856
|
-
external,
|
|
116857
|
-
platform,
|
|
116858
|
-
banner,
|
|
116859
|
-
define: define2,
|
|
116860
|
-
env,
|
|
116861
|
-
dts: false,
|
|
116862
|
-
experimentalDts: {
|
|
116863
|
-
entry,
|
|
116864
|
-
compilerOptions: {
|
|
116865
|
-
...dtsTsConfig,
|
|
116866
|
-
options: {
|
|
116867
|
-
...dtsTsConfig.options,
|
|
116868
|
-
outDir: outputPath
|
|
116869
|
-
}
|
|
116870
|
-
}
|
|
116871
|
-
},
|
|
116872
|
-
/*minify: debug ? false : "terser",
|
|
116873
|
-
terserOptions: {
|
|
116874
|
-
compress: true,
|
|
116875
|
-
ecma: 2020,
|
|
116876
|
-
keep_classnames: true,
|
|
116877
|
-
keep_fnames: true
|
|
116878
|
-
},*/
|
|
116879
|
-
apiReport: false,
|
|
116880
|
-
docModel: false,
|
|
116881
|
-
tsdocMetadata: false,
|
|
116882
|
-
sourcemap: debug,
|
|
116883
|
-
clean: false,
|
|
116884
|
-
tsconfigDecoratorMetadata: true,
|
|
116885
|
-
plugins,
|
|
116886
|
-
outExtension
|
|
116887
|
-
};
|
|
116888
|
-
}
|
|
116889
116792
|
function getConfig(workspaceRoot, projectRoot, getConfigFn, {
|
|
116890
116793
|
outputPath,
|
|
116891
116794
|
tsConfig,
|
|
@@ -116922,6 +116825,30 @@ var outExtension = ({ format: format2 }) => {
|
|
|
116922
116825
|
};
|
|
116923
116826
|
};
|
|
116924
116827
|
|
|
116828
|
+
// packages/workspace-tools/src/utils/file-path-utils.ts
|
|
116829
|
+
var removeExtension = (filePath) => {
|
|
116830
|
+
return filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
|
|
116831
|
+
};
|
|
116832
|
+
|
|
116833
|
+
// packages/workspace-tools/src/utils/get-project-configurations.ts
|
|
116834
|
+
var import_retrieve_workspace_files = require("nx/src/project-graph/utils/retrieve-workspace-files");
|
|
116835
|
+
var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(
|
|
116836
|
+
getWorkspaceRoot()
|
|
116837
|
+
);
|
|
116838
|
+
|
|
116839
|
+
// packages/workspace-tools/src/utils/get-project-deps.ts
|
|
116840
|
+
function getExternalDependencies(projectName, graph) {
|
|
116841
|
+
const allDeps = graph.dependencies[projectName];
|
|
116842
|
+
return Array.from(
|
|
116843
|
+
allDeps.reduce((acc, node) => {
|
|
116844
|
+
const found = graph.externalNodes[node.target];
|
|
116845
|
+
if (found)
|
|
116846
|
+
acc.push(found);
|
|
116847
|
+
return acc;
|
|
116848
|
+
}, [])
|
|
116849
|
+
);
|
|
116850
|
+
}
|
|
116851
|
+
|
|
116925
116852
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
116926
116853
|
async function tsupExecutorFn(options, context) {
|
|
116927
116854
|
try {
|
|
@@ -116978,8 +116905,8 @@ ${Object.keys(options).map(
|
|
|
116978
116905
|
throw new Error("The Build process failed trying to copy assets");
|
|
116979
116906
|
}
|
|
116980
116907
|
const pathToPackageJson = (0, import_path4.join)(context.root, projectRoot, "package.json");
|
|
116981
|
-
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0,
|
|
116982
|
-
const workspacePackageJson = (0,
|
|
116908
|
+
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
|
|
116909
|
+
const workspacePackageJson = (0, import_devkit.readJsonFile)(
|
|
116983
116910
|
(0, import_path4.join)(workspaceRoot, "package.json")
|
|
116984
116911
|
);
|
|
116985
116912
|
options.external = options.external || [];
|
|
@@ -117018,7 +116945,7 @@ ${Object.keys(options).map(
|
|
|
117018
116945
|
console.log(`\u26A1 Adding implicit dependency: ${key}`);
|
|
117019
116946
|
const projectConfig = projectConfigs[key];
|
|
117020
116947
|
if (projectConfig?.targets?.build) {
|
|
117021
|
-
const projectPackageJson = (0,
|
|
116948
|
+
const projectPackageJson = (0, import_devkit.readJsonFile)(
|
|
117022
116949
|
projectConfig.targets?.build.options.project
|
|
117023
116950
|
);
|
|
117024
116951
|
if (projectPackageJson?.name && !options.external.includes(projectPackageJson.name)) {
|
|
@@ -117068,7 +116995,7 @@ ${externalDependencies.map((dep) => {
|
|
|
117068
116995
|
entryPoints.push(options.entry);
|
|
117069
116996
|
}
|
|
117070
116997
|
if (options.emitOnAll === true) {
|
|
117071
|
-
entryPoints.push((0,
|
|
116998
|
+
entryPoints.push((0, import_devkit.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
|
|
117072
116999
|
}
|
|
117073
117000
|
if (options.additionalEntryPoints) {
|
|
117074
117001
|
entryPoints.push(...options.additionalEntryPoints);
|
|
@@ -117080,7 +117007,7 @@ ${externalDependencies.map((dep) => {
|
|
|
117080
117007
|
if (formattedPath.toUpperCase().startsWith("C:")) {
|
|
117081
117008
|
formattedPath = formattedPath.substring(2);
|
|
117082
117009
|
}
|
|
117083
|
-
let propertyKey = (0,
|
|
117010
|
+
let propertyKey = (0, import_devkit.joinPathFragments)(
|
|
117084
117011
|
filePath.path,
|
|
117085
117012
|
removeExtension(filePath.name)
|
|
117086
117013
|
).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
@@ -117089,19 +117016,19 @@ ${externalDependencies.map((dep) => {
|
|
|
117089
117016
|
propertyKey = propertyKey.substring(1);
|
|
117090
117017
|
}
|
|
117091
117018
|
console.debug(
|
|
117092
|
-
`Trying to add entry point ${propertyKey} at "${(0,
|
|
117019
|
+
`Trying to add entry point ${propertyKey} at "${(0, import_devkit.joinPathFragments)(
|
|
117093
117020
|
filePath.path,
|
|
117094
117021
|
filePath.name
|
|
117095
117022
|
)}"`
|
|
117096
117023
|
);
|
|
117097
117024
|
if (!(propertyKey in ret)) {
|
|
117098
|
-
ret[propertyKey] = (0,
|
|
117025
|
+
ret[propertyKey] = (0, import_devkit.joinPathFragments)(filePath.path, filePath.name);
|
|
117099
117026
|
}
|
|
117100
117027
|
}
|
|
117101
117028
|
return ret;
|
|
117102
117029
|
}, {});
|
|
117103
117030
|
if (options.generatePackageJson !== false) {
|
|
117104
|
-
const projectGraph = (0,
|
|
117031
|
+
const projectGraph = (0, import_devkit.readCachedProjectGraph)();
|
|
117105
117032
|
delete packageJson.dependencies;
|
|
117106
117033
|
externalDependencies.forEach((externalDependency) => {
|
|
117107
117034
|
const packageConfig = externalDependency.node.data;
|
|
@@ -117120,83 +117047,86 @@ ${externalDependencies.map((dep) => {
|
|
|
117120
117047
|
packageJson.dependencies[packageName] = "latest";
|
|
117121
117048
|
}
|
|
117122
117049
|
});
|
|
117050
|
+
const distPaths = _isFunction(options.getConfig) ? [""] : Object.keys(options.getConfig).map((key) => `${key}/`);
|
|
117123
117051
|
packageJson.type = "module";
|
|
117124
|
-
|
|
117125
|
-
|
|
117126
|
-
|
|
117127
|
-
|
|
117128
|
-
|
|
117129
|
-
|
|
117130
|
-
|
|
117131
|
-
|
|
117132
|
-
|
|
117133
|
-
|
|
117134
|
-
|
|
117135
|
-
|
|
117136
|
-
|
|
117052
|
+
if (distPaths.length > 1) {
|
|
117053
|
+
packageJson.exports ??= {
|
|
117054
|
+
".": {
|
|
117055
|
+
import: {
|
|
117056
|
+
types: `./${distPaths[0]}index.d.ts`,
|
|
117057
|
+
default: `./${distPaths[0]}index.js`
|
|
117058
|
+
},
|
|
117059
|
+
require: {
|
|
117060
|
+
types: `./${distPaths[0]}index.d.cts`,
|
|
117061
|
+
default: `./${distPaths[0]}index.cjs`
|
|
117062
|
+
},
|
|
117063
|
+
default: {
|
|
117064
|
+
types: `./${distPaths[0]}index.d.ts`,
|
|
117065
|
+
default: `./${distPaths[0]}index.js`
|
|
117066
|
+
},
|
|
117067
|
+
...(options.additionalEntryPoints ?? []).map((entryPoint) => ({
|
|
117068
|
+
[removeExtension(entryPoint).replace(sourceRoot, "")]: {
|
|
117069
|
+
types: (0, import_path4.join)(
|
|
117070
|
+
`./${distPaths[0]}`,
|
|
117071
|
+
`${removeExtension(entryPoint.replace(sourceRoot, ""))}.d.ts`
|
|
117072
|
+
),
|
|
117073
|
+
default: (0, import_path4.join)(
|
|
117074
|
+
`./${distPaths[0]}`,
|
|
117075
|
+
`${removeExtension(entryPoint.replace(sourceRoot, ""))}.js`
|
|
117076
|
+
)
|
|
117077
|
+
}
|
|
117078
|
+
}))
|
|
117137
117079
|
},
|
|
117138
|
-
|
|
117139
|
-
|
|
117140
|
-
|
|
117141
|
-
|
|
117142
|
-
|
|
117143
|
-
|
|
117144
|
-
|
|
117145
|
-
|
|
117146
|
-
|
|
117147
|
-
|
|
117080
|
+
"./package.json": "./package.json"
|
|
117081
|
+
};
|
|
117082
|
+
packageJson.exports = Object.keys(entry).reduce(
|
|
117083
|
+
(ret, key) => {
|
|
117084
|
+
let packageJsonKey = key.startsWith("./") ? key : `./${key}`;
|
|
117085
|
+
packageJsonKey = packageJsonKey.replaceAll("/index", "");
|
|
117086
|
+
if (!ret[packageJsonKey]) {
|
|
117087
|
+
ret[packageJsonKey] = {
|
|
117088
|
+
import: {
|
|
117089
|
+
types: `./${distPaths[0]}index.d.ts`,
|
|
117090
|
+
default: `./${distPaths[0]}${key}.js`
|
|
117091
|
+
},
|
|
117092
|
+
require: {
|
|
117093
|
+
types: `./${distPaths[0]}index.d.cts`,
|
|
117094
|
+
default: `./${distPaths[0]}${key}.cjs`
|
|
117095
|
+
},
|
|
117096
|
+
default: {
|
|
117097
|
+
types: `./${distPaths[0]}index.d.ts`,
|
|
117098
|
+
default: `./${distPaths[0]}${key}.js`
|
|
117099
|
+
}
|
|
117100
|
+
};
|
|
117148
117101
|
}
|
|
117149
|
-
|
|
117150
|
-
|
|
117151
|
-
|
|
117152
|
-
|
|
117153
|
-
|
|
117154
|
-
|
|
117155
|
-
|
|
117156
|
-
|
|
117157
|
-
|
|
117158
|
-
|
|
117159
|
-
|
|
117160
|
-
|
|
117161
|
-
|
|
117162
|
-
|
|
117163
|
-
|
|
117164
|
-
|
|
117165
|
-
|
|
117166
|
-
},
|
|
117167
|
-
default: {
|
|
117168
|
-
types: "./dist/modern/index.d.ts",
|
|
117169
|
-
default: `./dist/modern/${key}.js`
|
|
117170
|
-
}
|
|
117171
|
-
};
|
|
117102
|
+
return ret;
|
|
117103
|
+
},
|
|
117104
|
+
packageJson.exports
|
|
117105
|
+
);
|
|
117106
|
+
packageJson.funding ??= workspacePackageJson.funding;
|
|
117107
|
+
packageJson.types ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
|
|
117108
|
+
packageJson.typings ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
|
|
117109
|
+
packageJson.typescript ??= {
|
|
117110
|
+
definition: `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`
|
|
117111
|
+
};
|
|
117112
|
+
packageJson.main ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.cjs`;
|
|
117113
|
+
packageJson.module ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.js`;
|
|
117114
|
+
options.platform && options.platform !== "node" && (packageJson.browser ??= `${distPaths[0]}index.global.js`);
|
|
117115
|
+
if (options.includeSrc === true) {
|
|
117116
|
+
let distSrc = sourceRoot.replace(projectRoot, "");
|
|
117117
|
+
if (distSrc.startsWith("/")) {
|
|
117118
|
+
distSrc = distSrc.substring(1);
|
|
117172
117119
|
}
|
|
117173
|
-
|
|
117174
|
-
|
|
117175
|
-
|
|
117176
|
-
|
|
117177
|
-
|
|
117178
|
-
|
|
117179
|
-
|
|
117180
|
-
|
|
117181
|
-
|
|
117182
|
-
|
|
117183
|
-
packageJson.main ??= "dist/legacy/index.cjs";
|
|
117184
|
-
packageJson.module ??= "dist/legacy/index.js";
|
|
117185
|
-
options.platform && options.platform !== "node" && (packageJson.browser ??= "dist/modern/index.global.js");
|
|
117186
|
-
if (options.includeSrc === true) {
|
|
117187
|
-
let distSrc = sourceRoot.replace(projectRoot, "");
|
|
117188
|
-
if (distSrc.startsWith("/")) {
|
|
117189
|
-
distSrc = distSrc.substring(1);
|
|
117190
|
-
}
|
|
117191
|
-
packageJson.source ??= `${(0, import_path4.join)(distSrc, "index.ts").replaceAll(
|
|
117192
|
-
"\\",
|
|
117193
|
-
"/"
|
|
117194
|
-
)}`;
|
|
117195
|
-
}
|
|
117196
|
-
packageJson.sideEffects ??= false;
|
|
117197
|
-
packageJson.files ??= ["dist/**/*"];
|
|
117198
|
-
if (options.includeSrc === true && !packageJson.files.includes("src")) {
|
|
117199
|
-
packageJson.files.push("src/**/*");
|
|
117120
|
+
packageJson.source ??= `${(0, import_path4.join)(distSrc, "index.ts").replaceAll(
|
|
117121
|
+
"\\",
|
|
117122
|
+
"/"
|
|
117123
|
+
)}`;
|
|
117124
|
+
}
|
|
117125
|
+
packageJson.sideEffects ??= false;
|
|
117126
|
+
packageJson.files ??= ["dist/**/*"];
|
|
117127
|
+
if (options.includeSrc === true && !packageJson.files.includes("src")) {
|
|
117128
|
+
packageJson.files.push("src/**/*");
|
|
117129
|
+
}
|
|
117200
117130
|
}
|
|
117201
117131
|
packageJson.publishConfig ??= {
|
|
117202
117132
|
access: "public"
|
|
@@ -117225,10 +117155,10 @@ ${externalDependencies.map((dep) => {
|
|
|
117225
117155
|
}
|
|
117226
117156
|
if (options.includeSrc === true) {
|
|
117227
117157
|
const files = globSync([
|
|
117228
|
-
(0,
|
|
117229
|
-
(0,
|
|
117230
|
-
(0,
|
|
117231
|
-
(0,
|
|
117158
|
+
(0, import_devkit.joinPathFragments)(context.root, options.outputPath, "src/**/*.ts"),
|
|
117159
|
+
(0, import_devkit.joinPathFragments)(context.root, options.outputPath, "src/**/*.tsx"),
|
|
117160
|
+
(0, import_devkit.joinPathFragments)(context.root, options.outputPath, "src/**/*.js"),
|
|
117161
|
+
(0, import_devkit.joinPathFragments)(context.root, options.outputPath, "src/**/*.jsx")
|
|
117232
117162
|
]);
|
|
117233
117163
|
await Promise.allSettled(
|
|
117234
117164
|
files.map(
|
|
@@ -117300,10 +117230,12 @@ ${options.banner}
|
|
|
117300
117230
|
outputPath: options.outputPath,
|
|
117301
117231
|
entry
|
|
117302
117232
|
};
|
|
117303
|
-
const
|
|
117304
|
-
|
|
117305
|
-
|
|
117306
|
-
|
|
117233
|
+
const getConfigFns = _isFunction(options.getConfig) ? [options.getConfig] : Object.keys(options.getConfig).map((key) => options.getConfig[key]);
|
|
117234
|
+
const config = (0, import_tsup.defineConfig)(
|
|
117235
|
+
getConfigFns.map(
|
|
117236
|
+
(getConfigFn) => getConfig(context.root, projectRoot, getConfigFn, getConfigOptions)
|
|
117237
|
+
)
|
|
117238
|
+
);
|
|
117307
117239
|
if (typeof config === "function") {
|
|
117308
117240
|
await build(await Promise.resolve(config({})));
|
|
117309
117241
|
} else {
|
|
@@ -117343,7 +117275,7 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
117343
117275
|
);
|
|
117344
117276
|
tsConfig.options.pathsBasePath = workspaceRoot;
|
|
117345
117277
|
if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {
|
|
117346
|
-
tsConfig.options.tsBuildInfoFile = (0,
|
|
117278
|
+
tsConfig.options.tsBuildInfoFile = (0, import_devkit.joinPathFragments)(
|
|
117347
117279
|
outputPath,
|
|
117348
117280
|
"tsconfig.tsbuildinfo"
|
|
117349
117281
|
);
|
|
@@ -117390,6 +117322,7 @@ var applyDefaultOptions = (options) => {
|
|
|
117390
117322
|
options.define ??= {};
|
|
117391
117323
|
options.env ??= {};
|
|
117392
117324
|
options.verbose ??= !!process.env.CI;
|
|
117325
|
+
options.getConfig ??= defaultConfig;
|
|
117393
117326
|
return options;
|
|
117394
117327
|
};
|
|
117395
117328
|
var executor_default = withRunExecutor(
|
|
@@ -117402,6 +117335,88 @@ var executor_default = withRunExecutor(
|
|
|
117402
117335
|
}
|
|
117403
117336
|
}
|
|
117404
117337
|
);
|
|
117338
|
+
var _isFunction = (value) => {
|
|
117339
|
+
try {
|
|
117340
|
+
return value instanceof Function || typeof value === "function" || !!(value && value.constructor && value?.call && value?.apply);
|
|
117341
|
+
} catch (e) {
|
|
117342
|
+
return false;
|
|
117343
|
+
}
|
|
117344
|
+
};
|
|
117345
|
+
|
|
117346
|
+
// packages/workspace-tools/src/executors/tsup-node/get-config.ts
|
|
117347
|
+
function nodeConfig({
|
|
117348
|
+
entry,
|
|
117349
|
+
outDir,
|
|
117350
|
+
projectRoot,
|
|
117351
|
+
workspaceRoot,
|
|
117352
|
+
tsconfig = "tsconfig.json",
|
|
117353
|
+
splitting,
|
|
117354
|
+
treeshake,
|
|
117355
|
+
debug = false,
|
|
117356
|
+
shims = true,
|
|
117357
|
+
external,
|
|
117358
|
+
banner = {},
|
|
117359
|
+
platform = "node",
|
|
117360
|
+
verbose = false,
|
|
117361
|
+
apiReport = true,
|
|
117362
|
+
docModel = true,
|
|
117363
|
+
tsdocMetadata = true,
|
|
117364
|
+
define: define2,
|
|
117365
|
+
env,
|
|
117366
|
+
plugins,
|
|
117367
|
+
generatePackageJson,
|
|
117368
|
+
dtsTsConfig
|
|
117369
|
+
}) {
|
|
117370
|
+
return {
|
|
117371
|
+
name: "node",
|
|
117372
|
+
entry,
|
|
117373
|
+
format: ["cjs", "esm"],
|
|
117374
|
+
target: ["esnext", "node20"],
|
|
117375
|
+
tsconfig,
|
|
117376
|
+
splitting,
|
|
117377
|
+
generatePackageJson,
|
|
117378
|
+
treeshake: treeshake ? {
|
|
117379
|
+
preset: "recommended"
|
|
117380
|
+
} : false,
|
|
117381
|
+
projectRoot,
|
|
117382
|
+
workspaceRoot,
|
|
117383
|
+
outDir,
|
|
117384
|
+
silent: !verbose,
|
|
117385
|
+
metafile: true,
|
|
117386
|
+
shims,
|
|
117387
|
+
external,
|
|
117388
|
+
platform,
|
|
117389
|
+
banner,
|
|
117390
|
+
define: define2,
|
|
117391
|
+
env,
|
|
117392
|
+
dts: false,
|
|
117393
|
+
experimentalDts: {
|
|
117394
|
+
entry,
|
|
117395
|
+
compilerOptions: {
|
|
117396
|
+
...dtsTsConfig,
|
|
117397
|
+
options: {
|
|
117398
|
+
...dtsTsConfig.options,
|
|
117399
|
+
outDir
|
|
117400
|
+
}
|
|
117401
|
+
}
|
|
117402
|
+
},
|
|
117403
|
+
minify: debug ? false : "terser",
|
|
117404
|
+
terserOptions: {
|
|
117405
|
+
compress: true,
|
|
117406
|
+
ecma: 2020,
|
|
117407
|
+
keep_classnames: true,
|
|
117408
|
+
keep_fnames: true
|
|
117409
|
+
},
|
|
117410
|
+
apiReport,
|
|
117411
|
+
docModel,
|
|
117412
|
+
tsdocMetadata,
|
|
117413
|
+
sourcemap: debug,
|
|
117414
|
+
clean: false,
|
|
117415
|
+
tsconfigDecoratorMetadata: true,
|
|
117416
|
+
plugins,
|
|
117417
|
+
outExtension
|
|
117418
|
+
};
|
|
117419
|
+
}
|
|
117405
117420
|
|
|
117406
117421
|
// packages/workspace-tools/src/executors/tsup-node/executor.ts
|
|
117407
117422
|
var tsNodeBuildExecutorFn = (options, context, config) => {
|
|
@@ -117429,6 +117444,7 @@ var tsNodeBuildExecutorFn = (options, context, config) => {
|
|
|
117429
117444
|
var applyDefaultOptions2 = (options) => {
|
|
117430
117445
|
return {
|
|
117431
117446
|
...applyDefaultOptions({ plugins: [], ...options, platform: "node" }),
|
|
117447
|
+
getConfig: nodeConfig,
|
|
117432
117448
|
transports: ["pino-pretty", "pino-loki"]
|
|
117433
117449
|
};
|
|
117434
117450
|
};
|