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,11 +1,11 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* gen-exit-code-registry.cjs — generates FIVE byte-identical/derived
|
||||
* artifacts from the declaration at gsd-core/bin/shared/exit-codes.json:
|
||||
* - gsd-core/bin/lib/exit-code-registry.cjs (tsc-adjacent build tree)
|
||||
* artifacts from the declaration at msd-core/bin/shared/exit-codes.json:
|
||||
* - msd-core/bin/lib/exit-code-registry.cjs (tsc-adjacent build tree)
|
||||
* - scripts/lib/exit-code-registry.cjs (committed, for scripts/
|
||||
* consumers that must work on an unbuilt clone — same reason
|
||||
* scripts/lib/cli-exit.cjs exists alongside gsd-core/bin/lib/cli-exit.cjs;
|
||||
* scripts/lib/cli-exit.cjs exists alongside msd-core/bin/lib/cli-exit.cjs;
|
||||
* see scripts/gen-scripts-cli-exit.cjs).
|
||||
* - hooks/lib/exit-code-registry.js (committed, for hooks/
|
||||
* consumers that must work on a raw, unbuilt clone — same reason as the
|
||||
@@ -18,7 +18,7 @@
|
||||
* against the shape the .cjs artifacts above actually export — generated
|
||||
* from the SAME ENTRY_FIELD_TYPES table serializeRegistry() uses, so the
|
||||
* two can never independently drift).
|
||||
* - gsd-core/bin/shared/exit-codes.sh (POSIX sh, safe under
|
||||
* - msd-core/bin/shared/exit-codes.sh (POSIX sh, safe under
|
||||
* `set -u`: one `export EXIT_<NAME>=<code>` per entry, sourced by the
|
||||
* bash scanners under scripts/ so a shell caller never re-invents a
|
||||
* literal exit-code integer — ADR-3889 Phase 4, #3908).
|
||||
@@ -57,12 +57,12 @@ const fs = require('node:fs');
|
||||
const path = require('node:path');
|
||||
|
||||
const REPO_ROOT = path.resolve(__dirname, '..');
|
||||
const DEFAULT_DECLARATION_PATH = path.join(REPO_ROOT, 'gsd-core', 'bin', 'shared', 'exit-codes.json');
|
||||
const DEFAULT_OUTPUT_PATH = path.join(REPO_ROOT, 'gsd-core', 'bin', 'lib', 'exit-code-registry.cjs');
|
||||
const DEFAULT_DECLARATION_PATH = path.join(REPO_ROOT, 'msd-core', 'bin', 'shared', 'exit-codes.json');
|
||||
const DEFAULT_OUTPUT_PATH = path.join(REPO_ROOT, 'msd-core', 'bin', 'lib', 'exit-code-registry.cjs');
|
||||
const DEFAULT_SCRIPTS_OUTPUT_PATH = path.join(REPO_ROOT, 'scripts', 'lib', 'exit-code-registry.cjs');
|
||||
const DEFAULT_HOOKS_OUTPUT_PATH = path.join(REPO_ROOT, 'hooks', 'lib', 'exit-code-registry.js');
|
||||
const DEFAULT_DTS_OUTPUT_PATH = path.join(REPO_ROOT, 'src', 'exit-code-registry.d.cts');
|
||||
const DEFAULT_SH_OUTPUT_PATH = path.join(REPO_ROOT, 'gsd-core', 'bin', 'shared', 'exit-codes.sh');
|
||||
const DEFAULT_SH_OUTPUT_PATH = path.join(REPO_ROOT, 'msd-core', 'bin', 'shared', 'exit-codes.sh');
|
||||
|
||||
/**
|
||||
* Single source of the entry field list (name -> TS type), in emission order.
|
||||
@@ -103,12 +103,12 @@ const USAGE_MESSAGE = [
|
||||
' (no flag) same as --write',
|
||||
' --write write all five generated registry artifacts',
|
||||
' --check exit 1 if ANY committed artifact is stale',
|
||||
' --declaration override the declaration path (default: gsd-core/bin/shared/exit-codes.json)',
|
||||
' --out override the primary output artifact path (default: gsd-core/bin/lib/exit-code-registry.cjs)',
|
||||
' --declaration override the declaration path (default: msd-core/bin/shared/exit-codes.json)',
|
||||
' --out override the primary output artifact path (default: msd-core/bin/lib/exit-code-registry.cjs)',
|
||||
' --scripts-out override the secondary output artifact path (default: scripts/lib/exit-code-registry.cjs)',
|
||||
' --hooks-out override the hooks output artifact path (default: hooks/lib/exit-code-registry.js)',
|
||||
' --dts-out override the ambient type declaration path (default: src/exit-code-registry.d.cts)',
|
||||
' --sh-out override the shell-sourceable fragment path (default: gsd-core/bin/shared/exit-codes.sh)',
|
||||
' --sh-out override the shell-sourceable fragment path (default: msd-core/bin/shared/exit-codes.sh)',
|
||||
' --json emit ONE JSON report ({ok, reason, context, detail?}) on stdout instead of human-readable prose',
|
||||
].join('\n');
|
||||
|
||||
@@ -378,7 +378,7 @@ function loadDeclaration(declarationPath) {
|
||||
|
||||
/**
|
||||
* Hand-serialize the generated registry module (string concatenation, like
|
||||
* gsd-core/bin/lib/capability-registry.cjs — no build step, no template
|
||||
* msd-core/bin/lib/capability-registry.cjs — no build step, no template
|
||||
* engine, so the emitted bytes are exactly what `--check` re-derives).
|
||||
*/
|
||||
function serializeRegistry(entries, declarationPath) {
|
||||
@@ -389,7 +389,7 @@ function serializeRegistry(entries, declarationPath) {
|
||||
'// GENERATED FILE — DO NOT EDIT BY HAND.',
|
||||
`// Source of truth: ${relDeclaration}. Regenerate with:`,
|
||||
'// node scripts/gen-exit-code-registry.cjs --write',
|
||||
'// This exact content is emitted to THREE locations — gsd-core/bin/lib/exit-code-registry.cjs,',
|
||||
'// This exact content is emitted to THREE locations — msd-core/bin/lib/exit-code-registry.cjs,',
|
||||
'// scripts/lib/exit-code-registry.cjs, and hooks/lib/exit-code-registry.js (the latter two',
|
||||
'// committed so scripts/ and hooks/ consumers work on an unbuilt clone) — all byte-compared by',
|
||||
'// `npm run lint:generated-sync` (#3905 ADR-3889 Phase 1; #3906 Phase 2 added the second copy;',
|
||||
@@ -480,7 +480,7 @@ function serializeDts(declarationPath) {
|
||||
'//',
|
||||
'// Ambient type declaration for exit-code-registry.cjs — a GENERATED,',
|
||||
'// committed artifact with no `.cts` source of its own (it is hand-serialized',
|
||||
'// from gsd-core/bin/shared/exit-codes.json by scripts/gen-exit-code-registry.cjs,',
|
||||
'// from msd-core/bin/shared/exit-codes.json by scripts/gen-exit-code-registry.cjs,',
|
||||
'// ADR-3889 §2, #3905/#3906), so tsc has nothing to compile for it. This file',
|
||||
"// exists purely so `src/cli-exit.cts`'s `require('./exit-code-registry.cjs')`",
|
||||
'// type-checks against the SAME shape the generated artifact actually exports',
|
||||
@@ -521,7 +521,7 @@ function serializeDts(declarationPath) {
|
||||
* only ever ASSIGNS variables can never trip an unset-variable check,
|
||||
* regardless of what the caller's shell had in scope beforehand).
|
||||
*
|
||||
* Consumed by the bash scanners under scripts/ via `. gsd-core/bin/shared/
|
||||
* Consumed by the bash scanners under scripts/ via `. msd-core/bin/shared/
|
||||
* exit-codes.sh` (ADR-3889 Phase 4, #3908) so a shell caller resolves a
|
||||
* symbolic name instead of hardcoding a literal integer that can silently
|
||||
* drift from the registry.
|
||||
@@ -534,14 +534,14 @@ function serializeSh(entries, declarationPath) {
|
||||
`# Source of truth: ${relDeclaration}. Regenerate with:`,
|
||||
'# node scripts/gen-exit-code-registry.cjs --write',
|
||||
'#',
|
||||
'# One `export EXIT_<NAME>=<code>` per gsd-core/bin/shared/exit-codes.json',
|
||||
'# One `export EXIT_<NAME>=<code>` per msd-core/bin/shared/exit-codes.json',
|
||||
'# entry (ADR-3889 §2, #3905/#3906/#3908). POSIX sh, safe under `set -u`:',
|
||||
'# sourcing this file only ever ASSIGNS variables, never reads one, so it',
|
||||
'# cannot trip an unset-variable check regardless of the caller\'s existing',
|
||||
'# environment.',
|
||||
'#',
|
||||
'# Usage (from a scanner under scripts/):',
|
||||
'# . "$(dirname "$0")/../gsd-core/bin/shared/exit-codes.sh"',
|
||||
'# . "$(dirname "$0")/../msd-core/bin/shared/exit-codes.sh"',
|
||||
'# exit "$EXIT_UNAVAILABLE"',
|
||||
'',
|
||||
].join('\n');
|
||||
|
||||
Reference in New Issue
Block a user