@storm-software/workspace-tools 1.267.20 → 1.267.21
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 +12 -0
- package/README.md +1 -1
- package/dist/chunk-22UY7NFX.js +41 -0
- package/dist/chunk-23BZQTB2.mjs +425 -0
- package/dist/{chunk-7O34DHUG.js → chunk-2AVWFUXP.js} +4 -19
- package/dist/{chunk-YAKIVJU6.mjs → chunk-2M22JVJQ.mjs} +307 -192
- package/dist/{chunk-GXIIWSRN.mjs → chunk-3EDSGFA5.mjs} +63 -54
- package/dist/chunk-3RG5ZIWI.js +10 -0
- package/dist/{chunk-AC5SI4YZ.js → chunk-3TYXXJKV.js} +11 -8
- package/dist/{chunk-7GXOAREP.mjs → chunk-3ZBMLG4D.mjs} +17 -14
- package/dist/chunk-437WGH2M.mjs +32 -0
- package/dist/{chunk-ULBTYC2B.js → chunk-4BECJRPP.js} +13 -42
- package/dist/chunk-4QRA66TH.mjs +379 -0
- package/dist/chunk-4S66IYQF.mjs +31 -0
- package/dist/{chunk-4JOIS7WW.js → chunk-4WHSR4FK.js} +24 -14
- package/dist/{chunk-JTAXCQX6.js → chunk-53DNHF7B.js} +7 -13
- package/dist/{chunk-GGGO542M.js → chunk-54FVHKCU.js} +36 -24
- package/dist/{chunk-23IRDNF3.mjs → chunk-5HUW3BTP.mjs} +37 -21
- package/dist/{chunk-7NN23VWS.mjs → chunk-5LB2F3L4.mjs} +80 -65
- package/dist/{chunk-UF6KFXG5.js → chunk-5VY5IBBQ.js} +20 -17
- package/dist/{chunk-6QO3KMZA.js → chunk-5ZFTWEKB.js} +2 -16
- package/dist/chunk-6EMYX25V.js +7 -0
- package/dist/chunk-6QZSAZZ3.mjs +64 -0
- package/dist/{chunk-2JA7WAH7.mjs → chunk-7AN4JMFC.mjs} +2 -16
- package/dist/{chunk-MXS2AKLY.mjs → chunk-7HWV6U3E.mjs} +33 -18
- package/dist/{chunk-GKL4BY2Y.js → chunk-A5CKB6IJ.js} +7 -8
- package/dist/{chunk-HSN5YXMG.mjs → chunk-ABE7UOMX.mjs} +24 -21
- package/dist/{chunk-6W2B4WA4.mjs → chunk-AHLKRK7D.mjs} +33 -18
- package/dist/{chunk-6CGAYKQL.js → chunk-AJ3C2EDW.js} +69 -44
- package/dist/chunk-AMW7VHFM.mjs +52 -0
- package/dist/chunk-AOFWKOAI.js +31 -0
- package/dist/{chunk-7YRW5HNX.js → chunk-AX3RSZT7.js} +42 -31
- package/dist/chunk-BFD7HHVZ.mjs +32 -0
- package/dist/{chunk-ZMFVKBRM.js → chunk-BWGJVRAS.js} +2 -13
- package/dist/{chunk-M6NHJNGU.js → chunk-CWBHZBTN.js} +277 -169
- package/dist/{chunk-BNYSKNEI.mjs → chunk-EKWR7TBP.mjs} +36 -24
- package/dist/chunk-EU6N7QT3.js +32 -0
- package/dist/chunk-EYXDS7SG.js +105 -0
- package/dist/chunk-F66XEAID.mjs +113 -0
- package/dist/chunk-FOFNKU5G.js +379 -0
- package/dist/{chunk-7NNHBZC5.js → chunk-GNOIETZR.js} +28 -17
- package/dist/chunk-GQQLBQPQ.mjs +32 -0
- package/dist/{chunk-7PRHEOCT.js → chunk-H5NKKUPV.js} +31 -18
- package/dist/{chunk-NM7WF6O5.mjs → chunk-HMJTTE4A.mjs} +39 -30
- package/dist/{chunk-ZCIEDGNG.mjs → chunk-HY3ZC5EZ.mjs} +10 -31
- package/dist/{chunk-OQPX75CG.js → chunk-I5MSPQMO.js} +31 -18
- package/dist/{chunk-WPRKDCZP.mjs → chunk-IEZKYJSF.mjs} +3 -6
- package/dist/{chunk-IWCQL3AQ.js → chunk-IL3R5ZVS.js} +10 -31
- package/dist/{chunk-P4OVFIT6.js → chunk-IZN2IVJ4.js} +19 -6
- package/dist/{chunk-UALZJZUK.js → chunk-J2Z4WP3E.js} +32 -16
- package/dist/{chunk-RBU35LQW.js → chunk-J4DYXH46.js} +70 -61
- package/dist/chunk-KP4RPOBI.mjs +105 -0
- package/dist/chunk-KR72GKIT.mjs +7 -0
- package/dist/chunk-L4NCVOB5.mjs +17 -0
- package/dist/{chunk-4Y6B6JDH.js → chunk-LBAVVYKU.js} +315 -136
- package/dist/{chunk-34WSVY5D.mjs → chunk-LSF4BHCI.mjs} +24 -14
- package/dist/chunk-M725BO42.mjs +32 -0
- package/dist/{chunk-SAWEMBTS.mjs → chunk-MF6VZSIO.mjs} +30 -17
- package/dist/{chunk-2I6S33ZD.mjs → chunk-MMBLGUC3.mjs} +311 -132
- package/dist/chunk-MZSZKV4N.mjs +47 -0
- package/dist/chunk-O6RRIC6I.js +32 -0
- package/dist/chunk-OKSECMVK.js +32 -0
- package/dist/chunk-Q2HYWACQ.mjs +50 -0
- package/dist/{chunk-LJFHW7ZR.mjs → chunk-QFWQZOVG.mjs} +14 -43
- package/dist/{chunk-DHGZTMND.js → chunk-QVYCDING.js} +4 -7
- package/dist/{chunk-Z4NKRWWJ.js → chunk-RJRBED5Q.js} +48 -32
- package/dist/chunk-S5Z4QGF3.js +64 -0
- package/dist/{chunk-KQL5XMNL.mjs → chunk-SITFTWPY.mjs} +23 -8
- package/dist/chunk-SNMXP6JV.mjs +41 -0
- package/dist/chunk-SPXJBMLY.js +50 -0
- package/dist/{chunk-7TLYMNLD.mjs → chunk-SW2E5MQJ.mjs} +4 -19
- package/dist/{chunk-OKW5O5P4.js → chunk-T7BALDKJ.js} +26 -22
- package/dist/chunk-TSYIV33W.js +32 -0
- package/dist/{chunk-S3IPRXVE.mjs → chunk-U65XVJ4Y.mjs} +1 -12
- package/dist/{chunk-D3U4WMSI.mjs → chunk-U7JFVMCK.mjs} +6 -12
- package/dist/chunk-UIPUSUAB.js +425 -0
- package/dist/{chunk-O5QR3B3Z.mjs → chunk-UYSJG2E5.mjs} +56 -31
- package/dist/{chunk-SJGDCFBH.mjs → chunk-VLOTOQYE.mjs} +11 -8
- package/dist/{chunk-ENE6R7BT.mjs → chunk-W2C5IGWW.mjs} +3 -6
- package/dist/{chunk-G4QFSE5B.js → chunk-WE4HK4RN.js} +327 -212
- package/dist/{chunk-SUQKASD7.js → chunk-X2VJXJEF.js} +82 -67
- package/dist/{chunk-RK3UDPDP.mjs → chunk-X6PHOMFB.mjs} +32 -16
- package/dist/{chunk-PK2SUBWI.js → chunk-XZSS3YAB.js} +19 -16
- package/dist/chunk-YXBFVZ3K.js +47 -0
- package/dist/{chunk-CUPARBOS.js → chunk-ZP76EMBE.js} +41 -32
- package/dist/{chunk-OBZTQWHM.mjs → chunk-ZT4IIRQF.mjs} +254 -146
- package/dist/executors.js +21 -21
- package/dist/executors.mjs +20 -20
- package/dist/generators.js +17 -17
- package/dist/generators.mjs +18 -18
- package/dist/index.js +41 -41
- package/dist/index.mjs +42 -42
- package/dist/src/base/base-executor.js +7 -7
- package/dist/src/base/base-executor.mjs +6 -6
- package/dist/src/base/base-executor.untyped.js +1 -1
- package/dist/src/base/base-executor.untyped.mjs +1 -1
- package/dist/src/base/base-generator.js +7 -7
- package/dist/src/base/base-generator.mjs +6 -6
- package/dist/src/base/base-generator.untyped.js +1 -1
- package/dist/src/base/base-generator.untyped.mjs +1 -1
- package/dist/src/base/cargo-base-executor.untyped.js +3 -3
- package/dist/src/base/cargo-base-executor.untyped.mjs +2 -2
- package/dist/src/base/index.js +13 -13
- package/dist/src/base/index.mjs +12 -12
- package/dist/src/base/typescript-build-executor.untyped.js +3 -3
- package/dist/src/base/typescript-build-executor.untyped.mjs +2 -2
- package/dist/src/base/typescript-library-generator.untyped.js +3 -3
- package/dist/src/base/typescript-library-generator.untyped.mjs +2 -2
- package/dist/src/executors/cargo-build/executor.js +9 -9
- package/dist/src/executors/cargo-build/executor.mjs +8 -8
- package/dist/src/executors/cargo-build/untyped.js +3 -3
- package/dist/src/executors/cargo-build/untyped.mjs +2 -2
- package/dist/src/executors/cargo-check/executor.js +9 -9
- package/dist/src/executors/cargo-check/executor.mjs +8 -8
- package/dist/src/executors/cargo-check/untyped.js +3 -3
- package/dist/src/executors/cargo-check/untyped.mjs +2 -2
- package/dist/src/executors/cargo-clippy/executor.js +9 -9
- package/dist/src/executors/cargo-clippy/executor.mjs +8 -8
- package/dist/src/executors/cargo-clippy/untyped.js +3 -3
- package/dist/src/executors/cargo-clippy/untyped.mjs +2 -2
- package/dist/src/executors/cargo-doc/executor.js +9 -9
- package/dist/src/executors/cargo-doc/executor.mjs +8 -8
- package/dist/src/executors/cargo-doc/untyped.js +3 -3
- package/dist/src/executors/cargo-doc/untyped.mjs +2 -2
- package/dist/src/executors/cargo-format/executor.js +9 -9
- package/dist/src/executors/cargo-format/executor.mjs +8 -8
- package/dist/src/executors/cargo-format/untyped.js +3 -3
- package/dist/src/executors/cargo-format/untyped.mjs +2 -2
- package/dist/src/executors/cargo-publish/executor.js +4 -4
- package/dist/src/executors/cargo-publish/executor.mjs +3 -3
- package/dist/src/executors/cargo-publish/untyped.js +3 -3
- package/dist/src/executors/cargo-publish/untyped.mjs +2 -2
- package/dist/src/executors/clean-package/executor.js +84 -62
- package/dist/src/executors/clean-package/executor.mjs +84 -62
- package/dist/src/executors/clean-package/untyped.js +2 -4
- package/dist/src/executors/clean-package/untyped.mjs +2 -4
- package/dist/src/executors/esbuild/executor.js +8 -8
- package/dist/src/executors/esbuild/executor.mjs +7 -7
- package/dist/src/executors/esbuild/untyped.js +4 -8
- package/dist/src/executors/esbuild/untyped.mjs +3 -7
- package/dist/src/executors/npm-publish/executor.js +5 -5
- package/dist/src/executors/npm-publish/executor.mjs +4 -4
- package/dist/src/executors/npm-publish/untyped.js +1 -1
- package/dist/src/executors/npm-publish/untyped.mjs +1 -1
- package/dist/src/executors/size-limit/executor.js +8 -8
- package/dist/src/executors/size-limit/executor.mjs +7 -7
- package/dist/src/executors/size-limit/untyped.js +1 -1
- package/dist/src/executors/size-limit/untyped.mjs +1 -1
- package/dist/src/executors/typia/executor.js +8 -8
- package/dist/src/executors/typia/executor.mjs +7 -7
- package/dist/src/executors/typia/untyped.js +4 -12
- package/dist/src/executors/typia/untyped.mjs +4 -12
- package/dist/src/executors/unbuild/executor.js +8 -8
- package/dist/src/executors/unbuild/executor.mjs +7 -7
- package/dist/src/executors/unbuild/untyped.js +6 -13
- package/dist/src/executors/unbuild/untyped.mjs +5 -12
- package/dist/src/generators/browser-library/generator.js +10 -10
- package/dist/src/generators/browser-library/generator.mjs +9 -9
- package/dist/src/generators/browser-library/untyped.js +5 -11
- package/dist/src/generators/browser-library/untyped.mjs +4 -10
- package/dist/src/generators/config-schema/generator.js +8 -8
- package/dist/src/generators/config-schema/generator.mjs +7 -7
- package/dist/src/generators/config-schema/untyped.js +1 -1
- package/dist/src/generators/config-schema/untyped.mjs +1 -1
- package/dist/src/generators/init/init.js +3 -3
- package/dist/src/generators/init/init.mjs +2 -2
- package/dist/src/generators/init/untyped.js +1 -1
- package/dist/src/generators/init/untyped.mjs +1 -1
- package/dist/src/generators/neutral-library/generator.js +10 -10
- package/dist/src/generators/neutral-library/generator.mjs +9 -9
- package/dist/src/generators/neutral-library/untyped.js +5 -10
- package/dist/src/generators/neutral-library/untyped.mjs +4 -9
- package/dist/src/generators/node-library/generator.js +10 -10
- package/dist/src/generators/node-library/generator.mjs +9 -9
- package/dist/src/generators/node-library/untyped.js +5 -11
- package/dist/src/generators/node-library/untyped.mjs +4 -10
- package/dist/src/generators/preset/generator.js +8 -8
- package/dist/src/generators/preset/generator.mjs +7 -7
- package/dist/src/generators/preset/untyped.js +3 -11
- package/dist/src/generators/preset/untyped.mjs +3 -11
- package/dist/src/generators/release-version/generator.js +7 -7
- package/dist/src/generators/release-version/generator.mjs +6 -6
- package/dist/src/generators/release-version/untyped.js +3 -14
- package/dist/src/generators/release-version/untyped.mjs +3 -14
- package/dist/src/plugins/rust/cargo-toml.js +5 -5
- package/dist/src/plugins/rust/cargo-toml.mjs +4 -4
- package/dist/src/plugins/rust/index.js +5 -5
- package/dist/src/plugins/rust/index.mjs +4 -4
- package/dist/src/plugins/typescript/index.js +5 -5
- package/dist/src/plugins/typescript/index.mjs +4 -4
- package/dist/src/plugins/typescript/project-config.js +5 -5
- package/dist/src/plugins/typescript/project-config.mjs +4 -4
- package/dist/src/plugins/typescript/tsup.js +114 -109
- package/dist/src/plugins/typescript/tsup.mjs +116 -111
- package/dist/src/plugins/typescript/untyped-schema.js +93 -77
- package/dist/src/plugins/typescript/untyped-schema.mjs +96 -80
- package/dist/src/types.js +1 -1
- package/dist/src/types.mjs +1 -1
- package/dist/src/utils/apply-workspace-tokens.js +5 -5
- package/dist/src/utils/apply-workspace-tokens.mjs +4 -4
- package/dist/src/utils/cargo.js +3 -3
- package/dist/src/utils/cargo.mjs +2 -2
- package/dist/src/utils/create-cli-options.js +3 -3
- package/dist/src/utils/create-cli-options.mjs +2 -2
- package/dist/src/utils/get-project-configurations.js +5 -5
- package/dist/src/utils/get-project-configurations.mjs +4 -4
- package/dist/src/utils/index.js +15 -15
- package/dist/src/utils/index.mjs +14 -14
- package/dist/src/utils/lock-file.js +3 -3
- package/dist/src/utils/lock-file.mjs +2 -2
- package/dist/src/utils/package-helpers.js +5 -5
- package/dist/src/utils/package-helpers.mjs +4 -4
- package/dist/src/utils/plugin-helpers.js +4 -4
- package/dist/src/utils/plugin-helpers.mjs +3 -3
- package/dist/src/utils/pnpm-deps-update.js +4 -4
- package/dist/src/utils/pnpm-deps-update.mjs +3 -3
- package/dist/src/utils/project-tags.js +3 -3
- package/dist/src/utils/project-tags.mjs +2 -2
- package/dist/src/utils/toml.js +3 -3
- package/dist/src/utils/toml.mjs +2 -2
- package/dist/src/utils/typia-transform.js +3 -3
- package/dist/src/utils/typia-transform.mjs +2 -2
- package/dist/src/utils/versions.js +1 -1
- package/dist/src/utils/versions.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-3GQAWCBQ.js +0 -13
- package/dist/chunk-3IZ3O4OK.js +0 -30
- package/dist/chunk-6JJB5AYA.js +0 -51
- package/dist/chunk-7AXFMX2T.js +0 -37
- package/dist/chunk-B3DVFXXD.js +0 -32
- package/dist/chunk-DHOPT66G.mjs +0 -32
- package/dist/chunk-ECGUA6DW.mjs +0 -48
- package/dist/chunk-FMDP5I2Q.mjs +0 -446
- package/dist/chunk-GFHXZA2W.mjs +0 -31
- package/dist/chunk-HIZQZGPN.mjs +0 -32
- package/dist/chunk-HOXPAVCL.js +0 -32
- package/dist/chunk-ICPUM2HS.js +0 -50
- package/dist/chunk-ID7QJZH6.mjs +0 -37
- package/dist/chunk-KCUI5EYN.mjs +0 -468
- package/dist/chunk-KEBNU3P2.js +0 -446
- package/dist/chunk-KVZPB73M.mjs +0 -86
- package/dist/chunk-NSCWEC2S.js +0 -32
- package/dist/chunk-NX7JRHF4.mjs +0 -50
- package/dist/chunk-OQTJDGUH.js +0 -468
- package/dist/chunk-QCF7H4NZ.mjs +0 -32
- package/dist/chunk-QKHODSAV.mjs +0 -13
- package/dist/chunk-QMD25JYH.mjs +0 -43
- package/dist/chunk-RUKOOSWL.js +0 -31
- package/dist/chunk-SBJV4LAX.mjs +0 -51
- package/dist/chunk-TET4GF3D.js +0 -43
- package/dist/chunk-XITP2BX2.js +0 -13
- package/dist/chunk-XJZ5TRTJ.mjs +0 -102
- package/dist/chunk-Y4TQKFAH.mjs +0 -18
- package/dist/chunk-YW4UN25U.js +0 -86
- package/dist/chunk-ZUNLUDAB.mjs +0 -30
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _chunkZP76EMBEjs = require('./chunk-ZP76EMBE.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
6
|
+
var _chunk53DNHF7Bjs = require('./chunk-53DNHF7B.js');
|
|
10
7
|
|
|
11
8
|
// src/executors/npm-publish/executor.ts
|
|
12
9
|
var _child_process = require('child_process');
|
|
@@ -19,28 +16,33 @@ async function npmPublishExecutorFn(options, context) {
|
|
|
19
16
|
}
|
|
20
17
|
const projectConfig = _optionalChain([context, 'access', _ => _.projectsConfigurations, 'optionalAccess', _2 => _2.projects, 'optionalAccess', _3 => _3[context.projectName]]);
|
|
21
18
|
if (!projectConfig) {
|
|
22
|
-
throw new Error(
|
|
19
|
+
throw new Error(
|
|
20
|
+
`Could not find project configuration for \`${context.projectName}\``
|
|
21
|
+
);
|
|
23
22
|
}
|
|
24
|
-
const packageRoot =
|
|
25
|
-
|
|
23
|
+
const packageRoot = _chunk53DNHF7Bjs.joinPaths.call(void 0,
|
|
24
|
+
context.root,
|
|
25
|
+
options.packageRoot || _chunk53DNHF7Bjs.joinPaths.call(void 0, "dist", projectConfig.root)
|
|
26
|
+
);
|
|
27
|
+
const packageJsonPath = _chunk53DNHF7Bjs.joinPaths.call(void 0, packageRoot, "package.json");
|
|
26
28
|
const packageJsonFile = await _promises.readFile.call(void 0, packageJsonPath, "utf8");
|
|
27
29
|
if (!packageJsonFile) {
|
|
28
30
|
throw new Error(`Could not find \`package.json\` at ${packageJsonPath}`);
|
|
29
31
|
}
|
|
30
32
|
const packageJson = JSON.parse(packageJsonFile);
|
|
31
33
|
const packageName = packageJson.name;
|
|
32
|
-
console.info(
|
|
34
|
+
console.info(
|
|
35
|
+
`\u{1F680} Running Storm NPM Publish executor on the ${packageName} package`
|
|
36
|
+
);
|
|
33
37
|
const packageTxt = packageName === context.projectName ? `package "${packageName}"` : `package "${packageName}" from project "${context.projectName}"`;
|
|
34
38
|
if (packageJson.private === true) {
|
|
35
|
-
console.warn(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
};
|
|
39
|
+
console.warn(
|
|
40
|
+
`Skipped ${packageTxt}, because it has \`"private": true\` in ${packageJsonPath}`
|
|
41
|
+
);
|
|
42
|
+
return { success: true };
|
|
39
43
|
}
|
|
40
|
-
await
|
|
41
|
-
const npmPublishCommandSegments = [
|
|
42
|
-
`npm publish --json`
|
|
43
|
-
];
|
|
44
|
+
await _chunkZP76EMBEjs.pnpmCatalogUpdate.call(void 0, packageRoot, context.root);
|
|
45
|
+
const npmPublishCommandSegments = [`npm publish --json`];
|
|
44
46
|
const npmViewCommandSegments = [
|
|
45
47
|
`npm view ${packageName} versions dist-tags --json`
|
|
46
48
|
];
|
|
@@ -92,27 +94,31 @@ async function npmPublishExecutorFn(options, context) {
|
|
|
92
94
|
const resultJson = JSON.parse(result.toString());
|
|
93
95
|
const distTags = resultJson["dist-tags"] || {};
|
|
94
96
|
if (distTags[tag] === currentVersion) {
|
|
95
|
-
console.warn(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
};
|
|
97
|
+
console.warn(
|
|
98
|
+
`Skipped ${packageTxt} because v${currentVersion} already exists in ${registry} with tag "${tag}"`
|
|
99
|
+
);
|
|
100
|
+
return { success: true };
|
|
99
101
|
}
|
|
100
102
|
} catch (err) {
|
|
101
103
|
console.warn("\n ********************** \n");
|
|
102
|
-
console.warn(
|
|
104
|
+
console.warn(
|
|
105
|
+
`An error occurred while checking for existing dist-tags
|
|
103
106
|
${JSON.stringify(err)}
|
|
104
107
|
|
|
105
108
|
Note: If this is the first time this package has been published to NPM, this can be ignored.
|
|
106
109
|
|
|
107
|
-
`
|
|
110
|
+
`
|
|
111
|
+
);
|
|
108
112
|
console.info("");
|
|
109
113
|
}
|
|
110
114
|
try {
|
|
111
115
|
if (!isDryRun) {
|
|
112
116
|
const command = `npm dist-tag add ${packageName}@${currentVersion} ${tag} --registry="${registry}" `;
|
|
113
|
-
console.info(
|
|
117
|
+
console.info(
|
|
118
|
+
`Adding the dist-tag ${tag} - preparing to run the following:
|
|
114
119
|
${command}
|
|
115
|
-
`
|
|
120
|
+
`
|
|
121
|
+
);
|
|
116
122
|
const result = _child_process.execSync.call(void 0, command, {
|
|
117
123
|
cwd: packageRoot,
|
|
118
124
|
env: {
|
|
@@ -122,17 +128,19 @@ ${command}
|
|
|
122
128
|
maxBuffer: LARGE_BUFFER,
|
|
123
129
|
killSignal: "SIGTERM"
|
|
124
130
|
});
|
|
125
|
-
console.info(
|
|
131
|
+
console.info(
|
|
132
|
+
`Added the dist-tag ${tag} to v${currentVersion} for registry "${registry}"
|
|
126
133
|
|
|
127
134
|
Execution response: ${result.toString()}
|
|
128
|
-
`
|
|
135
|
+
`
|
|
136
|
+
);
|
|
129
137
|
} else {
|
|
130
|
-
console.info(
|
|
131
|
-
`
|
|
138
|
+
console.info(
|
|
139
|
+
`Would add the dist-tag ${tag} to v${currentVersion} for registry "${registry}", but [dry-run] was set.
|
|
140
|
+
`
|
|
141
|
+
);
|
|
132
142
|
}
|
|
133
|
-
return {
|
|
134
|
-
success: true
|
|
135
|
-
};
|
|
143
|
+
return { success: true };
|
|
136
144
|
} catch (err) {
|
|
137
145
|
try {
|
|
138
146
|
console.warn("\n ********************** \n");
|
|
@@ -140,16 +148,20 @@ Execution response: ${result.toString()}
|
|
|
140
148
|
if (Buffer.isBuffer(error)) {
|
|
141
149
|
error = error.toString();
|
|
142
150
|
}
|
|
143
|
-
console.warn(
|
|
151
|
+
console.warn(
|
|
152
|
+
`An error occurred while adding dist-tags:
|
|
144
153
|
${error}
|
|
145
154
|
|
|
146
155
|
Note: If this is the first time this package has been published to NPM, this can be ignored.
|
|
147
156
|
|
|
148
|
-
`
|
|
157
|
+
`
|
|
158
|
+
);
|
|
149
159
|
console.info("");
|
|
150
160
|
const stdoutData = JSON.parse(_optionalChain([err, 'access', _4 => _4.stdout, 'optionalAccess', _5 => _5.toString, 'call', _6 => _6()]) || "{}");
|
|
151
161
|
if (_optionalChain([stdoutData, 'optionalAccess', _7 => _7.error]) && !(_optionalChain([stdoutData, 'access', _8 => _8.error, 'optionalAccess', _9 => _9.code, 'optionalAccess', _10 => _10.includes, 'call', _11 => _11("E404")]) && _optionalChain([stdoutData, 'access', _12 => _12.error, 'optionalAccess', _13 => _13.summary, 'optionalAccess', _14 => _14.includes, 'call', _15 => _15("no such package available")])) && !(_optionalChain([err, 'access', _16 => _16.stderr, 'optionalAccess', _17 => _17.toString, 'call', _18 => _18(), 'access', _19 => _19.includes, 'call', _20 => _20("E404")]) && _optionalChain([err, 'access', _21 => _21.stderr, 'optionalAccess', _22 => _22.toString, 'call', _23 => _23(), 'access', _24 => _24.includes, 'call', _25 => _25("no such package available")]))) {
|
|
152
|
-
console.error(
|
|
162
|
+
console.error(
|
|
163
|
+
"npm dist-tag add error please see below for more information:"
|
|
164
|
+
);
|
|
153
165
|
if (stdoutData.error.summary) {
|
|
154
166
|
console.error(_optionalChain([stdoutData, 'access', _26 => _26.error, 'optionalAccess', _27 => _27.summary]));
|
|
155
167
|
}
|
|
@@ -157,18 +169,18 @@ Note: If this is the first time this package has been published to NPM, this can
|
|
|
157
169
|
console.error(_optionalChain([stdoutData, 'access', _28 => _28.error, 'optionalAccess', _29 => _29.detail]));
|
|
158
170
|
}
|
|
159
171
|
if (context.isVerbose) {
|
|
160
|
-
console.error(
|
|
172
|
+
console.error(
|
|
173
|
+
`npm dist-tag add stdout: ${JSON.stringify(stdoutData, null, 2)}`
|
|
174
|
+
);
|
|
161
175
|
}
|
|
162
|
-
return {
|
|
163
|
-
success: false
|
|
164
|
-
};
|
|
176
|
+
return { success: false };
|
|
165
177
|
}
|
|
166
178
|
} catch (err2) {
|
|
167
|
-
console.error(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
};
|
|
179
|
+
console.error(
|
|
180
|
+
`Something unexpected went wrong when processing the npm dist-tag add output
|
|
181
|
+
${JSON.stringify(err2)}`
|
|
182
|
+
);
|
|
183
|
+
return { success: false };
|
|
172
184
|
}
|
|
173
185
|
}
|
|
174
186
|
} catch (err) {
|
|
@@ -178,25 +190,29 @@ ${JSON.stringify(err2)}`);
|
|
|
178
190
|
}
|
|
179
191
|
console.error("\n ********************** \n");
|
|
180
192
|
console.info("");
|
|
181
|
-
console.error(
|
|
193
|
+
console.error(
|
|
194
|
+
"An error occured trying to run the npm dist-tag add command."
|
|
195
|
+
);
|
|
182
196
|
console.error(error);
|
|
183
197
|
console.info("");
|
|
184
198
|
const stdoutData = JSON.parse(_optionalChain([err, 'access', _30 => _30.stdout, 'optionalAccess', _31 => _31.toString, 'call', _32 => _32()]) || "{}");
|
|
185
199
|
if (!(_optionalChain([stdoutData, 'access', _33 => _33.error, 'optionalAccess', _34 => _34.code, 'optionalAccess', _35 => _35.includes, 'call', _36 => _36("E404")]) && _optionalChain([stdoutData, 'access', _37 => _37.error, 'optionalAccess', _38 => _38.summary, 'optionalAccess', _39 => _39.toLowerCase, 'call', _40 => _40(), 'access', _41 => _41.includes, 'call', _42 => _42("not found")])) && !(_optionalChain([err, 'access', _43 => _43.stderr, 'optionalAccess', _44 => _44.toString, 'call', _45 => _45(), 'access', _46 => _46.includes, 'call', _47 => _47("E404")]) && _optionalChain([err, 'access', _48 => _48.stderr, 'optionalAccess', _49 => _49.toString, 'call', _50 => _50(), 'access', _51 => _51.toLowerCase, 'call', _52 => _52(), 'access', _53 => _53.includes, 'call', _54 => _54("not found")]))) {
|
|
186
|
-
console.error(
|
|
200
|
+
console.error(
|
|
201
|
+
`Something unexpected went wrong when checking for existing dist-tags.
|
|
187
202
|
|
|
188
203
|
Error: ${JSON.stringify(err)}
|
|
189
|
-
`
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
};
|
|
204
|
+
`
|
|
205
|
+
);
|
|
206
|
+
return { success: false };
|
|
193
207
|
}
|
|
194
208
|
}
|
|
195
209
|
}
|
|
196
210
|
try {
|
|
197
211
|
const cwd = packageRoot;
|
|
198
212
|
const command = npmPublishCommandSegments.join(" ");
|
|
199
|
-
console.info(
|
|
213
|
+
console.info(
|
|
214
|
+
`Running publish command "${command}" in current working directory: "${cwd}" `
|
|
215
|
+
);
|
|
200
216
|
const result = _child_process.execSync.call(void 0, command, {
|
|
201
217
|
cwd,
|
|
202
218
|
env: {
|
|
@@ -207,19 +223,19 @@ Error: ${JSON.stringify(err)}
|
|
|
207
223
|
killSignal: "SIGTERM"
|
|
208
224
|
});
|
|
209
225
|
if (isDryRun) {
|
|
210
|
-
console.info(
|
|
226
|
+
console.info(
|
|
227
|
+
`Would publish to ${registry} with tag "${tag}", but [dry-run] was set ${result ? `
|
|
211
228
|
|
|
212
229
|
Execution response: ${result.toString()}` : ""}
|
|
213
|
-
`
|
|
230
|
+
`
|
|
231
|
+
);
|
|
214
232
|
} else {
|
|
215
233
|
console.info(`Published to ${registry} with tag "${tag}" ${result ? `
|
|
216
234
|
|
|
217
235
|
Execution response: ${result.toString()}` : ""}
|
|
218
236
|
`);
|
|
219
237
|
}
|
|
220
|
-
return {
|
|
221
|
-
success: true
|
|
222
|
-
};
|
|
238
|
+
return { success: true };
|
|
223
239
|
} catch (err) {
|
|
224
240
|
try {
|
|
225
241
|
console.error("\n ********************** \n");
|
|
@@ -236,30 +252,29 @@ Execution response: ${result.toString()}` : ""}
|
|
|
236
252
|
console.error(stdoutData.error.detail);
|
|
237
253
|
}
|
|
238
254
|
if (context.isVerbose) {
|
|
239
|
-
console.error(
|
|
240
|
-
|
|
255
|
+
console.error(
|
|
256
|
+
`npm publish stdout:
|
|
257
|
+
${JSON.stringify(stdoutData, null, 2)}`
|
|
258
|
+
);
|
|
241
259
|
}
|
|
242
260
|
console.error("\n ********************** \n");
|
|
243
|
-
return {
|
|
244
|
-
success: false
|
|
245
|
-
};
|
|
261
|
+
return { success: false };
|
|
246
262
|
} catch (err2) {
|
|
247
263
|
let error = err2;
|
|
248
264
|
if (Buffer.isBuffer(error)) {
|
|
249
265
|
error = error.toString();
|
|
250
266
|
}
|
|
251
|
-
console.error(
|
|
267
|
+
console.error(
|
|
268
|
+
`Something unexpected went wrong when processing the npm publish output
|
|
252
269
|
|
|
253
270
|
Error: ${JSON.stringify(error)}
|
|
254
|
-
`
|
|
271
|
+
`
|
|
272
|
+
);
|
|
255
273
|
console.error("\n ********************** \n");
|
|
256
|
-
return {
|
|
257
|
-
success: false
|
|
258
|
-
};
|
|
274
|
+
return { success: false };
|
|
259
275
|
}
|
|
260
276
|
}
|
|
261
277
|
}
|
|
262
|
-
_chunk3GQAWCBQjs.__name.call(void 0, npmPublishExecutorFn, "npmPublishExecutorFn");
|
|
263
278
|
|
|
264
279
|
|
|
265
280
|
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
findWorkspaceRoot
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
__name
|
|
6
|
-
} from "./chunk-WPRKDCZP.mjs";
|
|
3
|
+
} from "./chunk-LSF4BHCI.mjs";
|
|
7
4
|
|
|
8
5
|
// ../config-tools/src/utilities/apply-workspace-tokens.ts
|
|
9
|
-
var applyWorkspaceBaseTokens =
|
|
6
|
+
var applyWorkspaceBaseTokens = async (option, tokenParams) => {
|
|
10
7
|
let result = option;
|
|
11
8
|
if (!result) {
|
|
12
9
|
return result;
|
|
@@ -16,7 +13,10 @@ var applyWorkspaceBaseTokens = /* @__PURE__ */ __name(async (option, tokenParams
|
|
|
16
13
|
if (optionKeys.some((optionKey) => result.includes(`{${optionKey}}`))) {
|
|
17
14
|
for (const optionKey of optionKeys) {
|
|
18
15
|
if (result.includes(`{${optionKey}}`)) {
|
|
19
|
-
result = result.replaceAll(
|
|
16
|
+
result = result.replaceAll(
|
|
17
|
+
`{${optionKey}}`,
|
|
18
|
+
tokenParams?.[optionKey] || ""
|
|
19
|
+
);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -26,37 +26,53 @@ var applyWorkspaceBaseTokens = /* @__PURE__ */ __name(async (option, tokenParams
|
|
|
26
26
|
if (configKeys.some((configKey) => result.includes(`{${configKey}}`))) {
|
|
27
27
|
for (const configKey of configKeys) {
|
|
28
28
|
if (result.includes(`{${configKey}}`)) {
|
|
29
|
-
result = result.replaceAll(
|
|
29
|
+
result = result.replaceAll(
|
|
30
|
+
`{${configKey}}`,
|
|
31
|
+
tokenParams.config[configKey] || ""
|
|
32
|
+
);
|
|
30
33
|
}
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
37
|
if (result.includes("{workspaceRoot}")) {
|
|
35
|
-
result = result.replaceAll(
|
|
38
|
+
result = result.replaceAll(
|
|
39
|
+
"{workspaceRoot}",
|
|
40
|
+
tokenParams.workspaceRoot ?? tokenParams.config?.workspaceRoot ?? findWorkspaceRoot()
|
|
41
|
+
);
|
|
36
42
|
}
|
|
37
43
|
return result;
|
|
38
|
-
}
|
|
39
|
-
var applyWorkspaceProjectTokens =
|
|
44
|
+
};
|
|
45
|
+
var applyWorkspaceProjectTokens = (option, tokenParams) => {
|
|
40
46
|
return applyWorkspaceBaseTokens(option, tokenParams);
|
|
41
|
-
}
|
|
42
|
-
var applyWorkspaceTokens =
|
|
47
|
+
};
|
|
48
|
+
var applyWorkspaceTokens = async (options, tokenParams, tokenizerFn) => {
|
|
43
49
|
if (!options) {
|
|
44
50
|
return {};
|
|
45
51
|
}
|
|
46
52
|
const result = {};
|
|
47
53
|
for (const option of Object.keys(options)) {
|
|
48
54
|
if (typeof options[option] === "string") {
|
|
49
|
-
result[option] = await Promise.resolve(
|
|
55
|
+
result[option] = await Promise.resolve(
|
|
56
|
+
tokenizerFn(options[option], tokenParams)
|
|
57
|
+
);
|
|
50
58
|
} else if (Array.isArray(options[option])) {
|
|
51
|
-
result[option] = await Promise.all(
|
|
59
|
+
result[option] = await Promise.all(
|
|
60
|
+
options[option].map(
|
|
61
|
+
async (item) => typeof item === "string" ? await Promise.resolve(tokenizerFn(item, tokenParams)) : item
|
|
62
|
+
)
|
|
63
|
+
);
|
|
52
64
|
} else if (typeof options[option] === "object") {
|
|
53
|
-
result[option] = await applyWorkspaceTokens(
|
|
65
|
+
result[option] = await applyWorkspaceTokens(
|
|
66
|
+
options[option],
|
|
67
|
+
tokenParams,
|
|
68
|
+
tokenizerFn
|
|
69
|
+
);
|
|
54
70
|
} else {
|
|
55
71
|
result[option] = options[option];
|
|
56
72
|
}
|
|
57
73
|
}
|
|
58
74
|
return result;
|
|
59
|
-
}
|
|
75
|
+
};
|
|
60
76
|
|
|
61
77
|
export {
|
|
62
78
|
applyWorkspaceBaseTokens,
|
|
@@ -1,29 +1,36 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true})
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/utils/lock-file.ts
|
|
2
|
+
|
|
3
|
+
|
|
2
4
|
|
|
3
|
-
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
4
5
|
|
|
5
|
-
// src/utils/lock-file.ts
|
|
6
6
|
var _devkit = require('@nx/devkit');
|
|
7
7
|
var _fs = require('fs');
|
|
8
8
|
var _path = require('path');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
9
12
|
var _npmparser = require('nx/src/plugins/js/lock-file/npm-parser');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
10
16
|
var _pnpmparser = require('nx/src/plugins/js/lock-file/pnpm-parser');
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
11
20
|
var _yarnparser = require('nx/src/plugins/js/lock-file/yarn-parser');
|
|
12
21
|
var YARN_LOCK_FILE = "yarn.lock";
|
|
13
22
|
var NPM_LOCK_FILE = "package-lock.json";
|
|
14
23
|
var PNPM_LOCK_FILE = "pnpm-lock.yaml";
|
|
15
|
-
var LOCK_FILES = [
|
|
16
|
-
YARN_LOCK_FILE,
|
|
17
|
-
NPM_LOCK_FILE,
|
|
18
|
-
PNPM_LOCK_FILE
|
|
19
|
-
];
|
|
24
|
+
var LOCK_FILES = [YARN_LOCK_FILE, NPM_LOCK_FILE, PNPM_LOCK_FILE];
|
|
20
25
|
var YARN_LOCK_PATH = _path.join.call(void 0, _devkit.workspaceRoot, YARN_LOCK_FILE);
|
|
21
26
|
var NPM_LOCK_PATH = _path.join.call(void 0, _devkit.workspaceRoot, NPM_LOCK_FILE);
|
|
22
27
|
var PNPM_LOCK_PATH = _path.join.call(void 0, _devkit.workspaceRoot, PNPM_LOCK_FILE);
|
|
23
28
|
function getLockFileNodes(packageManager, contents, lockFileHash, context) {
|
|
24
29
|
try {
|
|
25
30
|
if (packageManager === "yarn") {
|
|
26
|
-
const packageJson = _devkit.readJsonFile.call(void 0,
|
|
31
|
+
const packageJson = _devkit.readJsonFile.call(void 0,
|
|
32
|
+
_path.join.call(void 0, context.workspaceRoot, "package.json")
|
|
33
|
+
);
|
|
27
34
|
return _yarnparser.getYarnLockfileNodes.call(void 0, contents, lockFileHash, packageJson);
|
|
28
35
|
}
|
|
29
36
|
if (packageManager === "pnpm") {
|
|
@@ -43,7 +50,6 @@ function getLockFileNodes(packageManager, contents, lockFileHash, context) {
|
|
|
43
50
|
}
|
|
44
51
|
throw new Error(`Unknown package manager: ${packageManager}`);
|
|
45
52
|
}
|
|
46
|
-
_chunk3GQAWCBQjs.__name.call(void 0, getLockFileNodes, "getLockFileNodes");
|
|
47
53
|
function getLockFileDependencies(packageManager, contents, lockFileHash, context) {
|
|
48
54
|
try {
|
|
49
55
|
if (packageManager === "yarn") {
|
|
@@ -66,7 +72,6 @@ function getLockFileDependencies(packageManager, contents, lockFileHash, context
|
|
|
66
72
|
}
|
|
67
73
|
throw new Error(`Unknown package manager: ${packageManager}`);
|
|
68
74
|
}
|
|
69
|
-
_chunk3GQAWCBQjs.__name.call(void 0, getLockFileDependencies, "getLockFileDependencies");
|
|
70
75
|
function lockFileExists(packageManager) {
|
|
71
76
|
if (packageManager === "yarn") {
|
|
72
77
|
return _fs.existsSync.call(void 0, YARN_LOCK_PATH);
|
|
@@ -77,9 +82,10 @@ function lockFileExists(packageManager) {
|
|
|
77
82
|
if (packageManager === "npm") {
|
|
78
83
|
return _fs.existsSync.call(void 0, NPM_LOCK_PATH);
|
|
79
84
|
}
|
|
80
|
-
throw new Error(
|
|
85
|
+
throw new Error(
|
|
86
|
+
`Unknown package manager ${packageManager} or lock file missing`
|
|
87
|
+
);
|
|
81
88
|
}
|
|
82
|
-
_chunk3GQAWCBQjs.__name.call(void 0, lockFileExists, "lockFileExists");
|
|
83
89
|
function getLockFileName(packageManager) {
|
|
84
90
|
if (packageManager === "yarn") {
|
|
85
91
|
return YARN_LOCK_FILE;
|
|
@@ -92,7 +98,6 @@ function getLockFileName(packageManager) {
|
|
|
92
98
|
}
|
|
93
99
|
throw new Error(`Unknown package manager: ${packageManager}`);
|
|
94
100
|
}
|
|
95
|
-
_chunk3GQAWCBQjs.__name.call(void 0, getLockFileName, "getLockFileName");
|
|
96
101
|
function errorBodyLines(originalError, additionalInfo = []) {
|
|
97
102
|
const result = [
|
|
98
103
|
"Please open an issue at `https://github.com/storm-software/storm-ops/issues/new?template=1-bug.yml` and provide a reproduction.",
|
|
@@ -109,11 +114,9 @@ Original error: ${originalError.message}
|
|
|
109
114
|
}
|
|
110
115
|
return result;
|
|
111
116
|
}
|
|
112
|
-
_chunk3GQAWCBQjs.__name.call(void 0, errorBodyLines, "errorBodyLines");
|
|
113
117
|
function isPostInstallProcess() {
|
|
114
118
|
return process.env.npm_command === "install" && process.env.npm_lifecycle_event === "postinstall";
|
|
115
119
|
}
|
|
116
|
-
_chunk3GQAWCBQjs.__name.call(void 0, isPostInstallProcess, "isPostInstallProcess");
|
|
117
120
|
|
|
118
121
|
|
|
119
122
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkAX3RSZT7js = require('./chunk-AX3RSZT7.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkBWGJVRASjs = require('./chunk-BWGJVRAS.js');
|
|
8
|
+
|
|
9
|
+
// src/utils/package-helpers.ts
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _devkit = require('@nx/devkit');
|
|
14
|
+
var _fs = require('fs');
|
|
15
|
+
var PackageManagerTypes = {
|
|
16
|
+
PackageJson: "package.json",
|
|
17
|
+
CargoToml: "Cargo.toml"
|
|
18
|
+
};
|
|
19
|
+
var getPackageInfo = (project) => {
|
|
20
|
+
if (_chunkAX3RSZT7js.isEqualProjectTag.call(void 0,
|
|
21
|
+
project,
|
|
22
|
+
_chunkAX3RSZT7js.ProjectTagConstants.Language.TAG_ID,
|
|
23
|
+
_chunkAX3RSZT7js.ProjectTagConstants.Language.RUST
|
|
24
|
+
) && _fs.existsSync.call(void 0, _devkit.joinPathFragments.call(void 0, project.root, "Cargo.toml"))) {
|
|
25
|
+
return {
|
|
26
|
+
type: "Cargo.toml",
|
|
27
|
+
content: _chunkBWGJVRASjs.parseCargoToml.call(void 0, _devkit.joinPathFragments.call(void 0, project.root, "Cargo.toml"))
|
|
28
|
+
};
|
|
29
|
+
} else if (_chunkAX3RSZT7js.isEqualProjectTag.call(void 0,
|
|
30
|
+
project,
|
|
31
|
+
_chunkAX3RSZT7js.ProjectTagConstants.Language.TAG_ID,
|
|
32
|
+
_chunkAX3RSZT7js.ProjectTagConstants.Language.TYPESCRIPT
|
|
33
|
+
) && _fs.existsSync.call(void 0, _devkit.joinPathFragments.call(void 0, project.root, "package.json"))) {
|
|
34
|
+
return {
|
|
35
|
+
type: "package.json",
|
|
36
|
+
content: _devkit.readJsonFile.call(void 0,
|
|
37
|
+
_devkit.joinPathFragments.call(void 0, project.root, "package.json")
|
|
38
|
+
)
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
exports.PackageManagerTypes = PackageManagerTypes; exports.getPackageInfo = getPackageInfo;
|
|
@@ -1,9 +1,6 @@
|
|
|
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(); } } 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
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunk3GQAWCBQjs = require('./chunk-3GQAWCBQ.js');
|
|
3
|
+
var _chunk53DNHF7Bjs = require('./chunk-53DNHF7B.js');
|
|
7
4
|
|
|
8
5
|
// src/utils/pnpm-deps-update.ts
|
|
9
6
|
var _fs = require('fs');
|
|
@@ -13,28 +10,38 @@ var _readyamlfile = require('read-yaml-file'); var _readyamlfile2 = _interopRequ
|
|
|
13
10
|
var pnpmCatalog;
|
|
14
11
|
async function pnpmCatalogUpdate(packageRoot, workspaceRoot = process.cwd()) {
|
|
15
12
|
if (!pnpmCatalog) {
|
|
16
|
-
const pnpmWorkspacePath =
|
|
13
|
+
const pnpmWorkspacePath = _chunk53DNHF7Bjs.joinPaths.call(void 0, workspaceRoot, "pnpm-workspace.yaml");
|
|
17
14
|
if (!_fs.existsSync.call(void 0, pnpmWorkspacePath)) {
|
|
18
|
-
console.warn(
|
|
15
|
+
console.warn(
|
|
16
|
+
`No \`pnpm-workspace.yaml\` file found in workspace root (searching in: ${pnpmWorkspacePath}). Skipping pnpm catalog read for now.`
|
|
17
|
+
);
|
|
19
18
|
return;
|
|
20
19
|
}
|
|
21
20
|
const pnpmWorkspaceYaml = await _readyamlfile2.default.call(void 0, pnpmWorkspacePath);
|
|
22
|
-
console.info(
|
|
21
|
+
console.info(
|
|
22
|
+
`pnpmWorkspaceYaml: ${JSON.stringify(_nullishCoalesce(pnpmWorkspaceYaml, () => ( {})))}`
|
|
23
|
+
);
|
|
23
24
|
if (_optionalChain([pnpmWorkspaceYaml, 'optionalAccess', _ => _.catalog])) {
|
|
24
25
|
pnpmCatalog = pnpmWorkspaceYaml.catalog;
|
|
25
26
|
} else {
|
|
26
|
-
console.warn(
|
|
27
|
+
console.warn(
|
|
28
|
+
`Found a \`pnpm-workspace.yaml\` file in the workspace root directory, but no pnpm catalog existed:
|
|
27
29
|
File name: ${pnpmWorkspacePath}
|
|
28
|
-
File contents: ${pnpmWorkspaceYaml ? JSON.stringify(pnpmWorkspaceYaml) : "EMPTY FILE"}`
|
|
30
|
+
File contents: ${pnpmWorkspaceYaml ? JSON.stringify(pnpmWorkspaceYaml) : "EMPTY FILE"}`
|
|
31
|
+
);
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
if (!pnpmCatalog) {
|
|
32
|
-
console.warn(
|
|
35
|
+
console.warn(
|
|
36
|
+
`No pnpm catalog found. Attempting to read from workspace root's \`pnpm-workspace.yaml\` file.`
|
|
37
|
+
);
|
|
33
38
|
}
|
|
34
|
-
const packageJsonPath =
|
|
39
|
+
const packageJsonPath = _chunk53DNHF7Bjs.joinPaths.call(void 0, packageRoot, "package.json");
|
|
35
40
|
const packageJsonFile = await _promises.readFile.call(void 0, packageJsonPath, "utf8");
|
|
36
41
|
if (!packageJsonFile) {
|
|
37
|
-
throw new Error(
|
|
42
|
+
throw new Error(
|
|
43
|
+
"No package.json file found in package root: " + packageRoot
|
|
44
|
+
);
|
|
38
45
|
}
|
|
39
46
|
const packageJson = JSON.parse(packageJsonFile);
|
|
40
47
|
for (const dependencyType of [
|
|
@@ -49,7 +56,9 @@ File contents: ${pnpmWorkspaceYaml ? JSON.stringify(pnpmWorkspaceYaml) : "EMPTY
|
|
|
49
56
|
for (const dependencyName of Object.keys(dependencies)) {
|
|
50
57
|
if (dependencies[dependencyName] === "catalog:") {
|
|
51
58
|
if (!pnpmCatalog) {
|
|
52
|
-
throw new Error(
|
|
59
|
+
throw new Error(
|
|
60
|
+
`Dependency ${dependencyName} is marked as \`catalog:\`, but no catalog exists in the workspace root's \`pnpm-workspace.yaml\` file.`
|
|
61
|
+
);
|
|
53
62
|
}
|
|
54
63
|
const catalogVersion = pnpmCatalog[dependencyName];
|
|
55
64
|
if (!catalogVersion) {
|
|
@@ -61,26 +70,26 @@ File contents: ${pnpmWorkspaceYaml ? JSON.stringify(pnpmWorkspaceYaml) : "EMPTY
|
|
|
61
70
|
}
|
|
62
71
|
}
|
|
63
72
|
}
|
|
64
|
-
return _promises.writeFile.call(void 0,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
73
|
+
return _promises.writeFile.call(void 0,
|
|
74
|
+
packageJsonPath,
|
|
75
|
+
await _prettier.format.call(void 0, JSON.stringify(packageJson), {
|
|
76
|
+
parser: "json",
|
|
77
|
+
proseWrap: "always",
|
|
78
|
+
trailingComma: "none",
|
|
79
|
+
tabWidth: 2,
|
|
80
|
+
semi: true,
|
|
81
|
+
singleQuote: false,
|
|
82
|
+
quoteProps: "as-needed",
|
|
83
|
+
insertPragma: false,
|
|
84
|
+
bracketSameLine: true,
|
|
85
|
+
printWidth: 80,
|
|
86
|
+
bracketSpacing: true,
|
|
87
|
+
arrowParens: "avoid",
|
|
88
|
+
endOfLine: "lf",
|
|
89
|
+
plugins: ["prettier-plugin-pkg"]
|
|
90
|
+
})
|
|
91
|
+
);
|
|
82
92
|
}
|
|
83
|
-
_chunk3GQAWCBQjs.__name.call(void 0, pnpmCatalogUpdate, "pnpmCatalogUpdate");
|
|
84
93
|
|
|
85
94
|
|
|
86
95
|
|