@molecule/api-code-sandbox-flyio 1.0.17 → 1.0.18

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.
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,EAUV,eAAe,EAEhB,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,YAAY,EAAgC,MAAM,UAAU,CAAA;AAsBrE,OAAO,EAAmD,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAEhG,OAAO,KAAK,EAEV,WAAW,EAUZ,MAAM,YAAY,CAAA;AAm6DnB;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,MAAM,CAAC,EAAE,WAAW,EACpB,MAAM,CAAC,EAAE,YAAY,EACrB,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,GACzB,eAAe,CAEjB"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,EAUV,eAAe,EAEhB,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,YAAY,EAAgC,MAAM,UAAU,CAAA;AAsBrE,OAAO,EAAmD,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAEhG,OAAO,KAAK,EAEV,WAAW,EAUZ,MAAM,YAAY,CAAA;AAw6DnB;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC5B,MAAM,CAAC,EAAE,WAAW,EACpB,MAAM,CAAC,EAAE,YAAY,EACrB,KAAK,CAAC,EAAE,WAAW,GAAG,IAAI,GACzB,eAAe,CAEjB"}
package/dist/provider.js CHANGED
@@ -819,7 +819,12 @@ class FlyioSandboxProvider {
819
819
  ? Math.max(1, Math.ceil(config.resources.diskMB / 1024))
820
820
  : (this.config.defaultVolumeGB ?? DEFAULT_VOLUME_GB);
821
821
  const volumeId = await this.ensureVolume(app, config.volumeName, sizeGB);
822
- machineConfig.mounts = [{ volume: volumeId, path: WORKSPACE_PATH }];
822
+ // The caller may scope the volume to a subtree (e.g. /workspace/<appDir>)
823
+ // so regenerable tooling (node_modules) stays on the fast image-backed
824
+ // rootfs and only durable state pays the volume's small-file IO cost.
825
+ machineConfig.mounts = [
826
+ { volume: volumeId, path: config.volumeMountPath ?? WORKSPACE_PATH },
827
+ ];
823
828
  }
824
829
  const service = this.previewService();
825
830
  if (service)
@@ -36,9 +36,11 @@
36
36
  * ## What the base image already gives you, and what this adds
37
37
  *
38
38
  * The base image (`registry.fly.io/molecule-sandbox:latest`) already carries the
39
- * toolchain and a warmed npm cache, so this is NOT about installing Node. It is
40
- * about the per-configuration layer — the scaffold plus its `node_modules` — which
41
- * otherwise gets rebuilt on every single boot.
39
+ * toolchain, a warmed npm cache, AND the package superset on the rootfs, so this
40
+ * is NOT about installing anything. It is about the per-configuration layer —
41
+ * the scaffolded SOURCE — which otherwise gets regenerated on every single boot.
42
+ * `node_modules` is deliberately excluded from capture (see the capture command)
43
+ * because the image provides it.
42
44
  *
43
45
  * ## The tenant boundary is the RESTORE, not the capture
44
46
  *
@@ -1 +1 @@
1
- {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,UAAU,EACV,oBAAoB,EACpB,eAAe,EAChB,MAAM,4BAA4B,CAAA;AAGnC,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAwB7D;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,QAAyB,CAAA;AAEvD,0EAA0E;AAC1E,eAAO,MAAM,2BAA2B,SAAU,CAAA;AAElD,uEAAuE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GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,eAAe,CAAC,CAsH1B;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B5F;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,eAAe,EACpB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAKjB;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAU1F"}
package/dist/templates.js CHANGED
@@ -36,9 +36,11 @@
36
36
  * ## What the base image already gives you, and what this adds
37
37
  *
38
38
  * The base image (`registry.fly.io/molecule-sandbox:latest`) already carries the
39
- * toolchain and a warmed npm cache, so this is NOT about installing Node. It is
40
- * about the per-configuration layer — the scaffold plus its `node_modules` — which
41
- * otherwise gets rebuilt on every single boot.
39
+ * toolchain, a warmed npm cache, AND the package superset on the rootfs, so this
40
+ * is NOT about installing anything. It is about the per-configuration layer —
41
+ * the scaffolded SOURCE — which otherwise gets regenerated on every single boot.
42
+ * `node_modules` is deliberately excluded from capture (see the capture command)
43
+ * because the image provides it.
42
44
  *
43
45
  * ## The tenant boundary is the RESTORE, not the capture
44
46
  *
@@ -245,7 +247,13 @@ export function buildCaptureCommand(paths, url, maxBytes) {
245
247
  // emit any archive it likes — but they mean a template captured from an
246
248
  // honest sandbox never even contains the bits, and the restore's own mask
247
249
  // and post-extraction assertion are what actually enforce it.
248
- `tar -C / --numeric-owner --owner=0 --group=0 --mode='a-s' -czf "$archive" ${members} || tar_rc=$?`,
250
+ // node_modules is EXCLUDED by design: the sandbox image bakes the package
251
+ // superset on the rootfs (with /workspace/node_modules resolving into it),
252
+ // so a template only needs the per-configuration layer — the scaffolded
253
+ // source — and a template restored onto any machine finds its packages
254
+ // already provided by the image. Capturing node_modules would multiply the
255
+ // archive by the whole superset (~GBs) and routinely trip maxArchiveBytes.
256
+ `tar -C / --numeric-owner --owner=0 --group=0 --mode='a-s' --exclude='node_modules' -czf "$archive" ${members} || tar_rc=$?`,
249
257
  // GNU tar exits 1 for "some files differ" — the normal outcome of archiving
250
258
  // a live workspace whose dev server is still writing. That is tolerated and
251
259
  // reported; 2 and above are real failures.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/api-code-sandbox-flyio",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "Fly.io Machines (Firecracker microVM) code sandbox provider",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -31,7 +31,7 @@
31
31
  "license": "Apache-2.0",
32
32
  "devDependencies": {
33
33
  "@molecule/api-bond": "1.0.1",
34
- "@molecule/api-code-sandbox": "1.0.2",
34
+ "@molecule/api-code-sandbox": "1.0.3",
35
35
  "@types/node": "26.1.2",
36
36
  "typescript": "6.0.3",
37
37
  "vitest": "4.1.10"