getculpa 1.0.1 → 1.0.3

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 CHANGED
@@ -1,24 +1,25 @@
1
- {
2
- "name": "getculpa",
3
- "version": "1.0.1",
4
- "description": "Culpa CLI: `npm i -g getculpa` provisions the full Culpa install (Windows-installer parity) and leaves it dormant. `getculpa` wakes the stack.",
5
- "license": "SEE LICENSE IN https://getculpa.com",
6
- "bin": {
7
- "getculpa": "bin/getculpa.js",
8
- "culpa": "bin/culpa.js"
9
- },
10
- "scripts": {
11
- "postinstall": "node scripts/install.js",
12
- "prepack": "node scripts/prepack.js"
13
- },
14
- "files": [
15
- "bin/",
16
- "lib/",
17
- "scripts/",
18
- "assets/",
19
- "README.md"
20
- ],
21
- "engines": {
22
- "node": ">=20"
23
- }
24
- }
1
+ {
2
+ "name": "getculpa",
3
+ "version": "1.0.3",
4
+ "description": "Culpa CLI: `npm i -g getculpa` provisions the full Culpa install (Windows-installer parity) and leaves it dormant. `getculpa` wakes the stack.",
5
+ "license": "SEE LICENSE IN LICENSE",
6
+ "bin": {
7
+ "getculpa": "bin/getculpa.js",
8
+ "culpa": "bin/culpa.js"
9
+ },
10
+ "scripts": {
11
+ "postinstall": "node scripts/install.js",
12
+ "prepack": "node scripts/prepack.js"
13
+ },
14
+ "files": [
15
+ "bin/",
16
+ "lib/",
17
+ "scripts/",
18
+ "assets/",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "engines": {
23
+ "node": ">=20"
24
+ }
25
+ }
@@ -111,21 +111,44 @@ async function main() {
111
111
  );
112
112
  provisionOpts.delegateWindowsInstaller = () => true;
113
113
  }
114
- const { classification, previousVersion } = await provision(provisionOpts);
114
+ const { classification, previousVersion, dockerState, imagesStaged, collectorStaged } =
115
+ await provision(provisionOpts);
116
+
117
+ // T-CF28-4b: stage the CLI payload the launcher actually runs. Without this
118
+ // a fresh install leaves state.json at `current: null` and the first
119
+ // `getculpa` dead-ends — the Mac tester's exact experience. Best-effort by
120
+ // construction: any failure leaves the payload deferred and the summary
121
+ // below names `getculpa update`, which is where we already were.
122
+ const { readPayloadState, stageInitialPayload, vendoredLauncherPath } = await import("../lib/bootstrap.mjs");
123
+ stageInitialPayload({
124
+ launcherPath: vendoredLauncherPath(path.join(__dirname, "..")),
125
+ env: process.env,
126
+ });
127
+ // V102 T-V102-15 (M3): the summary reports what updates/state.json actually
128
+ // says, never the updater's exit code — "installed" was claimed on a Mac
129
+ // whose state read current: null while doctor FAILed the same install.
130
+ const payloadState = readPayloadState({ env: process.env });
115
131
 
116
132
  // CF20-T6: the completion line names what actually happened — an upgrade
117
133
  // is STAGED only; the new version applies at the next `getculpa`, not here.
118
- if (classification === "upgrade") {
119
- console.log(`Culpa updated: ${previousVersion} -> ${pkg.version} (staged; applies at next \`getculpa\`).`);
120
- } else if (classification === "downgrade-package") {
121
- console.log(`Culpa ${previousVersion} is already installed; this package (${pkg.version}) is older and was not applied.`);
122
- } else if (classification === "same-version" || classification === "repair") {
123
- console.log("Culpa installation repaired.");
124
- } else {
125
- console.log("Culpa installed successfully.");
126
- }
127
- console.log("Run:");
128
- console.log(" getculpa");
134
+ // T-CF28-5/7: those words now live in lib/install-summary.mjs so they are
135
+ // testable, and they no longer report success without saying whether Docker
136
+ // — which Culpa cannot run without — is actually present.
137
+ const { buildInstallSummary } = await import("../lib/install-summary.mjs");
138
+ const summary = buildInstallSummary({
139
+ classification,
140
+ version: pkg.version,
141
+ previousVersion,
142
+ appDir,
143
+ dockerState,
144
+ imagesStaged,
145
+ collectorStaged,
146
+ payloadState,
147
+ platform: process.platform,
148
+ isTTY: Boolean(process.stdout.isTTY),
149
+ env: process.env,
150
+ });
151
+ for (const line of summary) console.log(line);
129
152
  }
130
153
 
131
154
  main().catch((e) => {