@storm-software/workspace-tools 1.240.2 → 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 +22 -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-F7QTSVDJ.mjs → chunk-NJ2QOT34.mjs} +1 -1
- package/dist/{chunk-PY52QA2R.js → chunk-PK2SUBWI.js} +7 -7
- 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 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +44 -34
- package/dist/index.mjs +53 -43
- 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 +9 -2
- package/dist/src/plugins/typescript/tsdown.mjs +9 -2
- package/dist/src/plugins/typescript/tsup.js +9 -2
- package/dist/src/plugins/typescript/tsup.mjs +9 -2
- 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 -1
- package/dist/src/utils/index.d.ts +2 -1
- package/dist/src/utils/index.js +20 -10
- package/dist/src/utils/index.mjs +27 -17
- package/dist/src/utils/lock-file.d.mts +1 -1
- package/dist/src/utils/lock-file.d.ts +1 -1
- package/dist/src/utils/lock-file.js +2 -2
- package/dist/src/utils/lock-file.mjs +1 -1
- 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 +2 -7
- 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,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getProjectPlatform
|
|
3
|
+
} from "./chunk-LUQIF4A3.mjs";
|
|
1
4
|
import {
|
|
2
5
|
ProjectTagConstants,
|
|
3
6
|
addProjectTag,
|
|
@@ -271,23 +274,28 @@ var createNodes = [
|
|
|
271
274
|
addProjectTag(project, ProjectTagConstants.Language.TAG_ID, ProjectTagConstants.Language.TYPESCRIPT, {
|
|
272
275
|
overwrite: true
|
|
273
276
|
});
|
|
274
|
-
const
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
277
|
+
const platform = getProjectPlatform(project);
|
|
278
|
+
switch (platform) {
|
|
279
|
+
case "worker":
|
|
280
|
+
addProjectTag(project, ProjectTagConstants.Platform.TAG_ID, ProjectTagConstants.Platform.WORKER, {
|
|
281
|
+
overwrite: true
|
|
282
|
+
});
|
|
283
|
+
break;
|
|
284
|
+
case "node":
|
|
285
|
+
addProjectTag(project, ProjectTagConstants.Platform.TAG_ID, ProjectTagConstants.Platform.NODE, {
|
|
286
|
+
overwrite: true
|
|
287
|
+
});
|
|
288
|
+
break;
|
|
289
|
+
case "browser":
|
|
290
|
+
addProjectTag(project, ProjectTagConstants.Platform.TAG_ID, ProjectTagConstants.Platform.BROWSER, {
|
|
291
|
+
overwrite: true
|
|
292
|
+
});
|
|
293
|
+
break;
|
|
294
|
+
default:
|
|
295
|
+
addProjectTag(project, ProjectTagConstants.Platform.TAG_ID, ProjectTagConstants.Platform.NEUTRAL, {
|
|
296
|
+
overwrite: true
|
|
297
|
+
});
|
|
298
|
+
break;
|
|
291
299
|
}
|
|
292
300
|
setDefaultProjectTags(project, name);
|
|
293
301
|
return project?.name ? {
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
} from "./chunk-XUV4U54K.mjs";
|
|
4
4
|
|
|
5
5
|
// src/utils/lock-file.ts
|
|
6
|
+
import { output, readJsonFile, workspaceRoot } from "@nx/devkit";
|
|
6
7
|
import { existsSync } from "node:fs";
|
|
7
8
|
import { join } from "node:path";
|
|
8
|
-
import { output, readJsonFile, workspaceRoot } from "nx/src/devkit-exports";
|
|
9
9
|
import { getNpmLockfileDependencies, getNpmLockfileNodes } from "nx/src/plugins/js/lock-file/npm-parser";
|
|
10
10
|
import { getPnpmLockfileDependencies, getPnpmLockfileNodes } from "nx/src/plugins/js/lock-file/pnpm-parser";
|
|
11
11
|
import { getYarnLockfileDependencies, getYarnLockfileNodes } from "nx/src/plugins/js/lock-file/yarn-parser";
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
4
4
|
|
|
5
5
|
// src/utils/lock-file.ts
|
|
6
|
+
var _devkit = require('@nx/devkit');
|
|
6
7
|
var _fs = require('fs');
|
|
7
8
|
var _path = require('path');
|
|
8
|
-
var _devkitexports = require('nx/src/devkit-exports');
|
|
9
9
|
var _npmparser = require('nx/src/plugins/js/lock-file/npm-parser');
|
|
10
10
|
var _pnpmparser = require('nx/src/plugins/js/lock-file/pnpm-parser');
|
|
11
11
|
var _yarnparser = require('nx/src/plugins/js/lock-file/yarn-parser');
|
|
@@ -17,13 +17,13 @@ var LOCK_FILES = [
|
|
|
17
17
|
NPM_LOCK_FILE,
|
|
18
18
|
PNPM_LOCK_FILE
|
|
19
19
|
];
|
|
20
|
-
var YARN_LOCK_PATH = _path.join.call(void 0,
|
|
21
|
-
var NPM_LOCK_PATH = _path.join.call(void 0,
|
|
22
|
-
var PNPM_LOCK_PATH = _path.join.call(void 0,
|
|
20
|
+
var YARN_LOCK_PATH = _path.join.call(void 0, _devkit.workspaceRoot, YARN_LOCK_FILE);
|
|
21
|
+
var NPM_LOCK_PATH = _path.join.call(void 0, _devkit.workspaceRoot, NPM_LOCK_FILE);
|
|
22
|
+
var PNPM_LOCK_PATH = _path.join.call(void 0, _devkit.workspaceRoot, PNPM_LOCK_FILE);
|
|
23
23
|
function getLockFileNodes(packageManager, contents, lockFileHash, context) {
|
|
24
24
|
try {
|
|
25
25
|
if (packageManager === "yarn") {
|
|
26
|
-
const packageJson =
|
|
26
|
+
const packageJson = _devkit.readJsonFile.call(void 0, _path.join.call(void 0, context.workspaceRoot, "package.json"));
|
|
27
27
|
return _yarnparser.getYarnLockfileNodes.call(void 0, contents, lockFileHash, packageJson);
|
|
28
28
|
}
|
|
29
29
|
if (packageManager === "pnpm") {
|
|
@@ -34,7 +34,7 @@ function getLockFileNodes(packageManager, contents, lockFileHash, context) {
|
|
|
34
34
|
}
|
|
35
35
|
} catch (e) {
|
|
36
36
|
if (!isPostInstallProcess()) {
|
|
37
|
-
|
|
37
|
+
_devkit.output.error({
|
|
38
38
|
title: `Failed to parse ${packageManager} lockfile`,
|
|
39
39
|
bodyLines: errorBodyLines(e)
|
|
40
40
|
});
|
|
@@ -57,7 +57,7 @@ function getLockFileDependencies(packageManager, contents, lockFileHash, context
|
|
|
57
57
|
}
|
|
58
58
|
} catch (e) {
|
|
59
59
|
if (!isPostInstallProcess()) {
|
|
60
|
-
|
|
60
|
+
_devkit.output.error({
|
|
61
61
|
title: `Failed to parse ${packageManager} lockfile`,
|
|
62
62
|
bodyLines: errorBodyLines(e)
|
|
63
63
|
});
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
writeInfo,
|
|
14
14
|
writeSuccess,
|
|
15
15
|
writeTrace
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7Q66XSCS.mjs";
|
|
17
17
|
import {
|
|
18
18
|
findWorkspaceRoot
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ZOFW74B2.mjs";
|
|
20
20
|
import {
|
|
21
21
|
__name
|
|
22
22
|
} from "./chunk-XUV4U54K.mjs";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _chunkULBTYC2Bjs = require('./chunk-ULBTYC2B.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkIBHLVELVjs = require('./chunk-IBHLVELV.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
@@ -15,7 +15,7 @@ async function cargoFormatExecutor(options, context) {
|
|
|
15
15
|
return await _chunkULBTYC2Bjs.cargoCommand.call(void 0, ...command);
|
|
16
16
|
}
|
|
17
17
|
_chunk3GQAWCBQjs.__name.call(void 0, cargoFormatExecutor, "cargoFormatExecutor");
|
|
18
|
-
var executor_default =
|
|
18
|
+
var executor_default = _chunkIBHLVELVjs.withRunExecutor.call(void 0, "Cargo Format", cargoFormatExecutor, {
|
|
19
19
|
skipReadingConfig: false,
|
|
20
20
|
hooks: {
|
|
21
21
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
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
|
-
var
|
|
3
|
+
var _chunkU6TLQT5Hjs = require('./chunk-U6TLQT5H.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
@@ -49,7 +49,7 @@ var applyWorkspaceExecutorTokens = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(
|
|
|
49
49
|
result = result.replaceAll("{sourceRoot}", sourceRoot);
|
|
50
50
|
}
|
|
51
51
|
if (result.includes("{workspaceRoot}")) {
|
|
52
|
-
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(tokenizerOptions.workspaceRoot, () => (
|
|
52
|
+
result = result.replaceAll("{workspaceRoot}", _nullishCoalesce(tokenizerOptions.workspaceRoot, () => ( _chunkU6TLQT5Hjs.findWorkspaceRoot.call(void 0, ))));
|
|
53
53
|
}
|
|
54
54
|
return result;
|
|
55
55
|
}, "applyWorkspaceExecutorTokens");
|
|
@@ -13,10 +13,10 @@ var _chunkZMFVKBRMjs = require('./chunk-ZMFVKBRM.js');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkB6PUPX6Ojs = require('./chunk-B6PUPX6O.js');
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkU6TLQT5Hjs = require('./chunk-U6TLQT5H.js');
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
@@ -248,16 +248,16 @@ var _version = require('nx/src/command-line/release/version');
|
|
|
248
248
|
var _utils = require('nx/src/tasks-runner/utils');
|
|
249
249
|
var _semver3 = require('semver');
|
|
250
250
|
async function releaseVersionGeneratorFn(tree, options, config) {
|
|
251
|
-
|
|
251
|
+
_chunkB6PUPX6Ojs.writeInfo.call(void 0, `\u26A1 Running the Storm Release Version generator...
|
|
252
252
|
|
|
253
253
|
`, config);
|
|
254
|
-
const stopwatch =
|
|
254
|
+
const stopwatch = _chunkB6PUPX6Ojs.getStopwatch.call(void 0, "Storm Release Version generator");
|
|
255
255
|
try {
|
|
256
|
-
const workspaceRoot =
|
|
257
|
-
|
|
256
|
+
const workspaceRoot = _chunkU6TLQT5Hjs.findWorkspaceRoot.call(void 0, );
|
|
257
|
+
_chunkB6PUPX6Ojs.writeDebug.call(void 0, `Loading the Storm Config from environment variables and storm.config.js file...
|
|
258
258
|
- workspaceRoot: ${workspaceRoot}`, config);
|
|
259
|
-
config = await
|
|
260
|
-
|
|
259
|
+
config = await _chunkB6PUPX6Ojs.getConfig.call(void 0, workspaceRoot);
|
|
260
|
+
_chunkB6PUPX6Ojs.writeTrace.call(void 0, `Generator schema options \u2699\uFE0F
|
|
261
261
|
${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`, config);
|
|
262
262
|
const versionData = {};
|
|
263
263
|
if (options.specifier) {
|
|
@@ -275,7 +275,7 @@ Valid values are: ${_version.validReleaseVersionPrefixes.map((s) => `"${s}"`).jo
|
|
|
275
275
|
const projects = options.projects;
|
|
276
276
|
const createResolvePackageRoot = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (customPackageRoot) => (projectNode) => {
|
|
277
277
|
if (_optionalChain([projectNode, 'optionalAccess', _3 => _3.data, 'optionalAccess', _4 => _4.root]) === _optionalChain([config, 'optionalAccess', _5 => _5.workspaceRoot]) || _optionalChain([projectNode, 'optionalAccess', _6 => _6.data, 'optionalAccess', _7 => _7.root]) === ".") {
|
|
278
|
-
return _nullishCoalesce(_optionalChain([config, 'optionalAccess', _8 => _8.workspaceRoot]), () => (
|
|
278
|
+
return _nullishCoalesce(_optionalChain([config, 'optionalAccess', _8 => _8.workspaceRoot]), () => ( _chunkU6TLQT5Hjs.findWorkspaceRoot.call(void 0, )));
|
|
279
279
|
}
|
|
280
280
|
if (!customPackageRoot) {
|
|
281
281
|
return projectNode.data.root;
|
|
@@ -305,11 +305,11 @@ Valid values are: ${_version.validReleaseVersionPrefixes.map((s) => `"${s}"`).jo
|
|
|
305
305
|
|
|
306
306
|
To fix this you will either need to add a package.json or Cargo.toml file at that location, or configure "release" within your nx.json to exclude "${projectName}" from the current release group, or amend the packageRoot configuration to point to where the package.json should be.`);
|
|
307
307
|
}
|
|
308
|
-
const workspaceRelativePackagePath = _path.relative.call(void 0, _nullishCoalesce(_optionalChain([config, 'optionalAccess', _9 => _9.workspaceRoot]), () => (
|
|
308
|
+
const workspaceRelativePackagePath = _path.relative.call(void 0, _nullishCoalesce(_optionalChain([config, 'optionalAccess', _9 => _9.workspaceRoot]), () => ( _chunkU6TLQT5Hjs.findWorkspaceRoot.call(void 0, ))), tree.exists(packageJsonPath) ? packageJsonPath : cargoTomlPath);
|
|
309
309
|
const log = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (msg) => {
|
|
310
|
-
|
|
310
|
+
_chunkB6PUPX6Ojs.writeInfo.call(void 0, `${projectName}: ${msg}`, config);
|
|
311
311
|
}, "log");
|
|
312
|
-
|
|
312
|
+
_chunkB6PUPX6Ojs.writeInfo.call(void 0, `Running release version for project: ${project.name}`, config);
|
|
313
313
|
let packageName;
|
|
314
314
|
let currentVersionFromDisk;
|
|
315
315
|
if (tree.exists(packageJsonPath)) {
|
|
@@ -583,7 +583,7 @@ Projects with packageRoot configured: ${Array.from(projectNameToPackageRootMap.k
|
|
|
583
583
|
}
|
|
584
584
|
}
|
|
585
585
|
await _devkit.formatFiles.call(void 0, tree);
|
|
586
|
-
|
|
586
|
+
_chunkB6PUPX6Ojs.writeSuccess.call(void 0, `Completed running the Storm Release Version generator!
|
|
587
587
|
`, config);
|
|
588
588
|
return {
|
|
589
589
|
data: versionData,
|
|
@@ -617,8 +617,8 @@ Projects with packageRoot configured: ${Array.from(projectNameToPackageRootMap.k
|
|
|
617
617
|
}, "callback")
|
|
618
618
|
};
|
|
619
619
|
} catch (error) {
|
|
620
|
-
|
|
621
|
-
|
|
620
|
+
_chunkB6PUPX6Ojs.writeFatal.call(void 0, "A fatal error occurred while running the Storm Release Version generator - the process was forced to terminate", config);
|
|
621
|
+
_chunkB6PUPX6Ojs.writeError.call(void 0, `An exception was thrown in the Storm Release Version generator's process
|
|
622
622
|
- Details: ${error.message}
|
|
623
623
|
- Stacktrace: ${error.stack}`, config);
|
|
624
624
|
throw new Error(`An exception was thrown in the Storm Release Version generator's process
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkB6PUPX6Ojs = require('./chunk-B6PUPX6O.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkU6TLQT5Hjs = require('./chunk-U6TLQT5H.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkBUXJSVJGjs = require('./chunk-BUXJSVJG.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
@@ -54,8 +54,8 @@ var copyAssets = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (con
|
|
|
54
54
|
output: "src/"
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${
|
|
57
|
+
_chunkB6PUPX6Ojs.writeTrace.call(void 0, `\u{1F4DD} Copying the following assets to the output directory:
|
|
58
|
+
${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${pendingAsset} -> ${outputPath}` : ` - ${pendingAsset.input}/${pendingAsset.glob} -> ${_chunkBUXJSVJGjs.joinPaths.call(void 0, outputPath, pendingAsset.output)}`).join("\n")}`, config);
|
|
59
59
|
const assetHandler = new (0, _copyassetshandler.CopyAssetsHandler)({
|
|
60
60
|
projectDir: projectRoot,
|
|
61
61
|
rootDir: config.workspaceRoot,
|
|
@@ -64,12 +64,12 @@ ${pendingAssets.map((pendingAsset) => typeof pendingAsset === "string" ? ` - ${p
|
|
|
64
64
|
});
|
|
65
65
|
await assetHandler.processAllAssetsOnce();
|
|
66
66
|
if (includeSrc === true) {
|
|
67
|
-
|
|
67
|
+
_chunkB6PUPX6Ojs.writeDebug.call(void 0, `\u{1F4DD} Adding banner and writing source files: ${_chunkBUXJSVJGjs.joinPaths.call(void 0, outputPath, "src")}`, config);
|
|
68
68
|
const files = await _glob.glob.call(void 0, [
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
_chunkBUXJSVJGjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.ts"),
|
|
70
|
+
_chunkBUXJSVJGjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.tsx"),
|
|
71
|
+
_chunkBUXJSVJGjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.js"),
|
|
72
|
+
_chunkBUXJSVJGjs.joinPaths.call(void 0, config.workspaceRoot, outputPath, "src/**/*.jsx")
|
|
73
73
|
]);
|
|
74
74
|
await Promise.allSettled(files.map(async (file) => _promises.writeFile.call(void 0, file, `${banner && typeof banner === "string" ? banner.startsWith("//") ? banner : `// ${banner}` : ""}
|
|
75
75
|
|
|
@@ -91,7 +91,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0
|
|
|
91
91
|
for (const project of projectDependencies.dependencies.filter((dep) => dep.node.type === "lib" && dep.node.data.root !== projectRoot && dep.node.data.root !== workspaceRoot)) {
|
|
92
92
|
const projectNode = project.node;
|
|
93
93
|
if (projectNode.data.root) {
|
|
94
|
-
const projectPackageJsonPath =
|
|
94
|
+
const projectPackageJsonPath = _chunkBUXJSVJGjs.joinPaths.call(void 0, workspaceRoot, projectNode.data.root, "package.json");
|
|
95
95
|
if (_fs.existsSync.call(void 0, projectPackageJsonPath)) {
|
|
96
96
|
const projectPackageJsonContent = await _promises.readFile.call(void 0, projectPackageJsonPath, "utf8");
|
|
97
97
|
const projectPackageJson = JSON.parse(projectPackageJsonContent);
|
|
@@ -102,7 +102,7 @@ var addPackageDependencies = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
if (localPackages.length > 0) {
|
|
105
|
-
|
|
105
|
+
_chunkB6PUPX6Ojs.writeTrace.call(void 0, `\u{1F4E6} Adding local packages to package.json: ${localPackages.map((p) => p.name).join(", ")}`);
|
|
106
106
|
packageJson.peerDependencies = localPackages.reduce((ret, localPackage) => {
|
|
107
107
|
if (!ret[localPackage.name]) {
|
|
108
108
|
ret[localPackage.name] = `>=${localPackage.version || "0.0.1"}`;
|
|
@@ -124,13 +124,13 @@ var addPackageDependencies = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0
|
|
|
124
124
|
return ret;
|
|
125
125
|
}, _nullishCoalesce(packageJson.peerDependencies, () => ( {})));
|
|
126
126
|
} else {
|
|
127
|
-
|
|
127
|
+
_chunkB6PUPX6Ojs.writeTrace.call(void 0, "\u{1F4E6} No local packages dependencies to add to package.json");
|
|
128
128
|
}
|
|
129
129
|
return packageJson;
|
|
130
130
|
}, "addPackageDependencies");
|
|
131
131
|
var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (config, projectRoot, sourceRoot, projectName, includeSrc = false, packageJson) => {
|
|
132
|
-
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot :
|
|
133
|
-
const workspacePackageJsonContent = await _promises.readFile.call(void 0,
|
|
132
|
+
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : _chunkU6TLQT5Hjs.findWorkspaceRoot.call(void 0, );
|
|
133
|
+
const workspacePackageJsonContent = await _promises.readFile.call(void 0, _chunkBUXJSVJGjs.joinPaths.call(void 0, workspaceRoot, "package.json"), "utf8");
|
|
134
134
|
const workspacePackageJson = JSON.parse(workspacePackageJsonContent);
|
|
135
135
|
packageJson.type ??= "module";
|
|
136
136
|
packageJson.sideEffects ??= false;
|
|
@@ -139,7 +139,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call
|
|
|
139
139
|
if (distSrc.startsWith("/")) {
|
|
140
140
|
distSrc = distSrc.substring(1);
|
|
141
141
|
}
|
|
142
|
-
packageJson.source ??= `${
|
|
142
|
+
packageJson.source ??= `${_chunkBUXJSVJGjs.joinPaths.call(void 0, distSrc, "index.ts").replaceAll("\\", "/")}`;
|
|
143
143
|
}
|
|
144
144
|
packageJson.files ??= [
|
|
145
145
|
"dist/**/*"
|
|
@@ -170,7 +170,7 @@ var addWorkspacePackageJsonFields = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call
|
|
|
170
170
|
];
|
|
171
171
|
}
|
|
172
172
|
packageJson.repository ??= workspacePackageJson.repository;
|
|
173
|
-
packageJson.repository.directory ??= projectRoot ? projectRoot :
|
|
173
|
+
packageJson.repository.directory ??= projectRoot ? projectRoot : _chunkBUXJSVJGjs.joinPaths.call(void 0, "packages", projectName);
|
|
174
174
|
return packageJson;
|
|
175
175
|
}, "addWorkspacePackageJsonFields");
|
|
176
176
|
var addPackageJsonExport = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (file, type = "module", sourceRoot) => {
|
|
@@ -197,7 +197,7 @@ var addPackageJsonExport = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0,
|
|
|
197
197
|
// ../build-tools/src/utilities/get-entry-points.ts
|
|
198
198
|
|
|
199
199
|
var getEntryPoints = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (config, projectRoot, sourceRoot, entry, emitOnAll = false) => {
|
|
200
|
-
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot :
|
|
200
|
+
const workspaceRoot = config.workspaceRoot ? config.workspaceRoot : _chunkU6TLQT5Hjs.findWorkspaceRoot.call(void 0, );
|
|
201
201
|
const entryPoints = [];
|
|
202
202
|
if (entry) {
|
|
203
203
|
if (Array.isArray(entry)) {
|
|
@@ -209,7 +209,7 @@ var getEntryPoints = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
if (emitOnAll) {
|
|
212
|
-
entryPoints.push(
|
|
212
|
+
entryPoints.push(_chunkBUXJSVJGjs.joinPaths.call(void 0, workspaceRoot, sourceRoot || projectRoot, "**/*.{ts,tsx}"));
|
|
213
213
|
}
|
|
214
214
|
const results = [];
|
|
215
215
|
for (const entryPoint in entryPoints) {
|
|
@@ -218,9 +218,9 @@ var getEntryPoints = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async
|
|
|
218
218
|
withFileTypes: true
|
|
219
219
|
});
|
|
220
220
|
results.push(...files.reduce((ret, filePath) => {
|
|
221
|
-
const result =
|
|
221
|
+
const result = _chunkBUXJSVJGjs.correctPaths.call(void 0, _chunkBUXJSVJGjs.joinPaths.call(void 0, filePath.path, filePath.name).replaceAll(_chunkBUXJSVJGjs.correctPaths.call(void 0, workspaceRoot), "").replaceAll(_chunkBUXJSVJGjs.correctPaths.call(void 0, projectRoot), ""));
|
|
222
222
|
if (result) {
|
|
223
|
-
|
|
223
|
+
_chunkB6PUPX6Ojs.writeDebug.call(void 0, `Trying to add entry point ${result} at "${_chunkBUXJSVJGjs.joinPaths.call(void 0, filePath.path, filePath.name)}"`, config);
|
|
224
224
|
if (!results.includes(result)) {
|
|
225
225
|
results.push(result);
|
|
226
226
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkXHH2IY66js = require('./chunk-XHH2IY66.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkKLHTXAIUjs = require('./chunk-KLHTXAIU.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
@@ -19,7 +19,7 @@ async function neutralLibraryGeneratorFn(tree, schema, config) {
|
|
|
19
19
|
devDependencies: {},
|
|
20
20
|
buildExecutor: "@storm-software/workspace-tools:unbuild"
|
|
21
21
|
};
|
|
22
|
-
const options = await
|
|
22
|
+
const options = await _chunkXHH2IY66js.normalizeOptions.call(void 0, tree, tsLibraryGeneratorOptions);
|
|
23
23
|
const { className, name, propertyName } = _devkit.names.call(void 0, options.projectNames.projectFileName);
|
|
24
24
|
_devkit.generateFiles.call(void 0, tree, filesDir, options.projectRoot, {
|
|
25
25
|
...schema,
|
|
@@ -37,12 +37,12 @@ async function neutralLibraryGeneratorFn(tree, schema, config) {
|
|
|
37
37
|
buildable: options.bundler && options.bundler !== "none",
|
|
38
38
|
hasUnitTestRunner: options.unitTestRunner !== "none"
|
|
39
39
|
});
|
|
40
|
-
await
|
|
40
|
+
await _chunkXHH2IY66js.typeScriptLibraryGeneratorFn.call(void 0, tree, tsLibraryGeneratorOptions, config);
|
|
41
41
|
await _devkit.formatFiles.call(void 0, tree);
|
|
42
42
|
return null;
|
|
43
43
|
}
|
|
44
44
|
_chunk3GQAWCBQjs.__name.call(void 0, neutralLibraryGeneratorFn, "neutralLibraryGeneratorFn");
|
|
45
|
-
var generator_default =
|
|
45
|
+
var generator_default = _chunkKLHTXAIUjs.withRunGenerator.call(void 0, "TypeScript Library Creator (Neutral Platform)", neutralLibraryGeneratorFn, {
|
|
46
46
|
hooks: {
|
|
47
47
|
applyDefaultOptions: /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (options) => {
|
|
48
48
|
options.description ??= "A library used by Storm Software to support either browser or NodeJs applications";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applyWorkspaceBaseTokens,
|
|
3
3
|
applyWorkspaceTokens
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-K62HB3IT.mjs";
|
|
5
5
|
import {
|
|
6
6
|
getConfig,
|
|
7
7
|
getStopwatch,
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
writeInfo,
|
|
12
12
|
writeSuccess,
|
|
13
13
|
writeTrace
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-7Q66XSCS.mjs";
|
|
15
15
|
import {
|
|
16
16
|
findWorkspaceRoot
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ZOFW74B2.mjs";
|
|
18
18
|
import {
|
|
19
19
|
__name
|
|
20
20
|
} from "./chunk-XUV4U54K.mjs";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
withRunExecutor
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GJ6DN3BR.mjs";
|
|
4
4
|
import {
|
|
5
5
|
writeInfo
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7Q66XSCS.mjs";
|
|
7
7
|
import {
|
|
8
8
|
joinPaths
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2AUNU6UA.mjs";
|
|
10
10
|
import {
|
|
11
11
|
__name
|
|
12
12
|
} from "./chunk-XUV4U54K.mjs";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeOptions,
|
|
3
3
|
typeScriptLibraryGeneratorFn
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5AQJQ72E.mjs";
|
|
5
5
|
import {
|
|
6
6
|
typesNodeVersion
|
|
7
7
|
} from "./chunk-EK75QNMS.mjs";
|
|
8
8
|
import {
|
|
9
9
|
withRunGenerator
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SNFZL5BN.mjs";
|
|
11
11
|
import {
|
|
12
12
|
__dirname,
|
|
13
13
|
__name
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkBUXJSVJGjs = require('./chunk-BUXJSVJG.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
@@ -61,9 +61,9 @@ var rootFiles = [
|
|
|
61
61
|
];
|
|
62
62
|
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
63
63
|
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
64
|
-
return
|
|
64
|
+
return _chunkBUXJSVJGjs.correctPaths.call(void 0, _nullishCoalesce(process.env.STORM_WORKSPACE_ROOT, () => ( process.env.NX_WORKSPACE_ROOT_PATH)));
|
|
65
65
|
}
|
|
66
|
-
return
|
|
66
|
+
return _chunkBUXJSVJGjs.correctPaths.call(void 0, findFolderUp(_nullishCoalesce(pathInsideMonorepo, () => ( process.cwd())), rootFiles));
|
|
67
67
|
}
|
|
68
68
|
_chunk3GQAWCBQjs.__name.call(void 0, findWorkspaceRootSafe, "findWorkspaceRootSafe");
|
|
69
69
|
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk7YRW5HNXjs = require('./chunk-7YRW5HNX.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
8
|
+
|
|
9
|
+
// src/utils/plugin-helpers.ts
|
|
10
|
+
var _devkit = require('@nx/devkit');
|
|
11
|
+
var _defu = require('defu'); var _defu2 = _interopRequireDefault(_defu);
|
|
12
|
+
var _fs = require('fs');
|
|
13
|
+
var _path = require('path');
|
|
14
|
+
var getProjectPlatform = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (project, ignoreTags = false) => {
|
|
15
|
+
const tsconfigJson = _devkit.readJsonFile.call(void 0, _path.join.call(void 0, project.root, "tsconfig.json"));
|
|
16
|
+
if (!tsconfigJson) {
|
|
17
|
+
throw new Error(`No tsconfig.json found in project root: ${project.root}`);
|
|
18
|
+
}
|
|
19
|
+
const packageJson = _devkit.readJsonFile.call(void 0, _path.join.call(void 0, 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 = _chunk7YRW5HNXjs.getProjectTag.call(void 0, project, _chunk7YRW5HNXjs.ProjectTagConstants.Platform.TAG_ID);
|
|
26
|
+
}
|
|
27
|
+
if (platformTag !== _chunk7YRW5HNXjs.ProjectTagConstants.Platform.NEUTRAL) {
|
|
28
|
+
const types = Array.isArray(_optionalChain([tsconfigJson, 'access', _ => _.compilerOptions, 'optionalAccess', _2 => _2.types])) ? tsconfigJson.compilerOptions.types : [];
|
|
29
|
+
if (platformTag === _chunk7YRW5HNXjs.ProjectTagConstants.Platform.WORKER || types.some((type) => type.toLowerCase() === "@cloudflare/workers-types") || _optionalChain([packageJson, 'access', _3 => _3.devDependencies, 'optionalAccess', _4 => _4["@cloudflare/workers-types"]]) || _optionalChain([packageJson, 'access', _5 => _5.devDependencies, 'optionalAccess', _6 => _6["wrangler"]])) {
|
|
30
|
+
return "worker";
|
|
31
|
+
}
|
|
32
|
+
if (platformTag === _chunk7YRW5HNXjs.ProjectTagConstants.Platform.NODE || _optionalChain([types, 'optionalAccess', _7 => _7.some, 'call', _8 => _8((type) => type.toLowerCase() === "node")]) || _optionalChain([packageJson, 'access', _9 => _9.devDependencies, 'optionalAccess', _10 => _10["@types/node"]])) {
|
|
33
|
+
return "node";
|
|
34
|
+
}
|
|
35
|
+
if (platformTag === _chunk7YRW5HNXjs.ProjectTagConstants.Platform.BROWSER || _optionalChain([types, 'optionalAccess', _11 => _11.some, 'call', _12 => _12((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__ */ _chunk3GQAWCBQjs.__name.call(void 0, (projectJsonPath, packageJson) => {
|
|
42
|
+
return getProjectConfigFromProjectRoot(_path.dirname.call(void 0, projectJsonPath), packageJson);
|
|
43
|
+
}, "getProjectConfigFromProjectJsonPath");
|
|
44
|
+
var getProjectConfigFromProjectRoot = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (projectRoot, packageJson) => {
|
|
45
|
+
const { nx, name } = packageJson;
|
|
46
|
+
const projectJson = _devkit.readJsonFile.call(void 0, _path.join.call(void 0, projectRoot, "project.json"));
|
|
47
|
+
return _defu2.default.call(void 0, _nullishCoalesce(nx, () => ( {})), projectJson, {
|
|
48
|
+
targets: {},
|
|
49
|
+
tags: [],
|
|
50
|
+
name,
|
|
51
|
+
root: projectRoot
|
|
52
|
+
});
|
|
53
|
+
}, "getProjectConfigFromProjectRoot");
|
|
54
|
+
var getProjectRoot = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (configPath, workspaceRoot) => {
|
|
55
|
+
try {
|
|
56
|
+
const root = _path.dirname.call(void 0, configPath);
|
|
57
|
+
const projectRoot = _path.join.call(void 0, workspaceRoot, root);
|
|
58
|
+
if (!_fs.existsSync.call(void 0, _path.join.call(void 0, projectRoot, "package.json")) && !_fs.existsSync.call(void 0, _path.join.call(void 0, 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
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
exports.getProjectPlatform = getProjectPlatform; exports.getProjectConfigFromProjectJsonPath = getProjectConfigFromProjectJsonPath; exports.getProjectConfigFromProjectRoot = getProjectConfigFromProjectRoot; exports.getProjectRoot = getProjectRoot;
|