@codedrifters/configulator 0.0.227 → 0.0.229

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
@@ -2267,6 +2267,148 @@ var companyProfileBundle = {
2267
2267
 
2268
2268
  // src/agent/bundles/github-workflow.ts
2269
2269
  var import_github = require("projen/lib/github");
2270
+ var setIssueTypeProcedure = {
2271
+ name: "set-issue-type.sh",
2272
+ description: "Assign a GitHub issue type (Feature / Task / Epic / Bug / etc.) via the updateIssueIssueType GraphQL mutation in a single step",
2273
+ content: [
2274
+ "#!/usr/bin/env bash",
2275
+ "# set-issue-type.sh \u2014 Assign a GitHub issue type in one step.",
2276
+ "#",
2277
+ "# Wraps the two-step GraphQL flow used to set an issue's type:",
2278
+ "# 1. Look up the repo's issue type node IDs.",
2279
+ "# 2. Call the updateIssueIssueType mutation.",
2280
+ "#",
2281
+ "# Usage:",
2282
+ "# .claude/procedures/set-issue-type.sh <issue-number> <type-name>",
2283
+ "#",
2284
+ "# Where <type-name> is the human-readable GitHub issue type name",
2285
+ "# (e.g. Feature, Task, Epic, Bug). Matching is case-insensitive.",
2286
+ "#",
2287
+ "# Exits 0 on success. Exits non-zero with a clear diagnostic on stderr",
2288
+ "# for any validation error or API failure.",
2289
+ "",
2290
+ "set -uo pipefail",
2291
+ "",
2292
+ "# \u2500\u2500 helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
2293
+ "",
2294
+ "err() {",
2295
+ ' printf "set-issue-type.sh: %s\\n" "$*" >&2',
2296
+ "}",
2297
+ "",
2298
+ "usage() {",
2299
+ " cat >&2 <<'USAGE'",
2300
+ "Usage: set-issue-type.sh <issue-number> <type-name>",
2301
+ "",
2302
+ " <issue-number> Positive integer GitHub issue number.",
2303
+ " <type-name> Human-readable issue type (Feature, Task, Epic, Bug,",
2304
+ " or any type defined at the org level). Case-insensitive.",
2305
+ "",
2306
+ "Examples:",
2307
+ " set-issue-type.sh 123 Feature",
2308
+ " set-issue-type.sh 456 bug",
2309
+ "USAGE",
2310
+ "}",
2311
+ "",
2312
+ "# \u2500\u2500 argument validation \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
2313
+ "",
2314
+ "if [[ $# -ne 2 ]]; then",
2315
+ ' err "expected 2 arguments, got $#"',
2316
+ " usage",
2317
+ " exit 2",
2318
+ "fi",
2319
+ "",
2320
+ 'issue_number="$1"',
2321
+ 'type_name="$2"',
2322
+ "",
2323
+ 'if ! [[ "$issue_number" =~ ^[1-9][0-9]*$ ]]; then',
2324
+ ` err "issue number must be a positive integer (got: '$issue_number')"`,
2325
+ " exit 2",
2326
+ "fi",
2327
+ "",
2328
+ 'if [[ -z "${type_name// /}" ]]; then',
2329
+ ' err "type name must be non-empty"',
2330
+ " exit 2",
2331
+ "fi",
2332
+ "",
2333
+ "# \u2500\u2500 dependency checks \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
2334
+ "",
2335
+ "for cmd in gh jq; do",
2336
+ ' if ! command -v "$cmd" >/dev/null 2>&1; then',
2337
+ ' err "required command not found on PATH: $cmd"',
2338
+ " exit 3",
2339
+ " fi",
2340
+ "done",
2341
+ "",
2342
+ "# \u2500\u2500 resolve repo owner/name \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
2343
+ "",
2344
+ "repo_json=$(gh repo view --json owner,name 2>/dev/null)",
2345
+ 'if [[ -z "$repo_json" ]]; then',
2346
+ ` err "could not resolve owning repo via 'gh repo view' (not a GitHub repo or gh not authenticated?)"`,
2347
+ " exit 4",
2348
+ "fi",
2349
+ "",
2350
+ `owner=$(echo "$repo_json" | jq -r '.owner.login // empty')`,
2351
+ `name=$(echo "$repo_json" | jq -r '.name // empty')`,
2352
+ "",
2353
+ 'if [[ -z "$owner" || -z "$name" ]]; then',
2354
+ ' err "could not parse owner/name from gh repo view output"',
2355
+ " exit 4",
2356
+ "fi",
2357
+ "",
2358
+ "# \u2500\u2500 look up issue type node ID \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
2359
+ "",
2360
+ "types_json=$(gh api graphql \\",
2361
+ " -f query='query($owner:String!,$repo:String!){repository(owner:$owner,name:$repo){issueTypes(first:50){nodes{id name}}}}' \\",
2362
+ ' -f owner="$owner" -f repo="$name" 2>/dev/null)',
2363
+ "",
2364
+ 'if [[ -z "$types_json" ]]; then',
2365
+ ' err "failed to query repo issue types via GraphQL"',
2366
+ " exit 5",
2367
+ "fi",
2368
+ "",
2369
+ `types_nodes=$(echo "$types_json" | jq -c '.data.repository.issueTypes.nodes // []')`,
2370
+ "",
2371
+ 'if [[ "$types_nodes" == "[]" || "$types_nodes" == "null" ]]; then',
2372
+ ' err "repo ${owner}/${name} has no issue types defined"',
2373
+ " exit 5",
2374
+ "fi",
2375
+ "",
2376
+ "# Case-insensitive match by name.",
2377
+ `type_id=$(echo "$types_nodes" | jq -r --arg n "$type_name" '`,
2378
+ " .[] | select((.name | ascii_downcase) == ($n | ascii_downcase)) | .id",
2379
+ "' | head -n 1)",
2380
+ "",
2381
+ 'if [[ -z "$type_id" ]]; then',
2382
+ ` available=$(echo "$types_nodes" | jq -r '.[].name' | paste -sd ',' - | sed 's/,/, /g')`,
2383
+ " err \"type '${type_name}' not found in ${owner}/${name}. Available types: ${available}\"",
2384
+ " exit 6",
2385
+ "fi",
2386
+ "",
2387
+ "# \u2500\u2500 look up issue node ID \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
2388
+ "",
2389
+ `issue_id=$(gh issue view "$issue_number" --json id -q '.id' 2>/dev/null || echo "")`,
2390
+ "",
2391
+ 'if [[ -z "$issue_id" ]]; then',
2392
+ ' err "issue #${issue_number} not found in ${owner}/${name}"',
2393
+ " exit 7",
2394
+ "fi",
2395
+ "",
2396
+ "# \u2500\u2500 apply the mutation \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
2397
+ "",
2398
+ "result=$(gh api graphql \\",
2399
+ " -f query='mutation($issueId:ID!,$typeId:ID!){updateIssueIssueType(input:{issueId:$issueId,issueTypeId:$typeId}){issue{number issueType{name}}}}' \\",
2400
+ ' -f issueId="$issue_id" -f typeId="$type_id" 2>&1)',
2401
+ "mutation_exit=$?",
2402
+ "",
2403
+ "if [[ $mutation_exit -ne 0 ]]; then",
2404
+ ' err "updateIssueIssueType mutation failed: ${result}"',
2405
+ " exit 8",
2406
+ "fi",
2407
+ "",
2408
+ "# Print the resulting {number, issueType: {name}} JSON line.",
2409
+ `echo "$result" | jq -c '.data.updateIssueIssueType.issue'`
2410
+ ].join("\n")
2411
+ };
2270
2412
  var githubWorkflowBundle = {
2271
2413
  name: "github-workflow",
2272
2414
  description: "GitHub issue and PR workflow automation patterns",
@@ -2329,19 +2471,20 @@ var githubWorkflowBundle = {
2329
2471
  " - `--title '<type>: <description>'`",
2330
2472
  " - `--body '<issue body>'`",
2331
2473
  " - `--label '<type-label>' --label '<priority-label>' --label '<status-label>'`",
2332
- "7. **Set the GitHub issue type** via the GraphQL `updateIssueIssueType` mutation:",
2333
- " - Look up the issue's node ID: `gh issue view <issue-number> --json id -q .id`",
2334
- " - Look up the repo's issue type node IDs (one-time, can be cached):",
2474
+ "7. **Set the GitHub issue type** by invoking the `set-issue-type.sh` helper (shipped with this bundle):",
2475
+ "",
2476
+ " ```sh",
2477
+ " .claude/procedures/set-issue-type.sh <issue-number> <Feature|Task|Epic|Bug>",
2478
+ " ```",
2335
2479
  "",
2336
- " ```sh",
2337
- " gh api graphql -f query='query($owner:String!,$repo:String!){repository(owner:$owner,name:$repo){issueTypes(first:20){nodes{id name}}}}' -f owner=<owner> -f repo=<repo>",
2338
- " ```",
2480
+ " The helper resolves owner/repo, looks up the issue type node ID, looks up the issue node ID, and applies the `updateIssueIssueType` mutation in one step. It exits non-zero with a clear diagnostic on any error and lists available types if the type name is not recognised.",
2339
2481
  "",
2340
- " - Apply the chosen type to the issue:",
2482
+ " **Under the hood** (documented fallback if the helper is unavailable): the helper performs a two-step GraphQL flow \u2014 first a `repository(...).issueTypes` query to map the human-readable type name to a node ID, then the `updateIssueIssueType` mutation. The canonical queries are:",
2341
2483
  "",
2342
- " ```sh",
2343
- " gh api graphql -f query='mutation($issueId:ID!,$typeId:ID!){updateIssueIssueType(input:{issueId:$issueId,issueTypeId:$typeId}){issue{number issueType{name}}}}' -f issueId=<issue-node-id> -f typeId=<issue-type-node-id>",
2344
- " ```",
2484
+ " ```sh",
2485
+ " gh api graphql -f query='query($owner:String!,$repo:String!){repository(owner:$owner,name:$repo){issueTypes(first:50){nodes{id name}}}}' -f owner=<owner> -f repo=<repo>",
2486
+ " gh api graphql -f query='mutation($issueId:ID!,$typeId:ID!){updateIssueIssueType(input:{issueId:$issueId,issueTypeId:$typeId}){issue{number issueType{name}}}}' -f issueId=<issue-node-id> -f typeId=<issue-type-node-id>",
2487
+ " ```",
2345
2488
  "",
2346
2489
  "### Issue Body Template",
2347
2490
  "",
@@ -2362,7 +2505,7 @@ var githubWorkflowBundle = {
2362
2505
  "### Important",
2363
2506
  "",
2364
2507
  "- Always use the conventional prefix in the issue title",
2365
- "- Always assign the correct GitHub issue type via the `updateIssueIssueType` GraphQL mutation (step 7) \u2014 never via `gh issue create --type`",
2508
+ "- Always assign the correct GitHub issue type via the `set-issue-type.sh` helper (step 7) \u2014 never via `gh issue create --type`",
2366
2509
  "- Always include `type:*`, `priority:*`, and `status:*` labels",
2367
2510
  "- If the user does not specify a type, ask before creating the issue",
2368
2511
  "- If the priority cannot be inferred from the description, ask the user before creating the issue",
@@ -2414,7 +2557,8 @@ var githubWorkflowBundle = {
2414
2557
  ].join("\n"),
2415
2558
  tags: ["workflow"]
2416
2559
  }
2417
- ]
2560
+ ],
2561
+ procedures: [setIssueTypeProcedure]
2418
2562
  };
2419
2563
 
2420
2564
  // src/agent/bundles/industry-discovery.ts
@@ -15286,7 +15430,7 @@ var MonorepoProject = class extends import_typescript3.TypeScriptAppProject {
15286
15430
  this.buildWorkflow?.addPostBuildSteps(
15287
15431
  {
15288
15432
  name: "Build Sub Projects",
15289
- run: `npx projen ${ROOT_CI_TASK_NAME}`
15433
+ run: `pnpm exec projen ${ROOT_CI_TASK_NAME}`
15290
15434
  },
15291
15435
  import_github2.WorkflowSteps.uploadArtifact({
15292
15436
  name: "Upload Turbo runs",
@@ -15940,7 +16084,7 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen18.Compone
15940
16084
  this.buildWorkflow.addPostBuildSteps(
15941
16085
  {
15942
16086
  name: "Build Sub Projects",
15943
- run: `npx projen ${ROOT_CI_TASK_NAME}`
16087
+ run: `pnpm exec projen ${ROOT_CI_TASK_NAME}`
15944
16088
  },
15945
16089
  import_github3.WorkflowSteps.uploadArtifact({
15946
16090
  name: "Upload Turbo runs",