@3sln/create-trove 0.0.16 → 0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3sln/create-trove",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "type": "module",
5
5
  "description": "Scaffold a Trove deployment — Bun, Node, or Cloudflare Workers — with the bindings, environment and secrets each one needs.",
6
6
  "repository": {
package/src/plan.js CHANGED
@@ -348,7 +348,7 @@ export async function askPlan(prompter, { name, version, runtime: preset, genera
348
348
  */
349
349
  async function askWorkers(prompter, { embeddingDim }) {
350
350
  const w = {
351
- d1: null, pluginDb: null, vectorize: null, ai: false, tasks: true,
351
+ d1: null, pluginDb: null, vectorize: null, ai: false, tasks: true, workerLoader: false,
352
352
  // nodejs_compat v2 needs 2024-09-23 or later; that exact floor was also the hardcoded
353
353
  // value, which made it two years stale on the day it shipped.
354
354
  compatibilityDate: '2026-07-01',
@@ -369,6 +369,19 @@ async function askWorkers(prompter, { embeddingDim }) {
369
369
  }
370
370
  }
371
371
 
372
+ // Default TRUE. Dynamic Workers reached open beta in March 2026 and is available to
373
+ // everyone on the Workers Paid plan — which a drive already needs for D1 and Durable
374
+ // Objects — so the binding is the ordinary case rather than the exotic one. Still a
375
+ // question, because it is the difference between "plugin indexers run" and "plugin
376
+ // indexers are skipped and the drive raises an issue saying so".
377
+ w.workerLoader = await prompter.confirm(
378
+ ' Bind a Worker Loader so plugin indexers can run?',
379
+ { key: 'workers.loader.enabled', default: true,
380
+ hint: 'without it, plugin indexers are skipped — a plugin still installs and its '
381
+ + 'viewers work, but nothing it would have contributed to search appears. '
382
+ + 'Needs the Workers Paid plan; works in `wrangler dev` regardless' },
383
+ );
384
+
372
385
  if (await prompter.section('Vectorize (semantic search)', { key: 'workers.vectorize.enabled',
373
386
  blurb: 'sqlite-vec is a native artifact and cannot load here, so semantic search needs Vectorize.',
374
387
  })) {
package/src/render.js CHANGED
@@ -434,6 +434,33 @@ function wranglerToml(plan) {
434
434
  L.push('');
435
435
  }
436
436
 
437
+ // Where PLUGIN INDEXERS run. A plugin's indexer is somebody else's code executing on
438
+ // the server, and a Worker cannot simply import it: the in-process runner loads code
439
+ // through a `data:` URL, which workerd refuses outright — so without this binding every
440
+ // plugin indexer fails on every file. (It used to fail silently; a deployment that
441
+ // cannot run them now skips them and raises an issue saying so.)
442
+ //
443
+ // A Worker Loader gives that code a real isolate with no bindings and no network beyond
444
+ // the one presigned URL the host hands it. Open beta since March 2026 on the Workers
445
+ // Paid plan — which a drive already needs for D1 and Durable Objects — and it works in
446
+ // `wrangler dev` on any plan.
447
+ //
448
+ // Billing is per unique Worker LOADED per day, not per file indexed: the loader is keyed
449
+ // by package digest, so a plugin costs one load a day however many files it walks.
450
+ if (w?.workerLoader) {
451
+ L.push('# Isolates for plugin indexers. See "Server indexers" in the README.');
452
+ L.push('[[worker_loaders]]');
453
+ L.push('binding = "LOADER"');
454
+ L.push('');
455
+ } else {
456
+ L.push('# [[worker_loaders]] # plugin indexers run in isolates loaded through this.');
457
+ L.push('# binding = "LOADER" # Needs the Workers Paid plan; works in `wrangler dev`');
458
+ L.push('# # on any plan. Without it a plugin that ships a server');
459
+ L.push('# # indexer still installs and its viewers work, but its');
460
+ L.push('# # indexers are skipped and the drive raises an issue.');
461
+ L.push('');
462
+ }
463
+
437
464
  if (w?.vectorize) {
438
465
  L.push('[[vectorize]]');
439
466
  L.push('binding = "VECTORIZE"');