@storm-software/workspace-tools 1.285.0 → 1.287.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +1 -2
- package/dist/{chunk-D26STI4S.mjs → chunk-5K5OGRSL.mjs} +178 -18
- package/dist/{chunk-BZTR7YL6.js → chunk-5X2P7IL3.js} +183 -23
- package/dist/chunk-DA53ZKBY.js +73 -0
- package/dist/chunk-M7ZPKNJT.mjs +73 -0
- package/dist/{chunk-G77OCEMB.js → chunk-Q27SXGNA.js} +79 -109
- package/dist/{chunk-3G7XO5ON.mjs → chunk-YTQNRG2E.mjs} +69 -99
- package/dist/executors.js +3 -3
- package/dist/executors.mjs +2 -2
- package/dist/generators.js +3 -2
- package/dist/generators.mjs +2 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +5 -8
- package/dist/index.mjs +4 -7
- package/dist/src/executors/npm-publish/executor.js +5 -3
- package/dist/src/executors/npm-publish/executor.mjs +4 -2
- package/dist/src/generators/release-version/generator.js +3 -2
- package/dist/src/generators/release-version/generator.mjs +2 -1
- package/dist/src/utils/index.d.mts +0 -1
- package/dist/src/utils/index.d.ts +0 -1
- package/dist/src/utils/index.js +2 -6
- package/dist/src/utils/index.mjs +1 -5
- package/package.json +22 -23
- package/dist/chunk-F6X43VUX.js +0 -163
- package/dist/chunk-KHT5W6AJ.mjs +0 -163
- package/dist/src/utils/pnpm-deps-update.d.mts +0 -9
- package/dist/src/utils/pnpm-deps-update.d.ts +0 -9
- package/dist/src/utils/pnpm-deps-update.js +0 -7
- package/dist/src/utils/pnpm-deps-update.mjs +0 -8
- /package/dist/{chunk-XCVH63OO.mjs → chunk-6YZ3OUJB.mjs} +0 -0
- /package/dist/{chunk-DO2X7OZO.js → chunk-JGP4YWZY.js} +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getConfig
|
|
3
|
+
} from "./chunk-HJPVYUW7.mjs";
|
|
4
|
+
|
|
5
|
+
// ../npm-tools/src/constants.ts
|
|
6
|
+
var DEFAULT_NPM_REGISTRY = "https://registry.npmjs.org";
|
|
7
|
+
var DEFAULT_GITHUB_REGISTRY = "https://npm.pkg.github.com";
|
|
8
|
+
var LATEST_NPM_TAG = "latest";
|
|
9
|
+
var DEFAULT_NPM_TAG = LATEST_NPM_TAG;
|
|
10
|
+
|
|
11
|
+
// ../npm-tools/src/helpers/get-registry.ts
|
|
12
|
+
import { exec } from "node:child_process";
|
|
13
|
+
async function getRegistry() {
|
|
14
|
+
return new Promise((resolve, reject) => {
|
|
15
|
+
exec("npm config get registry", (error, stdout, stderr) => {
|
|
16
|
+
if (error) {
|
|
17
|
+
return reject(error);
|
|
18
|
+
}
|
|
19
|
+
if (stderr) {
|
|
20
|
+
return reject(stderr);
|
|
21
|
+
}
|
|
22
|
+
return resolve(stdout.trim());
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
async function getNpmRegistry() {
|
|
27
|
+
if (process.env.STORM_REGISTRY_NPM) {
|
|
28
|
+
return process.env.STORM_REGISTRY_NPM;
|
|
29
|
+
}
|
|
30
|
+
const workspaceConfig = await getConfig();
|
|
31
|
+
if (workspaceConfig?.registry?.npm) {
|
|
32
|
+
return workspaceConfig?.registry?.npm;
|
|
33
|
+
}
|
|
34
|
+
return DEFAULT_NPM_REGISTRY;
|
|
35
|
+
}
|
|
36
|
+
async function getGitHubRegistry() {
|
|
37
|
+
if (process.env.STORM_REGISTRY_GITHUB) {
|
|
38
|
+
return process.env.STORM_REGISTRY_GITHUB;
|
|
39
|
+
}
|
|
40
|
+
const workspaceConfig = await getConfig();
|
|
41
|
+
if (workspaceConfig?.registry?.github) {
|
|
42
|
+
return workspaceConfig?.registry?.github;
|
|
43
|
+
}
|
|
44
|
+
return DEFAULT_GITHUB_REGISTRY;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// ../npm-tools/src/helpers/get-version.ts
|
|
48
|
+
import { exec as exec2 } from "node:child_process";
|
|
49
|
+
async function getVersion(packageName, tag = DEFAULT_NPM_TAG, options = {}) {
|
|
50
|
+
const { registry = getRegistry() } = options;
|
|
51
|
+
return new Promise((resolve, reject) => {
|
|
52
|
+
exec2(
|
|
53
|
+
`npm view ${packageName} version --registry=${registry} --tag=${tag}`,
|
|
54
|
+
(error, stdout, stderr) => {
|
|
55
|
+
if (error) {
|
|
56
|
+
return reject(error);
|
|
57
|
+
}
|
|
58
|
+
if (stderr) {
|
|
59
|
+
return reject(stderr);
|
|
60
|
+
}
|
|
61
|
+
return resolve(stdout.trim());
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
DEFAULT_NPM_TAG,
|
|
69
|
+
getRegistry,
|
|
70
|
+
getNpmRegistry,
|
|
71
|
+
getGitHubRegistry,
|
|
72
|
+
getVersion
|
|
73
|
+
};
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await 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; }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await 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
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkDA53ZKBYjs = require('./chunk-DA53ZKBY.js');
|
|
8
|
+
|
|
2
9
|
|
|
3
10
|
|
|
4
11
|
|
|
@@ -32,7 +39,7 @@ var _devkit = require('@nx/devkit');
|
|
|
32
39
|
var _resolvelocalpackagedependencies = require('@nx/js/src/generators/release-version/utils/resolve-local-package-dependencies');
|
|
33
40
|
var _updatelockfile = require('@nx/js/src/release/utils/update-lock-file');
|
|
34
41
|
|
|
35
|
-
// ../git-tools/
|
|
42
|
+
// ../git-tools/dist/chunk-5XXXTVPU.js
|
|
36
43
|
var COMMIT_TYPES = {
|
|
37
44
|
/* --- Bumps version when selected --- */
|
|
38
45
|
"chore": {
|
|
@@ -238,55 +245,56 @@ var DEFAULT_MONOREPO_COMMIT_QUESTIONS = {
|
|
|
238
245
|
issuesBody: DEFAULT_MINIMAL_COMMIT_QUESTIONS.issuesBody
|
|
239
246
|
};
|
|
240
247
|
var DEFAULT_MINIMAL_COMMIT_RULES = {
|
|
241
|
-
"body-leading-blank": [1
|
|
242
|
-
"body-max-length": [2
|
|
243
|
-
"footer-leading-blank": [1
|
|
244
|
-
"footer-max-line-length": [2
|
|
245
|
-
"header-max-length": [2
|
|
246
|
-
"header-trim": [2
|
|
247
|
-
"subject-case": [2
|
|
248
|
-
"subject-empty": [2
|
|
249
|
-
"subject-full-stop": [2
|
|
250
|
-
"subject-max-length": [2
|
|
251
|
-
"subject-min-length": [2
|
|
252
|
-
"type-case": [2
|
|
253
|
-
"type-empty": [2
|
|
248
|
+
"body-leading-blank": [1, "always"],
|
|
249
|
+
"body-max-length": [2, "always", 600],
|
|
250
|
+
"footer-leading-blank": [1, "always"],
|
|
251
|
+
"footer-max-line-length": [2, "always", 150],
|
|
252
|
+
"header-max-length": [2, "always", 150],
|
|
253
|
+
"header-trim": [2, "always"],
|
|
254
|
+
"subject-case": [2, "always", ["sentence-case"]],
|
|
255
|
+
"subject-empty": [2, "never"],
|
|
256
|
+
"subject-full-stop": [2, "never", "."],
|
|
257
|
+
"subject-max-length": [2, "always", 150],
|
|
258
|
+
"subject-min-length": [2, "always", 3],
|
|
259
|
+
"type-case": [2, "always", "kebab-case"],
|
|
260
|
+
"type-empty": [2, "never"],
|
|
254
261
|
"type-enum": [
|
|
255
|
-
2
|
|
262
|
+
2,
|
|
256
263
|
"always",
|
|
257
264
|
Object.keys(COMMIT_TYPES)
|
|
258
265
|
],
|
|
259
|
-
"type-max-length": [2
|
|
260
|
-
"type-min-length": [2
|
|
261
|
-
"scope-case": 0
|
|
262
|
-
"scope-empty": 0
|
|
266
|
+
"type-max-length": [2, "always", 20],
|
|
267
|
+
"type-min-length": [2, "always", 3],
|
|
268
|
+
"scope-case": 0,
|
|
269
|
+
"scope-empty": 0
|
|
270
|
+
/* Disabled */
|
|
263
271
|
};
|
|
264
272
|
var DEFAULT_MONOREPO_COMMIT_RULES = {
|
|
265
|
-
"body-leading-blank": [1
|
|
266
|
-
"body-max-length": [2
|
|
267
|
-
"footer-leading-blank": [1
|
|
268
|
-
"footer-max-line-length": [2
|
|
269
|
-
"header-max-length": [2
|
|
270
|
-
"header-trim": [2
|
|
271
|
-
"subject-case": [2
|
|
272
|
-
"subject-empty": [2
|
|
273
|
-
"subject-full-stop": [2
|
|
274
|
-
"subject-max-length": [2
|
|
275
|
-
"subject-min-length": [2
|
|
276
|
-
"type-case": [2
|
|
277
|
-
"type-empty": [2
|
|
273
|
+
"body-leading-blank": [1, "always"],
|
|
274
|
+
"body-max-length": [2, "always", 600],
|
|
275
|
+
"footer-leading-blank": [1, "always"],
|
|
276
|
+
"footer-max-line-length": [2, "always", 150],
|
|
277
|
+
"header-max-length": [2, "always", 150],
|
|
278
|
+
"header-trim": [2, "always"],
|
|
279
|
+
"subject-case": [2, "always", ["sentence-case"]],
|
|
280
|
+
"subject-empty": [2, "never"],
|
|
281
|
+
"subject-full-stop": [2, "never", "."],
|
|
282
|
+
"subject-max-length": [2, "always", 150],
|
|
283
|
+
"subject-min-length": [2, "always", 3],
|
|
284
|
+
"type-case": [2, "always", "kebab-case"],
|
|
285
|
+
"type-empty": [2, "never"],
|
|
278
286
|
"type-enum": [
|
|
279
|
-
2
|
|
287
|
+
2,
|
|
280
288
|
"always",
|
|
281
289
|
Object.keys(COMMIT_TYPES)
|
|
282
290
|
],
|
|
283
|
-
"type-max-length": [2
|
|
284
|
-
"type-min-length": [2
|
|
285
|
-
"scope-case": [2
|
|
286
|
-
"scope-empty": [2
|
|
291
|
+
"type-max-length": [2, "always", 20],
|
|
292
|
+
"type-min-length": [2, "always", 3],
|
|
293
|
+
"scope-case": [2, "always", ["kebab-case"]],
|
|
294
|
+
"scope-empty": [2, "never"]
|
|
287
295
|
};
|
|
288
296
|
|
|
289
|
-
// ../git-tools/
|
|
297
|
+
// ../git-tools/dist/chunk-LSRFGWF5.js
|
|
290
298
|
var DEFAULT_CONVENTIONAL_COMMITS_CONFIG = {
|
|
291
299
|
questions: DEFAULT_MONOREPO_COMMIT_QUESTIONS,
|
|
292
300
|
types: COMMIT_TYPES
|
|
@@ -358,8 +366,8 @@ Valid values are: ${_versionlegacy.validReleaseVersionPrefixes.map((s) => `"${s}
|
|
|
358
366
|
options.currentVersionResolver ??= "git-tag";
|
|
359
367
|
const projects = options.projects;
|
|
360
368
|
const createResolvePackageRoot = (customPackageRoot) => (projectNode) => {
|
|
361
|
-
if (_optionalChain([projectNode, 'optionalAccess',
|
|
362
|
-
return _nullishCoalesce(_optionalChain([config, 'optionalAccess',
|
|
369
|
+
if (_optionalChain([projectNode, 'optionalAccess', _2 => _2.data, 'optionalAccess', _3 => _3.root]) === _optionalChain([config, 'optionalAccess', _4 => _4.workspaceRoot]) || _optionalChain([projectNode, 'optionalAccess', _5 => _5.data, 'optionalAccess', _6 => _6.root]) === ".") {
|
|
370
|
+
return _nullishCoalesce(_optionalChain([config, 'optionalAccess', _7 => _7.workspaceRoot]), () => ( _chunkHNFKVXBVjs.findWorkspaceRoot.call(void 0, )));
|
|
363
371
|
}
|
|
364
372
|
if (!customPackageRoot) {
|
|
365
373
|
return projectNode.data.root;
|
|
@@ -401,7 +409,7 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
|
|
|
401
409
|
);
|
|
402
410
|
}
|
|
403
411
|
const workspaceRelativePackagePath = _path.relative.call(void 0,
|
|
404
|
-
_nullishCoalesce(_optionalChain([config, 'optionalAccess',
|
|
412
|
+
_nullishCoalesce(_optionalChain([config, 'optionalAccess', _8 => _8.workspaceRoot]), () => ( _chunkHNFKVXBVjs.findWorkspaceRoot.call(void 0, ))),
|
|
405
413
|
tree.exists(packageJsonPath) ? packageJsonPath : cargoTomlPath
|
|
406
414
|
);
|
|
407
415
|
const log = (msg) => {
|
|
@@ -419,7 +427,7 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
|
|
|
419
427
|
currentVersionFromDisk = projectPackageJson.version;
|
|
420
428
|
} else if (tree.exists(cargoTomlPath)) {
|
|
421
429
|
const cargoToml = _chunk452FQZ3Bjs.parseCargoToml.call(void 0,
|
|
422
|
-
_optionalChain([tree, 'access',
|
|
430
|
+
_optionalChain([tree, 'access', _9 => _9.read, 'call', _10 => _10(cargoTomlPath), 'optionalAccess', _11 => _11.toString, 'call', _12 => _12("utf-8")])
|
|
423
431
|
);
|
|
424
432
|
log(
|
|
425
433
|
`\u{1F50D} Reading data for package "${cargoToml.package.name}" from ${workspaceRelativePackagePath}`
|
|
@@ -438,51 +446,36 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
|
|
|
438
446
|
}
|
|
439
447
|
switch (options.currentVersionResolver) {
|
|
440
448
|
case "registry": {
|
|
441
|
-
const metadata = options.currentVersionResolverMetadata;
|
|
442
|
-
const
|
|
443
|
-
const
|
|
444
|
-
const
|
|
449
|
+
const metadata = _nullishCoalesce(options.currentVersionResolverMetadata, () => ( {}));
|
|
450
|
+
const tag = _nullishCoalesce(metadata.tag, () => ( _chunkDA53ZKBYjs.DEFAULT_NPM_TAG));
|
|
451
|
+
const registry = await _asyncNullishCoalesce(metadata.registry, async () => ( await _chunkDA53ZKBYjs.getRegistry.call(void 0, )));
|
|
452
|
+
const npmRegistry = await _chunkDA53ZKBYjs.getNpmRegistry.call(void 0, );
|
|
453
|
+
const githubRegistry = await _chunkDA53ZKBYjs.getGitHubRegistry.call(void 0, );
|
|
445
454
|
if (options.releaseGroup.projectsRelationship === "independent") {
|
|
446
455
|
try {
|
|
447
|
-
currentVersion = await
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
}
|
|
459
|
-
);
|
|
460
|
-
});
|
|
456
|
+
currentVersion = await _chunkDA53ZKBYjs.getVersion.call(void 0, packageName, tag, { registry });
|
|
457
|
+
if (!currentVersion) {
|
|
458
|
+
currentVersion = await _chunkDA53ZKBYjs.getVersion.call(void 0, packageName, tag, {
|
|
459
|
+
registry: npmRegistry
|
|
460
|
+
});
|
|
461
|
+
if (!currentVersion) {
|
|
462
|
+
currentVersion = await _chunkDA53ZKBYjs.getVersion.call(void 0, packageName, tag, {
|
|
463
|
+
registry: githubRegistry
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
}
|
|
461
467
|
log(
|
|
462
|
-
`\u{1F4C4} Resolved the current version as ${currentVersion} for tag "${tag}" from registry ${
|
|
468
|
+
`\u{1F4C4} Resolved the current version as ${currentVersion} for tag "${tag}" from registry ${registry}`
|
|
463
469
|
);
|
|
464
|
-
} catch (
|
|
470
|
+
} catch (e) {
|
|
465
471
|
try {
|
|
466
|
-
currentVersion = await
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
`npm view ${packageName} version --registry=${githubRegistry} --tag=${tag}`,
|
|
470
|
-
(error, stdout, stderr) => {
|
|
471
|
-
if (error) {
|
|
472
|
-
return reject(error);
|
|
473
|
-
}
|
|
474
|
-
if (stderr) {
|
|
475
|
-
return reject(stderr);
|
|
476
|
-
}
|
|
477
|
-
return resolve(stdout.trim());
|
|
478
|
-
}
|
|
479
|
-
);
|
|
480
|
-
}
|
|
481
|
-
);
|
|
472
|
+
currentVersion = await _chunkDA53ZKBYjs.getVersion.call(void 0, packageName, tag, {
|
|
473
|
+
registry: githubRegistry
|
|
474
|
+
});
|
|
482
475
|
log(
|
|
483
476
|
`\u{1F4C4} Resolved the current version as ${currentVersion} for tag "${tag}" from registry ${githubRegistry}`
|
|
484
477
|
);
|
|
485
|
-
} catch (
|
|
478
|
+
} catch (e2) {
|
|
486
479
|
if (options.fallbackCurrentVersionResolver === "disk") {
|
|
487
480
|
log(
|
|
488
481
|
`\u{1F4C4} Unable to resolve the current version from the registry ${npmRegistry}${githubRegistry ? ` or ${githubRegistry}` : ""}. Falling back to the version on disk of ${currentVersionFromDisk}`
|
|
@@ -581,7 +574,7 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
|
|
|
581
574
|
);
|
|
582
575
|
}
|
|
583
576
|
const affectedProjects = options.releaseGroup.projectsRelationship === "independent" ? [projectName] : projects.map((p) => p.name);
|
|
584
|
-
let previousVersionRef = _optionalChain([latestMatchingGitTag, 'optionalAccess',
|
|
577
|
+
let previousVersionRef = _optionalChain([latestMatchingGitTag, 'optionalAccess', _13 => _13.tag]) ? latestMatchingGitTag.tag : await _git.getFirstGitCommit.call(void 0, );
|
|
585
578
|
if (!previousVersionRef) {
|
|
586
579
|
log(
|
|
587
580
|
`Unable to determine previous version ref for the projects ${affectedProjects.join(
|
|
@@ -650,7 +643,7 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
|
|
|
650
643
|
tree,
|
|
651
644
|
options.projectGraph,
|
|
652
645
|
projects.filter(
|
|
653
|
-
(project2) => _optionalChain([project2, 'optionalAccess',
|
|
646
|
+
(project2) => _optionalChain([project2, 'optionalAccess', _14 => _14.data, 'optionalAccess', _15 => _15.root]) && _optionalChain([project2, 'optionalAccess', _16 => _16.data, 'optionalAccess', _17 => _17.root]) !== _optionalChain([config, 'optionalAccess', _18 => _18.workspaceRoot])
|
|
654
647
|
),
|
|
655
648
|
projectNameToPackageRootMap,
|
|
656
649
|
resolvePackageRoot,
|
|
@@ -694,7 +687,7 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
|
|
|
694
687
|
});
|
|
695
688
|
} else if (tree.exists(cargoTomlPath)) {
|
|
696
689
|
const cargoToml = _chunk452FQZ3Bjs.parseCargoToml.call(void 0,
|
|
697
|
-
_optionalChain([tree, 'access',
|
|
690
|
+
_optionalChain([tree, 'access', _19 => _19.read, 'call', _20 => _20(cargoTomlPath), 'optionalAccess', _21 => _21.toString, 'call', _22 => _22("utf-8")])
|
|
698
691
|
);
|
|
699
692
|
cargoToml.package ??= {};
|
|
700
693
|
cargoToml.package.version = newVersion;
|
|
@@ -764,14 +757,14 @@ Projects with packageRoot configured: ${Array.from(projectNameToPackageRootMap.k
|
|
|
764
757
|
versionPrefix = "";
|
|
765
758
|
if (currentVersion) {
|
|
766
759
|
const dependencyVersion = typeof dependencyData === "string" ? dependencyData : dependencyData.version;
|
|
767
|
-
const prefixMatch = _optionalChain([dependencyVersion, 'optionalAccess',
|
|
760
|
+
const prefixMatch = _optionalChain([dependencyVersion, 'optionalAccess', _23 => _23.match, 'call', _24 => _24(/^[~^=]/)]);
|
|
768
761
|
if (prefixMatch) {
|
|
769
762
|
versionPrefix = prefixMatch[0];
|
|
770
763
|
} else {
|
|
771
764
|
versionPrefix = "";
|
|
772
765
|
}
|
|
773
766
|
if (versionPrefix === "^") {
|
|
774
|
-
if (typeof dependencyData !== "string" && !_optionalChain([dependencyData, 'access',
|
|
767
|
+
if (typeof dependencyData !== "string" && !_optionalChain([dependencyData, 'access', _25 => _25.version, 'optionalAccess', _26 => _26.startsWith, 'call', _27 => _27("^")])) {
|
|
775
768
|
versionPrefix = "";
|
|
776
769
|
}
|
|
777
770
|
}
|
|
@@ -815,7 +808,7 @@ Projects with packageRoot configured: ${Array.from(projectNameToPackageRootMap.k
|
|
|
815
808
|
versionData
|
|
816
809
|
)) {
|
|
817
810
|
const project = projects.find((proj) => proj.name === projectName);
|
|
818
|
-
if (projectVersionData.newVersion && _optionalChain([project, 'optionalAccess',
|
|
811
|
+
if (projectVersionData.newVersion && _optionalChain([project, 'optionalAccess', _28 => _28.name]) && projectNameToPackageRootMap.get(project.name)) {
|
|
819
812
|
const projectRoot = projectNameToPackageRootMap.get(project.name);
|
|
820
813
|
if (projectRoot && tree2.exists(_devkit.joinPathFragments.call(void 0, projectRoot, "Cargo.toml"))) {
|
|
821
814
|
updatedCargoPackages.push(projectName);
|
|
@@ -858,29 +851,6 @@ Projects with packageRoot configured: ${Array.from(projectNameToPackageRootMap.k
|
|
|
858
851
|
}
|
|
859
852
|
}
|
|
860
853
|
var generator_default = releaseVersionGeneratorFn;
|
|
861
|
-
async function getNpmRegistry() {
|
|
862
|
-
if (process.env.STORM_REGISTRY_NPM) {
|
|
863
|
-
return process.env.STORM_REGISTRY_NPM;
|
|
864
|
-
}
|
|
865
|
-
const registry = await new Promise((resolve, reject) => {
|
|
866
|
-
_child_process.exec.call(void 0, "npm config get registry", (error, stdout, stderr) => {
|
|
867
|
-
if (error) {
|
|
868
|
-
return reject(error);
|
|
869
|
-
}
|
|
870
|
-
if (stderr) {
|
|
871
|
-
return reject(stderr);
|
|
872
|
-
}
|
|
873
|
-
return resolve(stdout.trim());
|
|
874
|
-
});
|
|
875
|
-
});
|
|
876
|
-
return registry ? registry : "https://registry.npmjs.org";
|
|
877
|
-
}
|
|
878
|
-
function getGitHubRegistry() {
|
|
879
|
-
if (process.env.STORM_REGISTRY_GITHUB) {
|
|
880
|
-
return process.env.STORM_REGISTRY_GITHUB;
|
|
881
|
-
}
|
|
882
|
-
return "https://npm.pkg.github.com";
|
|
883
|
-
}
|
|
884
854
|
function hasGitDiff(filePath) {
|
|
885
855
|
try {
|
|
886
856
|
const result = _child_process.execSync.call(void 0, `git diff --name-only "${filePath}"`).toString();
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_NPM_TAG,
|
|
3
|
+
getGitHubRegistry,
|
|
4
|
+
getNpmRegistry,
|
|
5
|
+
getRegistry,
|
|
6
|
+
getVersion
|
|
7
|
+
} from "./chunk-M7ZPKNJT.mjs";
|
|
1
8
|
import {
|
|
2
9
|
modifyCargoTable,
|
|
3
10
|
parseCargoToml,
|
|
@@ -32,7 +39,7 @@ import {
|
|
|
32
39
|
import { resolveLocalPackageDependencies as resolveLocalPackageJsonDependencies } from "@nx/js/src/generators/release-version/utils/resolve-local-package-dependencies";
|
|
33
40
|
import { updateLockFile } from "@nx/js/src/release/utils/update-lock-file";
|
|
34
41
|
|
|
35
|
-
// ../git-tools/
|
|
42
|
+
// ../git-tools/dist/chunk-5XXXTVPU.js
|
|
36
43
|
var COMMIT_TYPES = {
|
|
37
44
|
/* --- Bumps version when selected --- */
|
|
38
45
|
"chore": {
|
|
@@ -238,62 +245,63 @@ var DEFAULT_MONOREPO_COMMIT_QUESTIONS = {
|
|
|
238
245
|
issuesBody: DEFAULT_MINIMAL_COMMIT_QUESTIONS.issuesBody
|
|
239
246
|
};
|
|
240
247
|
var DEFAULT_MINIMAL_COMMIT_RULES = {
|
|
241
|
-
"body-leading-blank": [1
|
|
242
|
-
"body-max-length": [2
|
|
243
|
-
"footer-leading-blank": [1
|
|
244
|
-
"footer-max-line-length": [2
|
|
245
|
-
"header-max-length": [2
|
|
246
|
-
"header-trim": [2
|
|
247
|
-
"subject-case": [2
|
|
248
|
-
"subject-empty": [2
|
|
249
|
-
"subject-full-stop": [2
|
|
250
|
-
"subject-max-length": [2
|
|
251
|
-
"subject-min-length": [2
|
|
252
|
-
"type-case": [2
|
|
253
|
-
"type-empty": [2
|
|
248
|
+
"body-leading-blank": [1, "always"],
|
|
249
|
+
"body-max-length": [2, "always", 600],
|
|
250
|
+
"footer-leading-blank": [1, "always"],
|
|
251
|
+
"footer-max-line-length": [2, "always", 150],
|
|
252
|
+
"header-max-length": [2, "always", 150],
|
|
253
|
+
"header-trim": [2, "always"],
|
|
254
|
+
"subject-case": [2, "always", ["sentence-case"]],
|
|
255
|
+
"subject-empty": [2, "never"],
|
|
256
|
+
"subject-full-stop": [2, "never", "."],
|
|
257
|
+
"subject-max-length": [2, "always", 150],
|
|
258
|
+
"subject-min-length": [2, "always", 3],
|
|
259
|
+
"type-case": [2, "always", "kebab-case"],
|
|
260
|
+
"type-empty": [2, "never"],
|
|
254
261
|
"type-enum": [
|
|
255
|
-
2
|
|
262
|
+
2,
|
|
256
263
|
"always",
|
|
257
264
|
Object.keys(COMMIT_TYPES)
|
|
258
265
|
],
|
|
259
|
-
"type-max-length": [2
|
|
260
|
-
"type-min-length": [2
|
|
261
|
-
"scope-case": 0
|
|
262
|
-
"scope-empty": 0
|
|
266
|
+
"type-max-length": [2, "always", 20],
|
|
267
|
+
"type-min-length": [2, "always", 3],
|
|
268
|
+
"scope-case": 0,
|
|
269
|
+
"scope-empty": 0
|
|
270
|
+
/* Disabled */
|
|
263
271
|
};
|
|
264
272
|
var DEFAULT_MONOREPO_COMMIT_RULES = {
|
|
265
|
-
"body-leading-blank": [1
|
|
266
|
-
"body-max-length": [2
|
|
267
|
-
"footer-leading-blank": [1
|
|
268
|
-
"footer-max-line-length": [2
|
|
269
|
-
"header-max-length": [2
|
|
270
|
-
"header-trim": [2
|
|
271
|
-
"subject-case": [2
|
|
272
|
-
"subject-empty": [2
|
|
273
|
-
"subject-full-stop": [2
|
|
274
|
-
"subject-max-length": [2
|
|
275
|
-
"subject-min-length": [2
|
|
276
|
-
"type-case": [2
|
|
277
|
-
"type-empty": [2
|
|
273
|
+
"body-leading-blank": [1, "always"],
|
|
274
|
+
"body-max-length": [2, "always", 600],
|
|
275
|
+
"footer-leading-blank": [1, "always"],
|
|
276
|
+
"footer-max-line-length": [2, "always", 150],
|
|
277
|
+
"header-max-length": [2, "always", 150],
|
|
278
|
+
"header-trim": [2, "always"],
|
|
279
|
+
"subject-case": [2, "always", ["sentence-case"]],
|
|
280
|
+
"subject-empty": [2, "never"],
|
|
281
|
+
"subject-full-stop": [2, "never", "."],
|
|
282
|
+
"subject-max-length": [2, "always", 150],
|
|
283
|
+
"subject-min-length": [2, "always", 3],
|
|
284
|
+
"type-case": [2, "always", "kebab-case"],
|
|
285
|
+
"type-empty": [2, "never"],
|
|
278
286
|
"type-enum": [
|
|
279
|
-
2
|
|
287
|
+
2,
|
|
280
288
|
"always",
|
|
281
289
|
Object.keys(COMMIT_TYPES)
|
|
282
290
|
],
|
|
283
|
-
"type-max-length": [2
|
|
284
|
-
"type-min-length": [2
|
|
285
|
-
"scope-case": [2
|
|
286
|
-
"scope-empty": [2
|
|
291
|
+
"type-max-length": [2, "always", 20],
|
|
292
|
+
"type-min-length": [2, "always", 3],
|
|
293
|
+
"scope-case": [2, "always", ["kebab-case"]],
|
|
294
|
+
"scope-empty": [2, "never"]
|
|
287
295
|
};
|
|
288
296
|
|
|
289
|
-
// ../git-tools/
|
|
297
|
+
// ../git-tools/dist/chunk-LSRFGWF5.js
|
|
290
298
|
var DEFAULT_CONVENTIONAL_COMMITS_CONFIG = {
|
|
291
299
|
questions: DEFAULT_MONOREPO_COMMIT_QUESTIONS,
|
|
292
300
|
types: COMMIT_TYPES
|
|
293
301
|
};
|
|
294
302
|
|
|
295
303
|
// src/generators/release-version/generator.ts
|
|
296
|
-
import {
|
|
304
|
+
import { execSync } from "node:child_process";
|
|
297
305
|
import { relative } from "node:path";
|
|
298
306
|
import { IMPLICIT_DEFAULT_RELEASE_GROUP } from "nx/src/command-line/release/config/config";
|
|
299
307
|
import {
|
|
@@ -438,51 +446,36 @@ To fix this you will either need to add a package.json or Cargo.toml file at tha
|
|
|
438
446
|
}
|
|
439
447
|
switch (options.currentVersionResolver) {
|
|
440
448
|
case "registry": {
|
|
441
|
-
const metadata = options.currentVersionResolverMetadata;
|
|
442
|
-
const
|
|
443
|
-
const
|
|
444
|
-
const
|
|
449
|
+
const metadata = options.currentVersionResolverMetadata ?? {};
|
|
450
|
+
const tag = metadata.tag ?? DEFAULT_NPM_TAG;
|
|
451
|
+
const registry = metadata.registry ?? await getRegistry();
|
|
452
|
+
const npmRegistry = await getNpmRegistry();
|
|
453
|
+
const githubRegistry = await getGitHubRegistry();
|
|
445
454
|
if (options.releaseGroup.projectsRelationship === "independent") {
|
|
446
455
|
try {
|
|
447
|
-
currentVersion = await
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
}
|
|
459
|
-
);
|
|
460
|
-
});
|
|
456
|
+
currentVersion = await getVersion(packageName, tag, { registry });
|
|
457
|
+
if (!currentVersion) {
|
|
458
|
+
currentVersion = await getVersion(packageName, tag, {
|
|
459
|
+
registry: npmRegistry
|
|
460
|
+
});
|
|
461
|
+
if (!currentVersion) {
|
|
462
|
+
currentVersion = await getVersion(packageName, tag, {
|
|
463
|
+
registry: githubRegistry
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
}
|
|
461
467
|
log(
|
|
462
|
-
`\u{1F4C4} Resolved the current version as ${currentVersion} for tag "${tag}" from registry ${
|
|
468
|
+
`\u{1F4C4} Resolved the current version as ${currentVersion} for tag "${tag}" from registry ${registry}`
|
|
463
469
|
);
|
|
464
|
-
} catch
|
|
470
|
+
} catch {
|
|
465
471
|
try {
|
|
466
|
-
currentVersion = await
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
`npm view ${packageName} version --registry=${githubRegistry} --tag=${tag}`,
|
|
470
|
-
(error, stdout, stderr) => {
|
|
471
|
-
if (error) {
|
|
472
|
-
return reject(error);
|
|
473
|
-
}
|
|
474
|
-
if (stderr) {
|
|
475
|
-
return reject(stderr);
|
|
476
|
-
}
|
|
477
|
-
return resolve(stdout.trim());
|
|
478
|
-
}
|
|
479
|
-
);
|
|
480
|
-
}
|
|
481
|
-
);
|
|
472
|
+
currentVersion = await getVersion(packageName, tag, {
|
|
473
|
+
registry: githubRegistry
|
|
474
|
+
});
|
|
482
475
|
log(
|
|
483
476
|
`\u{1F4C4} Resolved the current version as ${currentVersion} for tag "${tag}" from registry ${githubRegistry}`
|
|
484
477
|
);
|
|
485
|
-
} catch
|
|
478
|
+
} catch {
|
|
486
479
|
if (options.fallbackCurrentVersionResolver === "disk") {
|
|
487
480
|
log(
|
|
488
481
|
`\u{1F4C4} Unable to resolve the current version from the registry ${npmRegistry}${githubRegistry ? ` or ${githubRegistry}` : ""}. Falling back to the version on disk of ${currentVersionFromDisk}`
|
|
@@ -858,29 +851,6 @@ Projects with packageRoot configured: ${Array.from(projectNameToPackageRootMap.k
|
|
|
858
851
|
}
|
|
859
852
|
}
|
|
860
853
|
var generator_default = releaseVersionGeneratorFn;
|
|
861
|
-
async function getNpmRegistry() {
|
|
862
|
-
if (process.env.STORM_REGISTRY_NPM) {
|
|
863
|
-
return process.env.STORM_REGISTRY_NPM;
|
|
864
|
-
}
|
|
865
|
-
const registry = await new Promise((resolve, reject) => {
|
|
866
|
-
exec("npm config get registry", (error, stdout, stderr) => {
|
|
867
|
-
if (error) {
|
|
868
|
-
return reject(error);
|
|
869
|
-
}
|
|
870
|
-
if (stderr) {
|
|
871
|
-
return reject(stderr);
|
|
872
|
-
}
|
|
873
|
-
return resolve(stdout.trim());
|
|
874
|
-
});
|
|
875
|
-
});
|
|
876
|
-
return registry ? registry : "https://registry.npmjs.org";
|
|
877
|
-
}
|
|
878
|
-
function getGitHubRegistry() {
|
|
879
|
-
if (process.env.STORM_REGISTRY_GITHUB) {
|
|
880
|
-
return process.env.STORM_REGISTRY_GITHUB;
|
|
881
|
-
}
|
|
882
|
-
return "https://npm.pkg.github.com";
|
|
883
|
-
}
|
|
884
854
|
function hasGitDiff(filePath) {
|
|
885
855
|
try {
|
|
886
856
|
const result = execSync(`git diff --name-only "${filePath}"`).toString();
|
package/dist/executors.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-7VDOGZYO.js');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk5X2P7IL3js = require('./chunk-5X2P7IL3.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkPNWYSTCQjs = require('./chunk-PNWYSTCQ.js');
|
|
@@ -33,8 +33,8 @@ var _chunkDY4PYCP6js = require('./chunk-DY4PYCP6.js');
|
|
|
33
33
|
|
|
34
34
|
var _chunkEIZKPKJHjs = require('./chunk-EIZKPKJH.js');
|
|
35
35
|
require('./chunk-73IC2JQV.js');
|
|
36
|
-
require('./chunk-F6X43VUX.js');
|
|
37
36
|
require('./chunk-LJDV7HFT.js');
|
|
37
|
+
require('./chunk-DA53ZKBY.js');
|
|
38
38
|
require('./chunk-452FQZ3B.js');
|
|
39
39
|
require('./chunk-AX3RSZT7.js');
|
|
40
40
|
require('./chunk-PQGJJ2VC.js');
|
|
@@ -55,4 +55,4 @@ require('./chunk-53DNHF7B.js');
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
exports.LARGE_BUFFER =
|
|
58
|
+
exports.LARGE_BUFFER = _chunk5X2P7IL3js.LARGE_BUFFER; exports.cargoBuildExecutor = _chunk2JYSOWHXjs.cargoBuildExecutor; exports.cargoCheckExecutor = _chunkUH5PNSPJjs.cargoCheckExecutor; exports.cargoClippyExecutor = _chunkDY4PYCP6js.cargoClippyExecutor; exports.cargoDocExecutor = _chunkEIZKPKJHjs.cargoDocExecutor; exports.cargoFormatExecutor = _chunkS5DC4QM3js.cargoFormatExecutor; exports.esbuildExecutorFn = _chunk7Y353S7Djs.esbuildExecutorFn; exports.getRegistryVersion = _chunkWRXLSZ6Ijs.getRegistryVersion; exports.sizeLimitExecutorFn = _chunkPNWYSTCQjs.sizeLimitExecutorFn; exports.typiaExecutorFn = _chunkG2ZFORXGjs.typiaExecutorFn; exports.unbuildExecutorFn = _chunk7IF3RQD4js.unbuildExecutorFn;
|