@storm-software/workspace-tools 1.35.5 → 1.36.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 +14 -0
- package/index.js +14625 -14434
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +36185 -188
- package/src/executors/tsup/executor.js +141 -200
- package/src/executors/tsup/schema.d.ts +3 -0
- package/src/executors/tsup-browser/executor.js +294 -193
- package/src/executors/tsup-neutral/executor.js +294 -193
- package/src/executors/tsup-node/executor.js +217 -200
- package/src/executors/tsup/get-config.js +0 -18533
|
@@ -4438,12 +4438,12 @@ var require_install_packages_task = __commonJS({
|
|
|
4438
4438
|
var child_process_1 = require("child_process");
|
|
4439
4439
|
var path_1 = require("path");
|
|
4440
4440
|
var nx_1 = require_nx();
|
|
4441
|
-
var { detectPackageManager, getPackageManagerCommand, joinPathFragments:
|
|
4441
|
+
var { detectPackageManager, getPackageManagerCommand, joinPathFragments: joinPathFragments2 } = (0, nx_1.requireNx)();
|
|
4442
4442
|
function installPackagesTask(tree, alwaysRun = false, cwd = "", packageManager = detectPackageManager(cwd)) {
|
|
4443
|
-
if (!tree.listChanges().find((f) => f.path ===
|
|
4443
|
+
if (!tree.listChanges().find((f) => f.path === joinPathFragments2(cwd, "package.json")) && !alwaysRun) {
|
|
4444
4444
|
return;
|
|
4445
4445
|
}
|
|
4446
|
-
const packageJsonValue = tree.read(
|
|
4446
|
+
const packageJsonValue = tree.read(joinPathFragments2(cwd, "package.json"), "utf-8");
|
|
4447
4447
|
let storedPackageJsonValue = global["__packageJsonInstallCache__"];
|
|
4448
4448
|
if (storedPackageJsonValue != packageJsonValue || alwaysRun) {
|
|
4449
4449
|
global["__packageJsonInstallCache__"] = packageJsonValue;
|
|
@@ -34939,7 +34939,7 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
34939
34939
|
var nx_1 = require_nx();
|
|
34940
34940
|
var get_workspace_layout_1 = require_get_workspace_layout();
|
|
34941
34941
|
var names_1 = require_names();
|
|
34942
|
-
var { joinPathFragments:
|
|
34942
|
+
var { joinPathFragments: joinPathFragments2, normalizePath, logger, readJson, stripIndents, workspaceRoot } = (0, nx_1.requireNx)();
|
|
34943
34943
|
var deprecationWarning = stripIndents`
|
|
34944
34944
|
In Nx 18, generating projects will no longer derive the name and root.
|
|
34945
34945
|
Please provide the exact project name and root in the future.`;
|
|
@@ -35015,14 +35015,14 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
35015
35015
|
if (directory === relativeCwd || directory.startsWith(`${relativeCwd}/`)) {
|
|
35016
35016
|
asProvidedProjectDirectory = directory;
|
|
35017
35017
|
} else {
|
|
35018
|
-
asProvidedProjectDirectory =
|
|
35018
|
+
asProvidedProjectDirectory = joinPathFragments2(relativeCwd, directory);
|
|
35019
35019
|
}
|
|
35020
35020
|
} else if (options.rootProject) {
|
|
35021
35021
|
asProvidedProjectDirectory = ".";
|
|
35022
35022
|
} else {
|
|
35023
35023
|
asProvidedProjectDirectory = relativeCwd;
|
|
35024
35024
|
if (!relativeCwd.endsWith(asProvidedProjectName) && !relativeCwd.endsWith(options.name)) {
|
|
35025
|
-
asProvidedProjectDirectory =
|
|
35025
|
+
asProvidedProjectDirectory = joinPathFragments2(relativeCwd, asProvidedProjectName);
|
|
35026
35026
|
}
|
|
35027
35027
|
}
|
|
35028
35028
|
if (asProvidedProjectName.startsWith("@")) {
|
|
@@ -35055,7 +35055,7 @@ var require_project_name_and_root_utils = __commonJS({
|
|
|
35055
35055
|
const derivedSimpleProjectName = name;
|
|
35056
35056
|
let derivedProjectDirectory = derivedProjectDirectoryWithoutLayout;
|
|
35057
35057
|
if (derivedProjectDirectoryWithoutLayout !== ".") {
|
|
35058
|
-
derivedProjectDirectory =
|
|
35058
|
+
derivedProjectDirectory = joinPathFragments2(layoutDirectory, derivedProjectDirectory);
|
|
35059
35059
|
}
|
|
35060
35060
|
let derivedImportPath;
|
|
35061
35061
|
if (options.projectType === "library") {
|
|
@@ -106223,7 +106223,7 @@ __export(executor_exports, {
|
|
|
106223
106223
|
});
|
|
106224
106224
|
module.exports = __toCommonJS(executor_exports);
|
|
106225
106225
|
var import_esbuild_decorators = __toESM(require_src());
|
|
106226
|
-
var
|
|
106226
|
+
var import_devkit = __toESM(require_devkit());
|
|
106227
106227
|
var import_js = __toESM(require_src2());
|
|
106228
106228
|
var import_normalize_options = __toESM(require_normalize_options());
|
|
106229
106229
|
var import_tsc = __toESM(require_tsc_impl());
|
|
@@ -116676,33 +116676,8 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
116676
116676
|
}
|
|
116677
116677
|
};
|
|
116678
116678
|
|
|
116679
|
-
// packages/workspace-tools/src/
|
|
116680
|
-
|
|
116681
|
-
return filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
|
|
116682
|
-
};
|
|
116683
|
-
|
|
116684
|
-
// packages/workspace-tools/src/utils/get-project-configurations.ts
|
|
116685
|
-
var import_retrieve_workspace_files = require("nx/src/project-graph/utils/retrieve-workspace-files");
|
|
116686
|
-
var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(
|
|
116687
|
-
getWorkspaceRoot()
|
|
116688
|
-
);
|
|
116689
|
-
|
|
116690
|
-
// packages/workspace-tools/src/utils/get-project-deps.ts
|
|
116691
|
-
function getExternalDependencies(projectName, graph) {
|
|
116692
|
-
const allDeps = graph.dependencies[projectName];
|
|
116693
|
-
return Array.from(
|
|
116694
|
-
allDeps.reduce((acc, node) => {
|
|
116695
|
-
const found = graph.externalNodes[node.target];
|
|
116696
|
-
if (found)
|
|
116697
|
-
acc.push(found);
|
|
116698
|
-
return acc;
|
|
116699
|
-
}, [])
|
|
116700
|
-
);
|
|
116701
|
-
}
|
|
116702
|
-
|
|
116703
|
-
// packages/workspace-tools/src/executors/tsup/get-config.ts
|
|
116704
|
-
var import_devkit = __toESM(require_devkit());
|
|
116705
|
-
function modernConfig({
|
|
116679
|
+
// packages/workspace-tools/src/base/get-tsup-config.ts
|
|
116680
|
+
function defaultConfig({
|
|
116706
116681
|
entry,
|
|
116707
116682
|
outDir,
|
|
116708
116683
|
projectRoot,
|
|
@@ -116725,9 +116700,8 @@ function modernConfig({
|
|
|
116725
116700
|
generatePackageJson,
|
|
116726
116701
|
dtsTsConfig
|
|
116727
116702
|
}) {
|
|
116728
|
-
let outputPath = (0, import_devkit.joinPathFragments)(outDir, "dist", "modern");
|
|
116729
116703
|
return {
|
|
116730
|
-
name: "
|
|
116704
|
+
name: "default",
|
|
116731
116705
|
entry,
|
|
116732
116706
|
format: platform !== "node" ? ["cjs", "esm", "iife"] : ["cjs", "esm"],
|
|
116733
116707
|
target: platform !== "node" ? [
|
|
@@ -116747,7 +116721,7 @@ function modernConfig({
|
|
|
116747
116721
|
} : false,
|
|
116748
116722
|
projectRoot,
|
|
116749
116723
|
workspaceRoot,
|
|
116750
|
-
outDir
|
|
116724
|
+
outDir,
|
|
116751
116725
|
silent: !verbose,
|
|
116752
116726
|
metafile: true,
|
|
116753
116727
|
shims,
|
|
@@ -116763,7 +116737,7 @@ function modernConfig({
|
|
|
116763
116737
|
...dtsTsConfig,
|
|
116764
116738
|
options: {
|
|
116765
116739
|
...dtsTsConfig.options,
|
|
116766
|
-
outDir
|
|
116740
|
+
outDir
|
|
116767
116741
|
}
|
|
116768
116742
|
}
|
|
116769
116743
|
},
|
|
@@ -116784,77 +116758,6 @@ function modernConfig({
|
|
|
116784
116758
|
outExtension
|
|
116785
116759
|
};
|
|
116786
116760
|
}
|
|
116787
|
-
function legacyConfig({
|
|
116788
|
-
entry,
|
|
116789
|
-
outDir,
|
|
116790
|
-
projectRoot,
|
|
116791
|
-
workspaceRoot,
|
|
116792
|
-
tsconfig = "tsconfig.json",
|
|
116793
|
-
splitting,
|
|
116794
|
-
treeshake,
|
|
116795
|
-
debug = false,
|
|
116796
|
-
external,
|
|
116797
|
-
banner = {},
|
|
116798
|
-
platform = "neutral",
|
|
116799
|
-
verbose = false,
|
|
116800
|
-
shims = true,
|
|
116801
|
-
define: define2,
|
|
116802
|
-
env,
|
|
116803
|
-
plugins,
|
|
116804
|
-
generatePackageJson,
|
|
116805
|
-
dtsTsConfig
|
|
116806
|
-
}) {
|
|
116807
|
-
let outputPath = (0, import_devkit.joinPathFragments)(outDir, "dist", "legacy");
|
|
116808
|
-
return {
|
|
116809
|
-
name: "legacy",
|
|
116810
|
-
entry,
|
|
116811
|
-
format: platform !== "node" ? ["cjs", "esm", "iife"] : ["cjs", "esm"],
|
|
116812
|
-
target: platform !== "node" ? ["es2022"] : ["es2022", "node18"],
|
|
116813
|
-
tsconfig,
|
|
116814
|
-
splitting,
|
|
116815
|
-
generatePackageJson,
|
|
116816
|
-
treeshake: treeshake ? {
|
|
116817
|
-
preset: "recommended"
|
|
116818
|
-
} : false,
|
|
116819
|
-
projectRoot,
|
|
116820
|
-
workspaceRoot,
|
|
116821
|
-
outDir: outputPath,
|
|
116822
|
-
silent: !verbose,
|
|
116823
|
-
metafile: true,
|
|
116824
|
-
shims,
|
|
116825
|
-
external,
|
|
116826
|
-
platform,
|
|
116827
|
-
banner,
|
|
116828
|
-
define: define2,
|
|
116829
|
-
env,
|
|
116830
|
-
dts: false,
|
|
116831
|
-
experimentalDts: {
|
|
116832
|
-
entry,
|
|
116833
|
-
compilerOptions: {
|
|
116834
|
-
...dtsTsConfig,
|
|
116835
|
-
options: {
|
|
116836
|
-
...dtsTsConfig.options,
|
|
116837
|
-
outDir: outputPath
|
|
116838
|
-
}
|
|
116839
|
-
}
|
|
116840
|
-
},
|
|
116841
|
-
/*minify: debug ? false : "terser",
|
|
116842
|
-
terserOptions: {
|
|
116843
|
-
compress: true,
|
|
116844
|
-
ecma: 2020,
|
|
116845
|
-
keep_classnames: true,
|
|
116846
|
-
keep_fnames: true
|
|
116847
|
-
},*/
|
|
116848
|
-
apiReport: false,
|
|
116849
|
-
docModel: false,
|
|
116850
|
-
tsdocMetadata: false,
|
|
116851
|
-
sourcemap: debug,
|
|
116852
|
-
clean: false,
|
|
116853
|
-
tsconfigDecoratorMetadata: true,
|
|
116854
|
-
plugins,
|
|
116855
|
-
outExtension
|
|
116856
|
-
};
|
|
116857
|
-
}
|
|
116858
116761
|
function getConfig(workspaceRoot, projectRoot, getConfigFn, {
|
|
116859
116762
|
outputPath,
|
|
116860
116763
|
tsConfig,
|
|
@@ -116891,6 +116794,30 @@ var outExtension = ({ format: format2 }) => {
|
|
|
116891
116794
|
};
|
|
116892
116795
|
};
|
|
116893
116796
|
|
|
116797
|
+
// packages/workspace-tools/src/utils/file-path-utils.ts
|
|
116798
|
+
var removeExtension = (filePath) => {
|
|
116799
|
+
return filePath.lastIndexOf(".") ? filePath.substring(0, filePath.lastIndexOf(".")) : filePath;
|
|
116800
|
+
};
|
|
116801
|
+
|
|
116802
|
+
// packages/workspace-tools/src/utils/get-project-configurations.ts
|
|
116803
|
+
var import_retrieve_workspace_files = require("nx/src/project-graph/utils/retrieve-workspace-files");
|
|
116804
|
+
var getProjectConfigurations = () => (0, import_retrieve_workspace_files.retrieveProjectConfigurationsWithoutPluginInference)(
|
|
116805
|
+
getWorkspaceRoot()
|
|
116806
|
+
);
|
|
116807
|
+
|
|
116808
|
+
// packages/workspace-tools/src/utils/get-project-deps.ts
|
|
116809
|
+
function getExternalDependencies(projectName, graph) {
|
|
116810
|
+
const allDeps = graph.dependencies[projectName];
|
|
116811
|
+
return Array.from(
|
|
116812
|
+
allDeps.reduce((acc, node) => {
|
|
116813
|
+
const found = graph.externalNodes[node.target];
|
|
116814
|
+
if (found)
|
|
116815
|
+
acc.push(found);
|
|
116816
|
+
return acc;
|
|
116817
|
+
}, [])
|
|
116818
|
+
);
|
|
116819
|
+
}
|
|
116820
|
+
|
|
116894
116821
|
// packages/workspace-tools/src/executors/tsup/executor.ts
|
|
116895
116822
|
async function tsupExecutorFn(options, context) {
|
|
116896
116823
|
try {
|
|
@@ -116947,8 +116874,8 @@ ${Object.keys(options).map(
|
|
|
116947
116874
|
throw new Error("The Build process failed trying to copy assets");
|
|
116948
116875
|
}
|
|
116949
116876
|
const pathToPackageJson = (0, import_path4.join)(context.root, projectRoot, "package.json");
|
|
116950
|
-
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0,
|
|
116951
|
-
const workspacePackageJson = (0,
|
|
116877
|
+
const packageJson = (0, import_fileutils.fileExists)(pathToPackageJson) ? (0, import_devkit.readJsonFile)(pathToPackageJson) : { name: context.projectName, version: "0.0.1" };
|
|
116878
|
+
const workspacePackageJson = (0, import_devkit.readJsonFile)(
|
|
116952
116879
|
(0, import_path4.join)(workspaceRoot, "package.json")
|
|
116953
116880
|
);
|
|
116954
116881
|
options.external = options.external || [];
|
|
@@ -116987,7 +116914,7 @@ ${Object.keys(options).map(
|
|
|
116987
116914
|
console.log(`\u26A1 Adding implicit dependency: ${key}`);
|
|
116988
116915
|
const projectConfig = projectConfigs[key];
|
|
116989
116916
|
if (projectConfig?.targets?.build) {
|
|
116990
|
-
const projectPackageJson = (0,
|
|
116917
|
+
const projectPackageJson = (0, import_devkit.readJsonFile)(
|
|
116991
116918
|
projectConfig.targets?.build.options.project
|
|
116992
116919
|
);
|
|
116993
116920
|
if (projectPackageJson?.name && !options.external.includes(projectPackageJson.name)) {
|
|
@@ -117037,7 +116964,7 @@ ${externalDependencies.map((dep) => {
|
|
|
117037
116964
|
entryPoints.push(options.entry);
|
|
117038
116965
|
}
|
|
117039
116966
|
if (options.emitOnAll === true) {
|
|
117040
|
-
entryPoints.push((0,
|
|
116967
|
+
entryPoints.push((0, import_devkit.joinPathFragments)(sourceRoot, "**/*.{ts,tsx}"));
|
|
117041
116968
|
}
|
|
117042
116969
|
if (options.additionalEntryPoints) {
|
|
117043
116970
|
entryPoints.push(...options.additionalEntryPoints);
|
|
@@ -117049,7 +116976,7 @@ ${externalDependencies.map((dep) => {
|
|
|
117049
116976
|
if (formattedPath.toUpperCase().startsWith("C:")) {
|
|
117050
116977
|
formattedPath = formattedPath.substring(2);
|
|
117051
116978
|
}
|
|
117052
|
-
let propertyKey = (0,
|
|
116979
|
+
let propertyKey = (0, import_devkit.joinPathFragments)(
|
|
117053
116980
|
filePath.path,
|
|
117054
116981
|
removeExtension(filePath.name)
|
|
117055
116982
|
).replaceAll("\\", "/").replaceAll(formattedPath, "").replaceAll(sourceRoot, "").replaceAll(projectRoot, "");
|
|
@@ -117058,19 +116985,19 @@ ${externalDependencies.map((dep) => {
|
|
|
117058
116985
|
propertyKey = propertyKey.substring(1);
|
|
117059
116986
|
}
|
|
117060
116987
|
console.debug(
|
|
117061
|
-
`Trying to add entry point ${propertyKey} at "${(0,
|
|
116988
|
+
`Trying to add entry point ${propertyKey} at "${(0, import_devkit.joinPathFragments)(
|
|
117062
116989
|
filePath.path,
|
|
117063
116990
|
filePath.name
|
|
117064
116991
|
)}"`
|
|
117065
116992
|
);
|
|
117066
116993
|
if (!(propertyKey in ret)) {
|
|
117067
|
-
ret[propertyKey] = (0,
|
|
116994
|
+
ret[propertyKey] = (0, import_devkit.joinPathFragments)(filePath.path, filePath.name);
|
|
117068
116995
|
}
|
|
117069
116996
|
}
|
|
117070
116997
|
return ret;
|
|
117071
116998
|
}, {});
|
|
117072
116999
|
if (options.generatePackageJson !== false) {
|
|
117073
|
-
const projectGraph = (0,
|
|
117000
|
+
const projectGraph = (0, import_devkit.readCachedProjectGraph)();
|
|
117074
117001
|
delete packageJson.dependencies;
|
|
117075
117002
|
externalDependencies.forEach((externalDependency) => {
|
|
117076
117003
|
const packageConfig = externalDependency.node.data;
|
|
@@ -117089,83 +117016,87 @@ ${externalDependencies.map((dep) => {
|
|
|
117089
117016
|
packageJson.dependencies[packageName] = "latest";
|
|
117090
117017
|
}
|
|
117091
117018
|
});
|
|
117019
|
+
console.log(JSON.stringify(options.getConfig));
|
|
117020
|
+
const distPaths = !options?.getConfig || _isFunction(options.getConfig) ? [""] : Object.keys(options.getConfig).map((key) => `${key}/`);
|
|
117092
117021
|
packageJson.type = "module";
|
|
117093
|
-
|
|
117094
|
-
|
|
117095
|
-
|
|
117096
|
-
|
|
117097
|
-
|
|
117098
|
-
|
|
117099
|
-
|
|
117100
|
-
|
|
117101
|
-
|
|
117102
|
-
|
|
117103
|
-
|
|
117104
|
-
|
|
117105
|
-
|
|
117022
|
+
if (distPaths.length > 1) {
|
|
117023
|
+
packageJson.exports ??= {
|
|
117024
|
+
".": {
|
|
117025
|
+
import: {
|
|
117026
|
+
types: `./${distPaths[0]}index.d.ts`,
|
|
117027
|
+
default: `./${distPaths[0]}index.js`
|
|
117028
|
+
},
|
|
117029
|
+
require: {
|
|
117030
|
+
types: `./${distPaths[0]}index.d.cts`,
|
|
117031
|
+
default: `./${distPaths[0]}index.cjs`
|
|
117032
|
+
},
|
|
117033
|
+
default: {
|
|
117034
|
+
types: `./${distPaths[0]}index.d.ts`,
|
|
117035
|
+
default: `./${distPaths[0]}index.js`
|
|
117036
|
+
},
|
|
117037
|
+
...(options.additionalEntryPoints ?? []).map((entryPoint) => ({
|
|
117038
|
+
[removeExtension(entryPoint).replace(sourceRoot, "")]: {
|
|
117039
|
+
types: (0, import_path4.join)(
|
|
117040
|
+
`./${distPaths[0]}`,
|
|
117041
|
+
`${removeExtension(entryPoint.replace(sourceRoot, ""))}.d.ts`
|
|
117042
|
+
),
|
|
117043
|
+
default: (0, import_path4.join)(
|
|
117044
|
+
`./${distPaths[0]}`,
|
|
117045
|
+
`${removeExtension(entryPoint.replace(sourceRoot, ""))}.js`
|
|
117046
|
+
)
|
|
117047
|
+
}
|
|
117048
|
+
}))
|
|
117106
117049
|
},
|
|
117107
|
-
|
|
117108
|
-
|
|
117109
|
-
|
|
117110
|
-
|
|
117111
|
-
|
|
117112
|
-
|
|
117113
|
-
|
|
117114
|
-
|
|
117115
|
-
|
|
117116
|
-
|
|
117050
|
+
"./package.json": "./package.json"
|
|
117051
|
+
};
|
|
117052
|
+
packageJson.exports = Object.keys(entry).reduce(
|
|
117053
|
+
(ret, key) => {
|
|
117054
|
+
let packageJsonKey = key.startsWith("./") ? key : `./${key}`;
|
|
117055
|
+
packageJsonKey = packageJsonKey.replaceAll("/index", "");
|
|
117056
|
+
if (!ret[packageJsonKey]) {
|
|
117057
|
+
ret[packageJsonKey] = {
|
|
117058
|
+
import: {
|
|
117059
|
+
types: `./${distPaths[0]}index.d.ts`,
|
|
117060
|
+
default: `./${distPaths[0]}${key}.js`
|
|
117061
|
+
},
|
|
117062
|
+
require: {
|
|
117063
|
+
types: `./${distPaths[0]}index.d.cts`,
|
|
117064
|
+
default: `./${distPaths[0]}${key}.cjs`
|
|
117065
|
+
},
|
|
117066
|
+
default: {
|
|
117067
|
+
types: `./${distPaths[0]}index.d.ts`,
|
|
117068
|
+
default: `./${distPaths[0]}${key}.js`
|
|
117069
|
+
}
|
|
117070
|
+
};
|
|
117117
117071
|
}
|
|
117118
|
-
|
|
117119
|
-
|
|
117120
|
-
|
|
117121
|
-
|
|
117122
|
-
|
|
117123
|
-
|
|
117124
|
-
|
|
117125
|
-
|
|
117126
|
-
|
|
117127
|
-
|
|
117128
|
-
|
|
117129
|
-
|
|
117130
|
-
|
|
117131
|
-
|
|
117132
|
-
|
|
117133
|
-
|
|
117134
|
-
|
|
117135
|
-
},
|
|
117136
|
-
default: {
|
|
117137
|
-
types: "./dist/modern/index.d.ts",
|
|
117138
|
-
default: `./dist/modern/${key}.js`
|
|
117139
|
-
}
|
|
117140
|
-
};
|
|
117072
|
+
return ret;
|
|
117073
|
+
},
|
|
117074
|
+
packageJson.exports
|
|
117075
|
+
);
|
|
117076
|
+
packageJson.funding ??= workspacePackageJson.funding;
|
|
117077
|
+
packageJson.types ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
|
|
117078
|
+
packageJson.typings ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
|
|
117079
|
+
packageJson.typescript ??= {
|
|
117080
|
+
definition: `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`
|
|
117081
|
+
};
|
|
117082
|
+
packageJson.main ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.cjs`;
|
|
117083
|
+
packageJson.module ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.js`;
|
|
117084
|
+
options.platform && options.platform !== "node" && (packageJson.browser ??= `${distPaths[0]}index.global.js`);
|
|
117085
|
+
if (options.includeSrc === true) {
|
|
117086
|
+
let distSrc = sourceRoot.replace(projectRoot, "");
|
|
117087
|
+
if (distSrc.startsWith("/")) {
|
|
117088
|
+
distSrc = distSrc.substring(1);
|
|
117141
117089
|
}
|
|
117142
|
-
|
|
117143
|
-
|
|
117144
|
-
|
|
117145
|
-
|
|
117146
|
-
|
|
117147
|
-
|
|
117148
|
-
|
|
117149
|
-
|
|
117150
|
-
|
|
117151
|
-
|
|
117152
|
-
packageJson.main ??= "dist/legacy/index.cjs";
|
|
117153
|
-
packageJson.module ??= "dist/legacy/index.js";
|
|
117154
|
-
options.platform && options.platform !== "node" && (packageJson.browser ??= "dist/modern/index.global.js");
|
|
117155
|
-
if (options.includeSrc === true) {
|
|
117156
|
-
let distSrc = sourceRoot.replace(projectRoot, "");
|
|
117157
|
-
if (distSrc.startsWith("/")) {
|
|
117158
|
-
distSrc = distSrc.substring(1);
|
|
117159
|
-
}
|
|
117160
|
-
packageJson.source ??= `${(0, import_path4.join)(distSrc, "index.ts").replaceAll(
|
|
117161
|
-
"\\",
|
|
117162
|
-
"/"
|
|
117163
|
-
)}`;
|
|
117164
|
-
}
|
|
117165
|
-
packageJson.sideEffects ??= false;
|
|
117166
|
-
packageJson.files ??= ["dist/**/*"];
|
|
117167
|
-
if (options.includeSrc === true && !packageJson.files.includes("src")) {
|
|
117168
|
-
packageJson.files.push("src/**/*");
|
|
117090
|
+
packageJson.source ??= `${(0, import_path4.join)(distSrc, "index.ts").replaceAll(
|
|
117091
|
+
"\\",
|
|
117092
|
+
"/"
|
|
117093
|
+
)}`;
|
|
117094
|
+
}
|
|
117095
|
+
packageJson.sideEffects ??= false;
|
|
117096
|
+
packageJson.files ??= ["dist/**/*"];
|
|
117097
|
+
if (options.includeSrc === true && !packageJson.files.includes("src")) {
|
|
117098
|
+
packageJson.files.push("src/**/*");
|
|
117099
|
+
}
|
|
117169
117100
|
}
|
|
117170
117101
|
packageJson.publishConfig ??= {
|
|
117171
117102
|
access: "public"
|
|
@@ -117194,10 +117125,10 @@ ${externalDependencies.map((dep) => {
|
|
|
117194
117125
|
}
|
|
117195
117126
|
if (options.includeSrc === true) {
|
|
117196
117127
|
const files = globSync([
|
|
117197
|
-
(0,
|
|
117198
|
-
(0,
|
|
117199
|
-
(0,
|
|
117200
|
-
(0,
|
|
117128
|
+
(0, import_devkit.joinPathFragments)(context.root, options.outputPath, "src/**/*.ts"),
|
|
117129
|
+
(0, import_devkit.joinPathFragments)(context.root, options.outputPath, "src/**/*.tsx"),
|
|
117130
|
+
(0, import_devkit.joinPathFragments)(context.root, options.outputPath, "src/**/*.js"),
|
|
117131
|
+
(0, import_devkit.joinPathFragments)(context.root, options.outputPath, "src/**/*.jsx")
|
|
117201
117132
|
]);
|
|
117202
117133
|
await Promise.allSettled(
|
|
117203
117134
|
files.map(
|
|
@@ -117269,10 +117200,12 @@ ${options.banner}
|
|
|
117269
117200
|
outputPath: options.outputPath,
|
|
117270
117201
|
entry
|
|
117271
117202
|
};
|
|
117272
|
-
const
|
|
117273
|
-
|
|
117274
|
-
|
|
117275
|
-
|
|
117203
|
+
const getConfigFns = _isFunction(options.getConfig) ? [options.getConfig] : Object.keys(options.getConfig).map((key) => options.getConfig[key]);
|
|
117204
|
+
const config = (0, import_tsup.defineConfig)(
|
|
117205
|
+
getConfigFns.map(
|
|
117206
|
+
(getConfigFn) => getConfig(context.root, projectRoot, getConfigFn, getConfigOptions)
|
|
117207
|
+
)
|
|
117208
|
+
);
|
|
117276
117209
|
if (typeof config === "function") {
|
|
117277
117210
|
await build(await Promise.resolve(config({})));
|
|
117278
117211
|
} else {
|
|
@@ -117312,7 +117245,7 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
117312
117245
|
);
|
|
117313
117246
|
tsConfig.options.pathsBasePath = workspaceRoot;
|
|
117314
117247
|
if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {
|
|
117315
|
-
tsConfig.options.tsBuildInfoFile = (0,
|
|
117248
|
+
tsConfig.options.tsBuildInfoFile = (0, import_devkit.joinPathFragments)(
|
|
117316
117249
|
outputPath,
|
|
117317
117250
|
"tsconfig.tsbuildinfo"
|
|
117318
117251
|
);
|
|
@@ -117359,6 +117292,7 @@ var applyDefaultOptions = (options) => {
|
|
|
117359
117292
|
options.define ??= {};
|
|
117360
117293
|
options.env ??= {};
|
|
117361
117294
|
options.verbose ??= !!process.env.CI;
|
|
117295
|
+
options.getConfig ??= defaultConfig;
|
|
117362
117296
|
return options;
|
|
117363
117297
|
};
|
|
117364
117298
|
var executor_default = withRunExecutor(
|
|
@@ -117371,6 +117305,13 @@ var executor_default = withRunExecutor(
|
|
|
117371
117305
|
}
|
|
117372
117306
|
}
|
|
117373
117307
|
);
|
|
117308
|
+
var _isFunction = (value) => {
|
|
117309
|
+
try {
|
|
117310
|
+
return value instanceof Function || typeof value === "function" || !!(value && value.constructor && value?.call && value?.apply);
|
|
117311
|
+
} catch (e) {
|
|
117312
|
+
return false;
|
|
117313
|
+
}
|
|
117314
|
+
};
|
|
117374
117315
|
// Annotate the CommonJS export names for ESM import in node:
|
|
117375
117316
|
0 && (module.exports = {
|
|
117376
117317
|
applyDefaultOptions,
|