@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 +21 -0
- package/lib/index.d.ts +21 -0
- package/lib/index.js +73 -3
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +73 -3
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -907,6 +907,28 @@ var baseBundle = {
|
|
|
907
907
|
|
|
908
908
|
// src/agent/bundles/project-context.ts
|
|
909
909
|
var PROJECT_CONTEXT_PATH = "docs/project-context.md";
|
|
910
|
+
var SUBPROJECT_ROLE_GUIDANCE = [
|
|
911
|
+
"### Sub-project roles",
|
|
912
|
+
"",
|
|
913
|
+
"When the repository follows the configulator monorepo layout,",
|
|
914
|
+
"every sub-project's role is derivable from the first segment of",
|
|
915
|
+
"its `outdir` path. No other lookup is required.",
|
|
916
|
+
"",
|
|
917
|
+
"- `apps/<scope>/<name>` \u2014 deployable application (CDK stack,",
|
|
918
|
+
" mobile app, backend service).",
|
|
919
|
+
"- `packages/<scope>/<name>` \u2014 shared library (published npm",
|
|
920
|
+
" package or workspace-internal library).",
|
|
921
|
+
"- `sites/<scope>/<name>` \u2014 user-facing web front end that is",
|
|
922
|
+
" not the monorepo-wide docs site.",
|
|
923
|
+
"- `docs/` \u2014 the single Starlight documentation site for the",
|
|
924
|
+
" whole monorepo (exactly one per repo; lives at `/docs`, not",
|
|
925
|
+
" under `sites/`).",
|
|
926
|
+
"",
|
|
927
|
+
"Repositories that have not adopted the layout contract may use a",
|
|
928
|
+
"different folder structure \u2014 in that case fall back to whatever",
|
|
929
|
+
`\`${PROJECT_CONTEXT_PATH}\` documents explicitly.`,
|
|
930
|
+
""
|
|
931
|
+
];
|
|
910
932
|
var PROJECT_CONTEXT_READER_SECTION = [
|
|
911
933
|
"## Project Context",
|
|
912
934
|
"",
|
|
@@ -921,6 +943,7 @@ var PROJECT_CONTEXT_READER_SECTION = [
|
|
|
921
943
|
"",
|
|
922
944
|
"You are a **read-only consumer** of this file. Do not edit it.",
|
|
923
945
|
"",
|
|
946
|
+
...SUBPROJECT_ROLE_GUIDANCE,
|
|
924
947
|
"---",
|
|
925
948
|
""
|
|
926
949
|
];
|
|
@@ -933,6 +956,7 @@ var PROJECT_CONTEXT_MAINTAINER_SECTION = [
|
|
|
933
956
|
"key stakeholders. Use it to judge relevance when scanning source",
|
|
934
957
|
"material in this session.",
|
|
935
958
|
"",
|
|
959
|
+
...SUBPROJECT_ROLE_GUIDANCE,
|
|
936
960
|
"### Seed on first use",
|
|
937
961
|
"",
|
|
938
962
|
`If \`${PROJECT_CONTEXT_PATH}\` does not exist, create it from this`,
|
|
@@ -962,7 +986,7 @@ var PROJECT_CONTEXT_MAINTAINER_SECTION = [
|
|
|
962
986
|
"",
|
|
963
987
|
"## Key Stakeholders",
|
|
964
988
|
"TODO: named people or teams and what they care about.",
|
|
965
|
-
"",
|
|
989
|
+
"{{monorepoLayoutSeedBlock}}",
|
|
966
990
|
"## References",
|
|
967
991
|
"TODO: links to BCM docs, competitive analysis, product roadmap, and",
|
|
968
992
|
"other authoritative sources.",
|
|
@@ -987,6 +1011,26 @@ var PROJECT_CONTEXT_MAINTAINER_SECTION = [
|
|
|
987
1011
|
"---",
|
|
988
1012
|
""
|
|
989
1013
|
];
|
|
1014
|
+
var MONOREPO_LAYOUT_SEED_BLOCK = [
|
|
1015
|
+
"",
|
|
1016
|
+
"## Sub-Projects",
|
|
1017
|
+
"",
|
|
1018
|
+
"TODO: one bullet per sub-project, grouped by role. The role is",
|
|
1019
|
+
"derivable from the first segment of each sub-project's `outdir`.",
|
|
1020
|
+
"",
|
|
1021
|
+
"### Applications (`apps/`)",
|
|
1022
|
+
"TODO: deployable applications (CDK stacks, mobile apps, services).",
|
|
1023
|
+
"",
|
|
1024
|
+
"### Packages (`packages/`)",
|
|
1025
|
+
"TODO: shared libraries (published npm packages, workspace-internal libraries).",
|
|
1026
|
+
"",
|
|
1027
|
+
"### Sites (`sites/`)",
|
|
1028
|
+
"TODO: user-facing web front ends (marketing sites, SPAs, client apps).",
|
|
1029
|
+
"",
|
|
1030
|
+
"### Docs (`docs/`)",
|
|
1031
|
+
"TODO: the single monorepo-wide Starlight documentation site.",
|
|
1032
|
+
""
|
|
1033
|
+
].join("\n");
|
|
990
1034
|
|
|
991
1035
|
// src/agent/bundles/bcm-writer.ts
|
|
992
1036
|
var bcmWriterSubAgent = {
|
|
@@ -12513,9 +12557,30 @@ var ProjectMetadata = class _ProjectMetadata extends Component2 {
|
|
|
12513
12557
|
labels: options.labels,
|
|
12514
12558
|
milestones: options.milestones,
|
|
12515
12559
|
docsPath: options.docsPath,
|
|
12516
|
-
deployment: options.deployment
|
|
12560
|
+
deployment: options.deployment,
|
|
12561
|
+
monorepoLayoutSeedBlock: this.resolveMonorepoLayoutSeedBlock()
|
|
12517
12562
|
};
|
|
12518
12563
|
}
|
|
12564
|
+
/**
|
|
12565
|
+
* Return the maintainer-seed addendum for the `project-context`
|
|
12566
|
+
* bundle, or an empty string when the root project either has no
|
|
12567
|
+
* layout-enforcement opinion or has opted out (`layoutEnforcement:
|
|
12568
|
+
* "off"`).
|
|
12569
|
+
*
|
|
12570
|
+
* Uses duck-typing on the root project's `layoutEnforcement`
|
|
12571
|
+
* property to avoid a circular import with `MonorepoProject`. The
|
|
12572
|
+
* concrete `MonorepoProject` class exposes this property as a
|
|
12573
|
+
* string; anything else resolves to the empty string so repos that
|
|
12574
|
+
* predate the monorepo layout contract see no change.
|
|
12575
|
+
*/
|
|
12576
|
+
resolveMonorepoLayoutSeedBlock() {
|
|
12577
|
+
const root = this.project.root;
|
|
12578
|
+
const enforcement = root.layoutEnforcement;
|
|
12579
|
+
if (typeof enforcement !== "string" || enforcement === "off") {
|
|
12580
|
+
return "";
|
|
12581
|
+
}
|
|
12582
|
+
return MONOREPO_LAYOUT_SEED_BLOCK;
|
|
12583
|
+
}
|
|
12519
12584
|
/**
|
|
12520
12585
|
* Attempts to auto-detect repository owner and name from the Projen
|
|
12521
12586
|
* project's package.json repository field.
|
|
@@ -14535,7 +14600,12 @@ var FALLBACKS = {
|
|
|
14535
14600
|
"githubProject.name": "<project-name>",
|
|
14536
14601
|
"githubProject.number": "<project-number>",
|
|
14537
14602
|
"githubProject.nodeId": "<project-node-id>",
|
|
14538
|
-
docsPath: "<docs-path>"
|
|
14603
|
+
docsPath: "<docs-path>",
|
|
14604
|
+
// The monorepo-layout seed block is additive: when absent, the
|
|
14605
|
+
// seeded `project-context.md` template reads cleanly without it.
|
|
14606
|
+
// Fall back to an empty string so no placeholder text leaks into
|
|
14607
|
+
// rendered prompts for repos that predate the layout contract.
|
|
14608
|
+
monorepoLayoutSeedBlock: ""
|
|
14539
14609
|
};
|
|
14540
14610
|
var TEMPLATE_RE = /\{\{(\w+(?:\.\w+)*)\}\}/g;
|
|
14541
14611
|
function getNestedValue(obj, path2) {
|