@storm-software/git-tools 2.131.6 → 2.131.8
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/README.md +1 -1
- package/bin/git.cjs +144 -71
- package/bin/git.cjs.map +1 -1
- package/bin/git.js +145 -72
- package/bin/git.js.map +1 -1
- package/dist/{chunk-EMMN3RCO.cjs → chunk-VOWQJXPC.cjs} +148 -47
- package/dist/{chunk-R6XSEPQS.js → chunk-ZDXX5TWI.js} +150 -49
- package/dist/index.cjs +25 -21
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/release/config.cjs +25 -21
- package/dist/release/config.d.cts +13 -56
- package/dist/release/config.d.ts +13 -56
- package/dist/release/config.js +1 -1
- package/package.json +6 -5
package/bin/git.js
CHANGED
|
@@ -8,7 +8,7 @@ import { prePushHook } from './chunk-ABI4JM6L.js';
|
|
|
8
8
|
import './chunk-HBLWPOJV.js';
|
|
9
9
|
import { prepareHook } from './chunk-AZGQVIYO.js';
|
|
10
10
|
import { run, runAsync } from './chunk-RPK5AKGK.js';
|
|
11
|
-
import { getConfig, handleProcess, writeSuccess, exitWithSuccess, exitWithError, writeInfo, brandIcon, findWorkspaceRootSafe, writeFatal, getWorkspaceConfig, joinPaths, writeDebug, isVerbose, writeWarning,
|
|
11
|
+
import { defu, getConfig, handleProcess, writeSuccess, exitWithSuccess, exitWithError, writeInfo, brandIcon, findWorkspaceRootSafe, writeFatal, getWorkspaceConfig, joinPaths, writeDebug, isVerbose, writeWarning, writeTrace, __require, STORM_DEFAULT_RELEASE_BANNER } from './chunk-7ES3CGZQ.js';
|
|
12
12
|
import TOML from '@ltd/j-toml';
|
|
13
13
|
import { Command } from 'commander';
|
|
14
14
|
import '@inquirer/checkbox';
|
|
@@ -63,10 +63,10 @@ import { validateResolvedVersionPlansAgainstFilter } from 'nx/src/command-line/r
|
|
|
63
63
|
import { readNxJson } from 'nx/src/config/nx-json';
|
|
64
64
|
import { FsTree } from 'nx/src/generators/tree';
|
|
65
65
|
import { createFileMapUsingProjectGraph } from 'nx/src/project-graph/file-map-utils';
|
|
66
|
-
import { findMatchingProjects } from 'nx/src/utils/find-matching-projects';
|
|
67
66
|
import importsPlugin from 'prettier-plugin-organize-imports';
|
|
68
67
|
import DefaultChangelogRenderer from 'nx/release/changelog-renderer';
|
|
69
68
|
import { DEFAULT_CONVENTIONAL_COMMITS_CONFIG } from 'nx/src/command-line/release/config/conventional-commits';
|
|
69
|
+
import { findMatchingProjects } from 'nx/src/utils/find-matching-projects';
|
|
70
70
|
import { IMPLICIT_DEFAULT_RELEASE_GROUP } from 'nx/src/command-line/release/config/config.js';
|
|
71
71
|
import { deriveSpecifierFromConventionalCommits } from 'nx/src/command-line/release/version/derive-specifier-from-conventional-commits';
|
|
72
72
|
import { deriveSpecifierFromVersionPlan } from 'nx/src/command-line/release/version/deriver-specifier-from-version-plans';
|
|
@@ -3266,16 +3266,44 @@ var StormChangelogRenderer = class extends DefaultChangelogRenderer {
|
|
|
3266
3266
|
}
|
|
3267
3267
|
};
|
|
3268
3268
|
|
|
3269
|
-
// src/
|
|
3269
|
+
// ../package-constants/src/tags.ts
|
|
3270
|
+
var ProjectTagConstants = {
|
|
3271
|
+
Language: {
|
|
3272
|
+
TAG_ID: "language",
|
|
3273
|
+
TYPESCRIPT: "typescript",
|
|
3274
|
+
RUST: "rust"
|
|
3275
|
+
}};
|
|
3276
|
+
var formatProjectTag = (variant, value) => {
|
|
3277
|
+
return `${variant}:${value}`;
|
|
3278
|
+
};
|
|
3279
|
+
var hasProjectTag = (project, variant) => {
|
|
3280
|
+
project.tags = project.tags ?? [];
|
|
3281
|
+
const prefix = formatProjectTag(variant, "");
|
|
3282
|
+
return project.tags.some(
|
|
3283
|
+
(tag) => tag.startsWith(prefix) && tag.length > prefix.length
|
|
3284
|
+
);
|
|
3285
|
+
};
|
|
3286
|
+
var getProjectTag = (project, variant) => {
|
|
3287
|
+
if (!hasProjectTag(project, variant)) {
|
|
3288
|
+
return void 0;
|
|
3289
|
+
}
|
|
3290
|
+
project.tags = project.tags ?? [];
|
|
3291
|
+
const prefix = formatProjectTag(variant, "");
|
|
3292
|
+
const tag = project.tags.find((tag2) => tag2.startsWith(prefix));
|
|
3293
|
+
return tag?.replace(prefix, "");
|
|
3294
|
+
};
|
|
3295
|
+
var isEqualProjectTag = (project, variant, value) => {
|
|
3296
|
+
const tag = getProjectTag(project, variant);
|
|
3297
|
+
return !!(tag && tag?.toUpperCase() === value.toUpperCase());
|
|
3298
|
+
};
|
|
3270
3299
|
var DEFAULT_CONVENTIONAL_COMMITS_CONFIG2 = {
|
|
3271
3300
|
useCommitScope: true,
|
|
3272
3301
|
questions: DEFAULT_MONOREPO_COMMIT_QUESTIONS,
|
|
3273
3302
|
types: DEFAULT_COMMIT_TYPES
|
|
3274
3303
|
};
|
|
3275
|
-
var
|
|
3304
|
+
var DEFAULT_INDEPENDENT_RELEASE_TAG_PATTERN = "{projectName}@{version}";
|
|
3276
3305
|
var DEFAULT_FIXED_RELEASE_TAG_PATTERN = "{releaseGroupName}@{version}";
|
|
3277
3306
|
var DEFAULT_COMMIT_MESSAGE = "release(monorepo): Publish v{version} release updates";
|
|
3278
|
-
var DEFAULT_VERSION_ACTIONS_PATH = "@nx/js/src/release/version-actions";
|
|
3279
3307
|
var DEFAULT_RELEASE_GROUP_GIT_CONFIG = {
|
|
3280
3308
|
commit: false,
|
|
3281
3309
|
commitMessage: DEFAULT_COMMIT_MESSAGE,
|
|
@@ -3291,8 +3319,6 @@ var DEFAULT_VERSION_RELEASE_CONFIG = {
|
|
|
3291
3319
|
fallbackCurrentVersionResolver: "disk",
|
|
3292
3320
|
specifierSource: "conventional-commits",
|
|
3293
3321
|
groupPreVersionCommand: "pnpm build",
|
|
3294
|
-
versionActions: DEFAULT_VERSION_ACTIONS_PATH,
|
|
3295
|
-
versionActionsOptions: {},
|
|
3296
3322
|
preserveLocalDependencyProtocols: true,
|
|
3297
3323
|
preserveMatchingDependencyRanges: true,
|
|
3298
3324
|
logUnchangedProjects: true,
|
|
@@ -3327,24 +3353,25 @@ var DEFAULT_RELEASE_GROUP_CONFIG = {
|
|
|
3327
3353
|
...DEFAULT_VERSION_RELEASE_CONFIG
|
|
3328
3354
|
},
|
|
3329
3355
|
releaseTag: {
|
|
3330
|
-
pattern:
|
|
3356
|
+
pattern: DEFAULT_INDEPENDENT_RELEASE_TAG_PATTERN,
|
|
3331
3357
|
preferDockerVersion: false
|
|
3332
3358
|
},
|
|
3333
3359
|
versionPlans: false
|
|
3334
3360
|
};
|
|
3361
|
+
var DEFAULT_INDEPENDENT_RELEASE_GROUP_CONFIG = {
|
|
3362
|
+
projectsRelationship: "independent",
|
|
3363
|
+
releaseTag: {
|
|
3364
|
+
pattern: DEFAULT_INDEPENDENT_RELEASE_TAG_PATTERN
|
|
3365
|
+
}
|
|
3366
|
+
};
|
|
3335
3367
|
var DEFAULT_FIXED_RELEASE_GROUP_CONFIG = {
|
|
3336
|
-
...DEFAULT_RELEASE_GROUP_CONFIG,
|
|
3337
3368
|
projectsRelationship: "fixed",
|
|
3338
3369
|
releaseTag: {
|
|
3339
|
-
...DEFAULT_RELEASE_GROUP_CONFIG.releaseTag,
|
|
3340
3370
|
pattern: DEFAULT_FIXED_RELEASE_TAG_PATTERN
|
|
3341
3371
|
}
|
|
3342
3372
|
};
|
|
3343
3373
|
var DEFAULT_JS_RELEASE_GROUP_CONFIG = {
|
|
3344
|
-
...DEFAULT_RELEASE_GROUP_CONFIG,
|
|
3345
|
-
projects: ["packages/*"],
|
|
3346
3374
|
version: {
|
|
3347
|
-
...DEFAULT_RELEASE_GROUP_CONFIG.version,
|
|
3348
3375
|
versionActions: "@storm-software/workspace-tools/release/js-version-actions",
|
|
3349
3376
|
versionActionsOptions: {
|
|
3350
3377
|
currentVersionResolver: "git-tag",
|
|
@@ -3360,10 +3387,7 @@ var DEFAULT_JS_RELEASE_GROUP_CONFIG = {
|
|
|
3360
3387
|
}
|
|
3361
3388
|
};
|
|
3362
3389
|
var DEFAULT_RUST_RELEASE_GROUP_CONFIG = {
|
|
3363
|
-
...DEFAULT_RELEASE_GROUP_CONFIG,
|
|
3364
|
-
projects: ["crates/*"],
|
|
3365
3390
|
version: {
|
|
3366
|
-
...DEFAULT_RELEASE_GROUP_CONFIG.version,
|
|
3367
3391
|
versionActions: "@storm-software/workspace-tools/release/rust-version-actions",
|
|
3368
3392
|
versionActionsOptions: {
|
|
3369
3393
|
currentVersionResolver: "git-tag",
|
|
@@ -3375,8 +3399,20 @@ var DEFAULT_RUST_RELEASE_GROUP_CONFIG = {
|
|
|
3375
3399
|
var DEFAULT_RELEASE_CONFIG = {
|
|
3376
3400
|
conventionalCommits: DEFAULT_CONVENTIONAL_COMMITS_CONFIG2,
|
|
3377
3401
|
groups: {
|
|
3378
|
-
packages:
|
|
3379
|
-
|
|
3402
|
+
packages: defu(
|
|
3403
|
+
{
|
|
3404
|
+
projects: ["packages/*"]
|
|
3405
|
+
},
|
|
3406
|
+
DEFAULT_JS_RELEASE_GROUP_CONFIG,
|
|
3407
|
+
DEFAULT_RELEASE_GROUP_CONFIG
|
|
3408
|
+
),
|
|
3409
|
+
crates: defu(
|
|
3410
|
+
{
|
|
3411
|
+
projects: ["crates/*"]
|
|
3412
|
+
},
|
|
3413
|
+
DEFAULT_RUST_RELEASE_GROUP_CONFIG,
|
|
3414
|
+
DEFAULT_RELEASE_GROUP_CONFIG
|
|
3415
|
+
)
|
|
3380
3416
|
},
|
|
3381
3417
|
changelog: {
|
|
3382
3418
|
...DEFAULT_CHANGELOG_RELEASE_CONFIG,
|
|
@@ -3385,40 +3421,101 @@ var DEFAULT_RELEASE_CONFIG = {
|
|
|
3385
3421
|
projectChangelogs: true
|
|
3386
3422
|
},
|
|
3387
3423
|
releaseTag: {
|
|
3388
|
-
pattern:
|
|
3424
|
+
pattern: DEFAULT_INDEPENDENT_RELEASE_TAG_PATTERN,
|
|
3389
3425
|
preferDockerVersion: false
|
|
3390
3426
|
},
|
|
3391
3427
|
version: {
|
|
3392
3428
|
...DEFAULT_VERSION_RELEASE_CONFIG
|
|
3393
3429
|
}
|
|
3394
3430
|
};
|
|
3395
|
-
function
|
|
3431
|
+
function mergeReleaseGroupConfig(config5, defaultConfig, workspaceConfig) {
|
|
3432
|
+
return defu(
|
|
3433
|
+
{
|
|
3434
|
+
...omit(defaultConfig, ["changelog", "version"]),
|
|
3435
|
+
...config5
|
|
3436
|
+
},
|
|
3437
|
+
{
|
|
3438
|
+
version: {
|
|
3439
|
+
...defaultConfig.version
|
|
3440
|
+
}
|
|
3441
|
+
},
|
|
3442
|
+
{
|
|
3443
|
+
changelog: {
|
|
3444
|
+
...typeof defaultConfig.changelog === "object" ? defaultConfig.changelog : {},
|
|
3445
|
+
renderer: StormChangelogRenderer,
|
|
3446
|
+
renderOptions: {
|
|
3447
|
+
...typeof defaultConfig.changelog === "object" && defaultConfig.changelog.renderOptions || {},
|
|
3448
|
+
workspaceConfig
|
|
3449
|
+
}
|
|
3450
|
+
}
|
|
3451
|
+
}
|
|
3452
|
+
);
|
|
3453
|
+
}
|
|
3454
|
+
function getReleaseGroupConfig(projectGraph, releaseConfig, workspaceConfig) {
|
|
3455
|
+
const alreadyMatchedProjects = /* @__PURE__ */ new Set();
|
|
3396
3456
|
return !releaseConfig?.groups || Object.keys(releaseConfig.groups).length === 0 ? {} : Object.fromEntries(
|
|
3397
3457
|
Object.entries(releaseConfig.groups).map(([name, group]) => {
|
|
3398
|
-
const
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
changelog: {
|
|
3413
|
-
...(group.projectsRelationship === "fixed" ? DEFAULT_FIXED_RELEASE_GROUP_CONFIG : DEFAULT_RELEASE_GROUP_CONFIG).changelog,
|
|
3414
|
-
renderer: StormChangelogRenderer,
|
|
3415
|
-
renderOptions: {
|
|
3416
|
-
...(group.projectsRelationship === "fixed" ? DEFAULT_FIXED_RELEASE_GROUP_CONFIG : DEFAULT_RELEASE_GROUP_CONFIG).changelog.renderOptions,
|
|
3417
|
-
workspaceConfig
|
|
3418
|
-
}
|
|
3419
|
-
}
|
|
3458
|
+
const matchingProjects = findMatchingProjects(
|
|
3459
|
+
typeof group.projects === "string" ? [group.projects] : group.projects,
|
|
3460
|
+
projectGraph.nodes
|
|
3461
|
+
);
|
|
3462
|
+
if (!matchingProjects.length) {
|
|
3463
|
+
throw new Error(
|
|
3464
|
+
`Release group "${name}" does not have any matching projects.`
|
|
3465
|
+
);
|
|
3466
|
+
}
|
|
3467
|
+
for (const project of matchingProjects) {
|
|
3468
|
+
if (alreadyMatchedProjects.has(project)) {
|
|
3469
|
+
throw new Error(
|
|
3470
|
+
`Project "${project}" is included in more than one release group. Please ensure that each project is only included in one release group, or remove the "projects" property from the release group configuration to allow it to be included in the same release group as other projects with overlapping globs.`
|
|
3471
|
+
);
|
|
3420
3472
|
}
|
|
3473
|
+
alreadyMatchedProjects.add(project);
|
|
3474
|
+
}
|
|
3475
|
+
let languageDefaultConfig = {};
|
|
3476
|
+
if (matchingProjects.every(
|
|
3477
|
+
(project) => projectGraph.nodes[project]?.data && (projectGraph.nodes[project]?.data.metadata?.js || isEqualProjectTag(
|
|
3478
|
+
projectGraph.nodes[project]?.data,
|
|
3479
|
+
ProjectTagConstants.Language.TAG_ID,
|
|
3480
|
+
ProjectTagConstants.Language.TYPESCRIPT
|
|
3481
|
+
) || projectGraph.nodes[project]?.data.metadata?.root && existsSync$1(
|
|
3482
|
+
joinPaths(
|
|
3483
|
+
projectGraph.nodes[project]?.data.metadata?.root,
|
|
3484
|
+
"package.json"
|
|
3485
|
+
)
|
|
3486
|
+
))
|
|
3487
|
+
)) {
|
|
3488
|
+
languageDefaultConfig = defu(
|
|
3489
|
+
DEFAULT_JS_RELEASE_GROUP_CONFIG,
|
|
3490
|
+
DEFAULT_RELEASE_GROUP_CONFIG
|
|
3491
|
+
);
|
|
3492
|
+
} else if (matchingProjects.every(
|
|
3493
|
+
(project) => projectGraph.nodes[project]?.data && (projectGraph.nodes[project]?.data.metadata?.rust || projectGraph.nodes[project]?.data.metadata?.cargo || isEqualProjectTag(
|
|
3494
|
+
projectGraph.nodes[project]?.data,
|
|
3495
|
+
ProjectTagConstants.Language.TAG_ID,
|
|
3496
|
+
ProjectTagConstants.Language.RUST
|
|
3497
|
+
) || projectGraph.nodes[project]?.data.metadata?.root && existsSync$1(
|
|
3498
|
+
joinPaths(
|
|
3499
|
+
projectGraph.nodes[project]?.data.metadata?.root,
|
|
3500
|
+
"Cargo.toml"
|
|
3501
|
+
)
|
|
3502
|
+
))
|
|
3503
|
+
)) {
|
|
3504
|
+
languageDefaultConfig = defu(
|
|
3505
|
+
DEFAULT_RUST_RELEASE_GROUP_CONFIG,
|
|
3506
|
+
DEFAULT_RELEASE_GROUP_CONFIG
|
|
3507
|
+
);
|
|
3508
|
+
}
|
|
3509
|
+
const config5 = mergeReleaseGroupConfig(
|
|
3510
|
+
group,
|
|
3511
|
+
defu(
|
|
3512
|
+
languageDefaultConfig,
|
|
3513
|
+
group.projectsRelationship === "fixed" ? DEFAULT_FIXED_RELEASE_GROUP_CONFIG : DEFAULT_INDEPENDENT_RELEASE_GROUP_CONFIG,
|
|
3514
|
+
DEFAULT_RELEASE_GROUP_CONFIG
|
|
3515
|
+
),
|
|
3516
|
+
workspaceConfig
|
|
3421
3517
|
);
|
|
3518
|
+
config5.projects = matchingProjects;
|
|
3422
3519
|
if (workspaceConfig?.workspaceRoot) {
|
|
3423
3520
|
if (config5.changelog?.renderer && typeof config5.changelog?.renderer === "string" && config5.changelog?.renderer?.toString().startsWith("./")) {
|
|
3424
3521
|
config5.changelog.renderer = joinPaths(
|
|
@@ -4118,10 +4215,15 @@ var StormReleaseClient = class _StormReleaseClient extends ReleaseClient {
|
|
|
4118
4215
|
}
|
|
4119
4216
|
},
|
|
4120
4217
|
{
|
|
4121
|
-
groups: getReleaseGroupConfig(
|
|
4218
|
+
groups: getReleaseGroupConfig(
|
|
4219
|
+
projectGraph,
|
|
4220
|
+
releaseConfig,
|
|
4221
|
+
workspaceConfig
|
|
4222
|
+
)
|
|
4122
4223
|
},
|
|
4123
4224
|
{
|
|
4124
4225
|
groups: getReleaseGroupConfig(
|
|
4226
|
+
projectGraph,
|
|
4125
4227
|
nxJson.release ?? {},
|
|
4126
4228
|
workspaceConfig
|
|
4127
4229
|
)
|
|
@@ -4147,35 +4249,6 @@ var StormReleaseClient = class _StormReleaseClient extends ReleaseClient {
|
|
|
4147
4249
|
})
|
|
4148
4250
|
);
|
|
4149
4251
|
}
|
|
4150
|
-
const alreadyMatchedProjects = /* @__PURE__ */ new Set();
|
|
4151
|
-
normalizedConfig.groups = Object.fromEntries(
|
|
4152
|
-
Object.entries(normalizedConfig.groups ?? {}).map(([name, group]) => {
|
|
4153
|
-
const matchingProjects = findMatchingProjects(
|
|
4154
|
-
group.projects,
|
|
4155
|
-
projectGraph.nodes
|
|
4156
|
-
);
|
|
4157
|
-
if (!matchingProjects.length) {
|
|
4158
|
-
throw new Error(
|
|
4159
|
-
`Release group "${name}" does not have any matching projects.`
|
|
4160
|
-
);
|
|
4161
|
-
}
|
|
4162
|
-
for (const project of matchingProjects) {
|
|
4163
|
-
if (alreadyMatchedProjects.has(project)) {
|
|
4164
|
-
throw new Error(
|
|
4165
|
-
`Project "${project}" is included in more than one release group. Please ensure that each project is only included in one release group, or remove the "projects" property from the release group configuration to allow it to be included in the same release group as other projects with overlapping globs.`
|
|
4166
|
-
);
|
|
4167
|
-
}
|
|
4168
|
-
alreadyMatchedProjects.add(project);
|
|
4169
|
-
}
|
|
4170
|
-
return [
|
|
4171
|
-
name,
|
|
4172
|
-
{
|
|
4173
|
-
...group,
|
|
4174
|
-
projects: matchingProjects
|
|
4175
|
-
}
|
|
4176
|
-
];
|
|
4177
|
-
})
|
|
4178
|
-
);
|
|
4179
4252
|
return new _StormReleaseClient(
|
|
4180
4253
|
projectGraph,
|
|
4181
4254
|
config5,
|