@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.mjs CHANGED
@@ -2867,20 +2867,26 @@ var createPackageSkill = {
2867
2867
  " places the sub-project at `packages/<scope>/<name>`.",
2868
2868
  "",
2869
2869
  "6. **Tell the user how to synthesize.** Instruct them to run, from",
2870
- " the repo root:",
2870
+ " the repo root, the safe three-step regen sequence:",
2871
2871
  "",
2872
2872
  " ```",
2873
+ " pnpm i",
2873
2874
  " pnpm exec projen",
2874
- " pnpm install",
2875
+ " pnpm i",
2875
2876
  " ```",
2876
2877
  "",
2877
- " `pnpm exec projen` regenerates the sub-project tree;",
2878
- " `pnpm install` updates the workspace lockfile. Do **not** run",
2879
- " these commands yourself \u2014 the user runs them.",
2878
+ " The leading `pnpm i` syncs `node_modules` with `pnpm-lock.yaml`",
2879
+ " so synth runs against the right configulator/projen/plugin",
2880
+ " versions \u2014 without it, `pnpm exec projen` may synth against a",
2881
+ " stale resolved version of any pnpm-managed component and produce",
2882
+ " phantom drift in generated files. `pnpm exec projen` regenerates",
2883
+ " the sub-project tree; the trailing `pnpm i` updates the workspace",
2884
+ " lockfile to pick up any dependency changes projen wrote during",
2885
+ " synth. Do **not** run these commands yourself \u2014 the user runs them.",
2880
2886
  "",
2881
2887
  "## Guardrails",
2882
2888
  "",
2883
- "- Never run `pnpm exec projen`, `pnpm install`, `pnpm build`,",
2889
+ "- Never run `pnpm exec projen`, `pnpm install`, `pnpm i`, `pnpm build`,",
2884
2890
  " `pnpm test`, or any other package-manager, build, or test command.",
2885
2891
  " Emit the projen block and instructions only.",
2886
2892
  "- Never scaffold outside `packages/`. Deployable apps belong under",
@@ -2990,20 +2996,26 @@ var createAppSkill = {
2990
2996
  " sub-project at `apps/<scope>/<name>`.",
2991
2997
  "",
2992
2998
  "6. **Tell the user how to synthesize.** Instruct them to run, from",
2993
- " the repo root:",
2999
+ " the repo root, the safe three-step regen sequence:",
2994
3000
  "",
2995
3001
  " ```",
3002
+ " pnpm i",
2996
3003
  " pnpm exec projen",
2997
- " pnpm install",
3004
+ " pnpm i",
2998
3005
  " ```",
2999
3006
  "",
3000
- " `pnpm exec projen` regenerates the sub-project tree;",
3001
- " `pnpm install` updates the workspace lockfile. Do **not** run",
3002
- " these commands yourself \u2014 the user runs them.",
3007
+ " The leading `pnpm i` syncs `node_modules` with `pnpm-lock.yaml`",
3008
+ " so synth runs against the right configulator/projen/plugin",
3009
+ " versions \u2014 without it, `pnpm exec projen` may synth against a",
3010
+ " stale resolved version of any pnpm-managed component and produce",
3011
+ " phantom drift in generated files. `pnpm exec projen` regenerates",
3012
+ " the sub-project tree; the trailing `pnpm i` updates the workspace",
3013
+ " lockfile to pick up any dependency changes projen wrote during",
3014
+ " synth. Do **not** run these commands yourself \u2014 the user runs them.",
3003
3015
  "",
3004
3016
  "## Guardrails",
3005
3017
  "",
3006
- "- Never run `pnpm exec projen`, `pnpm install`, `pnpm build`,",
3018
+ "- Never run `pnpm exec projen`, `pnpm install`, `pnpm i`, `pnpm build`,",
3007
3019
  " `pnpm test`, or any other package-manager, build, or test command.",
3008
3020
  " Emit the projen block and instructions only.",
3009
3021
  "- Never scaffold outside `apps/`. Shared libraries belong under",
@@ -3149,20 +3161,26 @@ var createSiteSkill = {
3149
3161
  " `sites/<scope>/<name>`.",
3150
3162
  "",
3151
3163
  "6. **Tell the user how to synthesize.** Instruct them to run, from",
3152
- " the repo root:",
3164
+ " the repo root, the safe three-step regen sequence:",
3153
3165
  "",
3154
3166
  " ```",
3167
+ " pnpm i",
3155
3168
  " pnpm exec projen",
3156
- " pnpm install",
3169
+ " pnpm i",
3157
3170
  " ```",
3158
3171
  "",
3159
- " `pnpm exec projen` regenerates the sub-project tree;",
3160
- " `pnpm install` updates the workspace lockfile. Do **not** run",
3161
- " these commands yourself \u2014 the user runs them.",
3172
+ " The leading `pnpm i` syncs `node_modules` with `pnpm-lock.yaml`",
3173
+ " so synth runs against the right configulator/projen/plugin",
3174
+ " versions \u2014 without it, `pnpm exec projen` may synth against a",
3175
+ " stale resolved version of any pnpm-managed component and produce",
3176
+ " phantom drift in generated files. `pnpm exec projen` regenerates",
3177
+ " the sub-project tree; the trailing `pnpm i` updates the workspace",
3178
+ " lockfile to pick up any dependency changes projen wrote during",
3179
+ " synth. Do **not** run these commands yourself \u2014 the user runs them.",
3162
3180
  "",
3163
3181
  "## Guardrails",
3164
3182
  "",
3165
- "- Never run `pnpm exec projen`, `pnpm install`, `pnpm build`,",
3183
+ "- Never run `pnpm exec projen`, `pnpm install`, `pnpm i`, `pnpm build`,",
3166
3184
  " `pnpm test`, or any other package-manager, build, or test command.",
3167
3185
  " Emit the projen block and instructions only.",
3168
3186
  "- Never scaffold the monorepo-wide docs site under `sites/`. The",
@@ -3266,7 +3284,7 @@ function buildBaseBundle(paths = DEFAULT_AGENT_PATHS) {
3266
3284
  "## Important Notes",
3267
3285
  "",
3268
3286
  "- **Never edit generated files** \u2014 they are marked with `// ~~ Generated by projen`",
3269
- "- **After modifying Projen configuration**, run `pnpm exec projen` to regenerate files, then `pnpm install` to update the lockfile.",
3287
+ "- **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`.",
3270
3288
  "- **Configure dependencies through Projen** \u2014 never use `npm install`, `pnpm add`, or `yarn add`. Add them to `deps` or `devDeps` in Projen config.",
3271
3289
  "- **Export from index.ts** to maintain clean public APIs",
3272
3290
  "",
@@ -3325,7 +3343,7 @@ function buildBaseBundle(paths = DEFAULT_AGENT_PATHS) {
3325
3343
  "",
3326
3344
  "After making changes that need validation, tell the user the specific commands to run:",
3327
3345
  "",
3328
- "1. **After projen config changes** \u2014 tell the user to run `pnpm exec projen && pnpm install`",
3346
+ "1. **After projen config changes** \u2014 tell the user to run the three-step regen sequence: `pnpm i && pnpm exec projen && pnpm i`",
3329
3347
  "2. **After source code changes** \u2014 tell the user to run `pnpm --filter @codedrifters/<package> test`",
3330
3348
  "3. **After multi-package changes** \u2014 tell the user to run `pnpm build:all`"
3331
3349
  ].join("\n"),
@@ -9101,7 +9119,7 @@ var githubWorkflowBundle = {
9101
9119
  "",
9102
9120
  "When the user says **open a PR** (or similar), follow these steps exactly:",
9103
9121
  "",
9104
- "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.",
9122
+ "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.",
9105
9123
  "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.",
9106
9124
  "3. **Check for uncommitted changes** \u2014 if any exist, commit them with a conventional commit message",
9107
9125
  "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",
@@ -13799,7 +13817,7 @@ var issueWorkerSubAgent = {
13799
13817
  "",
13800
13818
  "Run the appropriate verification commands depending on what changed:",
13801
13819
  "",
13802
- "1. If Projen config was changed: `pnpm exec projen && pnpm install`",
13820
+ "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)",
13803
13821
  "2. Compile the affected package: `pnpm --filter @codedrifters/<package> compile`",
13804
13822
  "3. Test the affected package: `pnpm --filter @codedrifters/<package> test`",
13805
13823
  "4. If changes span multiple packages: `pnpm build:all`",
@@ -15090,7 +15108,7 @@ var pnpmBundle = {
15090
15108
  "- Configure dependencies in Projen configuration files (`.projenrc.ts` or `projenrc/*.ts`)",
15091
15109
  "- Add dependencies to `deps`, `devDeps`, or `peerDeps` arrays in project configuration",
15092
15110
  '- Use catalog dependencies when available (e.g., `"aws-cdk-lib@catalog:"`)',
15093
- "- Ask the user to run `pnpm exec projen` and `pnpm install` after updating dependency configuration",
15111
+ "- 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.",
15094
15112
  "",
15095
15113
  "**DO NOT:**",
15096
15114
  "- Run `npm install some-package`",
@@ -16527,14 +16545,19 @@ var projenBundle = {
16527
16545
  "",
16528
16546
  "## Synthesizing Projen Configuration",
16529
16547
  "",
16530
- "After modifying any file in `projenrc/` or `.projenrc.ts`, regenerate project files:",
16548
+ "After modifying any file in `projenrc/` or `.projenrc.ts`, regenerate project files using the safe three-step sequence:",
16531
16549
  "",
16532
16550
  "```sh",
16551
+ "pnpm i",
16533
16552
  "pnpm exec projen",
16534
- "pnpm install",
16553
+ "pnpm i",
16535
16554
  "```",
16536
16555
  "",
16537
- "Both steps are required \u2014 `pnpm exec projen` regenerates files, `pnpm install` updates the lockfile to match.",
16556
+ "All three steps are required:",
16557
+ "",
16558
+ "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`.",
16559
+ "2. `pnpm exec projen` regenerates files against the now-synced templates.",
16560
+ "3. The trailing `pnpm i` picks up any dependency changes projen wrote into `package.json` during the synth pass and refreshes the lockfile.",
16538
16561
  "",
16539
16562
  "## Building",
16540
16563
  "",
@@ -16615,7 +16638,7 @@ var projenBundle = {
16615
16638
  "After finishing implementation work, validate that changes are correct by running the appropriate commands depending on what was changed:",
16616
16639
  "",
16617
16640
  "1. **Projen config changes** (`projenrc/`, `.projenrc.ts`):",
16618
- " - Run `pnpm exec projen` then `pnpm install`",
16641
+ " - Run the three-step regen sequence: `pnpm i`, then `pnpm exec projen`, then `pnpm i` again",
16619
16642
  " - Verify no unexpected generated file changes with `git diff`",
16620
16643
  "",
16621
16644
  "2. **Source code changes** (in a sub-package):",
@@ -16632,8 +16655,8 @@ var projenBundle = {
16632
16655
  "",
16633
16656
  "| Task | Command |",
16634
16657
  "|------|---------|",
16635
- "| Synthesize projen | `pnpm exec projen` |",
16636
- "| Install deps | `pnpm install` |",
16658
+ "| Regenerate projen configuration | `pnpm i && pnpm exec projen && pnpm i` |",
16659
+ "| Install deps | `pnpm i` |",
16637
16660
  "| Full monorepo build | `pnpm build:all` |",
16638
16661
  "| Root build only | `pnpm build` |",
16639
16662
  "| Compile one package | `pnpm --filter @codedrifters/<pkg> compile` |",
@@ -16691,7 +16714,7 @@ var projenBundle = {
16691
16714
  "",
16692
16715
  "## After Any Change",
16693
16716
  "",
16694
- "Run `pnpm exec projen` then `pnpm install` to regenerate the output files."
16717
+ "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."
16695
16718
  ].join("\n"),
16696
16719
  tags: ["workflow"]
16697
16720
  },
@@ -16709,7 +16732,7 @@ var projenBundle = {
16709
16732
  "- Edit Projen configuration in:",
16710
16733
  " - `.projenrc.ts` (root)",
16711
16734
  " - `projenrc/*.ts` (package-specific)",
16712
- "- After making Projen changes, run `pnpm exec projen` to synthesize",
16735
+ "- 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.",
16713
16736
  "",
16714
16737
  "## Workspace Dependencies",
16715
16738
  "",