@codedrifters/configulator 0.0.244 → 0.0.245

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 CHANGED
@@ -1534,6 +1534,14 @@ interface ResolvedProjectMetadata {
1534
1534
  readonly milestones?: ReadonlyArray<string>;
1535
1535
  readonly docsPath?: string;
1536
1536
  readonly deployment?: DeploymentMetadata;
1537
+ /**
1538
+ * Markdown block appended to the `project-context` maintainer seed
1539
+ * template. Resolved to the grouped sub-project list skeleton when
1540
+ * the root project is a `MonorepoProject` with layout enforcement
1541
+ * on (`layoutEnforcement !== "off"`); empty otherwise. Consumed by
1542
+ * the `{{monorepoLayoutSeedBlock}}` template variable.
1543
+ */
1544
+ readonly monorepoLayoutSeedBlock?: string;
1537
1545
  }
1538
1546
 
1539
1547
  /**
@@ -3636,6 +3644,19 @@ declare class ProjectMetadata extends Component {
3636
3644
  * Explicit options always take precedence over auto-detected values.
3637
3645
  */
3638
3646
  private resolveMetadata;
3647
+ /**
3648
+ * Return the maintainer-seed addendum for the `project-context`
3649
+ * bundle, or an empty string when the root project either has no
3650
+ * layout-enforcement opinion or has opted out (`layoutEnforcement:
3651
+ * "off"`).
3652
+ *
3653
+ * Uses duck-typing on the root project's `layoutEnforcement`
3654
+ * property to avoid a circular import with `MonorepoProject`. The
3655
+ * concrete `MonorepoProject` class exposes this property as a
3656
+ * string; anything else resolves to the empty string so repos that
3657
+ * predate the monorepo layout contract see no change.
3658
+ */
3659
+ private resolveMonorepoLayoutSeedBlock;
3639
3660
  /**
3640
3661
  * Attempts to auto-detect repository owner and name from the Projen
3641
3662
  * project's package.json repository field.
package/lib/index.d.ts CHANGED
@@ -1583,6 +1583,14 @@ interface ResolvedProjectMetadata {
1583
1583
  readonly milestones?: ReadonlyArray<string>;
1584
1584
  readonly docsPath?: string;
1585
1585
  readonly deployment?: DeploymentMetadata;
1586
+ /**
1587
+ * Markdown block appended to the `project-context` maintainer seed
1588
+ * template. Resolved to the grouped sub-project list skeleton when
1589
+ * the root project is a `MonorepoProject` with layout enforcement
1590
+ * on (`layoutEnforcement !== "off"`); empty otherwise. Consumed by
1591
+ * the `{{monorepoLayoutSeedBlock}}` template variable.
1592
+ */
1593
+ readonly monorepoLayoutSeedBlock?: string;
1586
1594
  }
1587
1595
 
1588
1596
  /**
@@ -3685,6 +3693,19 @@ declare class ProjectMetadata extends Component {
3685
3693
  * Explicit options always take precedence over auto-detected values.
3686
3694
  */
3687
3695
  private resolveMetadata;
