@molecule/api-deploy-rollout-fly 0.0.1-stage → 2.0.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 +13 -12
- package/dist/fly.d.ts +6 -5
- package/dist/fly.d.ts.map +1 -1
- package/dist/fly.js +8 -8
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-10-
|
|
6
|
+
Generated: 2026-10-20T12:05:18.845Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/api-deploy-rollout-fly
|
|
@@ -216,21 +216,21 @@ function parseFlyMachineList(json: string): FlyMachine[]
|
|
|
216
216
|
Validate a Machine list as a rollout target set and return what to act on.
|
|
217
217
|
|
|
218
218
|
Every Machine must be started (a stopped one cannot be reached over SSH, and its
|
|
219
|
-
patch volume would keep an older build), and all must run the SAME image
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
patch volume would keep an older build), and all must run the SAME image.
|
|
220
|
+
Configuration versions identify individual Machine instances, so a healthy
|
|
221
|
+
rolling deployment has a different version on each Machine. Preserve those
|
|
222
|
+
versions by id so callers can bind a patch to the Machine receiving it.
|
|
222
223
|
|
|
223
224
|
```typescript
|
|
224
|
-
function assertHomogeneousFlyMachines(
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
225
|
+
function assertHomogeneousFlyMachines(
|
|
226
|
+
machines: readonly FlyMachine[],
|
|
227
|
+
options?: { appName?: string },
|
|
228
|
+
): { ids: string[]; imageRef: string; machineVersions: Record<string, string> }
|
|
229
229
|
```
|
|
230
230
|
|
|
231
231
|
- `machines` — Parsed Machines.
|
|
232
232
|
|
|
233
|
-
**Returns:** The target set's ids, image ref and
|
|
233
|
+
**Returns:** The target set's ids, shared image ref and each Machine's version.
|
|
234
234
|
|
|
235
235
|
#### `listFlyMachines(options)`
|
|
236
236
|
|
|
@@ -310,7 +310,8 @@ Peer dependencies:
|
|
|
310
310
|
- **`parseFlyMachineList` is the only JSON the adapter trusts.** A Machine list
|
|
311
311
|
that is not an array is an error, never an empty set.
|
|
312
312
|
- **A mixed set is refused.** `assertHomogeneousFlyMachines` rejects Machines on
|
|
313
|
-
different images
|
|
314
|
-
|
|
313
|
+
different images. Each Machine has its own configuration version; the returned
|
|
314
|
+
`machineVersions` maps Machine ids to those versions. Bind each patch to its
|
|
315
|
+
target's version so a later image or configuration update retires it.
|
|
315
316
|
- **A restart that parks is started explicitly.** A Machine that comes back
|
|
316
317
|
`stopped`/`suspended` after a restart is started, not left parked.
|
package/dist/fly.d.ts
CHANGED
|
@@ -80,12 +80,13 @@ export declare const parseFlyMachineList: (json: string) => FlyMachine[];
|
|
|
80
80
|
* Validate a Machine list as a rollout target set and return what to act on.
|
|
81
81
|
*
|
|
82
82
|
* Every Machine must be started (a stopped one cannot be reached over SSH, and its
|
|
83
|
-
* patch volume would keep an older build), and all must run the SAME image
|
|
84
|
-
*
|
|
85
|
-
*
|
|
83
|
+
* patch volume would keep an older build), and all must run the SAME image.
|
|
84
|
+
* Configuration versions identify individual Machine instances, so a healthy
|
|
85
|
+
* rolling deployment has a different version on each Machine. Preserve those
|
|
86
|
+
* versions by id so callers can bind a patch to the Machine receiving it.
|
|
86
87
|
*
|
|
87
88
|
* @param machines - Parsed Machines.
|
|
88
|
-
* @returns The target set's ids, image ref and
|
|
89
|
+
* @returns The target set's ids, shared image ref and each Machine's version.
|
|
89
90
|
* @throws {Error} A plain, operator-readable refusal.
|
|
90
91
|
*/
|
|
91
92
|
export declare const assertHomogeneousFlyMachines: (machines: readonly FlyMachine[], options?: {
|
|
@@ -93,7 +94,7 @@ export declare const assertHomogeneousFlyMachines: (machines: readonly FlyMachin
|
|
|
93
94
|
}) => {
|
|
94
95
|
ids: string[];
|
|
95
96
|
imageRef: string;
|
|
96
|
-
|
|
97
|
+
machineVersions: Record<string, string>;
|
|
97
98
|
};
|
|
98
99
|
/** Where and how the adapter reaches one Fly app. */
|
|
99
100
|
export interface FlyMachinesOptions {
|
package/dist/fly.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fly.d.ts","sourceRoot":"","sources":["../src/fly.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,OAAO,KAAK,EACV,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EAChB,MAAM,8BAA8B,CAAA;AAErC,uDAAuD;AACvD,MAAM,WAAW,UAAW,SAAQ,eAAe;IACjD,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAA;IACb,sDAAsD;IACtD,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,qEAAqE;IACrE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB;;;;;;OAMG;IACH,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,2CAA2C;AAC3C,MAAM,WAAW,gBAAgB;IAC/B,qEAAqE;IACrE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,sBAAsB;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,8DAA8D;AAC9D,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAA;AAE5E;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,UAAS;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,KAAG,gBAiB7D,CAAA;AAED;;;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,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,EAC3E,WAAW,MAAM,KAChB,OAAO,CAAC,OAAO,CAkBjB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GACnC,SAAS,iBAAiB,KACzB,uBAAuB,CAAC,UAAU,CAqBpC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D,iEAAiE;IACjE,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;IAC9C,+DAA+D;IAC/D,SAAS,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IACpD,wDAAwD;IACxD,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC7C,uDAAuD;IACvD,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9C,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB,GACpC,SAAS,kBAAkB,KAC1B,gBAAgB,CAAC,UAAU,CA8B7B,CAAA"}
|
package/dist/fly.js
CHANGED
|
@@ -126,12 +126,13 @@ export const parseFlyMachineList = (json) => {
|
|
|
126
126
|
* Validate a Machine list as a rollout target set and return what to act on.
|
|
127
127
|
*
|
|
128
128
|
* Every Machine must be started (a stopped one cannot be reached over SSH, and its
|
|
129
|
-
* patch volume would keep an older build), and all must run the SAME image
|
|
130
|
-
*
|
|
131
|
-
*
|
|
129
|
+
* patch volume would keep an older build), and all must run the SAME image.
|
|
130
|
+
* Configuration versions identify individual Machine instances, so a healthy
|
|
131
|
+
* rolling deployment has a different version on each Machine. Preserve those
|
|
132
|
+
* versions by id so callers can bind a patch to the Machine receiving it.
|
|
132
133
|
*
|
|
133
134
|
* @param machines - Parsed Machines.
|
|
134
|
-
* @returns The target set's ids, image ref and
|
|
135
|
+
* @returns The target set's ids, shared image ref and each Machine's version.
|
|
135
136
|
* @throws {Error} A plain, operator-readable refusal.
|
|
136
137
|
*/
|
|
137
138
|
export const assertHomogeneousFlyMachines = (machines, options = {}) => {
|
|
@@ -157,16 +158,15 @@ export const assertHomogeneousFlyMachines = (machines, options = {}) => {
|
|
|
157
158
|
}
|
|
158
159
|
}
|
|
159
160
|
const imageRefs = [...new Set(machines.map((machine) => machine.imageRef))];
|
|
160
|
-
|
|
161
|
-
if (imageRefs.length > 1 || versions.length > 1) {
|
|
161
|
+
if (imageRefs.length > 1) {
|
|
162
162
|
throw new Error(`${app} Machines are running MIXED builds ` +
|
|
163
|
-
`(images: ${imageRefs.join(', ')}
|
|
163
|
+
`(images: ${imageRefs.join(', ')}) — a deploy is in ` +
|
|
164
164
|
'flight or a Machine was started separately. Wait for it to settle, then re-run.');
|
|
165
165
|
}
|
|
166
166
|
return {
|
|
167
167
|
ids: machines.map((machine) => machine.id),
|
|
168
168
|
imageRef: imageRefs[0],
|
|
169
|
-
|
|
169
|
+
machineVersions: Object.fromEntries(machines.map((machine) => [machine.id, machine.version])),
|
|
170
170
|
};
|
|
171
171
|
};
|
|
172
172
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -27,8 +27,9 @@
|
|
|
27
27
|
* - **`parseFlyMachineList` is the only JSON the adapter trusts.** A Machine list
|
|
28
28
|
* that is not an array is an error, never an empty set.
|
|
29
29
|
* - **A mixed set is refused.** `assertHomogeneousFlyMachines` rejects Machines on
|
|
30
|
-
* different images
|
|
31
|
-
*
|
|
30
|
+
* different images. Each Machine has its own configuration version; the returned
|
|
31
|
+
* `machineVersions` maps Machine ids to those versions. Bind each patch to its
|
|
32
|
+
* target's version so a later image or configuration update retires it.
|
|
32
33
|
* - **A restart that parks is started explicitly.** A Machine that comes back
|
|
33
34
|
* `stopped`/`suspended` after a restart is started, not left parked.
|
|
34
35
|
*
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,cAAc,oBAAoB,CAAA;AAClC,cAAc,UAAU,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -27,8 +27,9 @@
|
|
|
27
27
|
* - **`parseFlyMachineList` is the only JSON the adapter trusts.** A Machine list
|
|
28
28
|
* that is not an array is an error, never an empty set.
|
|
29
29
|
* - **A mixed set is refused.** `assertHomogeneousFlyMachines` rejects Machines on
|
|
30
|
-
* different images
|
|
31
|
-
*
|
|
30
|
+
* different images. Each Machine has its own configuration version; the returned
|
|
31
|
+
* `machineVersions` maps Machine ids to those versions. Bind each patch to its
|
|
32
|
+
* target's version so a later image or configuration update retires it.
|
|
32
33
|
* - **A restart that parks is started explicitly.** A Machine that comes back
|
|
33
34
|
* `stopped`/`suspended` after a restart is started, not left parked.
|
|
34
35
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/api-deploy-rollout-fly",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Fly Machines provider bond for @molecule/api-deploy-rollout: in-place restarts with a restore path and grow-then-shrink clones, over an injected flyctl runner.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@molecule/api-deploy-rollout": "^1.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@molecule/api-deploy-rollout": "1.
|
|
41
|
+
"@molecule/api-deploy-rollout": "1.1.0",
|
|
42
42
|
"@types/node": "26.1.2",
|
|
43
43
|
"typescript": "6.0.3",
|
|
44
44
|
"vitest": "4.1.11"
|