Adds get-shit-done/bin/lib/package-identity.cjs as the single source of truth for PACKAGE_NAME, derived from package.json `name` via require. Refactors all runtime code-line occurrences in bin/install.js, get-shit-done/bin/check-latest-version.cjs, get-shit-done/bin/lib/shell-command-projection.cjs, get-shit-done/bin/lib/verify.cjs, scripts/changeset/cli.cjs, scripts/changeset/github-release-notes.cjs, and scripts/release-tarball-smoke.cjs to import PACKAGE_NAME from the identity module instead of hardcoding the literal. The package name is unchanged (@opengsd/get-shit-done-redux). Behaviour is byte-identical: all --help, hint, and release-notes strings render exactly as before. Golden-literal tests (bug-2992, bug-378) keep their hardcoded expected values and remain GREEN. Adds tests/package-name-single-source.test.cjs lint guard: fails CI if @opengsd/get-shit-done-redux appears as a code-line literal in runtime .cjs/.js outside the identity module, enforcing a one-file rename path. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
20 lines
647 B
JavaScript
20 lines
647 B
JavaScript
'use strict';
|
|
|
|
/**
|
|
* Single source of truth for the package name at runtime (#516).
|
|
*
|
|
* Why this exists: the package name `@opengsd/get-shit-done-redux` was
|
|
* hardcoded as a string literal in ~15 runtime .cjs/.js files. When the
|
|
* package is renamed (e.g. to `@opengsd/gsd-core`), changing this one
|
|
* require path propagates the new name everywhere in runtime code.
|
|
*
|
|
* Path: get-shit-done/bin/lib/package-identity.cjs
|
|
* Resolves package.json both in-repo (3 levels up) and when shipped
|
|
* (package root is always 3 dirs above this file).
|
|
*/
|
|
const pkg = require('../../../package.json');
|
|
|
|
module.exports = {
|
|
PACKAGE_NAME: pkg.name,
|
|
};
|