@codedrifters/configulator 0.0.243 → 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 +108 -6
- package/lib/index.d.ts +109 -7
- package/lib/index.js +149 -13
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +146 -13
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
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
|
/**
|
|
@@ -2757,8 +2765,10 @@ type LayoutEnforcement = (typeof LAYOUT_ENFORCEMENT)[keyof typeof LAYOUT_ENFORCE
|
|
|
2757
2765
|
*
|
|
2758
2766
|
* We key by class name (not class reference) so this module stays free of
|
|
2759
2767
|
* import cycles with the project-type files that validate against it.
|
|
2760
|
-
* `StarlightProject` maps to `DOCS` because the docs-singleton
|
|
2761
|
-
*
|
|
2768
|
+
* `StarlightProject` maps to `DOCS` by default because the docs-singleton
|
|
2769
|
+
* rule says a default-role Starlight project is the monorepo-wide docs
|
|
2770
|
+
* site. Site-role Starlight projects override this mapping at validate
|
|
2771
|
+
* time via their instance `role` property.
|
|
2762
2772
|
*
|
|
2763
2773
|
* @see ADR-006 §4 — Configulator project-type → `outdir` mapping
|
|
2764
2774
|
*/
|
|
@@ -2773,6 +2783,14 @@ interface LayoutViolation {
|
|
|
2773
2783
|
readonly outdir: string;
|
|
2774
2784
|
readonly expectedRoot: MonorepoLayoutRoot;
|
|
2775
2785
|
}
|
|
2786
|
+
/**
|
|
2787
|
+
* Violation reported by {@link validateStarlightSingleton} when a
|
|
2788
|
+
* `MonorepoProject` tree contains more than one `StarlightProject`
|
|
2789
|
+
* carrying `role: "docs"` (the docs-singleton rule — ADR-006 §3).
|
|
2790
|
+
*/
|
|
2791
|
+
interface StarlightSingletonViolation {
|
|
2792
|
+
readonly projectNames: ReadonlyArray<string>;
|
|
2793
|
+
}
|
|
2776
2794
|
/**
|
|
2777
2795
|
* Inspect every sub-project of `root` and collect those whose `outdir` does
|
|
2778
2796
|
* not live under the root expected for their project class (ADR-006 §4).
|
|
@@ -2784,13 +2802,39 @@ interface LayoutViolation {
|
|
|
2784
2802
|
* sub-project).
|
|
2785
2803
|
* - `outdir` comparison is done in POSIX form against the project root so
|
|
2786
2804
|
* absolute paths synthesised on Windows still match.
|
|
2805
|
+
* - A `StarlightProject` carrying `role: "site"` is validated against the
|
|
2806
|
+
* `sites/` root rather than the default `docs/` root. This keeps the
|
|
2807
|
+
* class-to-root mapping static while still honouring the ADR-006 §3
|
|
2808
|
+
* docs-singleton carve-out for docs-role projects.
|
|
2787
2809
|
*/
|
|
2788
2810
|
declare function validateMonorepoLayout(root: Project$1): Array<LayoutViolation>;
|
|
2811
|
+
/**
|
|
2812
|
+
* Inspect every sub-project of `root` and flag cases where more than one
|
|
2813
|
+
* `StarlightProject` claims `role: "docs"` (ADR-006 §3 — there is
|
|
2814
|
+
* exactly one Starlight docs site per monorepo, and it lives at `/docs`).
|
|
2815
|
+
*
|
|
2816
|
+
* Returns `undefined` when the singleton rule is satisfied (zero or one
|
|
2817
|
+
* docs-role Starlight project). Returns a single violation whose
|
|
2818
|
+
* `projectNames` list contains every offending project when two or more
|
|
2819
|
+
* docs-role Starlight projects are present — the caller reports the
|
|
2820
|
+
* whole set so authors can see every candidate at once rather than
|
|
2821
|
+
* fixing them one at a time.
|
|
2822
|
+
*
|
|
2823
|
+
* Site-role Starlight projects never count toward the singleton limit
|
|
2824
|
+
* and are not flagged.
|
|
2825
|
+
*/
|
|
2826
|
+
declare function validateStarlightSingleton(root: Project$1): StarlightSingletonViolation | undefined;
|
|
2789
2827
|
/**
|
|
2790
2828
|
* Render one {@link LayoutViolation} as an actionable, single-line error
|
|
2791
2829
|
* message pointing the reader at ADR-006.
|
|
2792
2830
|
*/
|
|
2793
2831
|
declare function formatLayoutViolation(violation: LayoutViolation): string;
|
|
2832
|
+
/**
|
|
2833
|
+
* Render a {@link StarlightSingletonViolation} as an actionable,
|
|
2834
|
+
* single-line error message pointing the reader at ADR-006 §3
|
|
2835
|
+
* (docs-singleton carve-out).
|
|
2836
|
+
*/
|
|
2837
|
+
declare function formatStarlightSingletonViolation(violation: StarlightSingletonViolation): string;
|
|
2794
2838
|
|
|
2795
2839
|
/**
|
|
2796
2840
|
* Each of the below options corresponds to a task property found here:
|
|
@@ -3410,10 +3454,20 @@ declare class MonorepoProject extends TypeScriptAppProject {
|
|
|
3410
3454
|
* layout contract. Runs in `preSynthesize` so all sub-projects are
|
|
3411
3455
|
* attached by the time we inspect the tree.
|
|
3412
3456
|
*
|
|
3457
|
+
* Two checks run in sequence:
|
|
3458
|
+
*
|
|
3459
|
+
* 1. **Outdir-vs-root validation.** Every sub-project's `outdir` must
|
|
3460
|
+
* live under the root expected for its project type (ADR-006 §4).
|
|
3461
|
+
* 2. **Docs-singleton validation.** At most one `StarlightProject`
|
|
3462
|
+
* may carry `role: "docs"` (ADR-006 §3).
|
|
3463
|
+
*
|
|
3413
3464
|
* Behavior is controlled by `layoutEnforcement`:
|
|
3414
|
-
* - `"off"` — skip
|
|
3415
|
-
* - `"warn"` — log a `console.warn` per violation; continue.
|
|
3416
|
-
*
|
|
3465
|
+
* - `"off"` — skip both checks.
|
|
3466
|
+
* - `"warn"` — log a `console.warn` per violation; continue. Singleton
|
|
3467
|
+
* violations also warn in this mode rather than throwing, so all
|
|
3468
|
+
* layout findings are surfaced consistently.
|
|
3469
|
+
* - `"error"` — throw on the first outdir violation, or on the
|
|
3470
|
+
* singleton violation if outdir validation passed.
|
|
3417
3471
|
*/
|
|
3418
3472
|
preSynthesize(): void;
|
|
3419
3473
|
/**
|
|
@@ -3590,6 +3644,19 @@ declare class ProjectMetadata extends Component {
|
|
|
3590
3644
|
* Explicit options always take precedence over auto-detected values.
|
|
3591
3645
|
*/
|
|
3592
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;
|
|
3593
3660
|
/**
|
|
3594
3661
|
* Attempts to auto-detect repository owner and name from the Projen
|
|
3595
3662
|
* project's package.json repository field.
|
|
@@ -3633,6 +3700,21 @@ declare function resolveAwsCdkProjectOutdir(packageName: string | undefined): st
|
|
|
3633
3700
|
*/
|
|
3634
3701
|
declare function resolveAstroProjectOutdir(packageName: string | undefined): string;
|
|
3635
3702
|
|
|
3703
|
+
/**
|
|
3704
|
+
* Role a {@link StarlightProject} plays inside the monorepo (ADR-006).
|
|
3705
|
+
*
|
|
3706
|
+
* - `"docs"` — the monorepo-wide Starlight docs site. Singleton: at most one
|
|
3707
|
+
* docs-role project may exist per `MonorepoProject`. Defaults `outdir` to
|
|
3708
|
+
* `docs/`.
|
|
3709
|
+
* - `"site"` — a user-facing Starlight site deployed from `sites/`. Behaves
|
|
3710
|
+
* like a regular {@link AstroProject} for placement: defaults `outdir` to
|
|
3711
|
+
* `sites/<scope>/<name>`.
|
|
3712
|
+
*/
|
|
3713
|
+
declare const STARLIGHT_ROLE: {
|
|
3714
|
+
readonly DOCS: "docs";
|
|
3715
|
+
readonly SITE: "site";
|
|
3716
|
+
};
|
|
3717
|
+
type StarlightRole = (typeof STARLIGHT_ROLE)[keyof typeof STARLIGHT_ROLE];
|
|
3636
3718
|
/**
|
|
3637
3719
|
* A single Starlight social icon link.
|
|
3638
3720
|
*/
|
|
@@ -3687,6 +3769,19 @@ interface StarlightProjectOptions extends AstroProjectOptions {
|
|
|
3687
3769
|
* Starlight site title (required).
|
|
3688
3770
|
*/
|
|
3689
3771
|
readonly starlightTitle: string;
|
|
3772
|
+
/**
|
|
3773
|
+
* Role this Starlight project plays in the monorepo (ADR-006).
|
|
3774
|
+
*
|
|
3775
|
+
* - `"docs"` (default) — the monorepo-wide docs singleton. `outdir`
|
|
3776
|
+
* defaults to `docs/`. Only one docs-role `StarlightProject` may
|
|
3777
|
+
* exist per `MonorepoProject`; a second one fails synth.
|
|
3778
|
+
* - `"site"` — a regular user-facing Starlight site. `outdir`
|
|
3779
|
+
* defaults to `sites/<scope>/<name>` (same rule as
|
|
3780
|
+
* `AstroProject`). Multiple site-role projects are allowed.
|
|
3781
|
+
*
|
|
3782
|
+
* @default "docs"
|
|
3783
|
+
*/
|
|
3784
|
+
readonly role?: StarlightRole;
|
|
3690
3785
|
/**
|
|
3691
3786
|
* Starlight site description.
|
|
3692
3787
|
*/
|
|
@@ -3737,6 +3832,13 @@ interface StarlightProjectOptions extends AstroProjectOptions {
|
|
|
3737
3832
|
* Starlight Astro integration.
|
|
3738
3833
|
*/
|
|
3739
3834
|
declare class StarlightProject extends AstroProject {
|
|
3835
|
+
/**
|
|
3836
|
+
* Role this Starlight project plays in the monorepo (ADR-006).
|
|
3837
|
+
*
|
|
3838
|
+
* - `"docs"` — monorepo-wide docs singleton at `/docs`.
|
|
3839
|
+
* - `"site"` — user-facing Starlight site under `sites/<scope>/<name>`.
|
|
3840
|
+
*/
|
|
3841
|
+
readonly role: StarlightRole;
|
|
3740
3842
|
constructor(userOptions: StarlightProjectOptions);
|
|
3741
3843
|
}
|
|
3742
3844
|
|
|
@@ -3774,4 +3876,4 @@ declare const COMPLETE_JOB_ID = "complete";
|
|
|
3774
3876
|
*/
|
|
3775
3877
|
declare function addBuildCompleteJob(buildWorkflow: BuildWorkflow): void;
|
|
3776
3878
|
|
|
3777
|
-
export { AGENT_MODEL, AGENT_PLATFORM, AGENT_RULE_SCOPE, AgentConfig, type AgentConfigOptions, type AgentModel, type AgentPlatform, type AgentPlatformOverrides, type AgentProcedure, type AgentRule, type AgentRuleBundle, type AgentRuleScope, type AgentSkill, type AgentSubAgent, type AgentSubAgentPlatformOverrides, type ApproveMergeUpgradeOptions, AstroConfig, type AstroConfigOptions, type AstroIntegrationSpec, AstroOutput, AstroProject, type AstroProjectOptions, type AwsAccount, AwsCdkProject, type AwsCdkProjectOptions, AwsDeployWorkflow, AwsDeploymentConfig, AwsDeploymentTarget, type AwsDeploymentTargetOptions, type AwsLocalDeploymentConfig, type AwsOrganization, type AwsRegion, AwsTeardownWorkflow, type AwsTeardownWorkflowOptions, BUILT_IN_BUNDLES, CLAUDE_RULE_TARGET, COMPLETE_JOB_ID, type CiDeploymentConfig, type ClassTypeOptions, type ClaudeAutoModeConfig, type ClaudeHookAction, type ClaudeHookEntry, type ClaudeHooksConfig, type ClaudePermissionsConfig, type ClaudeRuleTarget, type ClaudeSandboxConfig, type ClaudeSettingsConfig, type CopilotHandoff, type CursorHookAction, type CursorHooksConfig, type CursorSettingsConfig, DEFAULT_PRIORITY_LABELS, DEFAULT_STATUS_LABELS, DEFAULT_TEARDOWN_BRANCH_PATTERNS, DEFAULT_TYPE_LABELS, type DeployWorkflowOptions, type DeploymentMetadata, type GitBranch, type GitHubBoardMetadata, type GitHubProjectMetadata, type GitHubSprintMetadata, type IDependencyResolver, JsiiFaker, LAYOUT_ENFORCEMENT, LAYOUT_ROOT_BY_PROJECT_TYPE, type LabelDefinition, type LayoutEnforcement, type LayoutViolation, MCP_TRANSPORT, MERGE_METHODS, MIMIMUM_RELEASE_AGE, MINIMUM_RELEASE_AGE, MONOREPO_LAYOUT, type McpServerConfig, type McpTransport, type MergeMethod, type MonorepoLayoutRoot, MonorepoProject, type MonorepoProjectOptions, type OrganizationMetadata, PROD_DEPLOY_NAME, PnpmWorkspace, type PnpmWorkspaceOptions, ProjectMetadata, type ProjectMetadataOptions, REQUIREMENTS_WRITER_PATHS, ROOT_CI_TASK_NAME, ROOT_TURBO_TASK_NAME, type RemoteCacheOptions, type RepositoryMetadata, ResetTask, type ResetTaskOptions, type ResolvedProjectMetadata, type SlackMetadata, type StarlightEditLink, type StarlightLogo, StarlightProject, type StarlightProjectOptions, type StarlightSidebarItem, type StarlightSocialLink, type SyncLabelsOptions, type TemplateResolveResult, TestRunner, TurboRepo, type TurboRepoOptions, TurboRepoTask, type TurboRepoTaskOptions, TypeScriptConfig, TypeScriptProject, type TypeScriptProjectOptions, VERSION, VERSION_KEYS_SKIP, VERSION_NPM_PACKAGES, VSCodeConfig, type VersionKey, Vitest, type VitestConfigOptions, type VitestOptions, addApproveMergeUpgradeWorkflow, addBuildCompleteJob, addSyncLabelsWorkflow, awsCdkBundle, baseBundle, bcmWriterBundle, companyProfileBundle, formatLayoutViolation, getLatestEligibleVersion, githubWorkflowBundle, industryDiscoveryBundle, jestBundle, maintenanceAuditBundle, meetingAnalysisBundle, orchestratorBundle, peopleProfileBundle, pnpmBundle, prReviewBundle, projenBundle, requirementsAnalystBundle, requirementsReviewerBundle, requirementsWriterBundle, researchPipelineBundle, resolveAstroProjectOutdir, resolveAwsCdkProjectOutdir, resolveModelAlias, resolveOutdirFromPackageName, resolveTemplateVariables, resolveTypeScriptProjectOutdir, slackBundle, softwareProfileBundle, turborepoBundle, typescriptBundle, validateMonorepoLayout, vitestBundle };
|
|
3879
|
+
export { AGENT_MODEL, AGENT_PLATFORM, AGENT_RULE_SCOPE, AgentConfig, type AgentConfigOptions, type AgentModel, type AgentPlatform, type AgentPlatformOverrides, type AgentProcedure, type AgentRule, type AgentRuleBundle, type AgentRuleScope, type AgentSkill, type AgentSubAgent, type AgentSubAgentPlatformOverrides, type ApproveMergeUpgradeOptions, AstroConfig, type AstroConfigOptions, type AstroIntegrationSpec, AstroOutput, AstroProject, type AstroProjectOptions, type AwsAccount, AwsCdkProject, type AwsCdkProjectOptions, AwsDeployWorkflow, AwsDeploymentConfig, AwsDeploymentTarget, type AwsDeploymentTargetOptions, type AwsLocalDeploymentConfig, type AwsOrganization, type AwsRegion, AwsTeardownWorkflow, type AwsTeardownWorkflowOptions, BUILT_IN_BUNDLES, CLAUDE_RULE_TARGET, COMPLETE_JOB_ID, type CiDeploymentConfig, type ClassTypeOptions, type ClaudeAutoModeConfig, type ClaudeHookAction, type ClaudeHookEntry, type ClaudeHooksConfig, type ClaudePermissionsConfig, type ClaudeRuleTarget, type ClaudeSandboxConfig, type ClaudeSettingsConfig, type CopilotHandoff, type CursorHookAction, type CursorHooksConfig, type CursorSettingsConfig, DEFAULT_PRIORITY_LABELS, DEFAULT_STATUS_LABELS, DEFAULT_TEARDOWN_BRANCH_PATTERNS, DEFAULT_TYPE_LABELS, type DeployWorkflowOptions, type DeploymentMetadata, type GitBranch, type GitHubBoardMetadata, type GitHubProjectMetadata, type GitHubSprintMetadata, type IDependencyResolver, JsiiFaker, LAYOUT_ENFORCEMENT, LAYOUT_ROOT_BY_PROJECT_TYPE, type LabelDefinition, type LayoutEnforcement, type LayoutViolation, MCP_TRANSPORT, MERGE_METHODS, MIMIMUM_RELEASE_AGE, MINIMUM_RELEASE_AGE, MONOREPO_LAYOUT, type McpServerConfig, type McpTransport, type MergeMethod, type MonorepoLayoutRoot, MonorepoProject, type MonorepoProjectOptions, type OrganizationMetadata, PROD_DEPLOY_NAME, PnpmWorkspace, type PnpmWorkspaceOptions, ProjectMetadata, type ProjectMetadataOptions, REQUIREMENTS_WRITER_PATHS, ROOT_CI_TASK_NAME, ROOT_TURBO_TASK_NAME, type RemoteCacheOptions, type RepositoryMetadata, ResetTask, type ResetTaskOptions, type ResolvedProjectMetadata, STARLIGHT_ROLE, type SlackMetadata, type StarlightEditLink, type StarlightLogo, StarlightProject, type StarlightProjectOptions, type StarlightRole, type StarlightSidebarItem, type StarlightSingletonViolation, type StarlightSocialLink, type SyncLabelsOptions, type TemplateResolveResult, TestRunner, TurboRepo, type TurboRepoOptions, TurboRepoTask, type TurboRepoTaskOptions, TypeScriptConfig, TypeScriptProject, type TypeScriptProjectOptions, VERSION, VERSION_KEYS_SKIP, VERSION_NPM_PACKAGES, VSCodeConfig, type VersionKey, Vitest, type VitestConfigOptions, type VitestOptions, addApproveMergeUpgradeWorkflow, addBuildCompleteJob, addSyncLabelsWorkflow, awsCdkBundle, baseBundle, bcmWriterBundle, companyProfileBundle, formatLayoutViolation, formatStarlightSingletonViolation, getLatestEligibleVersion, githubWorkflowBundle, industryDiscoveryBundle, jestBundle, maintenanceAuditBundle, meetingAnalysisBundle, orchestratorBundle, peopleProfileBundle, pnpmBundle, prReviewBundle, projenBundle, requirementsAnalystBundle, requirementsReviewerBundle, requirementsWriterBundle, researchPipelineBundle, resolveAstroProjectOutdir, resolveAwsCdkProjectOutdir, resolveModelAlias, resolveOutdirFromPackageName, resolveTemplateVariables, resolveTypeScriptProjectOutdir, slackBundle, softwareProfileBundle, turborepoBundle, typescriptBundle, validateMonorepoLayout, validateStarlightSingleton, vitestBundle };
|
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
|
/**
|
|
@@ -2806,8 +2814,10 @@ type LayoutEnforcement = (typeof LAYOUT_ENFORCEMENT)[keyof typeof LAYOUT_ENFORCE
|
|
|
2806
2814
|
*
|
|
2807
2815
|
* We key by class name (not class reference) so this module stays free of
|
|
2808
2816
|
* import cycles with the project-type files that validate against it.
|
|
2809
|
-
* `StarlightProject` maps to `DOCS` because the docs-singleton
|
|
2810
|
-
*
|
|
2817
|
+
* `StarlightProject` maps to `DOCS` by default because the docs-singleton
|
|
2818
|
+
* rule says a default-role Starlight project is the monorepo-wide docs
|
|
2819
|
+
* site. Site-role Starlight projects override this mapping at validate
|
|
2820
|
+
* time via their instance `role` property.
|
|
2811
2821
|
*
|
|
2812
2822
|
* @see ADR-006 §4 — Configulator project-type → `outdir` mapping
|
|
2813
2823
|
*/
|
|
@@ -2822,6 +2832,14 @@ interface LayoutViolation {
|
|
|
2822
2832
|
readonly outdir: string;
|
|
2823
2833
|
readonly expectedRoot: MonorepoLayoutRoot;
|
|
2824
2834
|
}
|
|
2835
|
+
/**
|
|
2836
|
+
* Violation reported by {@link validateStarlightSingleton} when a
|
|
2837
|
+
* `MonorepoProject` tree contains more than one `StarlightProject`
|
|
2838
|
+
* carrying `role: "docs"` (the docs-singleton rule — ADR-006 §3).
|
|
2839
|
+
*/
|
|
2840
|
+
interface StarlightSingletonViolation {
|
|
2841
|
+
readonly projectNames: ReadonlyArray<string>;
|
|
2842
|
+
}
|
|
2825
2843
|
/**
|
|
2826
2844
|
* Inspect every sub-project of `root` and collect those whose `outdir` does
|
|
2827
2845
|
* not live under the root expected for their project class (ADR-006 §4).
|
|
@@ -2833,13 +2851,39 @@ interface LayoutViolation {
|
|
|
2833
2851
|
* sub-project).
|
|
2834
2852
|
* - `outdir` comparison is done in POSIX form against the project root so
|
|
2835
2853
|
* absolute paths synthesised on Windows still match.
|
|
2854
|
+
* - A `StarlightProject` carrying `role: "site"` is validated against the
|
|
2855
|
+
* `sites/` root rather than the default `docs/` root. This keeps the
|
|
2856
|
+
* class-to-root mapping static while still honouring the ADR-006 §3
|
|
2857
|
+
* docs-singleton carve-out for docs-role projects.
|
|
2836
2858
|
*/
|
|
2837
2859
|
declare function validateMonorepoLayout(root: Project): Array<LayoutViolation>;
|
|
2860
|
+
/**
|
|
2861
|
+
* Inspect every sub-project of `root` and flag cases where more than one
|
|
2862
|
+
* `StarlightProject` claims `role: "docs"` (ADR-006 §3 — there is
|
|
2863
|
+
* exactly one Starlight docs site per monorepo, and it lives at `/docs`).
|
|
2864
|
+
*
|
|
2865
|
+
* Returns `undefined` when the singleton rule is satisfied (zero or one
|
|
2866
|
+
* docs-role Starlight project). Returns a single violation whose
|
|
2867
|
+
* `projectNames` list contains every offending project when two or more
|
|
2868
|
+
* docs-role Starlight projects are present — the caller reports the
|
|
2869
|
+
* whole set so authors can see every candidate at once rather than
|
|
2870
|
+
* fixing them one at a time.
|
|
2871
|
+
*
|
|
2872
|
+
* Site-role Starlight projects never count toward the singleton limit
|
|
2873
|
+
* and are not flagged.
|
|
2874
|
+
*/
|
|
2875
|
+
declare function validateStarlightSingleton(root: Project): StarlightSingletonViolation | undefined;
|
|
2838
2876
|
/**
|
|
2839
2877
|
* Render one {@link LayoutViolation} as an actionable, single-line error
|
|
2840
2878
|
* message pointing the reader at ADR-006.
|
|
2841
2879
|
*/
|
|
2842
2880
|
declare function formatLayoutViolation(violation: LayoutViolation): string;
|
|
2881
|
+
/**
|
|
2882
|
+
* Render a {@link StarlightSingletonViolation} as an actionable,
|
|
2883
|
+
* single-line error message pointing the reader at ADR-006 §3
|
|
2884
|
+
* (docs-singleton carve-out).
|
|
2885
|
+
*/
|
|
2886
|
+
declare function formatStarlightSingletonViolation(violation: StarlightSingletonViolation): string;
|
|
2843
2887
|
|
|
2844
2888
|
/**
|
|
2845
2889
|
* Each of the below options corresponds to a task property found here:
|
|
@@ -3459,10 +3503,20 @@ declare class MonorepoProject extends TypeScriptAppProject {
|
|
|
3459
3503
|
* layout contract. Runs in `preSynthesize` so all sub-projects are
|
|
3460
3504
|
* attached by the time we inspect the tree.
|
|
3461
3505
|
*
|
|
3506
|
+
* Two checks run in sequence:
|
|
3507
|
+
*
|
|
3508
|
+
* 1. **Outdir-vs-root validation.** Every sub-project's `outdir` must
|
|
3509
|
+
* live under the root expected for its project type (ADR-006 §4).
|
|
3510
|
+
* 2. **Docs-singleton validation.** At most one `StarlightProject`
|
|
3511
|
+
* may carry `role: "docs"` (ADR-006 §3).
|
|
3512
|
+
*
|
|
3462
3513
|
* Behavior is controlled by `layoutEnforcement`:
|
|
3463
|
-
* - `"off"` — skip
|
|
3464
|
-
* - `"warn"` — log a `console.warn` per violation; continue.
|
|
3465
|
-
*
|
|
3514
|
+
* - `"off"` — skip both checks.
|
|
3515
|
+
* - `"warn"` — log a `console.warn` per violation; continue. Singleton
|
|
3516
|
+
* violations also warn in this mode rather than throwing, so all
|
|
3517
|
+
* layout findings are surfaced consistently.
|
|
3518
|
+
* - `"error"` — throw on the first outdir violation, or on the
|
|
3519
|
+
* singleton violation if outdir validation passed.
|
|
3466
3520
|
*/
|
|
3467
3521
|
preSynthesize(): void;
|
|
3468
3522
|
/**
|
|
@@ -3639,6 +3693,19 @@ declare class ProjectMetadata extends Component {
|
|
|
3639
3693
|
* Explicit options always take precedence over auto-detected values.
|
|
3640
3694
|
*/
|
|
3641
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;
|
|
3642
3709
|
/**
|
|
3643
3710
|
* Attempts to auto-detect repository owner and name from the Projen
|
|
3644
3711
|
* project's package.json repository field.
|
|
@@ -3682,6 +3749,21 @@ declare function resolveAwsCdkProjectOutdir(packageName: string | undefined): st
|
|
|
3682
3749
|
*/
|
|
3683
3750
|
declare function resolveAstroProjectOutdir(packageName: string | undefined): string;
|
|
3684
3751
|
|
|
3752
|
+
/**
|
|
3753
|
+
* Role a {@link StarlightProject} plays inside the monorepo (ADR-006).
|
|
3754
|
+
*
|
|
3755
|
+
* - `"docs"` — the monorepo-wide Starlight docs site. Singleton: at most one
|
|
3756
|
+
* docs-role project may exist per `MonorepoProject`. Defaults `outdir` to
|
|
3757
|
+
* `docs/`.
|
|
3758
|
+
* - `"site"` — a user-facing Starlight site deployed from `sites/`. Behaves
|
|
3759
|
+
* like a regular {@link AstroProject} for placement: defaults `outdir` to
|
|
3760
|
+
* `sites/<scope>/<name>`.
|
|
3761
|
+
*/
|
|
3762
|
+
declare const STARLIGHT_ROLE: {
|
|
3763
|
+
readonly DOCS: "docs";
|
|
3764
|
+
readonly SITE: "site";
|
|
3765
|
+
};
|
|
3766
|
+
type StarlightRole = (typeof STARLIGHT_ROLE)[keyof typeof STARLIGHT_ROLE];
|
|
3685
3767
|
/**
|
|
3686
3768
|
* A single Starlight social icon link.
|
|
3687
3769
|
*/
|
|
@@ -3736,6 +3818,19 @@ interface StarlightProjectOptions extends AstroProjectOptions {
|
|
|
3736
3818
|
* Starlight site title (required).
|
|
3737
3819
|
*/
|
|
3738
3820
|
readonly starlightTitle: string;
|
|
3821
|
+
/**
|
|
3822
|
+
* Role this Starlight project plays in the monorepo (ADR-006).
|
|
3823
|
+
*
|
|
3824
|
+
* - `"docs"` (default) — the monorepo-wide docs singleton. `outdir`
|
|
3825
|
+
* defaults to `docs/`. Only one docs-role `StarlightProject` may
|
|
3826
|
+
* exist per `MonorepoProject`; a second one fails synth.
|
|
3827
|
+
* - `"site"` — a regular user-facing Starlight site. `outdir`
|
|
3828
|
+
* defaults to `sites/<scope>/<name>` (same rule as
|
|
3829
|
+
* `AstroProject`). Multiple site-role projects are allowed.
|
|
3830
|
+
*
|
|
3831
|
+
* @default "docs"
|
|
3832
|
+
*/
|
|
3833
|
+
readonly role?: StarlightRole;
|
|
3739
3834
|
/**
|
|
3740
3835
|
* Starlight site description.
|
|
3741
3836
|
*/
|
|
@@ -3786,6 +3881,13 @@ interface StarlightProjectOptions extends AstroProjectOptions {
|
|
|
3786
3881
|
* Starlight Astro integration.
|
|
3787
3882
|
*/
|
|
3788
3883
|
declare class StarlightProject extends AstroProject {
|
|
3884
|
+
/**
|
|
3885
|
+
* Role this Starlight project plays in the monorepo (ADR-006).
|
|
3886
|
+
*
|
|
3887
|
+
* - `"docs"` — monorepo-wide docs singleton at `/docs`.
|
|
3888
|
+
* - `"site"` — user-facing Starlight site under `sites/<scope>/<name>`.
|
|
3889
|
+
*/
|
|
3890
|
+
readonly role: StarlightRole;
|
|
3789
3891
|
constructor(userOptions: StarlightProjectOptions);
|
|
3790
3892
|
}
|
|
3791
3893
|
|
|
@@ -3823,5 +3925,5 @@ declare const COMPLETE_JOB_ID = "complete";
|
|
|
3823
3925
|
*/
|
|
3824
3926
|
declare function addBuildCompleteJob(buildWorkflow: BuildWorkflow): void;
|
|
3825
3927
|
|
|
3826
|
-
export { AGENT_MODEL, AGENT_PLATFORM, AGENT_RULE_SCOPE, AgentConfig, AstroConfig, AstroOutput, AstroProject, AwsCdkProject, AwsDeployWorkflow, AwsDeploymentConfig, AwsDeploymentTarget, AwsTeardownWorkflow, BUILT_IN_BUNDLES, CLAUDE_RULE_TARGET, COMPLETE_JOB_ID, DEFAULT_PRIORITY_LABELS, DEFAULT_STATUS_LABELS, DEFAULT_TEARDOWN_BRANCH_PATTERNS, DEFAULT_TYPE_LABELS, JsiiFaker, LAYOUT_ENFORCEMENT, LAYOUT_ROOT_BY_PROJECT_TYPE, MCP_TRANSPORT, MERGE_METHODS, MIMIMUM_RELEASE_AGE, MINIMUM_RELEASE_AGE, MONOREPO_LAYOUT, MonorepoProject, PROD_DEPLOY_NAME, PnpmWorkspace, ProjectMetadata, REQUIREMENTS_WRITER_PATHS, ROOT_CI_TASK_NAME, ROOT_TURBO_TASK_NAME, ResetTask, StarlightProject, TestRunner, TurboRepo, TurboRepoTask, TypeScriptConfig, TypeScriptProject, VERSION, VERSION_KEYS_SKIP, VERSION_NPM_PACKAGES, VSCodeConfig, Vitest, addApproveMergeUpgradeWorkflow, addBuildCompleteJob, addSyncLabelsWorkflow, awsCdkBundle, baseBundle, bcmWriterBundle, companyProfileBundle, formatLayoutViolation, getLatestEligibleVersion, githubWorkflowBundle, industryDiscoveryBundle, jestBundle, maintenanceAuditBundle, meetingAnalysisBundle, orchestratorBundle, peopleProfileBundle, pnpmBundle, prReviewBundle, projenBundle, requirementsAnalystBundle, requirementsReviewerBundle, requirementsWriterBundle, researchPipelineBundle, resolveAstroProjectOutdir, resolveAwsCdkProjectOutdir, resolveModelAlias, resolveOutdirFromPackageName, resolveTemplateVariables, resolveTypeScriptProjectOutdir, slackBundle, softwareProfileBundle, turborepoBundle, typescriptBundle, validateMonorepoLayout, vitestBundle };
|
|
3827
|
-
export type { AgentConfigOptions, AgentModel, AgentPlatform, AgentPlatformOverrides, AgentProcedure, AgentRule, AgentRuleBundle, AgentRuleScope, AgentSkill, AgentSubAgent, AgentSubAgentPlatformOverrides, ApproveMergeUpgradeOptions, AstroConfigOptions, AstroIntegrationSpec, AstroProjectOptions, AwsAccount, AwsCdkProjectOptions, AwsDeploymentTargetOptions, AwsLocalDeploymentConfig, AwsOrganization, AwsRegion, AwsTeardownWorkflowOptions, CiDeploymentConfig, ClassTypeOptions, ClaudeAutoModeConfig, ClaudeHookAction, ClaudeHookEntry, ClaudeHooksConfig, ClaudePermissionsConfig, ClaudeRuleTarget, ClaudeSandboxConfig, ClaudeSettingsConfig, CopilotHandoff, CursorHookAction, CursorHooksConfig, CursorSettingsConfig, DeployWorkflowOptions, DeploymentMetadata, GitBranch, GitHubBoardMetadata, GitHubProjectMetadata, GitHubSprintMetadata, IDependencyResolver, LabelDefinition, LayoutEnforcement, LayoutViolation, McpServerConfig, McpTransport, MergeMethod, MonorepoLayoutRoot, MonorepoProjectOptions, OrganizationMetadata, PnpmWorkspaceOptions, ProjectMetadataOptions, RemoteCacheOptions, RepositoryMetadata, ResetTaskOptions, ResolvedProjectMetadata, SlackMetadata, StarlightEditLink, StarlightLogo, StarlightProjectOptions, StarlightSidebarItem, StarlightSocialLink, SyncLabelsOptions, TemplateResolveResult, TurboRepoOptions, TurboRepoTaskOptions, TypeScriptProjectOptions, VersionKey, VitestConfigOptions, VitestOptions };
|
|
3928
|
+
export { AGENT_MODEL, AGENT_PLATFORM, AGENT_RULE_SCOPE, AgentConfig, AstroConfig, AstroOutput, AstroProject, AwsCdkProject, AwsDeployWorkflow, AwsDeploymentConfig, AwsDeploymentTarget, AwsTeardownWorkflow, BUILT_IN_BUNDLES, CLAUDE_RULE_TARGET, COMPLETE_JOB_ID, DEFAULT_PRIORITY_LABELS, DEFAULT_STATUS_LABELS, DEFAULT_TEARDOWN_BRANCH_PATTERNS, DEFAULT_TYPE_LABELS, JsiiFaker, LAYOUT_ENFORCEMENT, LAYOUT_ROOT_BY_PROJECT_TYPE, MCP_TRANSPORT, MERGE_METHODS, MIMIMUM_RELEASE_AGE, MINIMUM_RELEASE_AGE, MONOREPO_LAYOUT, MonorepoProject, PROD_DEPLOY_NAME, PnpmWorkspace, ProjectMetadata, REQUIREMENTS_WRITER_PATHS, ROOT_CI_TASK_NAME, ROOT_TURBO_TASK_NAME, ResetTask, STARLIGHT_ROLE, StarlightProject, TestRunner, TurboRepo, TurboRepoTask, TypeScriptConfig, TypeScriptProject, VERSION, VERSION_KEYS_SKIP, VERSION_NPM_PACKAGES, VSCodeConfig, Vitest, addApproveMergeUpgradeWorkflow, addBuildCompleteJob, addSyncLabelsWorkflow, awsCdkBundle, baseBundle, bcmWriterBundle, companyProfileBundle, formatLayoutViolation, formatStarlightSingletonViolation, getLatestEligibleVersion, githubWorkflowBundle, industryDiscoveryBundle, jestBundle, maintenanceAuditBundle, meetingAnalysisBundle, orchestratorBundle, peopleProfileBundle, pnpmBundle, prReviewBundle, projenBundle, requirementsAnalystBundle, requirementsReviewerBundle, requirementsWriterBundle, researchPipelineBundle, resolveAstroProjectOutdir, resolveAwsCdkProjectOutdir, resolveModelAlias, resolveOutdirFromPackageName, resolveTemplateVariables, resolveTypeScriptProjectOutdir, slackBundle, softwareProfileBundle, turborepoBundle, typescriptBundle, validateMonorepoLayout, validateStarlightSingleton, vitestBundle };
|
|
3929
|
+
export type { AgentConfigOptions, AgentModel, AgentPlatform, AgentPlatformOverrides, AgentProcedure, AgentRule, AgentRuleBundle, AgentRuleScope, AgentSkill, AgentSubAgent, AgentSubAgentPlatformOverrides, ApproveMergeUpgradeOptions, AstroConfigOptions, AstroIntegrationSpec, AstroProjectOptions, AwsAccount, AwsCdkProjectOptions, AwsDeploymentTargetOptions, AwsLocalDeploymentConfig, AwsOrganization, AwsRegion, AwsTeardownWorkflowOptions, CiDeploymentConfig, ClassTypeOptions, ClaudeAutoModeConfig, ClaudeHookAction, ClaudeHookEntry, ClaudeHooksConfig, ClaudePermissionsConfig, ClaudeRuleTarget, ClaudeSandboxConfig, ClaudeSettingsConfig, CopilotHandoff, CursorHookAction, CursorHooksConfig, CursorSettingsConfig, DeployWorkflowOptions, DeploymentMetadata, GitBranch, GitHubBoardMetadata, GitHubProjectMetadata, GitHubSprintMetadata, IDependencyResolver, LabelDefinition, LayoutEnforcement, LayoutViolation, McpServerConfig, McpTransport, MergeMethod, MonorepoLayoutRoot, MonorepoProjectOptions, OrganizationMetadata, PnpmWorkspaceOptions, ProjectMetadataOptions, RemoteCacheOptions, RepositoryMetadata, ResetTaskOptions, ResolvedProjectMetadata, SlackMetadata, StarlightEditLink, StarlightLogo, StarlightProjectOptions, StarlightRole, StarlightSidebarItem, StarlightSingletonViolation, StarlightSocialLink, SyncLabelsOptions, TemplateResolveResult, TurboRepoOptions, TurboRepoTaskOptions, TypeScriptProjectOptions, VersionKey, VitestConfigOptions, VitestOptions };
|