@topogram/cli 0.3.36 → 0.3.37
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/package.json +1 -1
- package/src/cli.js +32 -6
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -108,7 +108,32 @@ const CLI_PACKAGE_NAME = "@topogram/cli";
|
|
|
108
108
|
const NPMJS_REGISTRY = "https://registry.npmjs.org";
|
|
109
109
|
const TEMPLATE_FILES_MANIFEST = ".topogram-template-files.json";
|
|
110
110
|
const TEMPLATE_POLICY_FILE = "topogram.template-policy.json";
|
|
111
|
-
const
|
|
111
|
+
const FIRST_PARTY_GENERATOR_REPOS = [
|
|
112
|
+
"topogram-generator-express-api",
|
|
113
|
+
"topogram-generator-hono-api",
|
|
114
|
+
"topogram-generator-postgres-db",
|
|
115
|
+
"topogram-generator-react-web",
|
|
116
|
+
"topogram-generator-sqlite-db",
|
|
117
|
+
"topogram-generator-sveltekit-web",
|
|
118
|
+
"topogram-generator-swiftui-native",
|
|
119
|
+
"topogram-generator-vanilla-web"
|
|
120
|
+
];
|
|
121
|
+
const KNOWN_CLI_CONSUMER_REPOS = [
|
|
122
|
+
...FIRST_PARTY_GENERATOR_REPOS,
|
|
123
|
+
"topogram-starters",
|
|
124
|
+
"topogram-template-todo",
|
|
125
|
+
"topogram-demo-todo",
|
|
126
|
+
"topogram-hello"
|
|
127
|
+
];
|
|
128
|
+
const PACKAGE_UPDATE_CLI_CHECK_SCRIPTS = [
|
|
129
|
+
"cli:surface",
|
|
130
|
+
"doctor",
|
|
131
|
+
"catalog:show",
|
|
132
|
+
"catalog:template-show",
|
|
133
|
+
"check",
|
|
134
|
+
"pack:check",
|
|
135
|
+
"verify"
|
|
136
|
+
];
|
|
112
137
|
const REPO_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
113
138
|
const ENGINE_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
114
139
|
const TEMPLATES_ROOT = path.join(ENGINE_ROOT, "templates");
|
|
@@ -654,6 +679,7 @@ function printPackageHelp() {
|
|
|
654
679
|
console.log(" - npmjs package inspection confirms the requested public CLI version.");
|
|
655
680
|
console.log(" - npm install updates package.json and package-lock.json.");
|
|
656
681
|
console.log(" - Available consumer verification scripts run after install.");
|
|
682
|
+
console.log(` - Recognized scripts: ${PACKAGE_UPDATE_CLI_CHECK_SCRIPTS.join(", ")}.`);
|
|
657
683
|
console.log("");
|
|
658
684
|
console.log("Examples:");
|
|
659
685
|
console.log(" topogram package update-cli 0.3.5");
|
|
@@ -667,7 +693,7 @@ function printPackageHelp() {
|
|
|
667
693
|
function printReleaseHelp() {
|
|
668
694
|
console.log("Usage: topogram release status [--json] [--strict]");
|
|
669
695
|
console.log("");
|
|
670
|
-
console.log("Checks the local CLI version, latest published package version, release tag, and
|
|
696
|
+
console.log("Checks the local CLI version, latest published package version, release tag, and first-party consumer pins.");
|
|
671
697
|
console.log("");
|
|
672
698
|
console.log("Examples:");
|
|
673
699
|
console.log(" topogram release status");
|
|
@@ -1625,7 +1651,7 @@ function buildPackageUpdateCliPayload(requested, options = {}) {
|
|
|
1625
1651
|
const versionConvention = writeTopogramCliVersionConventionIfPresent(cwd, version);
|
|
1626
1652
|
const packageJson = readPackageJsonForUpdate(cwd);
|
|
1627
1653
|
const scripts = packageJson.scripts && typeof packageJson.scripts === "object" ? packageJson.scripts : {};
|
|
1628
|
-
const candidateScripts =
|
|
1654
|
+
const candidateScripts = PACKAGE_UPDATE_CLI_CHECK_SCRIPTS;
|
|
1629
1655
|
const scriptsRun = [];
|
|
1630
1656
|
const skippedScripts = [];
|
|
1631
1657
|
if (dependencyUpdatedBy !== "npm-install") {
|
|
@@ -1700,7 +1726,7 @@ function printPackageUpdateCli(payload) {
|
|
|
1700
1726
|
console.log(" git diff package.json package-lock.json");
|
|
1701
1727
|
console.log(` git commit -am "Update Topogram CLI to ${payload.requestedVersion}"`);
|
|
1702
1728
|
console.log(" git push");
|
|
1703
|
-
console.log(" confirm
|
|
1729
|
+
console.log(" confirm the repo verification workflow passes");
|
|
1704
1730
|
}
|
|
1705
1731
|
|
|
1706
1732
|
/**
|
|
@@ -1804,9 +1830,9 @@ function releaseStatusStrictDiagnostics(release) {
|
|
|
1804
1830
|
diagnostics.push({
|
|
1805
1831
|
code: "release_consumer_pins_not_current",
|
|
1806
1832
|
severity: "error",
|
|
1807
|
-
message: `
|
|
1833
|
+
message: `First-party consumers are not all pinned to ${CLI_PACKAGE_NAME}@${release.localVersion}.`,
|
|
1808
1834
|
path: "topogram-cli.version",
|
|
1809
|
-
suggestedFix: "Roll
|
|
1835
|
+
suggestedFix: "Roll first-party consumer repositories to the current CLI version before treating this release as complete."
|
|
1810
1836
|
});
|
|
1811
1837
|
}
|
|
1812
1838
|
return diagnostics;
|