@storm-software/workspace-tools 1.240.3 → 1.240.4
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 +6 -0
- package/README.md +1 -1
- package/dist/chunk-2AUNU6UA.mjs +32 -0
- package/dist/{chunk-WPMFZECR.js → chunk-2GRVQNW3.js} +3 -3
- package/dist/{chunk-HCEVPME2.js → chunk-2HD75CLD.js} +11 -11
- package/dist/{chunk-QLOTS3MH.mjs → chunk-3SP4ZXOA.mjs} +2 -2
- package/dist/{chunk-M47JATRY.mjs → chunk-4BEERAL7.mjs} +4 -4
- package/dist/{chunk-XSRDTQ5C.mjs → chunk-5AQJQ72E.mjs} +4 -4
- package/dist/{chunk-ZPWY4RXH.js → chunk-5DAZ2WTI.js} +2 -2
- package/dist/{chunk-WGNNLNSH.mjs → chunk-5XF4CY7D.mjs} +1 -1
- package/dist/{chunk-6TSAUSG4.mjs → chunk-6N67WSX5.mjs} +1 -1
- package/dist/{chunk-XS73BPQS.js → chunk-6QSFQS3X.js} +2 -2
- package/dist/{chunk-BJAK7EVK.js → chunk-7GKIVRFH.js} +6 -6
- package/dist/{chunk-5FEFILUQ.mjs → chunk-7PLUDZNP.mjs} +2 -2
- package/dist/{chunk-NYX3ICKR.mjs → chunk-7Q66XSCS.mjs} +2 -2
- package/dist/{chunk-RN4QXP7F.js → chunk-B6PUPX6O.js} +27 -27
- package/dist/{chunk-XCSSYTCU.js → chunk-BUXJSVJG.js} +11 -5
- package/dist/{chunk-M4PPRKPX.mjs → chunk-CFRPLVEU.mjs} +2 -2
- package/dist/{chunk-FFBZYD6R.mjs → chunk-CLBFXZQ5.mjs} +1 -1
- package/dist/{chunk-PB6J3FU7.js → chunk-D2ECVPJF.js} +2 -2
- package/dist/{chunk-TYAPQ46X.js → chunk-EDVXB4EP.js} +28 -20
- package/dist/{chunk-Y7RQKDIF.js → chunk-EFPBJWHS.js} +5 -5
- package/dist/{chunk-Y5SXJ6IC.mjs → chunk-EUCOXCI2.mjs} +3 -3
- package/dist/{chunk-JKJK4ONU.mjs → chunk-GJ6DN3BR.mjs} +3 -3
- package/dist/{chunk-33S3ENYB.mjs → chunk-GMC262MH.mjs} +4 -4
- package/dist/{chunk-3LJCHADS.js → chunk-GYGIXXAL.js} +5 -5
- package/dist/{chunk-NWSV2EYZ.js → chunk-HONSACRT.js} +2 -2
- package/dist/{chunk-AJ7WQHX5.mjs → chunk-HXU5ZXAJ.mjs} +1 -1
- package/dist/{chunk-CRMDACYF.js → chunk-IBHLVELV.js} +25 -25
- package/dist/{chunk-MQAKNE4X.js → chunk-IF2GIONQ.js} +5 -5
- package/dist/{chunk-I5N7XQEK.mjs → chunk-IUV3RLT4.mjs} +1 -1
- package/dist/{chunk-6NSTM255.js → chunk-JARU6ZVH.js} +41 -41
- package/dist/{chunk-2VV3TV3C.js → chunk-JOJ3CZQC.js} +5 -5
- package/dist/{chunk-2BQA54CQ.mjs → chunk-K62HB3IT.mjs} +1 -1
- package/dist/{chunk-4AOGBZNI.js → chunk-K7QVZAWD.js} +2 -2
- package/dist/{chunk-EGBJI6CN.js → chunk-KLHTXAIU.js} +20 -20
- package/dist/{chunk-RRQ7WHLD.mjs → chunk-KWIXQ4UN.mjs} +3 -3
- package/dist/{chunk-6WRRTV43.js → chunk-L5FYEAAP.js} +62 -62
- package/dist/{chunk-762D6XMQ.mjs → chunk-LNDWWYO3.mjs} +2 -2
- package/dist/chunk-LUQIF4A3.mjs +73 -0
- package/dist/{chunk-MFWYLIWY.mjs → chunk-LYUV4LMB.mjs} +2 -2
- package/dist/{chunk-MZ6IF3DO.js → chunk-MMMTLP2W.js} +5 -5
- package/dist/{chunk-XID4OBY2.mjs → chunk-N7VQR5KC.mjs} +25 -17
- package/dist/{chunk-FOYWFRVO.mjs → chunk-Q45DDLNL.mjs} +2 -2
- package/dist/{chunk-YVJY3MXR.js → chunk-QSLN7UYG.js} +2 -2
- package/dist/{chunk-BWFTYFWM.js → chunk-RFO5NMSB.js} +2 -2
- package/dist/{chunk-4ZKSU75O.js → chunk-RRWRVA7F.js} +15 -15
- package/dist/{chunk-2JLHVV5S.js → chunk-RSILHGEU.js} +21 -21
- package/dist/{chunk-SBHOAJIT.js → chunk-RTFFYOEY.js} +5 -5
- package/dist/{chunk-JXMDPU4I.mjs → chunk-SNFZL5BN.mjs} +3 -3
- package/dist/{chunk-SC3ANGC5.mjs → chunk-T342MIBF.mjs} +3 -3
- package/dist/{chunk-7HUOKMPU.mjs → chunk-TGDWEUKX.mjs} +1 -1
- package/dist/{chunk-JE4JY3YS.mjs → chunk-U4K5KWKS.mjs} +2 -2
- package/dist/{chunk-5MKQX2FE.js → chunk-U6TLQT5H.js} +3 -3
- package/dist/chunk-UF6KFXG5.js +73 -0
- package/dist/{chunk-BFKQCOQJ.mjs → chunk-UI3SQYV3.mjs} +1 -1
- package/dist/{chunk-FBLF4KJF.js → chunk-XHH2IY66.js} +15 -15
- package/dist/{chunk-RXH7O5YP.mjs → chunk-XIOF32ZH.mjs} +1 -1
- package/dist/{chunk-APBDTIK2.js → chunk-YSYBVJGR.js} +2 -2
- package/dist/{chunk-SGSMEZWT.js → chunk-YWKUJJ34.js} +2 -2
- package/dist/{chunk-HO2DSAZ2.mjs → chunk-ZERO7WV2.mjs} +1 -1
- package/dist/{chunk-DMUTOQCB.mjs → chunk-ZOFW74B2.mjs} +1 -1
- package/dist/executors.js +19 -19
- package/dist/executors.mjs +18 -18
- package/dist/generators.js +15 -15
- package/dist/generators.mjs +16 -16
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +43 -33
- package/dist/index.mjs +52 -42
- package/dist/src/base/base-executor.js +6 -6
- package/dist/src/base/base-executor.mjs +5 -5
- package/dist/src/base/base-generator.js +6 -6
- package/dist/src/base/base-generator.mjs +5 -5
- package/dist/src/base/index.js +9 -9
- package/dist/src/base/index.mjs +8 -8
- package/dist/src/executors/cargo-build/executor.js +7 -7
- package/dist/src/executors/cargo-build/executor.mjs +6 -6
- package/dist/src/executors/cargo-check/executor.js +7 -7
- package/dist/src/executors/cargo-check/executor.mjs +6 -6
- package/dist/src/executors/cargo-clippy/executor.js +7 -7
- package/dist/src/executors/cargo-clippy/executor.mjs +6 -6
- package/dist/src/executors/cargo-doc/executor.js +7 -7
- package/dist/src/executors/cargo-doc/executor.mjs +6 -6
- package/dist/src/executors/cargo-format/executor.js +7 -7
- package/dist/src/executors/cargo-format/executor.mjs +6 -6
- package/dist/src/executors/clean-package/executor.js +9 -9
- package/dist/src/executors/clean-package/executor.mjs +5 -5
- package/dist/src/executors/esbuild/executor.js +8 -8
- package/dist/src/executors/esbuild/executor.mjs +7 -7
- package/dist/src/executors/npm-publish/executor.js +4 -4
- package/dist/src/executors/npm-publish/executor.mjs +3 -3
- package/dist/src/executors/size-limit/executor.js +7 -7
- package/dist/src/executors/size-limit/executor.mjs +6 -6
- package/dist/src/executors/tsdown/executor.js +8 -8
- package/dist/src/executors/tsdown/executor.mjs +7 -7
- package/dist/src/executors/typia/executor.js +7 -7
- package/dist/src/executors/typia/executor.mjs +6 -6
- package/dist/src/executors/unbuild/executor.js +7 -7
- package/dist/src/executors/unbuild/executor.mjs +6 -6
- package/dist/src/generators/browser-library/generator.js +9 -9
- package/dist/src/generators/browser-library/generator.mjs +8 -8
- package/dist/src/generators/config-schema/generator.js +7 -7
- package/dist/src/generators/config-schema/generator.mjs +6 -6
- package/dist/src/generators/neutral-library/generator.js +9 -9
- package/dist/src/generators/neutral-library/generator.mjs +8 -8
- package/dist/src/generators/node-library/generator.js +9 -9
- package/dist/src/generators/node-library/generator.mjs +8 -8
- package/dist/src/generators/preset/generator.js +7 -7
- package/dist/src/generators/preset/generator.mjs +6 -6
- package/dist/src/generators/release-version/generator.js +5 -5
- package/dist/src/generators/release-version/generator.mjs +4 -4
- package/dist/src/plugins/typescript/index.js +3 -2
- package/dist/src/plugins/typescript/index.mjs +2 -1
- package/dist/src/plugins/typescript/project-config.js +3 -2
- package/dist/src/plugins/typescript/project-config.mjs +2 -1
- package/dist/src/plugins/typescript/tsdown.js +4 -4
- package/dist/src/plugins/typescript/tsdown.mjs +4 -4
- package/dist/src/plugins/typescript/tsup.js +4 -4
- package/dist/src/plugins/typescript/tsup.mjs +4 -4
- package/dist/src/utils/apply-workspace-tokens.js +4 -4
- package/dist/src/utils/apply-workspace-tokens.mjs +3 -3
- package/dist/src/utils/get-project-configurations.js +4 -4
- package/dist/src/utils/get-project-configurations.mjs +3 -3
- package/dist/src/utils/index.d.mts +2 -0
- package/dist/src/utils/index.d.ts +2 -0
- package/dist/src/utils/index.js +19 -9
- package/dist/src/utils/index.mjs +26 -16
- package/dist/src/utils/plugin-helpers.d.mts +9 -0
- package/dist/src/utils/plugin-helpers.d.ts +9 -0
- package/dist/src/utils/plugin-helpers.js +14 -0
- package/dist/src/utils/plugin-helpers.mjs +14 -0
- package/dist/src/utils/pnpm-deps-update.js +3 -3
- package/dist/src/utils/pnpm-deps-update.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-PVTEDLBL.mjs +0 -26
- /package/dist/{chunk-JGP4YWZY.js → chunk-DO2X7OZO.js} +0 -0
- /package/dist/{chunk-6YZ3OUJB.mjs → chunk-XCVH63OO.mjs} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk6QSFQS3Xjs = require('./chunk-6QSFQS3X.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -11,10 +11,10 @@ var _chunkXS73BPQSjs = require('./chunk-XS73BPQS.js');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkB6PUPX6Ojs = require('./chunk-B6PUPX6O.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkU6TLQT5Hjs = require('./chunk-U6TLQT5H.js');
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
@@ -23,34 +23,34 @@ var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
|
23
23
|
var withRunGenerator = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (name, generatorFn, generatorOptions = {
|
|
24
24
|
skipReadingConfig: false
|
|
25
25
|
}) => async (tree, _options) => {
|
|
26
|
-
const stopwatch =
|
|
26
|
+
const stopwatch = _chunkB6PUPX6Ojs.getStopwatch.call(void 0, name);
|
|
27
27
|
let options = _options;
|
|
28
28
|
let config;
|
|
29
29
|
try {
|
|
30
|
-
|
|
30
|
+
_chunkB6PUPX6Ojs.writeInfo.call(void 0, `\u26A1 Running the ${name} generator...
|
|
31
31
|
|
|
32
32
|
`, config);
|
|
33
|
-
const workspaceRoot =
|
|
33
|
+
const workspaceRoot = _chunkU6TLQT5Hjs.findWorkspaceRoot.call(void 0, );
|
|
34
34
|
if (!generatorOptions.skipReadingConfig) {
|
|
35
|
-
|
|
35
|
+
_chunkB6PUPX6Ojs.writeDebug.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
36
36
|
- workspaceRoot: ${workspaceRoot}`, config);
|
|
37
|
-
config = await
|
|
37
|
+
config = await _chunkB6PUPX6Ojs.getConfig.call(void 0, workspaceRoot);
|
|
38
38
|
}
|
|
39
39
|
if (_optionalChain([generatorOptions, 'optionalAccess', _ => _.hooks, 'optionalAccess', _2 => _2.applyDefaultOptions])) {
|
|
40
|
-
|
|
40
|
+
_chunkB6PUPX6Ojs.writeDebug.call(void 0, "Running the applyDefaultOptions hook...", config);
|
|
41
41
|
options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
|
|
42
|
-
|
|
42
|
+
_chunkB6PUPX6Ojs.writeDebug.call(void 0, "Completed the applyDefaultOptions hook", config);
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
_chunkB6PUPX6Ojs.writeTrace.call(void 0, `Generator schema options \u2699\uFE0F
|
|
45
45
|
${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`, config);
|
|
46
|
-
const tokenized = await
|
|
46
|
+
const tokenized = await _chunk6QSFQS3Xjs.applyWorkspaceTokens.call(void 0, options, {
|
|
47
47
|
workspaceRoot: tree.root,
|
|
48
48
|
config
|
|
49
|
-
},
|
|
49
|
+
}, _chunk6QSFQS3Xjs.applyWorkspaceBaseTokens);
|
|
50
50
|
if (_optionalChain([generatorOptions, 'optionalAccess', _3 => _3.hooks, 'optionalAccess', _4 => _4.preProcess])) {
|
|
51
|
-
|
|
51
|
+
_chunkB6PUPX6Ojs.writeDebug.call(void 0, "Running the preProcess hook...", config);
|
|
52
52
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
53
|
-
|
|
53
|
+
_chunkB6PUPX6Ojs.writeDebug.call(void 0, "Completed the preProcess hook", config);
|
|
54
54
|
}
|
|
55
55
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
56
56
|
if (result) {
|
|
@@ -63,18 +63,18 @@ ${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
if (_optionalChain([generatorOptions, 'optionalAccess', _14 => _14.hooks, 'optionalAccess', _15 => _15.postProcess])) {
|
|
66
|
-
|
|
66
|
+
_chunkB6PUPX6Ojs.writeDebug.call(void 0, "Running the postProcess hook...", config);
|
|
67
67
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
68
|
-
|
|
68
|
+
_chunkB6PUPX6Ojs.writeDebug.call(void 0, "Completed the postProcess hook", config);
|
|
69
69
|
}
|
|
70
70
|
return () => {
|
|
71
|
-
|
|
71
|
+
_chunkB6PUPX6Ojs.writeSuccess.call(void 0, `Completed running the ${name} generator!
|
|
72
72
|
`, config);
|
|
73
73
|
};
|
|
74
74
|
} catch (error) {
|
|
75
75
|
return () => {
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
_chunkB6PUPX6Ojs.writeFatal.call(void 0, "A fatal error occurred while running the generator - the process was forced to terminate", config);
|
|
77
|
+
_chunkB6PUPX6Ojs.writeError.call(void 0, `An exception was thrown in the generator's process
|
|
78
78
|
- Details: ${error.message}
|
|
79
79
|
- Stacktrace: ${error.stack}`, config);
|
|
80
80
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withRunGenerator
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SNFZL5BN.mjs";
|
|
4
4
|
import {
|
|
5
5
|
StormConfigSchema,
|
|
6
6
|
writeInfo,
|
|
7
7
|
writeSuccess,
|
|
8
8
|
writeTrace
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-7Q66XSCS.mjs";
|
|
10
10
|
import {
|
|
11
11
|
findWorkspaceRoot
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZOFW74B2.mjs";
|
|
13
13
|
import {
|
|
14
14
|
__name
|
|
15
15
|
} from "./chunk-XUV4U54K.mjs";
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkRSILHGEUjs = require('./chunk-RSILHGEU.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkIBHLVELVjs = require('./chunk-IBHLVELV.js');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -23,10 +23,10 @@ var _chunkCRMDACYFjs = require('./chunk-CRMDACYF.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkB6PUPX6Ojs = require('./chunk-B6PUPX6O.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
var
|
|
29
|
+
var _chunkBUXJSVJGjs = require('./chunk-BUXJSVJG.js');
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
@@ -208,8 +208,8 @@ var RendererEngine = class {
|
|
|
208
208
|
// ../esbuild/src/clean.ts
|
|
209
209
|
|
|
210
210
|
async function clean(name = "ESBuild", directory, config) {
|
|
211
|
-
|
|
212
|
-
const stopwatch =
|
|
211
|
+
_chunkB6PUPX6Ojs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
|
|
212
|
+
const stopwatch = _chunkB6PUPX6Ojs.getStopwatch.call(void 0, `${name} output clean`);
|
|
213
213
|
await _node.hfs.deleteAll(directory);
|
|
214
214
|
stopwatch();
|
|
215
215
|
}
|
|
@@ -330,7 +330,7 @@ var onErrorPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (option
|
|
|
330
330
|
setup(build4) {
|
|
331
331
|
build4.onEnd((result) => {
|
|
332
332
|
if (result.errors.length > 0 && process.env.WATCH !== "true") {
|
|
333
|
-
|
|
333
|
+
_chunkB6PUPX6Ojs.writeError.call(void 0, `The following errors occurred during the build:
|
|
334
334
|
${result.errors.map((error) => error.text).join("\n")}
|
|
335
335
|
|
|
336
336
|
`, resolvedOptions.config);
|
|
@@ -365,7 +365,7 @@ _chunk3GQAWCBQjs.__name.call(void 0, resolvePathsConfig, "resolvePathsConfig");
|
|
|
365
365
|
var resolvePathsPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
366
366
|
name: "storm:resolve-paths",
|
|
367
367
|
setup(build4) {
|
|
368
|
-
const parentTsConfig = build4.initialOptions.tsconfig ? _chunk3GQAWCBQjs.__require.call(void 0,
|
|
368
|
+
const parentTsConfig = build4.initialOptions.tsconfig ? _chunk3GQAWCBQjs.__require.call(void 0, _chunkBUXJSVJGjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, build4.initialOptions.tsconfig)) : _chunk3GQAWCBQjs.__require.call(void 0, _chunkBUXJSVJGjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, "tsconfig.json"));
|
|
369
369
|
const resolvedTsPaths = resolvePathsConfig(parentTsConfig, options.projectRoot);
|
|
370
370
|
const packagesRegex = new RegExp(`^(${Object.keys(resolvedTsPaths).join("|")})$`);
|
|
371
371
|
build4.onResolve({
|
|
@@ -388,7 +388,7 @@ var resolvePathsPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (o
|
|
|
388
388
|
|
|
389
389
|
var _apiextractor = require('@microsoft/api-extractor');
|
|
390
390
|
function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
391
|
-
const { dependencies, peerDependencies, devDependencies } = _chunk3GQAWCBQjs.__require.call(void 0,
|
|
391
|
+
const { dependencies, peerDependencies, devDependencies } = _chunk3GQAWCBQjs.__require.call(void 0, _chunkBUXJSVJGjs.joinPaths.call(void 0, options.projectRoot, "package.json"));
|
|
392
392
|
const dependenciesKeys = Object.keys(_nullishCoalesce(dependencies, () => ( {}))).flatMap((p) => [
|
|
393
393
|
p,
|
|
394
394
|
getTypeDependencyPackageName(p)
|
|
@@ -424,13 +424,13 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
424
424
|
},
|
|
425
425
|
dtsRollup: {
|
|
426
426
|
enabled: true,
|
|
427
|
-
untrimmedFilePath:
|
|
427
|
+
untrimmedFilePath: _chunkBUXJSVJGjs.joinPaths.call(void 0, options.outdir, `${outfile}.d.ts`)
|
|
428
428
|
},
|
|
429
429
|
tsdocMetadata: {
|
|
430
430
|
enabled: false
|
|
431
431
|
}
|
|
432
432
|
},
|
|
433
|
-
packageJsonFullPath:
|
|
433
|
+
packageJsonFullPath: _chunkBUXJSVJGjs.joinPaths.call(void 0, options.projectRoot, "package.json"),
|
|
434
434
|
configObjectFullPath: void 0
|
|
435
435
|
});
|
|
436
436
|
const extractorResult = _apiextractor.Extractor.invoke(extractorConfig, {
|
|
@@ -438,7 +438,7 @@ function bundleTypeDefinitions(filename, outfile, externals, options) {
|
|
|
438
438
|
localBuild: true
|
|
439
439
|
});
|
|
440
440
|
if (extractorResult.succeeded === false) {
|
|
441
|
-
|
|
441
|
+
_chunkB6PUPX6Ojs.writeError.call(void 0, `API Extractor completed with ${extractorResult.errorCount} ${extractorResult.errorCount === 1 ? "error" : "errors"}`);
|
|
442
442
|
throw new Error("API Extractor completed with errors");
|
|
443
443
|
}
|
|
444
444
|
}
|
|
@@ -457,12 +457,12 @@ var tscPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options, r
|
|
|
457
457
|
const sourceRoot = resolvedOptions.sourceRoot.replaceAll(resolvedOptions.projectRoot, "");
|
|
458
458
|
const typeOutDir = resolvedOptions.outdir;
|
|
459
459
|
const entryPoint = resolvedOptions.entryPoints[0].replace(sourceRoot, "").replace(/\.ts$/, "");
|
|
460
|
-
const bundlePath =
|
|
460
|
+
const bundlePath = _chunkBUXJSVJGjs.joinPaths.call(void 0, resolvedOptions.outdir, entryPoint);
|
|
461
461
|
let dtsPath;
|
|
462
|
-
if (await _node.hfs.isFile(
|
|
463
|
-
dtsPath =
|
|
464
|
-
} else if (await _node.hfs.isFile(
|
|
465
|
-
dtsPath =
|
|
462
|
+
if (await _node.hfs.isFile(_chunkBUXJSVJGjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`))) {
|
|
463
|
+
dtsPath = _chunkBUXJSVJGjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint}.d.ts`);
|
|
464
|
+
} else if (await _node.hfs.isFile(_chunkBUXJSVJGjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`))) {
|
|
465
|
+
dtsPath = _chunkBUXJSVJGjs.joinPaths.call(void 0, resolvedOptions.config.workspaceRoot, typeOutDir, `${entryPoint.replace(/^src\//, "")}.d.ts`);
|
|
466
466
|
}
|
|
467
467
|
const ext = resolvedOptions.outExtension.dts || resolvedOptions.format === "esm" ? "d.mts" : "d.ts";
|
|
468
468
|
if (process.env.WATCH !== "true" && process.env.DEV !== "true") {
|
|
@@ -487,7 +487,7 @@ _chunk3GQAWCBQjs.__name.call(void 0, getTypeDependencyPackageName, "getTypeDepen
|
|
|
487
487
|
|
|
488
488
|
// ../esbuild/src/config.ts
|
|
489
489
|
var getOutputExtensionMap = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options, pkgType) => {
|
|
490
|
-
return options.outExtension ? options.outExtension(options.format, pkgType) :
|
|
490
|
+
return options.outExtension ? options.outExtension(options.format, pkgType) : _chunkRSILHGEUjs.getOutExtension.call(void 0, options.format, pkgType);
|
|
491
491
|
}, "getOutputExtensionMap");
|
|
492
492
|
var getDefaultBuildPlugins = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options, resolvedOptions) => [
|
|
493
493
|
nodeProtocolPlugin(options, resolvedOptions),
|
|
@@ -535,7 +535,7 @@ var DEFAULT_BUILD_OPTIONS = {
|
|
|
535
535
|
".woff": "file",
|
|
536
536
|
".woff2": "file"
|
|
537
537
|
},
|
|
538
|
-
banner:
|
|
538
|
+
banner: _chunkRSILHGEUjs.DEFAULT_COMPILED_BANNER
|
|
539
539
|
};
|
|
540
540
|
|
|
541
541
|
// ../esbuild/src/plugins/deps-check.ts
|
|
@@ -617,8 +617,8 @@ var depsCheckPlugin = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (bund
|
|
|
617
617
|
const filteredMissingDeps = missingDependencies.filter((dep) => {
|
|
618
618
|
return !missingIgnore.some((pattern) => dep.match(pattern)) && !peerDependencies.includes(dep);
|
|
619
619
|
});
|
|
620
|
-
|
|
621
|
-
|
|
620
|
+
_chunkB6PUPX6Ojs.writeWarning.call(void 0, `Unused Dependencies: ${JSON.stringify(filteredUnusedDeps)}`);
|
|
621
|
+
_chunkB6PUPX6Ojs.writeError.call(void 0, `Missing Dependencies: ${JSON.stringify(filteredMissingDeps)}`);
|
|
622
622
|
if (filteredMissingDeps.length > 0) {
|
|
623
623
|
throw new Error(`Missing dependencies detected - please install them:
|
|
624
624
|
${JSON.stringify(filteredMissingDeps)}
|
|
@@ -712,13 +712,13 @@ var resolveOptions = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async
|
|
|
712
712
|
if (!workspaceRoot) {
|
|
713
713
|
throw new Error("Cannot find Nx workspace root");
|
|
714
714
|
}
|
|
715
|
-
const config = await
|
|
716
|
-
|
|
717
|
-
const stopwatch =
|
|
715
|
+
const config = await _chunkB6PUPX6Ojs.getConfig.call(void 0, workspaceRoot.dir);
|
|
716
|
+
_chunkB6PUPX6Ojs.writeDebug.call(void 0, " \u2699\uFE0F Resolving build options", config);
|
|
717
|
+
const stopwatch = _chunkB6PUPX6Ojs.getStopwatch.call(void 0, "Build options resolution");
|
|
718
718
|
const projectGraph = await _devkit.createProjectGraphAsync.call(void 0, {
|
|
719
719
|
exitOnError: true
|
|
720
720
|
});
|
|
721
|
-
const projectJsonPath =
|
|
721
|
+
const projectJsonPath = _chunkBUXJSVJGjs.joinPaths.call(void 0, workspaceRoot.dir, projectRoot, "project.json");
|
|
722
722
|
if (!await _node.hfs.isFile(projectJsonPath)) {
|
|
723
723
|
throw new Error("Cannot find project.json configuration");
|
|
724
724
|
}
|
|
@@ -730,14 +730,14 @@ var resolveOptions = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async
|
|
|
730
730
|
}
|
|
731
731
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
|
|
732
732
|
options.name ??= `${projectName}-${options.format}`;
|
|
733
|
-
options.target ??=
|
|
734
|
-
const packageJsonPath =
|
|
733
|
+
options.target ??= _chunkRSILHGEUjs.DEFAULT_TARGET;
|
|
734
|
+
const packageJsonPath = _chunkBUXJSVJGjs.joinPaths.call(void 0, workspaceRoot.dir, options.projectRoot, "package.json");
|
|
735
735
|
if (!await _node.hfs.isFile(packageJsonPath)) {
|
|
736
736
|
throw new Error("Cannot find package.json configuration");
|
|
737
737
|
}
|
|
738
738
|
const packageJson = await _node.hfs.json(packageJsonPath);
|
|
739
739
|
const outExtension = getOutputExtensionMap(options, packageJson.type);
|
|
740
|
-
const env =
|
|
740
|
+
const env = _chunkRSILHGEUjs.getEnv.call(void 0, "esbuild", options);
|
|
741
741
|
const result = {
|
|
742
742
|
...options,
|
|
743
743
|
config,
|
|
@@ -755,20 +755,20 @@ var resolveOptions = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async
|
|
|
755
755
|
".node"
|
|
756
756
|
],
|
|
757
757
|
...userOptions,
|
|
758
|
-
tsconfig:
|
|
758
|
+
tsconfig: _chunkBUXJSVJGjs.joinPaths.call(void 0, projectRoot, userOptions.tsconfig ? userOptions.tsconfig.replace(projectRoot, "") : "tsconfig.json"),
|
|
759
759
|
format: options.format || "cjs",
|
|
760
|
-
entryPoints: await
|
|
760
|
+
entryPoints: await _chunkRSILHGEUjs.getEntryPoints.call(void 0, config, projectRoot, projectJson.sourceRoot, userOptions.entry || [
|
|
761
761
|
"./src/index.ts"
|
|
762
762
|
], userOptions.emitOnAll),
|
|
763
|
-
outdir: userOptions.outputPath ||
|
|
763
|
+
outdir: userOptions.outputPath || _chunkBUXJSVJGjs.joinPaths.call(void 0, "dist", projectRoot),
|
|
764
764
|
plugins: [],
|
|
765
765
|
name: userOptions.name || projectName,
|
|
766
766
|
projectConfigurations,
|
|
767
767
|
projectName,
|
|
768
768
|
projectGraph,
|
|
769
|
-
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot ||
|
|
769
|
+
sourceRoot: userOptions.sourceRoot || projectJson.sourceRoot || _chunkBUXJSVJGjs.joinPaths.call(void 0, projectRoot, "src"),
|
|
770
770
|
minify: userOptions.minify || !userOptions.debug,
|
|
771
|
-
verbose: userOptions.verbose ||
|
|
771
|
+
verbose: userOptions.verbose || _chunkB6PUPX6Ojs.isVerbose.call(void 0, ) || userOptions.debug === true,
|
|
772
772
|
includeSrc: userOptions.includeSrc === true,
|
|
773
773
|
metafile: userOptions.metafile !== false,
|
|
774
774
|
generatePackageJson: userOptions.generatePackageJson !== false,
|
|
@@ -782,8 +782,8 @@ var resolveOptions = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async
|
|
|
782
782
|
outExtension,
|
|
783
783
|
footer: userOptions.footer,
|
|
784
784
|
banner: {
|
|
785
|
-
js: options.banner ||
|
|
786
|
-
css: options.banner ||
|
|
785
|
+
js: options.banner || _chunkRSILHGEUjs.DEFAULT_COMPILED_BANNER,
|
|
786
|
+
css: options.banner || _chunkRSILHGEUjs.DEFAULT_COMPILED_BANNER
|
|
787
787
|
},
|
|
788
788
|
splitting: options.format === "iife" ? false : typeof options.splitting === "boolean" ? options.splitting : options.format === "esm",
|
|
789
789
|
treeShaking: options.format === "esm",
|
|
@@ -804,8 +804,8 @@ var resolveOptions = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async
|
|
|
804
804
|
}, {})
|
|
805
805
|
},
|
|
806
806
|
inject: [
|
|
807
|
-
options.format === "cjs" && options.injectShims ?
|
|
808
|
-
options.format === "esm" && options.injectShims && options.platform === "node" ?
|
|
807
|
+
options.format === "cjs" && options.injectShims ? _chunkBUXJSVJGjs.joinPaths.call(void 0, __dirname, "../assets/cjs_shims.js") : "",
|
|
808
|
+
options.format === "esm" && options.injectShims && options.platform === "node" ? _chunkBUXJSVJGjs.joinPaths.call(void 0, __dirname, "../assets/esm_shims.js") : "",
|
|
809
809
|
..._nullishCoalesce(options.inject, () => ( []))
|
|
810
810
|
].filter(Boolean)
|
|
811
811
|
};
|
|
@@ -814,22 +814,22 @@ var resolveOptions = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async
|
|
|
814
814
|
return result;
|
|
815
815
|
}, "resolveOptions");
|
|
816
816
|
async function generatePackageJson(context2) {
|
|
817
|
-
if (context2.options.generatePackageJson !== false && await _node.hfs.isFile(
|
|
818
|
-
|
|
819
|
-
const stopwatch =
|
|
820
|
-
const packageJsonPath =
|
|
817
|
+
if (context2.options.generatePackageJson !== false && await _node.hfs.isFile(_chunkBUXJSVJGjs.joinPaths.call(void 0, context2.options.projectRoot, "package.json"))) {
|
|
818
|
+
_chunkB6PUPX6Ojs.writeDebug.call(void 0, " \u270D\uFE0F Writing package.json file", context2.options.config);
|
|
819
|
+
const stopwatch = _chunkB6PUPX6Ojs.getStopwatch.call(void 0, "Write package.json file");
|
|
820
|
+
const packageJsonPath = _chunkBUXJSVJGjs.joinPaths.call(void 0, context2.options.projectRoot, "project.json");
|
|
821
821
|
if (!await _node.hfs.isFile(packageJsonPath)) {
|
|
822
822
|
throw new Error("Cannot find package.json configuration");
|
|
823
823
|
}
|
|
824
|
-
let packageJson = await _node.hfs.json(
|
|
824
|
+
let packageJson = await _node.hfs.json(_chunkBUXJSVJGjs.joinPaths.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, "package.json"));
|
|
825
825
|
if (!packageJson) {
|
|
826
826
|
throw new Error("Cannot find package.json configuration file");
|
|
827
827
|
}
|
|
828
|
-
packageJson = await
|
|
829
|
-
packageJson = await
|
|
828
|
+
packageJson = await _chunkRSILHGEUjs.addPackageDependencies.call(void 0, context2.options.config.workspaceRoot, context2.options.projectRoot, context2.options.projectName, packageJson);
|
|
829
|
+
packageJson = await _chunkRSILHGEUjs.addWorkspacePackageJsonFields.call(void 0, context2.options.config, context2.options.projectRoot, context2.options.sourceRoot, context2.options.projectName, false, packageJson);
|
|
830
830
|
packageJson.exports ??= {};
|
|
831
831
|
packageJson.exports["./package.json"] ??= "./package.json";
|
|
832
|
-
packageJson.exports["."] ??=
|
|
832
|
+
packageJson.exports["."] ??= _chunkRSILHGEUjs.addPackageJsonExport.call(void 0, "index", packageJson.type, context2.options.sourceRoot);
|
|
833
833
|
let entryPoints = [
|
|
834
834
|
{
|
|
835
835
|
in: "./src/index.ts",
|
|
@@ -847,7 +847,7 @@ async function generatePackageJson(context2) {
|
|
|
847
847
|
const split = entryPoint.out.split(".");
|
|
848
848
|
split.pop();
|
|
849
849
|
const entry = split.join(".").replaceAll("\\", "/");
|
|
850
|
-
packageJson.exports[`./${entry}`] ??=
|
|
850
|
+
packageJson.exports[`./${entry}`] ??= _chunkRSILHGEUjs.addPackageJsonExport.call(void 0, entry, packageJson.type, context2.options.sourceRoot);
|
|
851
851
|
}
|
|
852
852
|
}
|
|
853
853
|
packageJson.main = packageJson.type === "commonjs" ? "./dist/index.js" : "./dist/index.cjs";
|
|
@@ -859,7 +859,7 @@ async function generatePackageJson(context2) {
|
|
|
859
859
|
}
|
|
860
860
|
return ret;
|
|
861
861
|
}, packageJson.exports);
|
|
862
|
-
await _devkit.writeJsonFile.call(void 0,
|
|
862
|
+
await _devkit.writeJsonFile.call(void 0, _chunkBUXJSVJGjs.joinPaths.call(void 0, context2.options.outdir, "package.json"), packageJson);
|
|
863
863
|
stopwatch();
|
|
864
864
|
}
|
|
865
865
|
return context2;
|
|
@@ -885,8 +885,8 @@ async function generateContext(getOptions) {
|
|
|
885
885
|
}
|
|
886
886
|
_chunk3GQAWCBQjs.__name.call(void 0, generateContext, "generateContext");
|
|
887
887
|
async function executeEsBuild(context2) {
|
|
888
|
-
|
|
889
|
-
const stopwatch =
|
|
888
|
+
_chunkB6PUPX6Ojs.writeDebug.call(void 0, ` \u{1F680} Running ${context2.options.name} build`, context2.options.config);
|
|
889
|
+
const stopwatch = _chunkB6PUPX6Ojs.getStopwatch.call(void 0, `${context2.options.name} build`);
|
|
890
890
|
if (process.env.WATCH === "true") {
|
|
891
891
|
const ctx = await esbuild2.context(context2.options);
|
|
892
892
|
watch(ctx, context2.options);
|
|
@@ -902,9 +902,9 @@ async function executeEsBuild(context2) {
|
|
|
902
902
|
_chunk3GQAWCBQjs.__name.call(void 0, executeEsBuild, "executeEsBuild");
|
|
903
903
|
async function copyBuildAssets(context2) {
|
|
904
904
|
if (_optionalChain([context2, 'access', _26 => _26.result, 'optionalAccess', _27 => _27.errors, 'access', _28 => _28.length]) === 0) {
|
|
905
|
-
|
|
906
|
-
const stopwatch =
|
|
907
|
-
await
|
|
905
|
+
_chunkB6PUPX6Ojs.writeDebug.call(void 0, ` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
|
|
906
|
+
const stopwatch = _chunkB6PUPX6Ojs.getStopwatch.call(void 0, `${context2.options.name} asset copy`);
|
|
907
|
+
await _chunkRSILHGEUjs.copyAssets.call(void 0, context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.sourceRoot, true, false);
|
|
908
908
|
stopwatch();
|
|
909
909
|
}
|
|
910
910
|
return context2;
|
|
@@ -913,9 +913,9 @@ _chunk3GQAWCBQjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
|
913
913
|
async function reportResults(context2) {
|
|
914
914
|
if (_optionalChain([context2, 'access', _29 => _29.result, 'optionalAccess', _30 => _30.errors, 'access', _31 => _31.length]) === 0) {
|
|
915
915
|
if (context2.result.warnings.length > 0) {
|
|
916
|
-
|
|
916
|
+
_chunkB6PUPX6Ojs.writeWarning.call(void 0, ` \u{1F6A7} The following warnings occurred during the build: ${context2.result.warnings.map((warning) => warning.text).join("\n")}`, context2.options.config);
|
|
917
917
|
}
|
|
918
|
-
|
|
918
|
+
_chunkB6PUPX6Ojs.writeSuccess.call(void 0, ` \u{1F4E6} The ${context2.options.name} build completed successfully`, context2.options.config);
|
|
919
919
|
}
|
|
920
920
|
}
|
|
921
921
|
_chunk3GQAWCBQjs.__name.call(void 0, reportResults, "reportResults");
|
|
@@ -957,8 +957,8 @@ async function cleanOutputPath(context2) {
|
|
|
957
957
|
}
|
|
958
958
|
_chunk3GQAWCBQjs.__name.call(void 0, cleanOutputPath, "cleanOutputPath");
|
|
959
959
|
async function build3(options) {
|
|
960
|
-
|
|
961
|
-
const stopwatch =
|
|
960
|
+
_chunkB6PUPX6Ojs.writeDebug.call(void 0, ` \u26A1 Executing Storm ESBuild pipeline`);
|
|
961
|
+
const stopwatch = _chunkB6PUPX6Ojs.getStopwatch.call(void 0, "ESBuild pipeline");
|
|
962
962
|
try {
|
|
963
963
|
const opts = Array.isArray(options) ? options : [
|
|
964
964
|
options
|
|
@@ -968,9 +968,9 @@ async function build3(options) {
|
|
|
968
968
|
}
|
|
969
969
|
void transduce.async(opts, dependencyCheck);
|
|
970
970
|
await transduce.async(await createOptions(opts), pipe.async(generateContext, cleanOutputPath, generatePackageJson, executeEsBuild, copyBuildAssets, reportResults));
|
|
971
|
-
|
|
971
|
+
_chunkB6PUPX6Ojs.writeSuccess.call(void 0, " \u{1F3C1} ESBuild pipeline build completed successfully");
|
|
972
972
|
} catch (error) {
|
|
973
|
-
|
|
973
|
+
_chunkB6PUPX6Ojs.writeFatal.call(void 0, " \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
|
|
974
974
|
throw error;
|
|
975
975
|
} finally {
|
|
976
976
|
stopwatch();
|
|
@@ -998,9 +998,9 @@ var watch = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (context2, opti
|
|
|
998
998
|
return context2.rebuild();
|
|
999
999
|
});
|
|
1000
1000
|
if (rebuildResult instanceof Error) {
|
|
1001
|
-
|
|
1001
|
+
_chunkB6PUPX6Ojs.writeError.call(void 0, rebuildResult.message);
|
|
1002
1002
|
}
|
|
1003
|
-
|
|
1003
|
+
_chunkB6PUPX6Ojs.writeTrace.call(void 0, `${Date.now() - timeBefore}ms [${_nullishCoalesce(options.name, () => ( ""))}]`);
|
|
1004
1004
|
}, 10);
|
|
1005
1005
|
changeWatcher.on("change", fastRebuild);
|
|
1006
1006
|
return void 0;
|
|
@@ -1008,7 +1008,7 @@ var watch = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (context2, opti
|
|
|
1008
1008
|
|
|
1009
1009
|
// src/executors/esbuild/executor.ts
|
|
1010
1010
|
async function esbuildExecutorFn(options, context2, config) {
|
|
1011
|
-
|
|
1011
|
+
_chunkB6PUPX6Ojs.writeInfo.call(void 0, "\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
|
|
1012
1012
|
if (!_optionalChain([context2, 'access', _32 => _32.projectsConfigurations, 'optionalAccess', _33 => _33.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _34 => _34.projectsConfigurations, 'access', _35 => _35.projects, 'access', _36 => _36[context2.projectName], 'optionalAccess', _37 => _37.root])) {
|
|
1013
1013
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
1014
1014
|
}
|
|
@@ -1025,7 +1025,7 @@ async function esbuildExecutorFn(options, context2, config) {
|
|
|
1025
1025
|
};
|
|
1026
1026
|
}
|
|
1027
1027
|
_chunk3GQAWCBQjs.__name.call(void 0, esbuildExecutorFn, "esbuildExecutorFn");
|
|
1028
|
-
var executor_default =
|
|
1028
|
+
var executor_default = _chunkIBHLVELVjs.withRunExecutor.call(void 0, "Storm ESBuild build", esbuildExecutorFn, {
|
|
1029
1029
|
skipReadingConfig: false,
|
|
1030
1030
|
hooks: {
|
|
1031
1031
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (options, config) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeOptions,
|
|
3
3
|
typeScriptLibraryGeneratorFn
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5AQJQ72E.mjs";
|
|
5
5
|
import {
|
|
6
6
|
withRunGenerator
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SNFZL5BN.mjs";
|
|
8
8
|
import {
|
|
9
9
|
__dirname,
|
|
10
10
|
__name
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ProjectTagConstants,
|
|
3
|
+
getProjectTag
|
|
4
|
+
} from "./chunk-66TYTM73.mjs";
|
|
5
|
+
import {
|
|
6
|
+
__name
|
|
7
|
+
} from "./chunk-XUV4U54K.mjs";
|
|
8
|
+
|
|
9
|
+
// src/utils/plugin-helpers.ts
|
|
10
|
+
import { readJsonFile } from "@nx/devkit";
|
|
11
|
+
import defu from "defu";
|
|
12
|
+
import { existsSync } from "node:fs";
|
|
13
|
+
import { dirname, join } from "node:path";
|
|
14
|
+
var getProjectPlatform = /* @__PURE__ */ __name((project, ignoreTags = false) => {
|
|
15
|
+
const tsconfigJson = readJsonFile(join(project.root, "tsconfig.json"));
|
|
16
|
+
if (!tsconfigJson) {
|
|
17
|
+
throw new Error(`No tsconfig.json found in project root: ${project.root}`);
|
|
18
|
+
}
|
|
19
|
+
const packageJson = readJsonFile(join(project.root, "package.json"));
|
|
20
|
+
if (!packageJson) {
|
|
21
|
+
throw new Error(`No package.json found in project root: ${project.root}`);
|
|
22
|
+
}
|
|
23
|
+
let platformTag = void 0;
|
|
24
|
+
if (!ignoreTags) {
|
|
25
|
+
platformTag = getProjectTag(project, ProjectTagConstants.Platform.TAG_ID);
|
|
26
|
+
}
|
|
27
|
+
if (platformTag !== ProjectTagConstants.Platform.NEUTRAL) {
|
|
28
|
+
const types = Array.isArray(tsconfigJson.compilerOptions?.types) ? tsconfigJson.compilerOptions.types : [];
|
|
29
|
+
if (platformTag === ProjectTagConstants.Platform.WORKER || types.some((type) => type.toLowerCase() === "@cloudflare/workers-types") || packageJson.devDependencies?.["@cloudflare/workers-types"] || packageJson.devDependencies?.["wrangler"]) {
|
|
30
|
+
return "worker";
|
|
31
|
+
}
|
|
32
|
+
if (platformTag === ProjectTagConstants.Platform.NODE || types?.some((type) => type.toLowerCase() === "node") || packageJson.devDependencies?.["@types/node"]) {
|
|
33
|
+
return "node";
|
|
34
|
+
}
|
|
35
|
+
if (platformTag === ProjectTagConstants.Platform.BROWSER || types?.some((type) => type.toLowerCase() === "dom") || packageJson.dependencies && Object.keys(packageJson.dependencies).some((dependency) => dependency.includes("react")) || packageJson.devDependencies && Object.keys(packageJson.devDependencies).some((devDependency) => devDependency.includes("react"))) {
|
|
36
|
+
return "browser";
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return "neutral";
|
|
40
|
+
}, "getProjectPlatform");
|
|
41
|
+
var getProjectConfigFromProjectJsonPath = /* @__PURE__ */ __name((projectJsonPath, packageJson) => {
|
|
42
|
+
return getProjectConfigFromProjectRoot(dirname(projectJsonPath), packageJson);
|
|
43
|
+
}, "getProjectConfigFromProjectJsonPath");
|
|
44
|
+
var getProjectConfigFromProjectRoot = /* @__PURE__ */ __name((projectRoot, packageJson) => {
|
|
45
|
+
const { nx, name } = packageJson;
|
|
46
|
+
const projectJson = readJsonFile(join(projectRoot, "project.json"));
|
|
47
|
+
return defu(nx ?? {}, projectJson, {
|
|
48
|
+
targets: {},
|
|
49
|
+
tags: [],
|
|
50
|
+
name,
|
|
51
|
+
root: projectRoot
|
|
52
|
+
});
|
|
53
|
+
}, "getProjectConfigFromProjectRoot");
|
|
54
|
+
var getProjectRoot = /* @__PURE__ */ __name((configPath, workspaceRoot) => {
|
|
55
|
+
try {
|
|
56
|
+
const root = dirname(configPath);
|
|
57
|
+
const projectRoot = join(workspaceRoot, root);
|
|
58
|
+
if (!existsSync(join(projectRoot, "package.json")) && !existsSync(join(projectRoot, "project.json"))) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return projectRoot;
|
|
62
|
+
} catch (error_) {
|
|
63
|
+
console.error(error_);
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
}, "getProjectRoot");
|
|
67
|
+
|
|
68
|
+
export {
|
|
69
|
+
getProjectPlatform,
|
|
70
|
+
getProjectConfigFromProjectJsonPath,
|
|
71
|
+
getProjectConfigFromProjectRoot,
|
|
72
|
+
getProjectRoot
|
|
73
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk2GRVQNW3js = require('./chunk-2GRVQNW3.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkBUXJSVJGjs = require('./chunk-BUXJSVJG.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
@@ -21,8 +21,8 @@ async function npmPublishExecutorFn(options, context) {
|
|
|
21
21
|
if (!projectConfig) {
|
|
22
22
|
throw new Error(`Could not find project configuration for \`${context.projectName}\``);
|
|
23
23
|
}
|
|
24
|
-
const packageRoot =
|
|
25
|
-
const packageJsonPath =
|
|
24
|
+
const packageRoot = _chunkBUXJSVJGjs.joinPaths.call(void 0, context.root, options.packageRoot || _chunkBUXJSVJGjs.joinPaths.call(void 0, "dist", projectConfig.root));
|
|
25
|
+
const packageJsonPath = _chunkBUXJSVJGjs.joinPaths.call(void 0, packageRoot, "package.json");
|
|
26
26
|
const packageJsonFile = await _promises2.default.readFile(packageJsonPath, "utf8");
|
|
27
27
|
if (!packageJsonFile) {
|
|
28
28
|
throw new Error(`Could not find \`package.json\` at ${packageJsonPath}`);
|
|
@@ -37,7 +37,7 @@ async function npmPublishExecutorFn(options, context) {
|
|
|
37
37
|
success: true
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
await
|
|
40
|
+
await _chunk2GRVQNW3js.pnpmCatalogUpdate.call(void 0, packageRoot, context.root);
|
|
41
41
|
const npmPublishCommandSegments = [
|
|
42
42
|
`npm publish --json`
|
|
43
43
|
];
|