@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
|
@@ -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,169 @@ 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-browser/get-config.ts
|
|
117347
|
+
var import_devkit2 = __toESM(require_devkit());
|
|
117348
|
+
function modernBrowserConfig({
|
|
117349
|
+
entry,
|
|
117350
|
+
outDir,
|
|
117351
|
+
projectRoot,
|
|
117352
|
+
workspaceRoot,
|
|
117353
|
+
tsconfig = "tsconfig.json",
|
|
117354
|
+
splitting,
|
|
117355
|
+
treeshake,
|
|
117356
|
+
debug = false,
|
|
117357
|
+
shims = true,
|
|
117358
|
+
external,
|
|
117359
|
+
banner = {},
|
|
117360
|
+
platform = "browser",
|
|
117361
|
+
verbose = false,
|
|
117362
|
+
apiReport = true,
|
|
117363
|
+
docModel = true,
|
|
117364
|
+
tsdocMetadata = true,
|
|
117365
|
+
define: define2,
|
|
117366
|
+
env,
|
|
117367
|
+
plugins,
|
|
117368
|
+
generatePackageJson,
|
|
117369
|
+
dtsTsConfig
|
|
117370
|
+
}) {
|
|
117371
|
+
let outputPath = (0, import_devkit2.joinPathFragments)(outDir, "dist", "modern");
|
|
117372
|
+
return {
|
|
117373
|
+
name: "modern",
|
|
117374
|
+
entry,
|
|
117375
|
+
format: ["cjs", "esm", "iife"],
|
|
117376
|
+
target: [
|
|
117377
|
+
"chrome91",
|
|
117378
|
+
"firefox90",
|
|
117379
|
+
"edge91",
|
|
117380
|
+
"safari15",
|
|
117381
|
+
"ios15",
|
|
117382
|
+
"opera77",
|
|
117383
|
+
"esnext"
|
|
117384
|
+
],
|
|
117385
|
+
tsconfig,
|
|
117386
|
+
splitting,
|
|
117387
|
+
generatePackageJson,
|
|
117388
|
+
treeshake: treeshake ? {
|
|
117389
|
+
preset: "recommended"
|
|
117390
|
+
} : false,
|
|
117391
|
+
projectRoot,
|
|
117392
|
+
workspaceRoot,
|
|
117393
|
+
outDir: outputPath,
|
|
117394
|
+
silent: !verbose,
|
|
117395
|
+
metafile: true,
|
|
117396
|
+
shims,
|
|
117397
|
+
external,
|
|
117398
|
+
platform,
|
|
117399
|
+
banner,
|
|
117400
|
+
define: define2,
|
|
117401
|
+
env,
|
|
117402
|
+
dts: false,
|
|
117403
|
+
experimentalDts: {
|
|
117404
|
+
entry,
|
|
117405
|
+
compilerOptions: {
|
|
117406
|
+
...dtsTsConfig,
|
|
117407
|
+
options: {
|
|
117408
|
+
...dtsTsConfig.options,
|
|
117409
|
+
outDir: outputPath
|
|
117410
|
+
}
|
|
117411
|
+
}
|
|
117412
|
+
},
|
|
117413
|
+
/*minify: debug ? false : "terser",
|
|
117414
|
+
terserOptions: {
|
|
117415
|
+
compress: true,
|
|
117416
|
+
ecma: 2020,
|
|
117417
|
+
keep_classnames: true,
|
|
117418
|
+
keep_fnames: true
|
|
117419
|
+
},*/
|
|
117420
|
+
apiReport,
|
|
117421
|
+
docModel,
|
|
117422
|
+
tsdocMetadata,
|
|
117423
|
+
sourcemap: debug,
|
|
117424
|
+
clean: false,
|
|
117425
|
+
tsconfigDecoratorMetadata: true,
|
|
117426
|
+
plugins,
|
|
117427
|
+
outExtension
|
|
117428
|
+
};
|
|
117429
|
+
}
|
|
117430
|
+
function legacyBrowserConfig({
|
|
117431
|
+
entry,
|
|
117432
|
+
outDir,
|
|
117433
|
+
projectRoot,
|
|
117434
|
+
workspaceRoot,
|
|
117435
|
+
tsconfig = "tsconfig.json",
|
|
117436
|
+
splitting,
|
|
117437
|
+
treeshake,
|
|
117438
|
+
debug = false,
|
|
117439
|
+
external,
|
|
117440
|
+
banner = {},
|
|
117441
|
+
platform = "browser",
|
|
117442
|
+
verbose = false,
|
|
117443
|
+
shims = true,
|
|
117444
|
+
define: define2,
|
|
117445
|
+
env,
|
|
117446
|
+
plugins,
|
|
117447
|
+
generatePackageJson,
|
|
117448
|
+
dtsTsConfig
|
|
117449
|
+
}) {
|
|
117450
|
+
let outputPath = (0, import_devkit2.joinPathFragments)(outDir, "dist", "legacy");
|
|
117451
|
+
return {
|
|
117452
|
+
name: "legacy",
|
|
117453
|
+
entry,
|
|
117454
|
+
format: ["cjs", "esm", "iife"],
|
|
117455
|
+
target: ["es2022"],
|
|
117456
|
+
tsconfig,
|
|
117457
|
+
splitting,
|
|
117458
|
+
generatePackageJson,
|
|
117459
|
+
treeshake: treeshake ? {
|
|
117460
|
+
preset: "recommended"
|
|
117461
|
+
} : false,
|
|
117462
|
+
projectRoot,
|
|
117463
|
+
workspaceRoot,
|
|
117464
|
+
outDir: outputPath,
|
|
117465
|
+
silent: !verbose,
|
|
117466
|
+
metafile: true,
|
|
117467
|
+
shims,
|
|
117468
|
+
external,
|
|
117469
|
+
platform,
|
|
117470
|
+
banner,
|
|
117471
|
+
define: define2,
|
|
117472
|
+
env,
|
|
117473
|
+
dts: false,
|
|
117474
|
+
experimentalDts: {
|
|
117475
|
+
entry,
|
|
117476
|
+
compilerOptions: {
|
|
117477
|
+
...dtsTsConfig,
|
|
117478
|
+
options: {
|
|
117479
|
+
...dtsTsConfig.options,
|
|
117480
|
+
outDir: outputPath
|
|
117481
|
+
}
|
|
117482
|
+
}
|
|
117483
|
+
},
|
|
117484
|
+
/*minify: debug ? false : "terser",
|
|
117485
|
+
terserOptions: {
|
|
117486
|
+
compress: true,
|
|
117487
|
+
ecma: 2020,
|
|
117488
|
+
keep_classnames: true,
|
|
117489
|
+
keep_fnames: true
|
|
117490
|
+
},*/
|
|
117491
|
+
apiReport: false,
|
|
117492
|
+
docModel: false,
|
|
117493
|
+
tsdocMetadata: false,
|
|
117494
|
+
sourcemap: debug,
|
|
117495
|
+
clean: false,
|
|
117496
|
+
tsconfigDecoratorMetadata: true,
|
|
117497
|
+
plugins,
|
|
117498
|
+
outExtension
|
|
117499
|
+
};
|
|
117500
|
+
}
|
|
117405
117501
|
|
|
117406
117502
|
// packages/workspace-tools/src/executors/tsup-browser/executor.ts
|
|
117407
117503
|
var tsNodeBuildExecutorFn = (options, context, config) => {
|
|
@@ -117429,6 +117525,10 @@ var tsNodeBuildExecutorFn = (options, context, config) => {
|
|
|
117429
117525
|
var applyDefaultOptions2 = (options) => {
|
|
117430
117526
|
return {
|
|
117431
117527
|
...applyDefaultOptions({ plugins: [], ...options, platform: "browser" }),
|
|
117528
|
+
getConfig: {
|
|
117529
|
+
"dist/modern": modernBrowserConfig,
|
|
117530
|
+
"dist/legacy": legacyBrowserConfig
|
|
117531
|
+
},
|
|
117432
117532
|
transports: ["pino-pretty"]
|
|
117433
117533
|
};
|
|
117434
117534
|
};
|