3696
+ /**
3697
+ * Return the maintainer-seed addendum for the `project-context`
3698
+ * bundle, or an empty string when the root project either has no
3699
+ * layout-enforcement opinion or has opted out (`layoutEnforcement:
3700
+ * "off"`).
3701
+ *
3702
+ * Uses duck-typing on the root project's `layoutEnforcement`
3703
+ * property to avoid a circular import with `MonorepoProject`. The
3704
+ * concrete `MonorepoProject` class exposes this property as a
3705
+ * string; anything else resolves to the empty string so repos that
3706
+ * predate the monorepo layout contract see no change.
3707
+ */
3708
+ private resolveMonorepoLayoutSeedBlock;
3688
3709
  /**
3689
3710
  * Attempts to auto-detect repository owner and name from the Projen
3690
3711
  * project's package.json repository field.
package/lib/index.js CHANGED
@@ -997,6 +997,28 @@ var baseBundle = {
997
997
 
998
998
  // src/agent/bundles/project-context.ts
999
999
  var PROJECT_CONTEXT_PATH = "docs/project-context.md";
1000
+ var SUBPROJECT_ROLE_GUIDANCE = [
1001
+ "### Sub-project roles",
1002
+ "",
1003
+ "When the repository follows the configulator monorepo layout,",
1004
+ "every sub-project's role is derivable from the first segment of",
1005
+ "its `outdir` path. No other lookup is required.",
1006
+ "",
1007
+ "- `apps/<scope>/<name>` \u2014 deployable application (CDK stack,",
1008
+ " mobile app, backend service).",
1009
+ "- `packages/<scope>/<name>` \u2014 shared library (published npm",
1010
+ " package or workspace-internal library).",
1011
+ "- `sites/<scope>/<name>` \u2014 user-facing web front end that is",
1012
+ " not the monorepo-wide docs site.",
1013
+ "- `docs/` \u2014 the single Starlight documentation site for the",
1014
+ " whole monorepo (exactly one per repo; lives at `/docs`, not",
1015
+ " under `sites/`).",
1016
+ "",
1017
+ "Repositories that have not adopted the layout contract may use a",
1018
+ "different folder structure \u2014 in that case fall back to whatever",
1019
+ `\`${PROJECT_CONTEXT_PATH}\` documents explicitly.`,
1020
+ ""
1021
+ ];
1000
1022
  var PROJECT_CONTEXT_READER_SECTION = [
1001
1023
  "## Project Context",
1002
1024
  "",
@@ -1011,6 +1033,7 @@ var PROJECT_CONTEXT_READER_SECTION = [
1011
1033
  "",
1012
1034
  "You are a **read-only consumer** of this file. Do not edit it.",
1013
1035
  "",
1036
+ ...SUBPROJECT_ROLE_GUIDANCE,
1014
1037
  "---",
1015
1038
  ""
1016
1039
  ];
@@ -1023,6 +1046,7 @@ var PROJECT_CONTEXT_MAINTAINER_SECTION = [
1023
1046
  "key stakeholders. Use it to judge relevance when scanning source",
1024
1047
  "material in this session.",
1025
1048
  "",
1049
+ ...SUBPROJECT_ROLE_GUIDANCE,
1026
1050
  "### Seed on first use",
1027
1051
  "",
1028
1052
  `If \`${PROJECT_CONTEXT_PATH}\` does not exist, create it from this`,
@@ -1052,7 +1076,7 @@ var PROJECT_CONTEXT_MAINTAINER_SECTION = [
1052
1076
  "",
1053
1077
  "## Key Stakeholders",
1054
1078
  "TODO: named people or teams and what they care about.",
1055
- "",
1079
+ "{{monorepoLayoutSeedBlock}}",
1056
1080
  "## References",
1057
1081
  "TODO: links to BCM docs, competitive analysis, product roadmap, and",
1058
1082
  "other authoritative sources.",
@@ -1077,6 +1101,26 @@ var PROJECT_CONTEXT_MAINTAINER_SECTION = [
1077
1101
  "---",
1078
1102
  ""
1079
1103
  ];
1104
+ var MONOREPO_LAYOUT_SEED_BLOCK = [
1105
+ "",
1106
+ "## Sub-Projects",
1107
+ "",
1108
+ "TODO: one bullet per sub-project, grouped by role. The role is",
1109
+ "derivable from the first segment of each sub-project's `outdir`.",
1110
+ "",
1111
+ "### Applications (`apps/`)",
1112
+ "TODO: deployable applications (CDK stacks, mobile apps, services).",
1113
+ "",
1114
+ "### Packages (`packages/`)",
1115
+ "TODO: shared libraries (published npm packages, workspace-internal libraries).",
1116
+ "",
1117
+ "### Sites (`sites/`)",
1118
+ "TODO: user-facing web front ends (marketing sites, SPAs, client apps).",
1119
+ "",
1120
+ "### Docs (`docs/`)",
1121
+ "TODO: the single monorepo-wide Starlight documentation site.",
1122
+ ""
1123
+ ].join("\n");
1080
1124
 
1081
1125
  // src/agent/bundles/bcm-writer.ts
1082
1126
  var bcmWriterSubAgent = {
@@ -12603,9 +12647,30 @@ var ProjectMetadata = class _ProjectMetadata extends import_projen2.Component {
12603
12647
  labels: options.labels,
12604
12648
  milestones: options.milestones,
12605
12649
  docsPath: options.docsPath,
12606
- deployment: options.deployment
12650
+ deployment: options.deployment,
12651
+ monorepoLayoutSeedBlock: this.resolveMonorepoLayoutSeedBlock()
12607
12652
  };
12608
12653
  }
12654
+ /**
12655
+ * Return the maintainer-seed addendum for the `project-context`
12656
+ * bundle, or an empty string when the root project either has no
12657
+ * layout-enforcement opinion or has opted out (`layoutEnforcement:
12658
+ * "off"`).
12659
+ *
12660
+ * Uses duck-typing on the root project's `layoutEnforcement`
12661
+ * property to avoid a circular import with `MonorepoProject`. The
12662
+ * concrete `MonorepoProject` class exposes this property as a
12663
+ * string; anything else resolves to the empty string so repos that
12664
+ * predate the monorepo layout contract see no change.
12665
+ */
12666
+ resolveMonorepoLayoutSeedBlock() {
12667
+ const root = this.project.root;
12668
+ const enforcement = root.layoutEnforcement;
12669
+ if (typeof enforcement !== "string" || enforcement === "off") {
12670
+ return "";
12671
+ }
12672
+ return MONOREPO_LAYOUT_SEED_BLOCK;
12673
+ }
12609
12674
  /**
12610
12675
  * Attempts to auto-detect repository owner and name from the Projen
12611
12676
  * project's package.json repository field.
@@ -14625,7 +14690,12 @@ var FALLBACKS = {
14625
14690
  "githubProject.name": "<project-name>",
14626
14691
  "githubProject.number": "<project-number>",
14627
14692
  "githubProject.nodeId": "<project-node-id>",
14628
- docsPath: "<docs-path>"
14693
+ docsPath: "<docs-path>",
14694
+ // The monorepo-layout seed block is additive: when absent, the
14695
+ // seeded `project-context.md` template reads cleanly without it.
14696
+ // Fall back to an empty string so no placeholder text leaks into
14697
+ // rendered prompts for repos that predate the layout contract.
14698
+ monorepoLayoutSeedBlock: ""
14629
14699
  };
14630
14700
  var TEMPLATE_RE = /\{\{(\w+(?:\.\w+)*)\}\}/g;
14631
14701
  function getNestedValue(obj, path2) {