@nestledjs/upgrades 0.1.0

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/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # @nestledjs/upgrades
2
+
3
+ `nestled-update` — apply Nestled template upgrades to a cloned project.
4
+
5
+ A project created from `nestled-template` uses this package to pull published
6
+ upgrades from its channel and apply them, tracking what it has already received
7
+ in `.nestled/upgrade-log.yaml`. Note **authoring** stays private (only the
8
+ template maintainer produces upgrades); every clone only ever consumes.
9
+
10
+ ## Model
11
+
12
+ - **Manifest** — the published feed: an ordered list of releases plus a pointer
13
+ per channel (`canary`, `stable`). A clone on channel `C` applies every release
14
+ with `baseline < release.id <= channels[C]`. Canary points ahead of stable, so
15
+ the maintainer's fleet validates a release before the world sees it.
16
+ - **Baseline** — each clone remembers the release it started from. Fresh clones
17
+ read it from a committed `.nestled/template-version` stamp; `nestled-update
18
+ init` records it, and each apply advances it.
19
+
20
+ See `docs/DISTRIBUTION-SPEC.md` in the nestled-upgrader repo for the full design.
21
+
22
+ ## CLI
23
+
24
+ ```bash
25
+ nestled-update init # establish this clone's baseline + channel
26
+ nestled-update check # show pending upgrades (no changes)
27
+ nestled-update status # show channel, baseline, applied history
28
+ nestled-update apply # apply pending upgrades
29
+ ```
30
+
31
+ ## How it reads the feed
32
+
33
+ The feed lives in the public `nestled-template` repo under `.nestled-upgrades/`
34
+ (`manifest.yaml` + `patches/*.diff`). `nestled-update` adds the template as an
35
+ upstream remote, `git fetch`es the feed ref, and reads the manifest + patches
36
+ via `git show` — no working checkout of the template. For local development/
37
+ testing, `--manifest <file>` reads a manifest off disk instead.
38
+
39
+ Configure the feed once at init:
40
+
41
+ ```bash
42
+ nestled-update init --remote <template-git-url> --ref develop --channel stable
43
+ ```
44
+
45
+ ## Status
46
+
47
+ - **Phase 1** — manifest schema, baseline stamp, channel-aware pending, and
48
+ `init` / `check` / `status`.
49
+ - **Phase 2** — real `apply`: git-fetch feed transport, branch per run, 3-way
50
+ patch application, `package-release` version bumps, verification gating with
51
+ clean rollback on failure, baseline advancement, and optional `--pr`.
52
+
53
+ Still to come (producer side, in the private repo): the `publish` /
54
+ `promote-release` / `baseline-fleet` commands that write releases into the
55
+ template feed and move channel pointers.
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@nestledjs/upgrades",
3
+ "version": "0.1.0",
4
+ "type": "commonjs",
5
+ "description": "Consume and apply Nestled template upgrades in a cloned project (nestled-update).",
6
+ "main": "./src/index.js",
7
+ "types": "./src/index.d.ts",
8
+ "bin": {
9
+ "nestled-update": "src/bin/nestled-update.js"
10
+ },
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "dependencies": {
15
+ "tslib": "^2.6.0",
16
+ "yaml": "^2.8.0"
17
+ }
18
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const cli_1 = require("../lib/cli");
5
+ process.exit((0, cli_1.run)(process.argv.slice(2)));
6
+ //# sourceMappingURL=nestled-update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nestled-update.js","sourceRoot":"","sources":["../../../../upgrades/src/bin/nestled-update.ts"],"names":[],"mappings":";;;AACA,oCAAiC;AAEjC,OAAO,CAAC,IAAI,CAAC,IAAA,SAAG,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
package/src/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export * from './lib/manifest';
2
+ export * from './lib/baseline';
3
+ export * from './lib/pending';
4
+ export * from './lib/git';
5
+ export * from './lib/feed';
6
+ export * from './lib/apply';
7
+ export { run } from './lib/cli';
package/src/index.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.run = void 0;
4
+ const tslib_1 = require("tslib");
5
+ tslib_1.__exportStar(require("./lib/manifest"), exports);
6
+ tslib_1.__exportStar(require("./lib/baseline"), exports);
7
+ tslib_1.__exportStar(require("./lib/pending"), exports);
8
+ tslib_1.__exportStar(require("./lib/git"), exports);
9
+ tslib_1.__exportStar(require("./lib/feed"), exports);
10
+ tslib_1.__exportStar(require("./lib/apply"), exports);
11
+ var cli_1 = require("./lib/cli");
12
+ Object.defineProperty(exports, "run", { enumerable: true, get: function () { return cli_1.run; } });
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../upgrades/src/index.ts"],"names":[],"mappings":";;;;AAAA,yDAA+B;AAC/B,yDAA+B;AAC/B,wDAA8B;AAC9B,oDAA0B;AAC1B,qDAA2B;AAC3B,sDAA4B;AAC5B,iCAAgC;AAAvB,0FAAA,GAAG,OAAA"}
@@ -0,0 +1,52 @@
1
+ import { ResolveFeedOptions } from './feed';
2
+ import { PrResult } from './git';
3
+ export type RunStatus = 'up-to-date' | 'applied' | 'blocked' | 'verification-failed';
4
+ export interface AppliedNote {
5
+ id: string;
6
+ title: string;
7
+ delivery: string;
8
+ via3way?: boolean;
9
+ alreadyApplied?: boolean;
10
+ packageUpdated?: {
11
+ manifest: string;
12
+ name: string;
13
+ version: string;
14
+ }[];
15
+ }
16
+ export interface BlockedInfo {
17
+ id: string;
18
+ reason: string;
19
+ output?: string;
20
+ }
21
+ export interface VerificationResult {
22
+ command: string;
23
+ status: number;
24
+ output: string;
25
+ error: string;
26
+ }
27
+ export interface ApplyRunResult {
28
+ status: RunStatus;
29
+ channel: string;
30
+ branch?: string;
31
+ applied: AppliedNote[];
32
+ blocked?: BlockedInfo;
33
+ verification?: VerificationResult[];
34
+ baselineRelease?: string;
35
+ pr?: PrResult;
36
+ }
37
+ export interface ApplyOptions extends ResolveFeedOptions {
38
+ allowDirty?: boolean;
39
+ autoPR?: boolean;
40
+ verification?: string[];
41
+ forkedAreas?: string[];
42
+ defaultBranch?: string;
43
+ }
44
+ /**
45
+ * Apply every pending upgrade for this clone's channel, all-or-nothing per run:
46
+ * notes are applied and committed one at a time onto a dedicated branch; the
47
+ * first note that cannot be applied cleanly, or a failing verification run,
48
+ * rolls the branch back to where it started and records the blocker for manual
49
+ * adaptation. On success, per-note outcomes are recorded and the baseline is
50
+ * advanced across every fully-completed release.
51
+ */
52
+ export declare function applyRun(projectDir: string, options?: ApplyOptions): ApplyRunResult;
@@ -0,0 +1,326 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applyRun = applyRun;
4
+ const node_child_process_1 = require("node:child_process");
5
+ const node_fs_1 = require("node:fs");
6
+ const node_os_1 = require("node:os");
7
+ const node_path_1 = require("node:path");
8
+ const manifest_1 = require("./manifest");
9
+ const baseline_1 = require("./baseline");
10
+ const pending_1 = require("./pending");
11
+ const feed_1 = require("./feed");
12
+ const git_1 = require("./git");
13
+ /** A patch must never touch our own bookkeeping. */
14
+ const PATCH_EXCLUDES = ['.nestled/**'];
15
+ function includesPackage(note) {
16
+ return note.delivery === 'package-release' || note.delivery === 'hybrid';
17
+ }
18
+ function includesPatch(note) {
19
+ return !note.delivery || note.delivery === 'code-patch' || note.delivery === 'hybrid';
20
+ }
21
+ function tryApplyPatch(cwd, diffText) {
22
+ const excludeArgs = PATCH_EXCLUDES.map((pattern) => `--exclude=${pattern}`);
23
+ const dir = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), 'nestled-upd-'));
24
+ const file = (0, node_path_1.join)(dir, 'change.diff');
25
+ (0, node_fs_1.writeFileSync)(file, diffText, 'utf8');
26
+ try {
27
+ const check = (0, git_1.git)(cwd, ['apply', ...excludeArgs, '--check', file]);
28
+ if (check.status !== 0) {
29
+ const reverse = (0, git_1.git)(cwd, ['apply', ...excludeArgs, '--reverse', '--check', file]);
30
+ if (reverse.status === 0)
31
+ return { applied: false, alreadyApplied: true };
32
+ const threeWay = (0, git_1.git)(cwd, ['apply', '--3way', ...excludeArgs, file]);
33
+ if (threeWay.status === 0)
34
+ return { applied: true, via3way: true };
35
+ // 3-way may have left partial state on this (uncommitted) note only.
36
+ (0, git_1.git)(cwd, ['checkout', '--', '.']);
37
+ return { applied: false, output: check.stderr || check.stdout };
38
+ }
39
+ const apply = (0, git_1.git)(cwd, ['apply', ...excludeArgs, file]);
40
+ return { applied: apply.status === 0, output: apply.stderr || apply.stdout };
41
+ }
42
+ finally {
43
+ (0, node_fs_1.rmSync)(dir, { recursive: true, force: true });
44
+ }
45
+ }
46
+ function safeReadPackageJson(filePath) {
47
+ try {
48
+ return JSON.parse((0, node_fs_1.readFileSync)(filePath, 'utf8'));
49
+ }
50
+ catch (_a) {
51
+ return null;
52
+ }
53
+ }
54
+ function walkPackageJson(dir, result) {
55
+ for (const entry of (0, node_fs_1.readdirSync)(dir, { withFileTypes: true })) {
56
+ if (entry.name === 'node_modules' || entry.name === '.git')
57
+ continue;
58
+ const absolute = (0, node_path_1.join)(dir, entry.name);
59
+ if (entry.isDirectory())
60
+ walkPackageJson(absolute, result);
61
+ else if (entry.name === 'package.json')
62
+ result.push(absolute);
63
+ }
64
+ }
65
+ function findPackageManifests(cwd, releases) {
66
+ const explicit = releases.flatMap((release) => { var _a; return (_a = release.manifests) !== null && _a !== void 0 ? _a : []; });
67
+ if (explicit.length) {
68
+ return explicit.map((manifest) => (0, node_path_1.join)(cwd, manifest)).filter((manifest) => (0, node_fs_1.existsSync)(manifest));
69
+ }
70
+ const result = [];
71
+ walkPackageJson(cwd, result);
72
+ return result;
73
+ }
74
+ function verifyPublishedPackage(name, version) {
75
+ var _a, _b;
76
+ if (!name || !version)
77
+ return false;
78
+ const result = (0, node_child_process_1.spawnSync)('npm', ['view', `${name}@${version}`, 'version', '--json'], { encoding: 'utf8' });
79
+ return ((_a = result.status) !== null && _a !== void 0 ? _a : 1) === 0 && ((_b = result.stdout) !== null && _b !== void 0 ? _b : '').trim() !== '';
80
+ }
81
+ function packageManagerInstall(cwd) {
82
+ if ((0, node_fs_1.existsSync)((0, node_path_1.join)(cwd, 'pnpm-lock.yaml')))
83
+ return ['pnpm', 'install'];
84
+ if ((0, node_fs_1.existsSync)((0, node_path_1.join)(cwd, 'yarn.lock')))
85
+ return ['yarn', 'install'];
86
+ if ((0, node_fs_1.existsSync)((0, node_path_1.join)(cwd, 'package-lock.json')))
87
+ return ['npm', 'install'];
88
+ return null;
89
+ }
90
+ function updateLockfile(cwd) {
91
+ var _a, _b;
92
+ const command = packageManagerInstall(cwd);
93
+ if (!command)
94
+ return { status: 0, reason: 'No package manager lockfile detected.' };
95
+ const result = (0, node_child_process_1.spawnSync)(command[0], command.slice(1), { cwd, encoding: 'utf8' });
96
+ return {
97
+ status: (_a = result.status) !== null && _a !== void 0 ? _a : 1,
98
+ reason: ((_b = result.status) !== null && _b !== void 0 ? _b : 1) === 0 ? 'Lockfile updated.' : result.stderr || result.stdout || 'Install failed.',
99
+ };
100
+ }
101
+ function applyPackageReleases(cwd, note) {
102
+ var _a, _b, _c, _d, _e;
103
+ const releases = (_a = note.packageReleases) !== null && _a !== void 0 ? _a : [];
104
+ if (releases.some((release) => !release.targetVersion && !release.versionRange)) {
105
+ return { status: 'blocked', reason: 'Package release is missing targetVersion and versionRange (pending release).' };
106
+ }
107
+ for (const release of releases) {
108
+ const version = (_b = release.targetVersion) !== null && _b !== void 0 ? _b : release.versionRange;
109
+ if (!verifyPublishedPackage(release.name, version)) {
110
+ return { status: 'blocked', reason: `Cannot verify published version for ${release.name}@${version}.` };
111
+ }
112
+ }
113
+ const manifests = findPackageManifests(cwd, releases);
114
+ const updated = [];
115
+ for (const manifestPath of manifests) {
116
+ const pkg = safeReadPackageJson(manifestPath);
117
+ if (!pkg)
118
+ continue;
119
+ let changed = false;
120
+ for (const release of releases) {
121
+ const version = (_d = (_c = release.versionRange) !== null && _c !== void 0 ? _c : release.targetVersion) !== null && _d !== void 0 ? _d : '';
122
+ for (const field of ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies']) {
123
+ if ((_e = pkg[field]) === null || _e === void 0 ? void 0 : _e[release.name]) {
124
+ pkg[field][release.name] = version;
125
+ updated.push({ manifest: (0, node_path_1.relative)(cwd, manifestPath), name: release.name, version });
126
+ changed = true;
127
+ }
128
+ }
129
+ }
130
+ if (changed)
131
+ (0, node_fs_1.writeFileSync)(manifestPath, `${JSON.stringify(pkg, null, 2)}\n`);
132
+ }
133
+ if (updated.length === 0) {
134
+ const names = releases.map((r) => r.name).join(', ') || 'the referenced packages';
135
+ return { status: 'not-applicable', reason: `Project does not consume ${names}.` };
136
+ }
137
+ const lockfile = updateLockfile(cwd);
138
+ return { status: lockfile.status === 0 ? 'applied' : 'blocked', reason: lockfile.reason, updated };
139
+ }
140
+ function detectPackageManager(cwd) {
141
+ if ((0, node_fs_1.existsSync)((0, node_path_1.join)(cwd, 'yarn.lock')))
142
+ return 'yarn';
143
+ if ((0, node_fs_1.existsSync)((0, node_path_1.join)(cwd, 'package-lock.json')))
144
+ return 'npm';
145
+ return 'pnpm';
146
+ }
147
+ function inferVerification(cwd) {
148
+ var _a;
149
+ const pkg = safeReadPackageJson((0, node_path_1.join)(cwd, 'package.json'));
150
+ if (!pkg)
151
+ return [];
152
+ const pm = detectPackageManager(cwd);
153
+ const scripts = (_a = pkg.scripts) !== null && _a !== void 0 ? _a : {};
154
+ const commands = [];
155
+ if (scripts.lint)
156
+ commands.push(`${pm} lint`);
157
+ if (scripts.test)
158
+ commands.push(`${pm} test`);
159
+ return commands;
160
+ }
161
+ function runVerification(cwd, commands) {
162
+ return commands.map((command) => {
163
+ var _a, _b, _c;
164
+ const result = (0, node_child_process_1.spawnSync)(command, { cwd, shell: true, encoding: 'utf8' });
165
+ return { command, status: (_a = result.status) !== null && _a !== void 0 ? _a : 1, output: (_b = result.stdout) !== null && _b !== void 0 ? _b : '', error: (_c = result.stderr) !== null && _c !== void 0 ? _c : '' };
166
+ });
167
+ }
168
+ function releasesForBaseline(manifest, pending) {
169
+ return manifest.releases
170
+ .filter((release) => {
171
+ const aboveBaseline = !pending.baseline || (0, manifest_1.compareReleaseId)(release.id, pending.baseline) > 0;
172
+ const withinCeiling = !pending.ceiling || (0, manifest_1.compareReleaseId)(release.id, pending.ceiling) <= 0;
173
+ return aboveBaseline && withinCeiling;
174
+ })
175
+ .sort((a, b) => (0, manifest_1.compareReleaseId)(a.id, b.id))
176
+ .map((release) => {
177
+ var _a;
178
+ return ({
179
+ id: release.id,
180
+ templateCommit: release.templateCommit,
181
+ noteIds: ((_a = release.notes) !== null && _a !== void 0 ? _a : []).map((note) => note.id),
182
+ });
183
+ });
184
+ }
185
+ function prBody(applied, channel, ceiling) {
186
+ const lines = applied.map((note) => `- ${note.id} — ${note.title}`);
187
+ return [
188
+ '## Nestled upgrades',
189
+ '',
190
+ `Channel: ${channel}${ceiling ? ` (up to ${ceiling})` : ''}`,
191
+ '',
192
+ ...lines,
193
+ '',
194
+ '🤖 Applied by nestled-update',
195
+ ].join('\n');
196
+ }
197
+ /**
198
+ * Apply every pending upgrade for this clone's channel, all-or-nothing per run:
199
+ * notes are applied and committed one at a time onto a dedicated branch; the
200
+ * first note that cannot be applied cleanly, or a failing verification run,
201
+ * rolls the branch back to where it started and records the blocker for manual
202
+ * adaptation. On success, per-note outcomes are recorded and the baseline is
203
+ * advanced across every fully-completed release.
204
+ */
205
+ function applyRun(projectDir, options = {}) {
206
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
207
+ const config = (0, baseline_1.readSiteConfig)(projectDir);
208
+ const log = (0, baseline_1.readUpgradeLog)(projectDir);
209
+ (_a = log.upgrades) !== null && _a !== void 0 ? _a : (log.upgrades = {});
210
+ const channel = log.template.channel || baseline_1.DEFAULT_CHANNEL;
211
+ const feed = (0, feed_1.resolveFeed)(projectDir, log, options);
212
+ const pending = (0, pending_1.computePending)(feed.manifest, log);
213
+ if (pending.notes.length === 0) {
214
+ return { status: 'up-to-date', channel, applied: [], baselineRelease: log.template.baselineRelease };
215
+ }
216
+ if (!(0, git_1.isGitRepo)(projectDir)) {
217
+ throw new Error('Project is not a git repository; cannot create an upgrade branch.');
218
+ }
219
+ const startedClean = !(0, git_1.hasUncommittedChanges)(projectDir);
220
+ if (!startedClean && !options.allowDirty) {
221
+ throw new Error('Project has uncommitted changes. Commit them, or re-run with --allow-dirty.');
222
+ }
223
+ const branch = `nestled-update/${channel}-${pending.ceiling}`;
224
+ (0, git_1.checkoutBranch)(projectDir, branch);
225
+ const startCommit = (0, git_1.gitOutput)(projectDir, ['rev-parse', 'HEAD']);
226
+ const forked = new Set((_c = (_b = options.forkedAreas) !== null && _b !== void 0 ? _b : config.forkedAreas) !== null && _c !== void 0 ? _c : []);
227
+ const rollback = () => {
228
+ if (startedClean && startCommit)
229
+ (0, git_1.git)(projectDir, ['reset', '--hard', startCommit]);
230
+ else
231
+ (0, git_1.git)(projectDir, ['checkout', '--', '.']);
232
+ };
233
+ const applied = [];
234
+ let blocked = null;
235
+ for (const note of pending.notes) {
236
+ if (note.area && forked.has(note.area)) {
237
+ blocked = { id: note.id, reason: `Area "${note.area}" is marked forked; review intent before applying.` };
238
+ break;
239
+ }
240
+ const entry = { id: note.id, title: note.title, delivery: note.delivery };
241
+ if (includesPackage(note)) {
242
+ const result = applyPackageReleases(projectDir, note);
243
+ if (result.status === 'blocked') {
244
+ blocked = { id: note.id, reason: (_d = result.reason) !== null && _d !== void 0 ? _d : 'Package release blocked.' };
245
+ break;
246
+ }
247
+ if (result.status === 'not-applicable' && !includesPatch(note)) {
248
+ log.upgrades[note.id] = 'not-applicable';
249
+ continue;
250
+ }
251
+ entry.packageUpdated = result.updated;
252
+ }
253
+ if (includesPatch(note)) {
254
+ if (!note.patch) {
255
+ blocked = { id: note.id, reason: 'Note declares a code patch but has no patch reference.' };
256
+ break;
257
+ }
258
+ const diff = feed.readPatch(note.patch);
259
+ if (diff == null) {
260
+ blocked = { id: note.id, reason: `Patch not found in feed: ${note.patch}` };
261
+ break;
262
+ }
263
+ const patch = tryApplyPatch(projectDir, diff);
264
+ if (!patch.applied && !patch.alreadyApplied) {
265
+ blocked = {
266
+ id: note.id,
267
+ reason: 'Patch did not apply cleanly; intent-based adaptation required.',
268
+ output: patch.output,
269
+ };
270
+ break;
271
+ }
272
+ entry.via3way = patch.via3way;
273
+ entry.alreadyApplied = patch.alreadyApplied;
274
+ }
275
+ (0, git_1.commitAll)(projectDir, `Apply Nestled upgrade ${note.id}`);
276
+ applied.push({ note, entry });
277
+ }
278
+ if (blocked) {
279
+ rollback();
280
+ log.upgrades[blocked.id] = 'blocked';
281
+ (0, baseline_1.writeUpgradeLog)(projectDir, log);
282
+ return { status: 'blocked', channel, branch, applied: [], blocked, baselineRelease: log.template.baselineRelease };
283
+ }
284
+ const commands = (_f = (_e = options.verification) !== null && _e !== void 0 ? _e : config.verification) !== null && _f !== void 0 ? _f : inferVerification(projectDir);
285
+ const verification = applied.length ? runVerification(projectDir, commands) : [];
286
+ const failed = verification.find((item) => item.status !== 0);
287
+ if (failed) {
288
+ rollback();
289
+ for (const { note } of applied)
290
+ log.upgrades[note.id] = 'blocked';
291
+ (0, baseline_1.writeUpgradeLog)(projectDir, log);
292
+ return {
293
+ status: 'verification-failed',
294
+ channel,
295
+ branch,
296
+ applied: [],
297
+ verification,
298
+ blocked: { id: failed.command, reason: `Verification failed: ${failed.command}` },
299
+ baselineRelease: log.template.baselineRelease,
300
+ };
301
+ }
302
+ for (const { note, entry } of applied) {
303
+ log.upgrades[note.id] = (entry.alreadyApplied ? 'superseded' : 'applied');
304
+ }
305
+ (0, baseline_1.advanceBaseline)(log, releasesForBaseline(feed.manifest, pending));
306
+ (0, baseline_1.writeUpgradeLog)(projectDir, log);
307
+ let pr;
308
+ if (((_g = options.autoPR) !== null && _g !== void 0 ? _g : config.autoPR) && applied.length) {
309
+ pr = (0, git_1.pushAndCreatePR)(projectDir, {
310
+ branch,
311
+ base: (_j = (_h = options.defaultBranch) !== null && _h !== void 0 ? _h : config.defaultBranch) !== null && _j !== void 0 ? _j : 'develop',
312
+ title: `Nestled upgrades up to ${pending.ceiling}`,
313
+ body: prBody(applied.map((a) => a.entry), channel, pending.ceiling),
314
+ });
315
+ }
316
+ return {
317
+ status: 'applied',
318
+ channel,
319
+ branch,
320
+ applied: applied.map((a) => a.entry),
321
+ verification,
322
+ baselineRelease: log.template.baselineRelease,
323
+ pr,
324
+ };
325
+ }
326
+ //# sourceMappingURL=apply.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply.js","sourceRoot":"","sources":["../../../../upgrades/src/lib/apply.ts"],"names":[],"mappings":";;AAyQA,4BAkIC;AA3YD,2DAA+C;AAC/C,qCAAoG;AACpG,qCAAiC;AACjC,yCAA2C;AAC3C,yCAAqF;AACrF,yCASoB;AACpB,uCAA0D;AAC1D,iCAAyD;AACzD,+BASe;AAEf,oDAAoD;AACpD,MAAM,cAAc,GAAG,CAAC,aAAa,CAAC,CAAC;AA6CvC,SAAS,eAAe,CAAC,IAAiB;IACxC,OAAO,IAAI,CAAC,QAAQ,KAAK,iBAAiB,IAAI,IAAI,CAAC,QAAQ,KAAK,QAAQ,CAAC;AAC3E,CAAC;AAED,SAAS,aAAa,CAAC,IAAiB;IACtC,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,KAAK,YAAY,IAAI,IAAI,CAAC,QAAQ,KAAK,QAAQ,CAAC;AACxF,CAAC;AASD,SAAS,aAAa,CAAC,GAAW,EAAE,QAAgB;IAClD,MAAM,WAAW,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,aAAa,OAAO,EAAE,CAAC,CAAC;IAC5E,MAAM,GAAG,GAAG,IAAA,qBAAW,EAAC,IAAA,gBAAI,EAAC,IAAA,gBAAM,GAAE,EAAE,cAAc,CAAC,CAAC,CAAC;IACxD,MAAM,IAAI,GAAG,IAAA,gBAAI,EAAC,GAAG,EAAE,aAAa,CAAC,CAAC;IACt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AM,mCAAI,MAAM,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACxD,EAAE,GAAG,IAAA,qBAAe,EAAC,UAAU,EAAE;YAC/B,MAAM;YACN,IAAI,EAAE,MAAA,MAAA,OAAO,CAAC,aAAa,mCAAI,MAAM,CAAC,aAAa,mCAAI,SAAS;YAChE,KAAK,EAAE,0BAA0B,OAAO,CAAC,OAAO,EAAE;YAClD,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;SACpE,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,MAAM,EAAE,SAAS;QACjB,OAAO;QACP,MAAM;QACN,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;QACpC,YAAY;QACZ,eAAe,EAAE,GAAG,CAAC,QAAQ,CAAC,eAAe;QAC7C,EAAE;KACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Per-clone state, stored at `<project>/.nestled/upgrade-log.yaml`. This is the
3
+ * same file (and the same `template.originCommit` / `lastReviewedCommit` fields)
4
+ * the private fleet upgrader already writes — we add `channel` and
5
+ * `baselineRelease` so a standalone clone can compute what it still needs.
6
+ */
7
+ export type Outcome = 'applied' | 'blocked' | 'superseded' | 'not-applicable' | 'pending-release';
8
+ /** Outcomes that mean a note should not be offered again. */
9
+ export declare const TERMINAL_OUTCOMES: ReadonlySet<Outcome>;
10
+ export interface TemplateState {
11
+ repo?: string;
12
+ /** Which channel this clone follows. Defaults to `stable`. */
13
+ channel?: string;
14
+ /** Newest release considered already-present in this clone. */
15
+ baselineRelease?: string;
16
+ /** Git URL of the template feed source. */
17
+ remote?: string;
18
+ /** Branch/ref on the template that carries the feed. */
19
+ ref?: string;
20
+ originCommit?: string;
21
+ lastReviewedCommit?: string;
22
+ }
23
+ export interface UpgradeLog {
24
+ template: TemplateState;
25
+ upgrades: Record<string, Outcome>;
26
+ }
27
+ export declare const DEFAULT_CHANNEL = "stable";
28
+ /** Version stamp committed into the template, carried by every clone. */
29
+ export interface TemplateVersionStamp {
30
+ release: string;
31
+ commit?: string;
32
+ repo?: string;
33
+ remote?: string;
34
+ ref?: string;
35
+ }
36
+ /**
37
+ * Optional per-site settings at `<project>/.nestled/config.yaml`. Everything is
38
+ * optional; sensible defaults apply when the file (or a field) is absent.
39
+ */
40
+ export interface SiteConfig {
41
+ /** Verification commands to run after applying; inferred if omitted. */
42
+ verification?: string[];
43
+ /** Subsystem tags this clone has forked; matching notes are held for review. */
44
+ forkedAreas?: string[];
45
+ /** Push the upgrade branch and open a PR after a successful apply. */
46
+ autoPR?: boolean;
47
+ /** Base branch for the PR (default: the current branch's tracking base). */
48
+ defaultBranch?: string;
49
+ template?: {
50
+ remote?: string;
51
+ ref?: string;
52
+ };
53
+ }
54
+ export declare function readSiteConfig(projectDir: string): SiteConfig;
55
+ export declare function nestledDir(projectDir: string): string;
56
+ export declare function logPathFor(projectDir: string): string;
57
+ export declare function readUpgradeLog(projectDir: string): UpgradeLog;
58
+ export declare function writeUpgradeLog(projectDir: string, log: UpgradeLog): void;
59
+ /**
60
+ * Read the version stamp that travelled with the clone. Tolerates a couple of
61
+ * filename spellings so producers aren't locked into one. Returns null if the
62
+ * clone predates the stamp (legacy adoption — caller must supply a baseline).
63
+ */
64
+ export declare function readTemplateStamp(projectDir: string): TemplateVersionStamp | null;
65
+ export interface InitBaselineOptions {
66
+ /** Explicit baseline release id; overrides the clone's stamp. */
67
+ at?: string;
68
+ channel?: string;
69
+ repo?: string;
70
+ commit?: string;
71
+ /** Git URL of the template feed source. */
72
+ remote?: string;
73
+ /** Feed branch/ref on the template. */
74
+ ref?: string;
75
+ }
76
+ /**
77
+ * Establish (or re-affirm) the baseline for a clone. Precedence for the
78
+ * baseline release: explicit `--at` > existing log > committed template stamp.
79
+ * Idempotent: re-running never lowers an existing baseline or loses history.
80
+ */
81
+ export declare function initBaseline(projectDir: string, options?: InitBaselineOptions): UpgradeLog;
82
+ /**
83
+ * Advance the baseline as far as the manifest allows: walk releases in order
84
+ * above the current baseline and move the baseline forward across each release
85
+ * whose every note has reached a terminal outcome in the log, stopping at the
86
+ * first release that still has unfinished work. Also carries `lastReviewedCommit`
87
+ * forward to the release's template commit. Mutates and returns `log`.
88
+ */
89
+ export declare function advanceBaseline(log: UpgradeLog, releasesAscending: {
90
+ id: string;
91
+ templateCommit?: string;
92
+ noteIds: string[];
93
+ }[]): UpgradeLog;