refactor: hard-fork GSD -> MSD (Make Software Done)
Mechanical rename produced by scripts/msd-rename.cjs: gsd/Gsd/GSD -> msd/Msd/MSD across contents and paths, upstream package/repo coordinates -> @golem15/msd-core and golem15com/msd-core. Deep links into upstream history, sibling upstream packages, the GSD-2 import feature, CHANGELOG.md and .changeset/ are kept as-is. Hand edits on top: MSD block-letter banner and logos, LICENSE copyright line, package/plugin identity, regenerated lockfile, install-tree fixtures, derived registries and benchmark baseline; migration checksum baseline re-locked (MSD keeps its own install state, so no install had applied the old sums); sort-order and regex-escaped expectations in tests adjusted.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Tests for src/phase-id.cts (compiled to gsd-core/bin/lib/phase-id.cjs).
|
||||
* Tests for src/phase-id.cts (compiled to msd-core/bin/lib/phase-id.cjs).
|
||||
*
|
||||
* Verifies behavioural contracts of the extracted pure phase-id helpers:
|
||||
* - normalizePhaseName
|
||||
@@ -20,8 +20,8 @@
|
||||
const { test, describe } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
|
||||
const phaseId = require('../gsd-core/bin/lib/phase-id.cjs');
|
||||
const { buildPhaseHeadingRegex: headingRegex } = require('../gsd-core/bin/lib/roadmap.cjs');
|
||||
const phaseId = require('../msd-core/bin/lib/phase-id.cjs');
|
||||
const { buildPhaseHeadingRegex: headingRegex } = require('../msd-core/bin/lib/roadmap.cjs');
|
||||
const fc = require('fast-check');
|
||||
|
||||
// escapeRegex moved off phase-id.cjs entirely in #3212 Phase 1 (#3412): it is
|
||||
@@ -37,7 +37,7 @@ const fc = require('fast-check');
|
||||
// TEXT-equivalent (it hex-escapes the first character and all hyphens), so any
|
||||
// test that pinned the literal source text (e.g. `'0*29'`, `'PROJ-42'`) is
|
||||
// brittle to that internal encoding, not to actual behavior. `headingRegex`
|
||||
// (imported above as `buildPhaseHeadingRegex` from gsd-core/bin/lib/roadmap.cjs)
|
||||
// (imported above as `buildPhaseHeadingRegex` from msd-core/bin/lib/roadmap.cjs)
|
||||
// is the SAME production function src/roadmap.cts's searchPhaseInContent uses to
|
||||
// build its heading regex — not a hand-duplicated copy — so tests assert what
|
||||
// matches and what doesn't — the real contract — rather than the escaper's
|
||||
@@ -1514,19 +1514,19 @@ describe('phaseKeyFrom* — one key space for directories and prose', () => {
|
||||
// and cmdInitExecutePhase (src/init.cts), so the two consumers cannot diverge
|
||||
// on how an undeliverable phase_slug degrades.
|
||||
describe('renderPhaseBranchName — shared branch-name template renderer', () => {
|
||||
const DEFAULT_TEMPLATE = 'gsd/phase-{phase}-{slug}';
|
||||
const DEFAULT_TEMPLATE = 'msd/phase-{phase}-{slug}';
|
||||
|
||||
test('a real slug substitutes normally, unchanged from prior behavior', () => {
|
||||
assert.strictEqual(
|
||||
phaseId.renderPhaseBranchName(DEFAULT_TEMPLATE, '8', 'my-feature'),
|
||||
'gsd/phase-08-my-feature',
|
||||
'msd/phase-08-my-feature',
|
||||
);
|
||||
});
|
||||
|
||||
test('an empty slug drops the {slug} token cleanly for the default template', () => {
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName(DEFAULT_TEMPLATE, '8', ''), 'gsd/phase-08');
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName(DEFAULT_TEMPLATE, '8', null), 'gsd/phase-08');
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName(DEFAULT_TEMPLATE, '8', undefined), 'gsd/phase-08');
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName(DEFAULT_TEMPLATE, '8', ''), 'msd/phase-08');
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName(DEFAULT_TEMPLATE, '8', null), 'msd/phase-08');
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName(DEFAULT_TEMPLATE, '8', undefined), 'msd/phase-08');
|
||||
});
|
||||
|
||||
test('the literal word "phase" is never substituted for an undeliverable slug', () => {
|
||||
@@ -1535,11 +1535,11 @@ describe('renderPhaseBranchName — shared branch-name template renderer', () =>
|
||||
});
|
||||
|
||||
test('an empty slug at the START of a template drops the token and its trailing separator', () => {
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName('{slug}-gsd-{phase}', '8', ''), 'gsd-08');
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName('{slug}-msd-{phase}', '8', ''), 'msd-08');
|
||||
});
|
||||
|
||||
test('an empty slug at the END of a template drops the token and its leading separator', () => {
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName('gsd-{phase}-{slug}', '8', ''), 'gsd-08');
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName('msd-{phase}-{slug}', '8', ''), 'msd-08');
|
||||
});
|
||||
|
||||
test('a doubled-separator template does not produce an invalid leading/trailing separator', () => {
|
||||
@@ -1548,14 +1548,14 @@ describe('renderPhaseBranchName — shared branch-name template renderer', () =>
|
||||
});
|
||||
|
||||
test('non-string phaseSlug values (digits, objects) degrade like an empty slug', () => {
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName(DEFAULT_TEMPLATE, '8', 42), 'gsd/phase-08');
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName(DEFAULT_TEMPLATE, '8', {}), 'gsd/phase-08');
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName(DEFAULT_TEMPLATE, '8', []), 'gsd/phase-08');
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName(DEFAULT_TEMPLATE, '8', 42), 'msd/phase-08');
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName(DEFAULT_TEMPLATE, '8', {}), 'msd/phase-08');
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName(DEFAULT_TEMPLATE, '8', []), 'msd/phase-08');
|
||||
});
|
||||
|
||||
test('a template with no {slug} token at all is returned unchanged, just phase-substituted', () => {
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName('gsd/phase-{phase}', '8', ''), 'gsd/phase-08');
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName('gsd/phase-{phase}', '8', 'x'), 'gsd/phase-08');
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName('msd/phase-{phase}', '8', ''), 'msd/phase-08');
|
||||
assert.strictEqual(phaseId.renderPhaseBranchName('msd/phase-{phase}', '8', 'x'), 'msd/phase-08');
|
||||
});
|
||||
|
||||
test('a template that is only {slug} degrades to null rather than an empty branch name', () => {
|
||||
@@ -1569,7 +1569,7 @@ describe('renderPhaseBranchName — shared branch-name template renderer', () =>
|
||||
// invariant), so the slug domain here is exactly the undeliverable one.
|
||||
fc.assert(
|
||||
fc.property(
|
||||
fc.constantFrom('gsd/phase-{phase}-{slug}', '{slug}-gsd-{phase}', 'gsd-{phase}-{slug}', 'feature//{slug}', '{phase}.{slug}'),
|
||||
fc.constantFrom('msd/phase-{phase}-{slug}', '{slug}-msd-{phase}', 'msd-{phase}-{slug}', 'feature//{slug}', '{phase}.{slug}'),
|
||||
fc.integer({ min: 0, max: 999 }),
|
||||
fc.constantFrom('', null, undefined, 0, 42, {}, []),
|
||||
(template, phaseNumber, phaseSlug) => {
|
||||
|
||||
Reference in New Issue
Block a user