@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
|
@@ -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,87 @@ ${externalDependencies.map((dep) => {
|
|
|
117120
117047
|
packageJson.dependencies[packageName] = "latest";
|
|
117121
117048
|
}
|
|
117122
117049
|
});
|
|
117050
|
+
console.log(JSON.stringify(options.getConfig));
|
|
117051
|
+
const distPaths = !options?.getConfig || _isFunction(options.getConfig) ? [""] : Object.keys(options.getConfig).map((key) => `${key}/`);
|
|
117123
117052
|
packageJson.type = "module";
|
|
117124
|
-
|
|
117125
|
-
|
|
117126
|
-
|
|
117127
|
-
|
|
117128
|
-
|
|
117129
|
-
|
|
117130
|
-
|
|
117131
|
-
|
|
117132
|
-
|
|
117133
|
-
|
|
117134
|
-
|
|
117135
|
-
|
|
117136
|
-
|
|
117053
|
+
if (distPaths.length > 1) {
|
|
117054
|
+
packageJson.exports ??= {
|
|
117055
|
+
".": {
|
|
117056
|
+
import: {
|
|
117057
|
+
types: `./${distPaths[0]}index.d.ts`,
|
|
117058
|
+
default: `./${distPaths[0]}index.js`
|
|
117059
|
+
},
|
|
117060
|
+
require: {
|
|
117061
|
+
types: `./${distPaths[0]}index.d.cts`,
|
|
117062
|
+
default: `./${distPaths[0]}index.cjs`
|
|
117063
|
+
},
|
|
117064
|
+
default: {
|
|
117065
|
+
types: `./${distPaths[0]}index.d.ts`,
|
|
117066
|
+
default: `./${distPaths[0]}index.js`
|
|
117067
|
+
},
|
|
117068
|
+
...(options.additionalEntryPoints ?? []).map((entryPoint) => ({
|
|
117069
|
+
[removeExtension(entryPoint).replace(sourceRoot, "")]: {
|
|
117070
|
+
types: (0, import_path4.join)(
|
|
117071
|
+
`./${distPaths[0]}`,
|
|
117072
|
+
`${removeExtension(entryPoint.replace(sourceRoot, ""))}.d.ts`
|
|
117073
|
+
),
|
|
117074
|
+
default: (0, import_path4.join)(
|
|
117075
|
+
`./${distPaths[0]}`,
|
|
117076
|
+
`${removeExtension(entryPoint.replace(sourceRoot, ""))}.js`
|
|
117077
|
+
)
|
|
117078
|
+
}
|
|
117079
|
+
}))
|
|
117137
117080
|
},
|
|
117138
|
-
|
|
117139
|
-
|
|
117140
|
-
|
|
117141
|
-
|
|
117142
|
-
|
|
117143
|
-
|
|
117144
|
-
|
|
117145
|
-
|
|
117146
|
-
|
|
117147
|
-
|
|
117081
|
+
"./package.json": "./package.json"
|
|
117082
|
+
};
|
|
117083
|
+
packageJson.exports = Object.keys(entry).reduce(
|
|
117084
|
+
(ret, key) => {
|
|
117085
|
+
let packageJsonKey = key.startsWith("./") ? key : `./${key}`;
|
|
117086
|
+
packageJsonKey = packageJsonKey.replaceAll("/index", "");
|
|
117087
|
+
if (!ret[packageJsonKey]) {
|
|
117088
|
+
ret[packageJsonKey] = {
|
|
117089
|
+
import: {
|
|
117090
|
+
types: `./${distPaths[0]}index.d.ts`,
|
|
117091
|
+
default: `./${distPaths[0]}${key}.js`
|
|
117092
|
+
},
|
|
117093
|
+
require: {
|
|
117094
|
+
types: `./${distPaths[0]}index.d.cts`,
|
|
117095
|
+
default: `./${distPaths[0]}${key}.cjs`
|
|
117096
|
+
},
|
|
117097
|
+
default: {
|
|
117098
|
+
types: `./${distPaths[0]}index.d.ts`,
|
|
117099
|
+
default: `./${distPaths[0]}${key}.js`
|
|
117100
|
+
}
|
|
117101
|
+
};
|
|
117148
117102
|
}
|
|
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
|
-
};
|
|
117103
|
+
return ret;
|
|
117104
|
+
},
|
|
117105
|
+
packageJson.exports
|
|
117106
|
+
);
|
|
117107
|
+
packageJson.funding ??= workspacePackageJson.funding;
|
|
117108
|
+
packageJson.types ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
|
|
117109
|
+
packageJson.typings ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`;
|
|
117110
|
+
packageJson.typescript ??= {
|
|
117111
|
+
definition: `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.d.ts`
|
|
117112
|
+
};
|
|
117113
|
+
packageJson.main ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.cjs`;
|
|
117114
|
+
packageJson.module ??= `${distPaths.length > 1 ? distPaths[1] : distPaths[0]}index.js`;
|
|
117115
|
+
options.platform && options.platform !== "node" && (packageJson.browser ??= `${distPaths[0]}index.global.js`);
|
|
117116
|
+
if (options.includeSrc === true) {
|
|
117117
|
+
let distSrc = sourceRoot.replace(projectRoot, "");
|
|
117118
|
+
if (distSrc.startsWith("/")) {
|
|
117119
|
+
distSrc = distSrc.substring(1);
|
|
117172
117120
|
}
|
|
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/**/*");
|
|
117121
|
+
packageJson.source ??= `${(0, import_path4.join)(distSrc, "index.ts").replaceAll(
|
|
117122
|
+
"\\",
|
|
117123
|
+
"/"
|
|
117124
|
+
)}`;
|
|
117125
|
+
}
|
|
117126
|
+
packageJson.sideEffects ??= false;
|
|
117127
|
+
packageJson.files ??= ["dist/**/*"];
|
|
117128
|
+
if (options.includeSrc === true && !packageJson.files.includes("src")) {
|
|
117129
|
+
packageJson.files.push("src/**/*");
|
|
117130
|
+
}
|
|
117200
117131
|
}
|
|
117201
117132
|
packageJson.publishConfig ??= {
|
|
117202
117133
|
access: "public"
|
|
@@ -117225,10 +117156,10 @@ ${externalDependencies.map((dep) => {
|
|
|
117225
117156
|
}
|
|
117226
117157
|
if (options.includeSrc === true) {
|
|
117227
117158
|
const files = globSync([
|
|
117228
|
-
(0,
|
|
117229
|
-
(0,
|
|
117230
|
-
(0,
|
|
117231
|
-
(0,
|
|
117159
|
+
(0, import_devkit.joinPathFragments)(context.root, options.outputPath, "src/**/*.ts"),
|
|
117160
|
+
(0, import_devkit.joinPathFragments)(context.root, options.outputPath, "src/**/*.tsx"),
|
|
117161
|
+
(0, import_devkit.joinPathFragments)(context.root, options.outputPath, "src/**/*.js"),
|
|
117162
|
+
(0, import_devkit.joinPathFragments)(context.root, options.outputPath, "src/**/*.jsx")
|
|
117232
117163
|
]);
|
|
117233
117164
|
await Promise.allSettled(
|
|
117234
117165
|
files.map(
|
|
@@ -117300,10 +117231,12 @@ ${options.banner}
|
|
|
117300
117231
|
outputPath: options.outputPath,
|
|
117301
117232
|
entry
|
|
117302
117233
|
};
|
|
117303
|
-
const
|
|
117304
|
-
|
|
117305
|
-
|
|
117306
|
-
|
|
117234
|
+
const getConfigFns = _isFunction(options.getConfig) ? [options.getConfig] : Object.keys(options.getConfig).map((key) => options.getConfig[key]);
|
|
117235
|
+
const config = (0, import_tsup.defineConfig)(
|
|
117236
|
+
getConfigFns.map(
|
|
117237
|
+
(getConfigFn) => getConfig(context.root, projectRoot, getConfigFn, getConfigOptions)
|
|
117238
|
+
)
|
|
117239
|
+
);
|
|
117307
117240
|
if (typeof config === "function") {
|
|
117308
117241
|
await build(await Promise.resolve(config({})));
|
|
117309
117242
|
} else {
|
|
@@ -117343,7 +117276,7 @@ function getNormalizedTsConfig(workspaceRoot, outputPath, options) {
|
|
|
117343
117276
|
);
|
|
117344
117277
|
tsConfig.options.pathsBasePath = workspaceRoot;
|
|
117345
117278
|
if (tsConfig.options.incremental && !tsConfig.options.tsBuildInfoFile) {
|
|
117346
|
-
tsConfig.options.tsBuildInfoFile = (0,
|
|
117279
|
+
tsConfig.options.tsBuildInfoFile = (0, import_devkit.joinPathFragments)(
|
|
117347
117280
|
outputPath,
|
|
117348
117281
|
"tsconfig.tsbuildinfo"
|
|
117349
117282
|
);
|
|
@@ -117390,6 +117323,7 @@ var applyDefaultOptions = (options) => {
|
|
|
117390
117323
|
options.define ??= {};
|
|
117391
117324
|
options.env ??= {};
|
|
117392
117325
|
options.verbose ??= !!process.env.CI;
|
|
117326
|
+
options.getConfig ??= defaultConfig;
|
|
117393
117327
|
return options;
|
|
117394
117328
|
};
|
|
117395
117329
|
var executor_default = withRunExecutor(
|
|
@@ -117402,6 +117336,169 @@ var executor_default = withRunExecutor(
|
|
|
117402
117336
|
}
|
|
117403
117337
|
}
|
|
117404
117338
|
);
|
|
117339
|
+
var _isFunction = (value) => {
|
|
117340
|
+
try {
|
|
117341
|
+
return value instanceof Function || typeof value === "function" || !!(value && value.constructor && value?.call && value?.apply);
|
|
117342
|
+
} catch (e) {
|
|
117343
|
+
return false;
|
|
117344
|
+
}
|
|
117345
|
+
};
|
|
117346
|
+
|
|
117347
|
+
// packages/workspace-tools/src/executors/tsup-neutral/get-config.ts
|
|
117348
|
+
var import_devkit2 = __toESM(require_devkit());
|
|
117349
|
+
function modernNeutralConfig({
|
|
117350
|
+
entry,
|
|
117351
|
+
outDir,
|
|
117352
|
+
projectRoot,
|
|
117353
|
+
workspaceRoot,
|
|
117354
|
+
tsconfig = "tsconfig.json",
|
|
117355
|
+
splitting,
|
|
117356
|
+
treeshake,
|
|
117357
|
+
debug = false,
|
|
117358
|
+
shims = true,
|
|
117359
|
+
external,
|
|
117360
|
+
banner = {},
|
|
117361
|
+
platform = "neutral",
|
|
117362
|
+
verbose = false,
|
|
117363
|
+
apiReport = true,
|
|
117364
|
+
docModel = true,
|
|
117365
|
+
tsdocMetadata = true,
|
|
117366
|
+
define: define2,
|
|
117367
|
+
env,
|
|
117368
|
+
plugins,
|
|
117369
|
+
generatePackageJson,
|
|
117370
|
+
dtsTsConfig
|
|
117371
|
+
}) {
|
|
117372
|
+
let outputPath = (0, import_devkit2.joinPathFragments)(outDir, "dist", "modern");
|
|
117373
|
+
return {
|
|
117374
|
+
name: "modern",
|
|
117375
|
+
entry,
|
|
117376
|
+
format: ["cjs", "esm", "iife"],
|
|
117377
|
+
target: [
|
|
117378
|
+
"chrome91",
|
|
117379
|
+
"firefox90",
|
|
117380
|
+
"edge91",
|
|
117381
|
+
"safari15",
|
|
117382
|
+
"ios15",
|
|
117383
|
+
"opera77",
|
|
117384
|
+
"esnext"
|
|
117385
|
+
],
|
|
117386
|
+
tsconfig,
|
|
117387
|
+
splitting,
|
|
117388
|
+
generatePackageJson,
|
|
117389
|
+
treeshake: treeshake ? {
|
|
117390
|
+
preset: "recommended"
|
|
117391
|
+
} : false,
|
|
117392
|
+
projectRoot,
|
|
117393
|
+
workspaceRoot,
|
|
117394
|
+
outDir: outputPath,
|
|
117395
|
+
silent: !verbose,
|
|
117396
|
+
metafile: true,
|
|
117397
|
+
shims,
|
|
117398
|
+
external,
|
|
117399
|
+
platform,
|
|
117400
|
+
banner,
|
|
117401
|
+
define: define2,
|
|
117402
|
+
env,
|
|
117403
|
+
dts: false,
|
|
117404
|
+
experimentalDts: {
|
|
117405
|
+
entry,
|
|
117406
|
+
compilerOptions: {
|
|
117407
|
+
...dtsTsConfig,
|
|
117408
|
+
options: {
|
|
117409
|
+
...dtsTsConfig.options,
|
|
117410
|
+
outDir: outputPath
|
|
117411
|
+
}
|
|
117412
|
+
}
|
|
117413
|
+
},
|
|
117414
|
+
/*minify: debug ? false : "terser",
|
|
117415
|
+
terserOptions: {
|
|
117416
|
+
compress: true,
|
|
117417
|
+
ecma: 2020,
|
|
117418
|
+
keep_classnames: true,
|
|
117419
|
+
keep_fnames: true
|
|
117420
|
+
},*/
|
|
117421
|
+
apiReport,
|
|
117422
|
+
docModel,
|
|
117423
|
+
tsdocMetadata,
|
|
117424
|
+
sourcemap: debug,
|
|
117425
|
+
clean: false,
|
|
117426
|
+
tsconfigDecoratorMetadata: true,
|
|
117427
|
+
plugins,
|
|
117428
|
+
outExtension
|
|
117429
|
+
};
|
|
117430
|
+
}
|
|
117431
|
+
function legacyNeutralConfig({
|
|
117432
|
+
entry,
|
|
117433
|
+
outDir,
|
|
117434
|
+
projectRoot,
|
|
117435
|
+
workspaceRoot,
|
|
117436
|
+
tsconfig = "tsconfig.json",
|
|
117437
|
+
splitting,
|
|
117438
|
+
treeshake,
|
|
117439
|
+
debug = false,
|
|
117440
|
+
external,
|
|
117441
|
+
banner = {},
|
|
117442
|
+
platform = "neutral",
|
|
117443
|
+
verbose = false,
|
|
117444
|
+
shims = true,
|
|
117445
|
+
define: define2,
|
|
117446
|
+
env,
|
|
117447
|
+
plugins,
|
|
117448
|
+
generatePackageJson,
|
|
117449
|
+
dtsTsConfig
|
|
117450
|
+
}) {
|
|
117451
|
+
let outputPath = (0, import_devkit2.joinPathFragments)(outDir, "dist", "legacy");
|
|
117452
|
+
return {
|
|
117453
|
+
name: "legacy",
|
|
117454
|
+
entry,
|
|
117455
|
+
format: ["cjs", "esm", "iife"],
|
|
117456
|
+
target: ["es2022"],
|
|
117457
|
+
tsconfig,
|
|
117458
|
+
splitting,
|
|
117459
|
+
generatePackageJson,
|
|
117460
|
+
treeshake: treeshake ? {
|
|
117461
|
+
preset: "recommended"
|
|
117462
|
+
} : false,
|
|
117463
|
+
projectRoot,
|
|
117464
|
+
workspaceRoot,
|
|
117465
|
+
outDir: outputPath,
|
|
117466
|
+
silent: !verbose,
|
|
117467
|
+
metafile: true,
|
|
117468
|
+
shims,
|
|
117469
|
+
external,
|
|
117470
|
+
platform,
|
|
117471
|
+
banner,
|
|
117472
|
+
define: define2,
|
|
117473
|
+
env,
|
|
117474
|
+
dts: false,
|
|
117475
|
+
experimentalDts: {
|
|
117476
|
+
entry,
|
|
117477
|
+
compilerOptions: {
|
|
117478
|
+
...dtsTsConfig,
|
|
117479
|
+
options: {
|
|
117480
|
+
...dtsTsConfig.options,
|
|
117481
|
+
outDir: outputPath
|
|
117482
|
+
}
|
|
117483
|
+
}
|
|
117484
|
+
},
|
|
117485
|
+
/*minify: debug ? false : "terser",
|
|
117486
|
+
terserOptions: {
|
|
117487
|
+
compress: true,
|
|
117488
|
+
ecma: 2020,
|
|
117489
|
+
keep_classnames: true,
|
|
117490
|
+
keep_fnames: true
|
|
117491
|
+
},*/
|
|
117492
|
+
apiReport: false,
|
|
117493
|
+
docModel: false,
|
|
117494
|
+
tsdocMetadata: false,
|
|
117495
|
+
sourcemap: debug,
|
|
117496
|
+
clean: false,
|
|
117497
|
+
tsconfigDecoratorMetadata: true,
|
|
117498
|
+
plugins,
|
|
117499
|
+
outExtension
|
|
117500
|
+
};
|
|
117501
|
+
}
|
|
117405
117502
|
|
|
117406
117503
|
// packages/workspace-tools/src/executors/tsup-neutral/executor.ts
|
|
117407
117504
|
var tsNeutralBuildExecutorFn = (options, context, config) => {
|
|
@@ -117433,6 +117530,10 @@ var applyDefaultOptions2 = (options) => {
|
|
|
117433
117530
|
...options,
|
|
117434
117531
|
platform: "neutral"
|
|
117435
117532
|
}),
|
|
117533
|
+
getConfig: {
|
|
117534
|
+
"dist/modern": modernNeutralConfig,
|
|
117535
|
+
"dist/legacy": legacyNeutralConfig
|
|
117536
|
+
},
|
|
117436
117537
|
transports: ["pino-pretty"]
|
|
117437
117538
|
};
|
|
117438
117539
|
};
|