@3sln/create-trove 0.0.4 → 0.0.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/render.js +9 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3sln/create-trove",
3
- "version": "0.0.4",
3
+ "version": "0.0.7",
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/render.js CHANGED
@@ -213,6 +213,11 @@ export { default, TroveTasks } from '@3sln/trove/server/adapters/worker.js';
213
213
  path: '.dev.vars',
214
214
  contents: devVarsExample(plan, { localS3, bucket, withSecrets: true }),
215
215
  });
216
+ // Recorded here rather than worked out again by the README, which is how this went
217
+ // wrong: the condition was duplicated, a generated VAPID pair was added to one copy
218
+ // and not the other, and the README then told people to copy the example over a
219
+ // .dev.vars that already held the only copy of a key.
220
+ plan.wroteDevVars = true;
216
221
  }
217
222
 
218
223
  steps.push({ cmd: `${enter(plan)}npm install`, why: 'wrangler, and @3sln/trove for the app assets' });
@@ -522,10 +527,10 @@ function readme(plan, steps) {
522
527
  const localS3 = plan.sections.flatMap((s) => s.entries)
523
528
  .some((e) => e.key === 'TROVE_STORAGE' && e.value === 's3' && !e.commented);
524
529
 
525
- // A generated `.dev.vars` holds the credentials that were just answered; telling
526
- // someone to copy the example over it would throw them away on the first read of
527
- // this file.
528
- const hasDevVars = plan.sections.flatMap((s) => s.entries).some((e) => e.secret && isSet(e));
530
+ // Set by renderWorkers when it actually wrote the file. A .dev.vars can hold an
531
+ // answered credential or a generated key pair, and either way `cp` over it destroys
532
+ // something — for the key pair, the only copy that exists.
533
+ const hasDevVars = plan.wroteDevVars;
529
534
 
530
535
  L.push('## Local development');
531
536
  L.push('');