@codedrifters/configulator 0.0.174 → 0.0.176
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.d.mts +7 -1
- package/lib/index.d.ts +7 -1
- package/lib/index.js +266 -12
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +265 -12
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -271,12 +271,16 @@ var awsCdkBundle = {
|
|
|
271
271
|
"## Filename / Class Name Matching",
|
|
272
272
|
"",
|
|
273
273
|
"- Kebab-case filenames must mirror PascalCase class names (e.g., `my-construct.ts` \u2192 `MyConstruct`)",
|
|
274
|
+
"- Name props interfaces `ClassNameProps` (e.g., `MyConstructProps`)",
|
|
274
275
|
"- One primary construct per file; supporting types (props interface, enums) live in the same file",
|
|
275
276
|
"- Test files follow the same pattern: `my-construct.spec.ts`",
|
|
277
|
+
"- When renaming, prefer renaming the class to match the filename",
|
|
276
278
|
"",
|
|
277
279
|
"## Cross-Stack Lookup Patterns",
|
|
278
280
|
"",
|
|
279
|
-
"- Lookups live on **service classes**, not component/construct classes",
|
|
281
|
+
"- Lookups live on **service classes**, not component/construct classes \u2014 do not add `fromConstruct()` or similar lookup methods to component classes",
|
|
282
|
+
"- Use `*.of(this)` for stack or service references where the pattern exists in the codebase",
|
|
283
|
+
"- Within services, prefer creating resources in protected methods; expose retrieval via static methods on the owning service",
|
|
280
284
|
"- Use static methods for cross-stack lookups so consumers don't need an instance:",
|
|
281
285
|
"",
|
|
282
286
|
"```typescript",
|
|
@@ -302,6 +306,11 @@ var awsCdkBundle = {
|
|
|
302
306
|
"- Use SSM parameters for cross-stack references when needed",
|
|
303
307
|
"- Do not pass values between stacks; use SSM parameters instead",
|
|
304
308
|
"",
|
|
309
|
+
"## Lambda Handlers (NodejsFunction)",
|
|
310
|
+
"",
|
|
311
|
+
"- When adding a `NodejsFunction` with a bundled handler, ensure the `entry` path is explicitly configured",
|
|
312
|
+
"- Verify the entry is included in the build tool config (e.g., tsup entry list) so the runtime can find the handler",
|
|
313
|
+
"",
|
|
305
314
|
"## CDK Testing",
|
|
306
315
|
"",
|
|
307
316
|
"- Mock `Code.fromAsset` in any test file that synthesizes CDK stacks",
|
|
@@ -463,12 +472,31 @@ var baseBundle = {
|
|
|
463
472
|
},
|
|
464
473
|
{
|
|
465
474
|
name: "cursor-projen-restrictions",
|
|
466
|
-
description: "Cursor must not run projen or package-manager
|
|
475
|
+
description: "Cursor must not run projen, build, test, or package-manager commands",
|
|
467
476
|
scope: AGENT_RULE_SCOPE.ALWAYS,
|
|
468
477
|
content: [
|
|
469
|
-
"# Projen Restrictions",
|
|
478
|
+
"# Projen & Development Command Restrictions",
|
|
479
|
+
"",
|
|
480
|
+
"**Never** run any of the following commands. Instead, tell the user which commands to run and why.",
|
|
481
|
+
"",
|
|
482
|
+
"## Prohibited Commands",
|
|
483
|
+
"",
|
|
484
|
+
"- `npx projen` \u2014 synthesize project files",
|
|
485
|
+
"- `pnpm install` / `pnpm i` \u2014 install dependencies",
|
|
486
|
+
"- `pnpm build` / `pnpm build:all` \u2014 build the project",
|
|
487
|
+
"- `pnpm test` / `pnpm --filter ... test` \u2014 run tests",
|
|
488
|
+
"- `pnpm eslint` / `pnpm --filter ... eslint` \u2014 run linting",
|
|
489
|
+
"- `pnpm compile` / `pnpm --filter ... compile` \u2014 compile packages",
|
|
490
|
+
"- `pnpm reset` / `pnpm reset:all` \u2014 reset build artifacts",
|
|
491
|
+
"- Any `vitest`, `tsup`, `rollup`, or `turbo` commands",
|
|
492
|
+
"",
|
|
493
|
+
"## What to Do Instead",
|
|
494
|
+
"",
|
|
495
|
+
"After making changes that need validation, tell the user the specific commands to run:",
|
|
470
496
|
"",
|
|
471
|
-
"
|
|
497
|
+
"1. **After projen config changes** \u2014 tell the user to run `npx projen && pnpm install`",
|
|
498
|
+
"2. **After source code changes** \u2014 tell the user to run `pnpm --filter @codedrifters/<package> test`",
|
|
499
|
+
"3. **After multi-package changes** \u2014 tell the user to run `pnpm build:all`"
|
|
472
500
|
].join("\n"),
|
|
473
501
|
platforms: {
|
|
474
502
|
claude: { exclude: true }
|
|
@@ -522,7 +550,7 @@ var baseBundle = {
|
|
|
522
550
|
"## Code Formatting",
|
|
523
551
|
"",
|
|
524
552
|
"- Use **Prettier** for formatting (runs automatically on save in VS Code)",
|
|
525
|
-
"- Always use curly braces for control flow, even single-line statements",
|
|
553
|
+
"- Always use curly braces for control flow, even single-line statements; use multi-line format for complex conditionals",
|
|
526
554
|
"- Prefer `const` over `let`; avoid `var`",
|
|
527
555
|
"- Use trailing commas in multi-line objects/arrays",
|
|
528
556
|
"",
|
|
@@ -536,13 +564,15 @@ var baseBundle = {
|
|
|
536
564
|
"",
|
|
537
565
|
"## Import Conventions",
|
|
538
566
|
"",
|
|
539
|
-
"- **Always use ES modules** (`import`/`export`), never `require()`",
|
|
567
|
+
"- **Always use ES modules** (`import`/`export`), never `require()` (exception: `.projenrc.ts` files where `require` is allowed)",
|
|
540
568
|
"- Import order:",
|
|
541
569
|
" 1. Built-in Node.js modules (e.g., `node:path`, `node:fs`)",
|
|
542
570
|
" 2. External dependencies (alphabetically sorted)",
|
|
543
571
|
" 3. Internal imports (relative paths)",
|
|
544
572
|
"- Group imports with blank lines between groups",
|
|
545
573
|
"- Alphabetize imports within each group (case-insensitive)",
|
|
574
|
+
"- Use absolute imports from package root when possible",
|
|
575
|
+
"- Avoid duplicate imports (`import/no-duplicates`); all imports must be resolvable (`import/no-unresolved`)",
|
|
546
576
|
"",
|
|
547
577
|
"## Error Handling",
|
|
548
578
|
"",
|
|
@@ -774,13 +804,15 @@ var githubWorkflowBundle = {
|
|
|
774
804
|
"",
|
|
775
805
|
"When the user says **open a PR** (or similar), follow these steps exactly:",
|
|
776
806
|
"",
|
|
777
|
-
"1. **
|
|
778
|
-
"2. **
|
|
779
|
-
"3. **
|
|
780
|
-
"4. **
|
|
807
|
+
"1. **Regenerate project files** \u2014 run `npx 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.",
|
|
808
|
+
"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.",
|
|
809
|
+
"3. **Check for uncommitted changes** \u2014 if any exist, commit them with a conventional commit message",
|
|
810
|
+
"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",
|
|
811
|
+
"5. **Push the branch** to origin: `git push -u origin <branch>`",
|
|
812
|
+
"6. **Create the PR** using `gh pr create`:",
|
|
781
813
|
" - **Title**: use a conventional commit style title (e.g., `feat(scope): short description`)",
|
|
782
814
|
" - **Body**: include `Closes #<issue-number>` (derived from the branch name) and a brief summary of changes",
|
|
783
|
-
"
|
|
815
|
+
"7. **Enable auto-merge with squash** \u2014 use `gh pr merge --auto --squash` with the merge commit message:",
|
|
784
816
|
"",
|
|
785
817
|
"```",
|
|
786
818
|
"gh pr merge --auto --squash --subject '<conventional-commit-title>' --body '<extended-description>'",
|
|
@@ -1012,6 +1044,185 @@ var projenBundle = {
|
|
|
1012
1044
|
description: "Projen conventions, synthesis workflow, .projenrc.ts patterns",
|
|
1013
1045
|
appliesWhen: (project) => hasDep(project, "projen"),
|
|
1014
1046
|
rules: [
|
|
1047
|
+
{
|
|
1048
|
+
name: "development-commands",
|
|
1049
|
+
description: "Projen development commands for building, testing, linting, and validating changes",
|
|
1050
|
+
scope: AGENT_RULE_SCOPE.ALWAYS,
|
|
1051
|
+
content: [
|
|
1052
|
+
"# Development Commands",
|
|
1053
|
+
"",
|
|
1054
|
+
"This project uses Projen to manage configuration and Turborepo to orchestrate builds across the monorepo. Run all commands from the **repository root** unless otherwise noted.",
|
|
1055
|
+
"",
|
|
1056
|
+
"## Synthesizing Projen Configuration",
|
|
1057
|
+
"",
|
|
1058
|
+
"After modifying any file in `projenrc/` or `.projenrc.ts`, regenerate project files:",
|
|
1059
|
+
"",
|
|
1060
|
+
"```sh",
|
|
1061
|
+
"npx projen",
|
|
1062
|
+
"pnpm install",
|
|
1063
|
+
"```",
|
|
1064
|
+
"",
|
|
1065
|
+
"Both steps are required \u2014 `npx projen` regenerates files, `pnpm install` updates the lockfile to match.",
|
|
1066
|
+
"",
|
|
1067
|
+
"## Building",
|
|
1068
|
+
"",
|
|
1069
|
+
"**Full monorepo build** (compile + test + package, all sub-packages via Turborepo):",
|
|
1070
|
+
"",
|
|
1071
|
+
"```sh",
|
|
1072
|
+
"pnpm build:all",
|
|
1073
|
+
"```",
|
|
1074
|
+
"",
|
|
1075
|
+
"**Root project only** (synthesize + compile + lint):",
|
|
1076
|
+
"",
|
|
1077
|
+
"```sh",
|
|
1078
|
+
"pnpm build",
|
|
1079
|
+
"```",
|
|
1080
|
+
"",
|
|
1081
|
+
"**Single sub-package** (compile only):",
|
|
1082
|
+
"",
|
|
1083
|
+
"```sh",
|
|
1084
|
+
"pnpm --filter @codedrifters/<package> compile",
|
|
1085
|
+
"```",
|
|
1086
|
+
"",
|
|
1087
|
+
"Replace `<package>` with `configulator`, `constructs`, or `utils`.",
|
|
1088
|
+
"",
|
|
1089
|
+
"## Testing",
|
|
1090
|
+
"",
|
|
1091
|
+
"**Run tests for a single sub-package:**",
|
|
1092
|
+
"",
|
|
1093
|
+
"```sh",
|
|
1094
|
+
"pnpm --filter @codedrifters/<package> test",
|
|
1095
|
+
"```",
|
|
1096
|
+
"",
|
|
1097
|
+
"This runs ESLint + Vitest for the specified package.",
|
|
1098
|
+
"",
|
|
1099
|
+
"**Run only Vitest (skip lint) in a sub-package:**",
|
|
1100
|
+
"",
|
|
1101
|
+
"```sh",
|
|
1102
|
+
"cd packages/@codedrifters/<package>",
|
|
1103
|
+
"pnpm exec vitest run",
|
|
1104
|
+
"```",
|
|
1105
|
+
"",
|
|
1106
|
+
"**Run a specific test file:**",
|
|
1107
|
+
"",
|
|
1108
|
+
"```sh",
|
|
1109
|
+
"cd packages/@codedrifters/<package>",
|
|
1110
|
+
"pnpm exec vitest run src/path/to/file.test.ts",
|
|
1111
|
+
"```",
|
|
1112
|
+
"",
|
|
1113
|
+
"## Linting",
|
|
1114
|
+
"",
|
|
1115
|
+
"**Lint the root project:**",
|
|
1116
|
+
"",
|
|
1117
|
+
"```sh",
|
|
1118
|
+
"pnpm eslint",
|
|
1119
|
+
"```",
|
|
1120
|
+
"",
|
|
1121
|
+
"**Lint a single sub-package:**",
|
|
1122
|
+
"",
|
|
1123
|
+
"```sh",
|
|
1124
|
+
"pnpm --filter @codedrifters/<package> eslint",
|
|
1125
|
+
"```",
|
|
1126
|
+
"",
|
|
1127
|
+
"## Resetting Build Artifacts",
|
|
1128
|
+
"",
|
|
1129
|
+
"**Reset everything** (all packages + root):",
|
|
1130
|
+
"",
|
|
1131
|
+
"```sh",
|
|
1132
|
+
"pnpm reset:all",
|
|
1133
|
+
"```",
|
|
1134
|
+
"",
|
|
1135
|
+
"**Reset root only:**",
|
|
1136
|
+
"",
|
|
1137
|
+
"```sh",
|
|
1138
|
+
"pnpm reset",
|
|
1139
|
+
"```",
|
|
1140
|
+
"",
|
|
1141
|
+
"## Validating Changes Are Complete",
|
|
1142
|
+
"",
|
|
1143
|
+
"After finishing implementation work, validate that changes are correct by running the appropriate commands depending on what was changed:",
|
|
1144
|
+
"",
|
|
1145
|
+
"1. **Projen config changes** (`projenrc/`, `.projenrc.ts`):",
|
|
1146
|
+
" - Run `npx projen` then `pnpm install`",
|
|
1147
|
+
" - Verify no unexpected generated file changes with `git diff`",
|
|
1148
|
+
"",
|
|
1149
|
+
"2. **Source code changes** (in a sub-package):",
|
|
1150
|
+
" - Compile: `pnpm --filter @codedrifters/<package> compile`",
|
|
1151
|
+
" - Test: `pnpm --filter @codedrifters/<package> test`",
|
|
1152
|
+
"",
|
|
1153
|
+
"3. **Changes spanning multiple packages**:",
|
|
1154
|
+
" - Run `pnpm build:all` to validate the full monorepo build",
|
|
1155
|
+
"",
|
|
1156
|
+
"4. **Root-level changes** (projenrc, root config):",
|
|
1157
|
+
" - Run `pnpm build` to validate root synthesis + compilation + lint",
|
|
1158
|
+
"",
|
|
1159
|
+
"## Command Reference",
|
|
1160
|
+
"",
|
|
1161
|
+
"| Task | Command |",
|
|
1162
|
+
"|------|---------|",
|
|
1163
|
+
"| Synthesize projen | `npx projen` |",
|
|
1164
|
+
"| Install deps | `pnpm install` |",
|
|
1165
|
+
"| Full monorepo build | `pnpm build:all` |",
|
|
1166
|
+
"| Root build only | `pnpm build` |",
|
|
1167
|
+
"| Compile one package | `pnpm --filter @codedrifters/<pkg> compile` |",
|
|
1168
|
+
"| Test one package | `pnpm --filter @codedrifters/<pkg> test` |",
|
|
1169
|
+
"| Lint one package | `pnpm --filter @codedrifters/<pkg> eslint` |",
|
|
1170
|
+
"| Lint root | `pnpm eslint` |",
|
|
1171
|
+
"| Reset all artifacts | `pnpm reset:all` |"
|
|
1172
|
+
].join("\n"),
|
|
1173
|
+
tags: ["workflow"]
|
|
1174
|
+
},
|
|
1175
|
+
{
|
|
1176
|
+
name: "agent-rules-customization",
|
|
1177
|
+
description: "How to customize agent rules for this repo via the Projen project definition",
|
|
1178
|
+
scope: AGENT_RULE_SCOPE.FILE_PATTERN,
|
|
1179
|
+
filePatterns: [
|
|
1180
|
+
"projenrc/**/*.ts",
|
|
1181
|
+
".projenrc.ts",
|
|
1182
|
+
".claude/rules/*.md",
|
|
1183
|
+
".cursor/rules/*.mdc",
|
|
1184
|
+
"CLAUDE.md"
|
|
1185
|
+
],
|
|
1186
|
+
content: [
|
|
1187
|
+
"# Customizing Agent Rules",
|
|
1188
|
+
"",
|
|
1189
|
+
"Agent rules for Claude and Cursor are **generated** by configulator's `AgentConfig` component. The generated output files (`.claude/rules/`, `.cursor/rules/`, `CLAUDE.md`) must not be edited directly \u2014 they are overwritten on every `npx projen` run.",
|
|
1190
|
+
"",
|
|
1191
|
+
"## Adding Repo-Specific Rules",
|
|
1192
|
+
"",
|
|
1193
|
+
"Rules that only apply to this repository should be added to the `agentConfig.rules` array in the Projen project definition (`.projenrc.ts` or `projenrc/*.ts`):",
|
|
1194
|
+
"",
|
|
1195
|
+
"```typescript",
|
|
1196
|
+
"agentConfig: {",
|
|
1197
|
+
" rules: [",
|
|
1198
|
+
" {",
|
|
1199
|
+
" name: 'my-repo-rule',",
|
|
1200
|
+
" description: 'What this rule does',",
|
|
1201
|
+
" scope: AGENT_RULE_SCOPE.ALWAYS, // or FILE_PATTERN with filePatterns",
|
|
1202
|
+
" content: '# My Rule\\n\\n- Guideline 1\\n- Guideline 2',",
|
|
1203
|
+
" },",
|
|
1204
|
+
" ],",
|
|
1205
|
+
"}",
|
|
1206
|
+
"```",
|
|
1207
|
+
"",
|
|
1208
|
+
"## Extending Existing Bundle Rules",
|
|
1209
|
+
"",
|
|
1210
|
+
"To append repo-specific content to a rule provided by a configulator bundle (without replacing it), use `agentConfig.ruleExtensions`:",
|
|
1211
|
+
"",
|
|
1212
|
+
"```typescript",
|
|
1213
|
+
"agentConfig: {",
|
|
1214
|
+
" ruleExtensions: {",
|
|
1215
|
+
" 'typescript-conventions': '## Additional Guidelines\\n\\n- My custom guideline',",
|
|
1216
|
+
" },",
|
|
1217
|
+
"}",
|
|
1218
|
+
"```",
|
|
1219
|
+
"",
|
|
1220
|
+
"## After Any Change",
|
|
1221
|
+
"",
|
|
1222
|
+
"Run `npx projen` then `pnpm install` to regenerate the output files."
|
|
1223
|
+
].join("\n"),
|
|
1224
|
+
tags: ["workflow"]
|
|
1225
|
+
},
|
|
1015
1226
|
{
|
|
1016
1227
|
name: "projen-conventions",
|
|
1017
1228
|
description: "Projen configuration patterns and best practices",
|
|
@@ -1096,6 +1307,46 @@ var projenBundle = {
|
|
|
1096
1307
|
]
|
|
1097
1308
|
};
|
|
1098
1309
|
|
|
1310
|
+
// src/agent/bundles/slack.ts
|
|
1311
|
+
var slackBundle = {
|
|
1312
|
+
name: "slack",
|
|
1313
|
+
description: "Slack MCP message formatting and best practices",
|
|
1314
|
+
appliesWhen: () => false,
|
|
1315
|
+
rules: [
|
|
1316
|
+
{
|
|
1317
|
+
name: "slack-message-formatting",
|
|
1318
|
+
description: "Format Slack messages with explicit links so bullets and labels render correctly",
|
|
1319
|
+
scope: AGENT_RULE_SCOPE.ALWAYS,
|
|
1320
|
+
content: [
|
|
1321
|
+
"# Slack Message Formatting",
|
|
1322
|
+
"",
|
|
1323
|
+
"When composing or sending messages to Slack (e.g., via Slack MCP tools like `slack_send_message`), use formatting that Slack's mrkdwn parser renders correctly.",
|
|
1324
|
+
"",
|
|
1325
|
+
"## Rules",
|
|
1326
|
+
"",
|
|
1327
|
+
"1. **Use Slack's explicit link syntax** for any link in a message:",
|
|
1328
|
+
" - Format: `<https://example.com|display text>`",
|
|
1329
|
+
" - Text outside the angle brackets (bullets, labels) stays separate and won't merge into the link",
|
|
1330
|
+
"",
|
|
1331
|
+
"2. **Do not rely on auto-linkification** when the message has bullets or labels before URLs \u2014 auto-linked URLs can break or merge with surrounding text",
|
|
1332
|
+
"",
|
|
1333
|
+
"3. **Put each list item on its own line** with a newline between items so list structure is clear",
|
|
1334
|
+
"",
|
|
1335
|
+
"4. **Example \u2014 preferred:**",
|
|
1336
|
+
" ```",
|
|
1337
|
+
" Status update:",
|
|
1338
|
+
"",
|
|
1339
|
+
" \u2022 Feature A: <https://github.com/org/repo/pull/1|repo#1>",
|
|
1340
|
+
" \u2022 Feature B: <https://github.com/org/repo/pull/2|repo#2>",
|
|
1341
|
+
" ```",
|
|
1342
|
+
"",
|
|
1343
|
+
"5. **Avoid:** Plain URLs immediately after a bullet/label on the same line (e.g., `\u2022 Feature A: https://github.com/...`) when sending via API, as it can render with bullets inside or between links"
|
|
1344
|
+
].join("\n"),
|
|
1345
|
+
tags: ["workflow"]
|
|
1346
|
+
}
|
|
1347
|
+
]
|
|
1348
|
+
};
|
|
1349
|
+
|
|
1099
1350
|
// src/turbo/turbo-repo.ts
|
|
1100
1351
|
import { Component as Component3, FileBase, JsonFile } from "projen/lib";
|
|
1101
1352
|
import { JobPermission } from "projen/lib/github/workflows-model";
|
|
@@ -1676,7 +1927,8 @@ var BUILT_IN_BUNDLES = [
|
|
|
1676
1927
|
pnpmBundle,
|
|
1677
1928
|
awsCdkBundle,
|
|
1678
1929
|
projenBundle,
|
|
1679
|
-
githubWorkflowBundle
|
|
1930
|
+
githubWorkflowBundle,
|
|
1931
|
+
slackBundle
|
|
1680
1932
|
];
|
|
1681
1933
|
|
|
1682
1934
|
// src/projects/project-metadata.ts
|
|
@@ -4119,6 +4371,7 @@ export {
|
|
|
4119
4371
|
pnpmBundle,
|
|
4120
4372
|
projenBundle,
|
|
4121
4373
|
resolveTemplateVariables,
|
|
4374
|
+
slackBundle,
|
|
4122
4375
|
turborepoBundle,
|
|
4123
4376
|
typescriptBundle,
|
|
4124
4377
|
vitestBundle
|