@codedrifters/configulator 0.0.277 → 0.0.278

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/lib/index.js CHANGED
@@ -3123,20 +3123,26 @@ var createPackageSkill = {
3123
3123
  " places the sub-project at `packages/<scope>/<name>`.",
3124
3124
  "",
3125
3125
  "6. **Tell the user how to synthesize.** Instruct them to run, from",
3126
- " the repo root:",
3126
+ " the repo root, the safe three-step regen sequence:",
3127
3127
  "",
3128
3128
  " ```",
3129
+ " pnpm i",
3129
3130
  " pnpm exec projen",
3130
- " pnpm install",
3131
+ " pnpm i",
3131
3132
  " ```",
3132
3133
  "",
3133
- " `pnpm exec projen` regenerates the sub-project tree;",
3134
- " `pnpm install` updates the workspace lockfile. Do **not** run",
3135
- " these commands yourself \u2014 the user runs them.",
3134
+ " The leading `pnpm i` syncs `node_modules` with `pnpm-lock.yaml`",
3135
+ " so synth runs against the right configulator/projen/plugin",
3136
+ " versions \u2014 without it, `pnpm exec projen` may synth against a",
3137
+ " stale resolved version of any pnpm-managed component and produce",
3138
+ " phantom drift in generated files. `pnpm exec projen` regenerates",
3139
+ " the sub-project tree; the trailing `pnpm i` updates the workspace",
3140
+ " lockfile to pick up any dependency changes projen wrote during",
3141
+ " synth. Do **not** run these commands yourself \u2014 the user runs them.",
3136
3142
  "",
3137
3143
  "## Guardrails",
3138
3144
  "",
3139
- "- Never run `pnpm exec projen`, `pnpm install`, `pnpm build`,",
3145
+ "- Never run `pnpm exec projen`, `pnpm install`, `pnpm i`, `pnpm build`,",
3140
3146
  " `pnpm test`, or any other package-manager, build, or test command.",
3141
3147
  " Emit the projen block and instructions only.",
3142
3148
  "- Never scaffold outside `packages/`. Deployable apps belong under",
@@ -3246,20 +3252,26 @@ var createAppSkill = {
3246
3252
  " sub-project at `apps/<scope>/<name>`.",
3247
3253
  "",
3248
3254
  "6. **Tell the user how to synthesize.** Instruct them to run, from",
3249
- " the repo root:",
3255
+ " the repo root, the safe three-step regen sequence:",
3250
3256
  "",
3251
3257
  " ```",
3258
+ " pnpm i",
3252
3259
  " pnpm exec projen",
3253
- " pnpm install",
3260
+ " pnpm i",
3254
3261
  " ```",
3255
3262
  "",
3256
- " `pnpm exec projen` regenerates the sub-project tree;",
3257
- " `pnpm install` updates the workspace lockfile. Do **not** run",
3258
- " these commands yourself \u2014 the user runs them.",
3263
+ " The leading `pnpm i` syncs `node_modules` with `pnpm-lock.yaml`",
3264
+ " so synth runs against the right configulator/projen/plugin",
3265
+ " versions \u2014 without it, `pnpm exec projen` may synth against a",
3266
+ " stale resolved version of any pnpm-managed component and produce",
3267
+ " phantom drift in generated files. `pnpm exec projen` regenerates",
3268
+ " the sub-project tree; the trailing `pnpm i` updates the workspace",
3269
+ " lockfile to pick up any dependency changes projen wrote during",
3270
+ " synth. Do **not** run these commands yourself \u2014 the user runs them.",
3259
3271
  "",
3260
3272
  "## Guardrails",
3261
3273
  "",
3262
- "- Never run `pnpm exec projen`, `pnpm install`, `pnpm build`,",
3274
+ "- Never run `pnpm exec projen`, `pnpm install`, `pnpm i`, `pnpm build`,",
3263
3275
  " `pnpm test`, or any other package-manager, build, or test command.",
3264
3276
  " Emit the projen block and instructions only.",
3265
3277
  "- Never scaffold outside `apps/`. Shared libraries belong under",
@@ -3405,20 +3417,26 @@ var createSiteSkill = {
3405
3417
  " `sites/<scope>/<name>`.",
3406
3418
  "",
3407
3419
  "6. **Tell the user how to synthesize.** Instruct them to run, from",
3408
- " the repo root:",
3420
+ " the repo root, the safe three-step regen sequence:",
3409
3421
  "",
3410
3422
  " ```",
3423
+ " pnpm i",
3411
3424
  " pnpm exec projen",
3412
- " pnpm install",
3425
+ " pnpm i",
3413
3426
  " ```",
3414
3427
  "",
3415
- " `pnpm exec projen` regenerates the sub-project tree;",
3416
- " `pnpm install` updates the workspace lockfile. Do **not** run",
3417
- " these commands yourself \u2014 the user runs them.",
3428
+ " The leading `pnpm i` syncs `node_modules` with `pnpm-lock.yaml`",
3429
+ " so synth runs against the right configulator/projen/plugin",
3430
+ " versions \u2014 without it, `pnpm exec projen` may synth against a",
3431
+ " stale resolved version of any pnpm-managed component and produce",
3432
+ " phantom drift in generated files. `pnpm exec projen` regenerates",
3433
+ " the sub-project tree; the trailing `pnpm i` updates the workspace",
3434
+ " lockfile to pick up any dependency changes projen wrote during",
3435
+ " synth. Do **not** run these commands yourself \u2014 the user runs them.",
3418
3436
  "",
3419
3437
  "## Guardrails",
3420
3438
  "",
3421
- "- Never run `pnpm exec projen`, `pnpm install`, `pnpm build`,",
3439
+ "- Never run `pnpm exec projen`, `pnpm install`, `pnpm i`, `pnpm build`,",
3422
3440
  " `pnpm test`, or any other package-manager, build, or test command.",
3423
3441
  " Emit the projen block and instructions only.",
3424
3442
  "- Never scaffold the monorepo-wide docs site under `sites/`. The",
@@ -3522,7 +3540,7 @@ function buildBaseBundle(paths = DEFAULT_AGENT_PATHS) {
3522
3540
  "## Important Notes",
3523
3541
  "",
3524
3542
  "- **Never edit generated files** \u2014 they are marked with `// ~~ Generated by projen`",
3525
- "- **After modifying Projen configuration**, run `pnpm exec projen` to regenerate files, then `pnpm install` to update the lockfile.",
3543
+ "- **After modifying Projen configuration**, run the three-step regen sequence: `pnpm i`, then `pnpm exec projen`, then `pnpm i` again. The leading `pnpm i` syncs `node_modules` with the lockfile so synth runs against the right configulator/projen/plugin versions; the trailing `pnpm i` refreshes the lockfile to match anything projen rewrote in `package.json`.",
3526
3544
  "- **Configure dependencies through Projen** \u2014 never use `npm install`, `pnpm add`, or `yarn add`. Add them to `deps` or `devDeps` in Projen config.",
3527
3545
  "- **Export from index.ts** to maintain clean public APIs",
3528
3546
  "",
@@ -3581,7 +3599,7 @@ function buildBaseBundle(paths = DEFAULT_AGENT_PATHS) {
3581
3599
  "",
3582
3600
  "After making changes that need validation, tell the user the specific commands to run:",
3583
3601
  "",
3584
- "1. **After projen config changes** \u2014 tell the user to run `pnpm exec projen && pnpm install`",
3602
+ "1. **After projen config changes** \u2014 tell the user to run the three-step regen sequence: `pnpm i && pnpm exec projen && pnpm i`",
3585
3603
  "2. **After source code changes** \u2014 tell the user to run `pnpm --filter @codedrifters/<package> test`",
3586
3604
  "3. **After multi-package changes** \u2014 tell the user to run `pnpm build:all`"
3587
3605
  ].join("\n"),
@@ -9357,7 +9375,7 @@ var githubWorkflowBundle = {
9357
9375
  "",
9358
9376
  "When the user says **open a PR** (or similar), follow these steps exactly:",
9359
9377
  "",
9360
- "1. **Regenerate project files** \u2014 run `pnpm exec projen` then `pnpm install` to ensure all generated files are up to date. Check `git diff` \u2014 if there are changes, commit them before proceeding.",
9378
+ "1. **Regenerate project files** \u2014 run the three-step regen sequence (`pnpm i`, then `pnpm exec projen`, then `pnpm i` again) to ensure all generated files are up to date. The leading `pnpm i` is required because `pnpm exec projen` synthesises against whatever version of configulator (and projen, and any projen plugins) is currently resolved in `node_modules`; if the lockfile has moved past `node_modules` (typically right after `git pull` lands a dependency upgrade, or on a fresh checkout), synth runs against stale templates and produces phantom drift in `.claude/`, `.github/labels.yml`, `CLAUDE.md`, and other generated files. The trailing `pnpm i` picks up any dependency changes projen wrote into `package.json` during synth. Check `git diff` after the third step \u2014 if there are changes, commit them before proceeding.",
9361
9379
  "2. **Run the full monorepo build** \u2014 run `pnpm build:all` to compile, lint, and test all packages (mirrors the CI pipeline). This command requires the user to be authenticated to AWS on the prod account used for Turborepo remote caching (`readonlyaccess-prod-525259625215-us-east-1` profile). If the command fails due to AWS credentials, ask the user to authenticate first. If the build produces changes to turbo inputs (typically snapshot files or ESLint auto-fixes), commit those changes and run `pnpm build:all` again \u2014 the build must complete cleanly with no uncommitted changes.",
9362
9380
  "3. **Check for uncommitted changes** \u2014 if any exist, commit them with a conventional commit message",
9363
9381
  "4. **Pull and rebase from the default branch** \u2014 run `git pull origin {{repository.defaultBranch}} --rebase` to incorporate the latest changes and resolve any conflicts before pushing",
@@ -14055,7 +14073,7 @@ var issueWorkerSubAgent = {
14055
14073
  "",
14056
14074
  "Run the appropriate verification commands depending on what changed:",
14057
14075
  "",
14058
- "1. If Projen config was changed: `pnpm exec projen && pnpm install`",
14076
+ "1. If Projen config was changed: run the three-step regen sequence `pnpm i && pnpm exec projen && pnpm i` (leading `pnpm i` syncs `node_modules` with the lockfile so synth runs against the right configulator/projen/plugin versions; trailing `pnpm i` refreshes the lockfile after synth)",
14059
14077
  "2. Compile the affected package: `pnpm --filter @codedrifters/<package> compile`",
14060
14078
  "3. Test the affected package: `pnpm --filter @codedrifters/<package> test`",
14061
14079
  "4. If changes span multiple packages: `pnpm build:all`",
@@ -15346,7 +15364,7 @@ var pnpmBundle = {
15346
15364
  "- Configure dependencies in Projen configuration files (`.projenrc.ts` or `projenrc/*.ts`)",
15347
15365
  "- Add dependencies to `deps`, `devDeps`, or `peerDeps` arrays in project configuration",
15348
15366
  '- Use catalog dependencies when available (e.g., `"aws-cdk-lib@catalog:"`)',
15349
- "- Ask the user to run `pnpm exec projen` and `pnpm install` after updating dependency configuration",
15367
+ "- Ask the user to run the three-step regen sequence after updating dependency configuration: `pnpm i`, then `pnpm exec projen`, then `pnpm i` again. The leading `pnpm i` syncs `node_modules` with the lockfile so synth runs against the right configulator/projen/plugin versions; the trailing `pnpm i` picks up any dependency changes projen wrote during synth.",
15350
15368
  "",
15351
15369
  "**DO NOT:**",
15352
15370
  "- Run `npm install some-package`",
@@ -16783,14 +16801,19 @@ var projenBundle = {
16783
16801
  "",
16784
16802
  "## Synthesizing Projen Configuration",
16785
16803
  "",
16786
- "After modifying any file in `projenrc/` or `.projenrc.ts`, regenerate project files:",
16804
+ "After modifying any file in `projenrc/` or `.projenrc.ts`, regenerate project files using the safe three-step sequence:",
16787
16805
  "",
16788
16806
  "```sh",
16807
+ "pnpm i",
16789
16808
  "pnpm exec projen",
16790
- "pnpm install",
16809
+ "pnpm i",
16791
16810
  "```",
16792
16811
  "",
16793
- "Both steps are required \u2014 `pnpm exec projen` regenerates files, `pnpm install` updates the lockfile to match.",
16812
+ "All three steps are required:",
16813
+ "",
16814
+ "1. The leading `pnpm i` guarantees `node_modules` matches `pnpm-lock.yaml` before synth. Without this step, `pnpm exec projen` may synth against a stale version of any pnpm-resolved component (configulator itself, projen, or any plugin) that the lockfile has already moved past \u2014 most commonly right after `git pull` updates the lockfile or on a fresh checkout. The result is phantom drift in `.claude/`, `.github/labels.yml`, `CLAUDE.md`, and other configulator-generated files that looks like a real bundle change but vanishes after running `pnpm i`.",
16815
+ "2. `pnpm exec projen` regenerates files against the now-synced templates.",
16816
+ "3. The trailing `pnpm i` picks up any dependency changes projen wrote into `package.json` during the synth pass and refreshes the lockfile.",
16794
16817
  "",
16795
16818
  "## Building",
16796
16819
  "",
@@ -16871,7 +16894,7 @@ var projenBundle = {
16871
16894
  "After finishing implementation work, validate that changes are correct by running the appropriate commands depending on what was changed:",
16872
16895
  "",
16873
16896
  "1. **Projen config changes** (`projenrc/`, `.projenrc.ts`):",
16874
- " - Run `pnpm exec projen` then `pnpm install`",
16897
+ " - Run the three-step regen sequence: `pnpm i`, then `pnpm exec projen`, then `pnpm i` again",
16875
16898
  " - Verify no unexpected generated file changes with `git diff`",
16876
16899
  "",
16877
16900
  "2. **Source code changes** (in a sub-package):",
@@ -16888,8 +16911,8 @@ var projenBundle = {
16888
16911
  "",
16889
16912
  "| Task | Command |",
16890
16913
  "|------|---------|",
16891
- "| Synthesize projen | `pnpm exec projen` |",
16892
- "| Install deps | `pnpm install` |",
16914
+ "| Regenerate projen configuration | `pnpm i && pnpm exec projen && pnpm i` |",
16915
+ "| Install deps | `pnpm i` |",
16893
16916
  "| Full monorepo build | `pnpm build:all` |",
16894
16917
  "| Root build only | `pnpm build` |",
16895
16918
  "| Compile one package | `pnpm --filter @codedrifters/<pkg> compile` |",
@@ -16947,7 +16970,7 @@ var projenBundle = {
16947
16970
  "",
16948
16971
  "## After Any Change",
16949
16972
  "",
16950
- "Run `pnpm exec projen` then `pnpm install` to regenerate the output files."
16973
+ "Run the three-step regen sequence to regenerate the output files: `pnpm i`, then `pnpm exec projen`, then `pnpm i` again. The leading `pnpm i` syncs `node_modules` with the lockfile before synth so `pnpm exec projen` runs against the right configulator/projen/plugin versions; the trailing `pnpm i` refreshes the lockfile for any dependency changes projen made during synth."
16951
16974
  ].join("\n"),
16952
16975
  tags: ["workflow"]
16953
16976
  },
@@ -16965,7 +16988,7 @@ var projenBundle = {
16965
16988
  "- Edit Projen configuration in:",
16966
16989
  " - `.projenrc.ts` (root)",
16967
16990
  " - `projenrc/*.ts` (package-specific)",
16968
- "- After making Projen changes, run `pnpm exec projen` to synthesize",
16991
+ "- After making Projen changes, run the three-step regen sequence: `pnpm i`, `pnpm exec projen`, `pnpm i`. The leading `pnpm i` ensures `node_modules` matches the lockfile so synth runs against the right configulator/projen/plugin versions; without it, synth can produce phantom drift in generated files. The trailing `pnpm i` picks up dependency changes projen wrote during synth.",
16969
16992
  "",
16970
16993
  "## Workspace Dependencies",
16971
16994
  "",