@codedrifters/configulator 0.0.237 → 0.0.239
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 +103 -1
- package/lib/index.d.ts +104 -2
- package/lib/index.js +126 -13
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +121 -13
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.d.mts
CHANGED
|
@@ -2721,6 +2721,77 @@ declare class AwsDeployWorkflow extends Component {
|
|
|
2721
2721
|
preSynthesize(): void;
|
|
2722
2722
|
}
|
|
2723
2723
|
|
|
2724
|
+
/**
|
|
2725
|
+
* Canonical top-level folders for a configulator monorepo (ADR-006).
|
|
2726
|
+
*
|
|
2727
|
+
* Every sub-project must live under one of these roots. `DOCS` is a
|
|
2728
|
+
* singleton (the single Starlight site at `/docs`); `APPS`, `PACKAGES`,
|
|
2729
|
+
* and `SITES` are parents for `@scope/<name>` sub-projects.
|
|
2730
|
+
*
|
|
2731
|
+
* @see docs/requirements/architectural-decisions/ADR-006-monorepo-layout.md
|
|
2732
|
+
*/
|
|
2733
|
+
declare const MONOREPO_LAYOUT: {
|
|
2734
|
+
readonly DOCS: "docs";
|
|
2735
|
+
readonly APPS: "apps";
|
|
2736
|
+
readonly PACKAGES: "packages";
|
|
2737
|
+
readonly SITES: "sites";
|
|
2738
|
+
};
|
|
2739
|
+
type MonorepoLayoutRoot = (typeof MONOREPO_LAYOUT)[keyof typeof MONOREPO_LAYOUT];
|
|
2740
|
+
/**
|
|
2741
|
+
* How `MonorepoProject` reacts when a sub-project's `outdir` falls outside
|
|
2742
|
+
* the root expected for its project type (see ADR-006 §4).
|
|
2743
|
+
*
|
|
2744
|
+
* - `"off"` — no validation runs.
|
|
2745
|
+
* - `"warn"` — log a console warning per offending sub-project; synth proceeds.
|
|
2746
|
+
* - `"error"` — throw on the first offending sub-project; synth fails.
|
|
2747
|
+
*/
|
|
2748
|
+
declare const LAYOUT_ENFORCEMENT: {
|
|
2749
|
+
readonly OFF: "off";
|
|
2750
|
+
readonly WARN: "warn";
|
|
2751
|
+
readonly ERROR: "error";
|
|
2752
|
+
};
|
|
2753
|
+
type LayoutEnforcement = (typeof LAYOUT_ENFORCEMENT)[keyof typeof LAYOUT_ENFORCEMENT];
|
|
2754
|
+
/**
|
|
2755
|
+
* Mapping from configulator project-type class name to the root folder its
|
|
2756
|
+
* `outdir` must live under.
|
|
2757
|
+
*
|
|
2758
|
+
* We key by class name (not class reference) so this module stays free of
|
|
2759
|
+
* import cycles with the project-type files that validate against it.
|
|
2760
|
+
* `StarlightProject` maps to `DOCS` because the docs-singleton rule says
|
|
2761
|
+
* Starlight is only ever used as the monorepo-wide docs site.
|
|
2762
|
+
*
|
|
2763
|
+
* @see ADR-006 §4 — Configulator project-type → `outdir` mapping
|
|
2764
|
+
*/
|
|
2765
|
+
declare const LAYOUT_ROOT_BY_PROJECT_TYPE: Readonly<Record<string, MonorepoLayoutRoot>>;
|
|
2766
|
+
/**
|
|
2767
|
+
* A single offender reported by {@link validateMonorepoLayout}. One entry
|
|
2768
|
+
* per sub-project whose `outdir` falls outside its expected root.
|
|
2769
|
+
*/
|
|
2770
|
+
interface LayoutViolation {
|
|
2771
|
+
readonly projectName: string;
|
|
2772
|
+
readonly projectType: string;
|
|
2773
|
+
readonly outdir: string;
|
|
2774
|
+
readonly expectedRoot: MonorepoLayoutRoot;
|
|
2775
|
+
}
|
|
2776
|
+
/**
|
|
2777
|
+
* Inspect every sub-project of `root` and collect those whose `outdir` does
|
|
2778
|
+
* not live under the root expected for their project class (ADR-006 §4).
|
|
2779
|
+
*
|
|
2780
|
+
* - Sub-projects whose class name is not in
|
|
2781
|
+
* {@link LAYOUT_ROOT_BY_PROJECT_TYPE} are skipped — the contract only
|
|
2782
|
+
* covers the four documented project types.
|
|
2783
|
+
* - The root project itself is skipped (it *is* the monorepo root, not a
|
|
2784
|
+
* sub-project).
|
|
2785
|
+
* - `outdir` comparison is done in POSIX form against the project root so
|
|
2786
|
+
* absolute paths synthesised on Windows still match.
|
|
2787
|
+
*/
|
|
2788
|
+
declare function validateMonorepoLayout(root: Project$1): Array<LayoutViolation>;
|
|
2789
|
+
/**
|
|
2790
|
+
* Render one {@link LayoutViolation} as an actionable, single-line error
|
|
2791
|
+
* message pointing the reader at ADR-006.
|
|
2792
|
+
*/
|
|
2793
|
+
declare function formatLayoutViolation(violation: LayoutViolation): string;
|
|
2794
|
+
|
|
2724
2795
|
/**
|
|
2725
2796
|
* Each of the below options corresponds to a task property found here:
|
|
2726
2797
|
* * https://turborepo.com/docs/reference/configuration#defining-tasks
|
|
@@ -3303,6 +3374,22 @@ interface MonorepoProjectOptions extends Omit<TypeScriptProjectOptions$1, "defau
|
|
|
3303
3374
|
* @default true
|
|
3304
3375
|
*/
|
|
3305
3376
|
readonly syncLabels?: SyncLabelsOptions | boolean;
|
|
3377
|
+
/**
|
|
3378
|
+
* How to react when a sub-project's `outdir` falls outside the root
|
|
3379
|
+
* expected for its project type (ADR-006 §4).
|
|
3380
|
+
*
|
|
3381
|
+
* - `"off"` — skip validation entirely.
|
|
3382
|
+
* - `"warn"` — log a console warning per violation; synth proceeds.
|
|
3383
|
+
* - `"error"` — throw on the first violation; synth fails.
|
|
3384
|
+
*
|
|
3385
|
+
* Defaults to `"warn"` during the ADR-006 rollout so existing consumers
|
|
3386
|
+
* with legacy outdirs see actionable warnings but do not break. A future
|
|
3387
|
+
* release will flip the default to `"error"`.
|
|
3388
|
+
*
|
|
3389
|
+
* @default "warn"
|
|
3390
|
+
* @see docs/requirements/architectural-decisions/ADR-006-monorepo-layout.md
|
|
3391
|
+
*/
|
|
3392
|
+
readonly layoutEnforcement?: LayoutEnforcement;
|
|
3306
3393
|
}
|
|
3307
3394
|
declare class MonorepoProject extends TypeScriptAppProject {
|
|
3308
3395
|
/**
|
|
@@ -3313,7 +3400,22 @@ declare class MonorepoProject extends TypeScriptAppProject {
|
|
|
3313
3400
|
* Whether this monorepo consumes configulator from a registry (drives upgrade workflow steps).
|
|
3314
3401
|
*/
|
|
3315
3402
|
readonly configulatorRegistryConsumer: boolean;
|
|
3403
|
+
/**
|
|
3404
|
+
* Layout-enforcement mode for sub-project `outdir` validation (ADR-006).
|
|
3405
|
+
*/
|
|
3406
|
+
readonly layoutEnforcement: LayoutEnforcement;
|
|
3316
3407
|
constructor(userOptions: MonorepoProjectOptions);
|
|
3408
|
+
/**
|
|
3409
|
+
* Validate sub-project `outdir` values against the ADR-006 monorepo
|
|
3410
|
+
* layout contract. Runs in `preSynthesize` so all sub-projects are
|
|
3411
|
+
* attached by the time we inspect the tree.
|
|
3412
|
+
*
|
|
3413
|
+
* Behavior is controlled by `layoutEnforcement`:
|
|
3414
|
+
* - `"off"` — skip validation.
|
|
3415
|
+
* - `"warn"` — log a `console.warn` per violation; continue.
|
|
3416
|
+
* - `"error"` — throw on the first violation.
|
|
3417
|
+
*/
|
|
3418
|
+
preSynthesize(): void;
|
|
3317
3419
|
/**
|
|
3318
3420
|
* Allows a sub project to request installation of dependency at the Monorepo root
|
|
3319
3421
|
* They must provide a function that is executed after dependencies have been installed
|
|
@@ -3636,4 +3738,4 @@ declare const COMPLETE_JOB_ID = "complete";
|
|
|
3636
3738
|
*/
|
|
3637
3739
|
declare function addBuildCompleteJob(buildWorkflow: BuildWorkflow): void;
|
|
3638
3740
|
|
|
3639
|
-
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, type LabelDefinition, MCP_TRANSPORT, MERGE_METHODS, MIMIMUM_RELEASE_AGE, MINIMUM_RELEASE_AGE, type McpServerConfig, type McpTransport, type MergeMethod, 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, getLatestEligibleVersion, githubWorkflowBundle, industryDiscoveryBundle, jestBundle, maintenanceAuditBundle, meetingAnalysisBundle, orchestratorBundle, peopleProfileBundle, pnpmBundle, prReviewBundle, projenBundle, requirementsAnalystBundle, requirementsReviewerBundle, requirementsWriterBundle, researchPipelineBundle, resolveModelAlias, resolveTemplateVariables, slackBundle, softwareProfileBundle, turborepoBundle, typescriptBundle, vitestBundle };
|
|
3741
|
+
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, resolveModelAlias, resolveTemplateVariables, slackBundle, softwareProfileBundle, turborepoBundle, typescriptBundle, validateMonorepoLayout, vitestBundle };
|
package/lib/index.d.ts
CHANGED
|
@@ -2770,6 +2770,77 @@ declare class AwsDeployWorkflow extends Component {
|
|
|
2770
2770
|
preSynthesize(): void;
|
|
2771
2771
|
}
|
|
2772
2772
|
|
|
2773
|
+
/**
|
|
2774
|
+
* Canonical top-level folders for a configulator monorepo (ADR-006).
|
|
2775
|
+
*
|
|
2776
|
+
* Every sub-project must live under one of these roots. `DOCS` is a
|
|
2777
|
+
* singleton (the single Starlight site at `/docs`); `APPS`, `PACKAGES`,
|
|
2778
|
+
* and `SITES` are parents for `@scope/<name>` sub-projects.
|
|
2779
|
+
*
|
|
2780
|
+
* @see docs/requirements/architectural-decisions/ADR-006-monorepo-layout.md
|
|
2781
|
+
*/
|
|
2782
|
+
declare const MONOREPO_LAYOUT: {
|
|
2783
|
+
readonly DOCS: "docs";
|
|
2784
|
+
readonly APPS: "apps";
|
|
2785
|
+
readonly PACKAGES: "packages";
|
|
2786
|
+
readonly SITES: "sites";
|
|
2787
|
+
};
|
|
2788
|
+
type MonorepoLayoutRoot = (typeof MONOREPO_LAYOUT)[keyof typeof MONOREPO_LAYOUT];
|
|
2789
|
+
/**
|
|
2790
|
+
* How `MonorepoProject` reacts when a sub-project's `outdir` falls outside
|
|
2791
|
+
* the root expected for its project type (see ADR-006 §4).
|
|
2792
|
+
*
|
|
2793
|
+
* - `"off"` — no validation runs.
|
|
2794
|
+
* - `"warn"` — log a console warning per offending sub-project; synth proceeds.
|
|
2795
|
+
* - `"error"` — throw on the first offending sub-project; synth fails.
|
|
2796
|
+
*/
|
|
2797
|
+
declare const LAYOUT_ENFORCEMENT: {
|
|
2798
|
+
readonly OFF: "off";
|
|
2799
|
+
readonly WARN: "warn";
|
|
2800
|
+
readonly ERROR: "error";
|
|
2801
|
+
};
|
|
2802
|
+
type LayoutEnforcement = (typeof LAYOUT_ENFORCEMENT)[keyof typeof LAYOUT_ENFORCEMENT];
|
|
2803
|
+
/**
|
|
2804
|
+
* Mapping from configulator project-type class name to the root folder its
|
|
2805
|
+
* `outdir` must live under.
|
|
2806
|
+
*
|
|
2807
|
+
* We key by class name (not class reference) so this module stays free of
|
|
2808
|
+
* import cycles with the project-type files that validate against it.
|
|
2809
|
+
* `StarlightProject` maps to `DOCS` because the docs-singleton rule says
|
|
2810
|
+
* Starlight is only ever used as the monorepo-wide docs site.
|
|
2811
|
+
*
|
|
2812
|
+
* @see ADR-006 §4 — Configulator project-type → `outdir` mapping
|
|
2813
|
+
*/
|
|
2814
|
+
declare const LAYOUT_ROOT_BY_PROJECT_TYPE: Readonly<Record<string, MonorepoLayoutRoot>>;
|
|
2815
|
+
/**
|
|
2816
|
+
* A single offender reported by {@link validateMonorepoLayout}. One entry
|
|
2817
|
+
* per sub-project whose `outdir` falls outside its expected root.
|
|
2818
|
+
*/
|
|
2819
|
+
interface LayoutViolation {
|
|
2820
|
+
readonly projectName: string;
|
|
2821
|
+
readonly projectType: string;
|
|
2822
|
+
readonly outdir: string;
|
|
2823
|
+
readonly expectedRoot: MonorepoLayoutRoot;
|
|
2824
|
+
}
|
|
2825
|
+
/**
|
|
2826
|
+
* Inspect every sub-project of `root` and collect those whose `outdir` does
|
|
2827
|
+
* not live under the root expected for their project class (ADR-006 §4).
|
|
2828
|
+
*
|
|
2829
|
+
* - Sub-projects whose class name is not in
|
|
2830
|
+
* {@link LAYOUT_ROOT_BY_PROJECT_TYPE} are skipped — the contract only
|
|
2831
|
+
* covers the four documented project types.
|
|
2832
|
+
* - The root project itself is skipped (it *is* the monorepo root, not a
|
|
2833
|
+
* sub-project).
|
|
2834
|
+
* - `outdir` comparison is done in POSIX form against the project root so
|
|
2835
|
+
* absolute paths synthesised on Windows still match.
|
|
2836
|
+
*/
|
|
2837
|
+
declare function validateMonorepoLayout(root: Project): Array<LayoutViolation>;
|
|
2838
|
+
/**
|
|
2839
|
+
* Render one {@link LayoutViolation} as an actionable, single-line error
|
|
2840
|
+
* message pointing the reader at ADR-006.
|
|
2841
|
+
*/
|
|
2842
|
+
declare function formatLayoutViolation(violation: LayoutViolation): string;
|
|
2843
|
+
|
|
2773
2844
|
/**
|
|
2774
2845
|
* Each of the below options corresponds to a task property found here:
|
|
2775
2846
|
* * https://turborepo.com/docs/reference/configuration#defining-tasks
|
|
@@ -3352,6 +3423,22 @@ interface MonorepoProjectOptions extends Omit<TypeScriptProjectOptions$1, "defau
|
|
|
3352
3423
|
* @default true
|
|
3353
3424
|
*/
|
|
3354
3425
|
readonly syncLabels?: SyncLabelsOptions | boolean;
|
|
3426
|
+
/**
|
|
3427
|
+
* How to react when a sub-project's `outdir` falls outside the root
|
|
3428
|
+
* expected for its project type (ADR-006 §4).
|
|
3429
|
+
*
|
|
3430
|
+
* - `"off"` — skip validation entirely.
|
|
3431
|
+
* - `"warn"` — log a console warning per violation; synth proceeds.
|
|
3432
|
+
* - `"error"` — throw on the first violation; synth fails.
|
|
3433
|
+
*
|
|
3434
|
+
* Defaults to `"warn"` during the ADR-006 rollout so existing consumers
|
|
3435
|
+
* with legacy outdirs see actionable warnings but do not break. A future
|
|
3436
|
+
* release will flip the default to `"error"`.
|
|
3437
|
+
*
|
|
3438
|
+
* @default "warn"
|
|
3439
|
+
* @see docs/requirements/architectural-decisions/ADR-006-monorepo-layout.md
|
|
3440
|
+
*/
|
|
3441
|
+
readonly layoutEnforcement?: LayoutEnforcement;
|
|
3355
3442
|
}
|
|
3356
3443
|
declare class MonorepoProject extends TypeScriptAppProject {
|
|
3357
3444
|
/**
|
|
@@ -3362,7 +3449,22 @@ declare class MonorepoProject extends TypeScriptAppProject {
|
|
|
3362
3449
|
* Whether this monorepo consumes configulator from a registry (drives upgrade workflow steps).
|
|
3363
3450
|
*/
|
|
3364
3451
|
readonly configulatorRegistryConsumer: boolean;
|
|
3452
|
+
/**
|
|
3453
|
+
* Layout-enforcement mode for sub-project `outdir` validation (ADR-006).
|
|
3454
|
+
*/
|
|
3455
|
+
readonly layoutEnforcement: LayoutEnforcement;
|
|
3365
3456
|
constructor(userOptions: MonorepoProjectOptions);
|
|
3457
|
+
/**
|
|
3458
|
+
* Validate sub-project `outdir` values against the ADR-006 monorepo
|
|
3459
|
+
* layout contract. Runs in `preSynthesize` so all sub-projects are
|
|
3460
|
+
* attached by the time we inspect the tree.
|
|
3461
|
+
*
|
|
3462
|
+
* Behavior is controlled by `layoutEnforcement`:
|
|
3463
|
+
* - `"off"` — skip validation.
|
|
3464
|
+
* - `"warn"` — log a `console.warn` per violation; continue.
|
|
3465
|
+
* - `"error"` — throw on the first violation.
|
|
3466
|
+
*/
|
|
3467
|
+
preSynthesize(): void;
|
|
3366
3468
|
/**
|
|
3367
3469
|
* Allows a sub project to request installation of dependency at the Monorepo root
|
|
3368
3470
|
* They must provide a function that is executed after dependencies have been installed
|
|
@@ -3685,5 +3787,5 @@ declare const COMPLETE_JOB_ID = "complete";
|
|
|
3685
3787
|
*/
|
|
3686
3788
|
declare function addBuildCompleteJob(buildWorkflow: BuildWorkflow): void;
|
|
3687
3789
|
|
|
3688
|
-
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, MCP_TRANSPORT, MERGE_METHODS, MIMIMUM_RELEASE_AGE, MINIMUM_RELEASE_AGE, 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, getLatestEligibleVersion, githubWorkflowBundle, industryDiscoveryBundle, jestBundle, maintenanceAuditBundle, meetingAnalysisBundle, orchestratorBundle, peopleProfileBundle, pnpmBundle, prReviewBundle, projenBundle, requirementsAnalystBundle, requirementsReviewerBundle, requirementsWriterBundle, researchPipelineBundle, resolveModelAlias, resolveTemplateVariables, slackBundle, softwareProfileBundle, turborepoBundle, typescriptBundle, vitestBundle };
|
|
3689
|
-
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, McpServerConfig, McpTransport, MergeMethod, MonorepoProjectOptions, OrganizationMetadata, PnpmWorkspaceOptions, ProjectMetadataOptions, RemoteCacheOptions, RepositoryMetadata, ResetTaskOptions, ResolvedProjectMetadata, SlackMetadata, StarlightEditLink, StarlightLogo, StarlightProjectOptions, StarlightSidebarItem, StarlightSocialLink, SyncLabelsOptions, TemplateResolveResult, TurboRepoOptions, TurboRepoTaskOptions, TypeScriptProjectOptions, VersionKey, VitestConfigOptions, VitestOptions };
|
|
3790
|
+
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, resolveModelAlias, resolveTemplateVariables, slackBundle, softwareProfileBundle, turborepoBundle, typescriptBundle, validateMonorepoLayout, vitestBundle };
|
|
3791
|
+
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 };
|
package/lib/index.js
CHANGED
|
@@ -195,10 +195,13 @@ __export(index_exports, {
|
|
|
195
195
|
DEFAULT_TEARDOWN_BRANCH_PATTERNS: () => DEFAULT_TEARDOWN_BRANCH_PATTERNS,
|
|
196
196
|
DEFAULT_TYPE_LABELS: () => DEFAULT_TYPE_LABELS,
|
|
197
197
|
JsiiFaker: () => JsiiFaker,
|
|
198
|
+
LAYOUT_ENFORCEMENT: () => LAYOUT_ENFORCEMENT,
|
|
199
|
+
LAYOUT_ROOT_BY_PROJECT_TYPE: () => LAYOUT_ROOT_BY_PROJECT_TYPE,
|
|
198
200
|
MCP_TRANSPORT: () => MCP_TRANSPORT,
|
|
199
201
|
MERGE_METHODS: () => MERGE_METHODS,
|
|
200
202
|
MIMIMUM_RELEASE_AGE: () => MIMIMUM_RELEASE_AGE,
|
|
201
203
|
MINIMUM_RELEASE_AGE: () => MINIMUM_RELEASE_AGE,
|
|
204
|
+
MONOREPO_LAYOUT: () => MONOREPO_LAYOUT,
|
|
202
205
|
MonorepoProject: () => MonorepoProject,
|
|
203
206
|
PROD_DEPLOY_NAME: () => PROD_DEPLOY_NAME,
|
|
204
207
|
PnpmWorkspace: () => PnpmWorkspace,
|
|
@@ -225,6 +228,7 @@ __export(index_exports, {
|
|
|
225
228
|
baseBundle: () => baseBundle,
|
|
226
229
|
bcmWriterBundle: () => bcmWriterBundle,
|
|
227
230
|
companyProfileBundle: () => companyProfileBundle,
|
|
231
|
+
formatLayoutViolation: () => formatLayoutViolation,
|
|
228
232
|
getLatestEligibleVersion: () => getLatestEligibleVersion,
|
|
229
233
|
githubWorkflowBundle: () => githubWorkflowBundle,
|
|
230
234
|
industryDiscoveryBundle: () => industryDiscoveryBundle,
|
|
@@ -246,6 +250,7 @@ __export(index_exports, {
|
|
|
246
250
|
softwareProfileBundle: () => softwareProfileBundle,
|
|
247
251
|
turborepoBundle: () => turborepoBundle,
|
|
248
252
|
typescriptBundle: () => typescriptBundle,
|
|
253
|
+
validateMonorepoLayout: () => validateMonorepoLayout,
|
|
249
254
|
vitestBundle: () => vitestBundle
|
|
250
255
|
});
|
|
251
256
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -537,7 +542,7 @@ var baseBundle = {
|
|
|
537
542
|
"## Important Notes",
|
|
538
543
|
"",
|
|
539
544
|
"- **Never edit generated files** \u2014 they are marked with `// ~~ Generated by projen`",
|
|
540
|
-
"- **After modifying Projen configuration**, run `
|
|
545
|
+
"- **After modifying Projen configuration**, run `pnpm exec projen` to regenerate files, then `pnpm install` to update the lockfile.",
|
|
541
546
|
"- **Configure dependencies through Projen** \u2014 never use `npm install`, `pnpm add`, or `yarn add`. Add them to `deps` or `devDeps` in Projen config.",
|
|
542
547
|
"- **Export from index.ts** to maintain clean public APIs"
|
|
543
548
|
].join("\n"),
|
|
@@ -554,7 +559,7 @@ var baseBundle = {
|
|
|
554
559
|
"",
|
|
555
560
|
"## Prohibited Commands",
|
|
556
561
|
"",
|
|
557
|
-
"- `
|
|
562
|
+
"- `pnpm exec projen` \u2014 synthesize project files",
|
|
558
563
|
"- `pnpm install` / `pnpm i` \u2014 install dependencies",
|
|
559
564
|
"- `pnpm build` / `pnpm build:all` \u2014 build the project",
|
|
560
565
|
"- `pnpm test` / `pnpm --filter ... test` \u2014 run tests",
|
|
@@ -567,7 +572,7 @@ var baseBundle = {
|
|
|
567
572
|
"",
|
|
568
573
|
"After making changes that need validation, tell the user the specific commands to run:",
|
|
569
574
|
"",
|
|
570
|
-
"1. **After projen config changes** \u2014 tell the user to run `
|
|
575
|
+
"1. **After projen config changes** \u2014 tell the user to run `pnpm exec projen && pnpm install`",
|
|
571
576
|
"2. **After source code changes** \u2014 tell the user to run `pnpm --filter @codedrifters/<package> test`",
|
|
572
577
|
"3. **After multi-package changes** \u2014 tell the user to run `pnpm build:all`"
|
|
573
578
|
].join("\n"),
|
|
@@ -2525,7 +2530,7 @@ var githubWorkflowBundle = {
|
|
|
2525
2530
|
"",
|
|
2526
2531
|
"When the user says **open a PR** (or similar), follow these steps exactly:",
|
|
2527
2532
|
"",
|
|
2528
|
-
"1. **Regenerate project files** \u2014 run `
|
|
2533
|
+
"1. **Regenerate project files** \u2014 run `pnpm exec 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.",
|
|
2529
2534
|
"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.",
|
|
2530
2535
|
"3. **Check for uncommitted changes** \u2014 if any exist, commit them with a conventional commit message",
|
|
2531
2536
|
"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",
|
|
@@ -4671,7 +4676,7 @@ var issueWorkerSubAgent = {
|
|
|
4671
4676
|
"",
|
|
4672
4677
|
"Run the appropriate verification commands depending on what changed:",
|
|
4673
4678
|
"",
|
|
4674
|
-
"1. If Projen config was changed: `
|
|
4679
|
+
"1. If Projen config was changed: `pnpm exec projen && pnpm install`",
|
|
4675
4680
|
"2. Compile the affected package: `pnpm --filter @codedrifters/<package> compile`",
|
|
4676
4681
|
"3. Test the affected package: `pnpm --filter @codedrifters/<package> test`",
|
|
4677
4682
|
"4. If changes span multiple packages: `pnpm build:all`",
|
|
@@ -5664,7 +5669,7 @@ var pnpmBundle = {
|
|
|
5664
5669
|
"- Configure dependencies in Projen configuration files (`.projenrc.ts` or `projenrc/*.ts`)",
|
|
5665
5670
|
"- Add dependencies to `deps`, `devDeps`, or `peerDeps` arrays in project configuration",
|
|
5666
5671
|
'- Use catalog dependencies when available (e.g., `"aws-cdk-lib@catalog:"`)',
|
|
5667
|
-
"- Ask the user to run `
|
|
5672
|
+
"- Ask the user to run `pnpm exec projen` and `pnpm install` after updating dependency configuration",
|
|
5668
5673
|
"",
|
|
5669
5674
|
"**DO NOT:**",
|
|
5670
5675
|
"- Run `npm install some-package`",
|
|
@@ -7093,11 +7098,11 @@ var projenBundle = {
|
|
|
7093
7098
|
"After modifying any file in `projenrc/` or `.projenrc.ts`, regenerate project files:",
|
|
7094
7099
|
"",
|
|
7095
7100
|
"```sh",
|
|
7096
|
-
"
|
|
7101
|
+
"pnpm exec projen",
|
|
7097
7102
|
"pnpm install",
|
|
7098
7103
|
"```",
|
|
7099
7104
|
"",
|
|
7100
|
-
"Both steps are required \u2014 `
|
|
7105
|
+
"Both steps are required \u2014 `pnpm exec projen` regenerates files, `pnpm install` updates the lockfile to match.",
|
|
7101
7106
|
"",
|
|
7102
7107
|
"## Building",
|
|
7103
7108
|
"",
|
|
@@ -7178,7 +7183,7 @@ var projenBundle = {
|
|
|
7178
7183
|
"After finishing implementation work, validate that changes are correct by running the appropriate commands depending on what was changed:",
|
|
7179
7184
|
"",
|
|
7180
7185
|
"1. **Projen config changes** (`projenrc/`, `.projenrc.ts`):",
|
|
7181
|
-
" - Run `
|
|
7186
|
+
" - Run `pnpm exec projen` then `pnpm install`",
|
|
7182
7187
|
" - Verify no unexpected generated file changes with `git diff`",
|
|
7183
7188
|
"",
|
|
7184
7189
|
"2. **Source code changes** (in a sub-package):",
|
|
@@ -7195,7 +7200,7 @@ var projenBundle = {
|
|
|
7195
7200
|
"",
|
|
7196
7201
|
"| Task | Command |",
|
|
7197
7202
|
"|------|---------|",
|
|
7198
|
-
"| Synthesize projen | `
|
|
7203
|
+
"| Synthesize projen | `pnpm exec projen` |",
|
|
7199
7204
|
"| Install deps | `pnpm install` |",
|
|
7200
7205
|
"| Full monorepo build | `pnpm build:all` |",
|
|
7201
7206
|
"| Root build only | `pnpm build` |",
|
|
@@ -7221,7 +7226,7 @@ var projenBundle = {
|
|
|
7221
7226
|
content: [
|
|
7222
7227
|
"# Customizing Agent Rules",
|
|
7223
7228
|
"",
|
|
7224
|
-
"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 `
|
|
7229
|
+
"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 `pnpm exec projen` run.",
|
|
7225
7230
|
"",
|
|
7226
7231
|
"## Adding Repo-Specific Rules",
|
|
7227
7232
|
"",
|
|
@@ -7254,7 +7259,7 @@ var projenBundle = {
|
|
|
7254
7259
|
"",
|
|
7255
7260
|
"## After Any Change",
|
|
7256
7261
|
"",
|
|
7257
|
-
"Run `
|
|
7262
|
+
"Run `pnpm exec projen` then `pnpm install` to regenerate the output files."
|
|
7258
7263
|
].join("\n"),
|
|
7259
7264
|
tags: ["workflow"]
|
|
7260
7265
|
},
|
|
@@ -7272,7 +7277,7 @@ var projenBundle = {
|
|
|
7272
7277
|
"- Edit Projen configuration in:",
|
|
7273
7278
|
" - `.projenrc.ts` (root)",
|
|
7274
7279
|
" - `projenrc/*.ts` (package-specific)",
|
|
7275
|
-
"- After making Projen changes, run `
|
|
7280
|
+
"- After making Projen changes, run `pnpm exec projen` to synthesize",
|
|
7276
7281
|
"",
|
|
7277
7282
|
"## Workspace Dependencies",
|
|
7278
7283
|
"",
|
|
@@ -15556,6 +15561,77 @@ var import_javascript3 = require("projen/lib/javascript");
|
|
|
15556
15561
|
var import_typescript3 = require("projen/lib/typescript");
|
|
15557
15562
|
var import_ts_deepmerge = require("ts-deepmerge");
|
|
15558
15563
|
|
|
15564
|
+
// src/projects/monorepo-layout.ts
|
|
15565
|
+
var MONOREPO_LAYOUT = {
|
|
15566
|
+
DOCS: "docs",
|
|
15567
|
+
APPS: "apps",
|
|
15568
|
+
PACKAGES: "packages",
|
|
15569
|
+
SITES: "sites"
|
|
15570
|
+
};
|
|
15571
|
+
var LAYOUT_ENFORCEMENT = {
|
|
15572
|
+
OFF: "off",
|
|
15573
|
+
WARN: "warn",
|
|
15574
|
+
ERROR: "error"
|
|
15575
|
+
};
|
|
15576
|
+
var LAYOUT_ROOT_BY_PROJECT_TYPE = {
|
|
15577
|
+
TypeScriptProject: MONOREPO_LAYOUT.PACKAGES,
|
|
15578
|
+
AwsCdkProject: MONOREPO_LAYOUT.APPS,
|
|
15579
|
+
AstroProject: MONOREPO_LAYOUT.SITES,
|
|
15580
|
+
StarlightProject: MONOREPO_LAYOUT.DOCS
|
|
15581
|
+
};
|
|
15582
|
+
function validateMonorepoLayout(root) {
|
|
15583
|
+
const violations = [];
|
|
15584
|
+
const rootOutdir = toPosix(root.outdir);
|
|
15585
|
+
for (const sub of root.subprojects) {
|
|
15586
|
+
const className = sub.constructor.name;
|
|
15587
|
+
const expectedRoot = LAYOUT_ROOT_BY_PROJECT_TYPE[className];
|
|
15588
|
+
if (expectedRoot === void 0) {
|
|
15589
|
+
continue;
|
|
15590
|
+
}
|
|
15591
|
+
const relOutdir = relativeOutdir(rootOutdir, toPosix(sub.outdir));
|
|
15592
|
+
if (!outdirMatchesRoot(relOutdir, expectedRoot)) {
|
|
15593
|
+
violations.push({
|
|
15594
|
+
projectName: sub.name,
|
|
15595
|
+
projectType: className,
|
|
15596
|
+
outdir: relOutdir,
|
|
15597
|
+
expectedRoot
|
|
15598
|
+
});
|
|
15599
|
+
}
|
|
15600
|
+
}
|
|
15601
|
+
return violations;
|
|
15602
|
+
}
|
|
15603
|
+
function formatLayoutViolation(violation) {
|
|
15604
|
+
const { projectName, projectType, outdir, expectedRoot } = violation;
|
|
15605
|
+
const expectedExample = expectedRoot === MONOREPO_LAYOUT.DOCS ? "docs/" : `${expectedRoot}/<scope>/<name>`;
|
|
15606
|
+
return `[monorepo-layout] ${projectType} "${projectName}" has outdir "${outdir}", which is outside the expected root "${expectedRoot}/" (expected e.g. "${expectedExample}"). See docs/requirements/architectural-decisions/ADR-006-monorepo-layout.md.`;
|
|
15607
|
+
}
|
|
15608
|
+
function outdirMatchesRoot(relOutdir, expectedRoot) {
|
|
15609
|
+
const segments = relOutdir.split("/").filter((s) => s.length > 0);
|
|
15610
|
+
if (segments.length === 0) {
|
|
15611
|
+
return false;
|
|
15612
|
+
}
|
|
15613
|
+
if (segments[0] !== expectedRoot) {
|
|
15614
|
+
return false;
|
|
15615
|
+
}
|
|
15616
|
+
if (expectedRoot === MONOREPO_LAYOUT.DOCS) {
|
|
15617
|
+
return true;
|
|
15618
|
+
}
|
|
15619
|
+
return segments.length >= 2;
|
|
15620
|
+
}
|
|
15621
|
+
function toPosix(p) {
|
|
15622
|
+
return p.replace(/\\/g, "/");
|
|
15623
|
+
}
|
|
15624
|
+
function relativeOutdir(rootOutdir, subOutdir) {
|
|
15625
|
+
if (subOutdir === rootOutdir) {
|
|
15626
|
+
return "";
|
|
15627
|
+
}
|
|
15628
|
+
const prefix2 = rootOutdir.endsWith("/") ? rootOutdir : `${rootOutdir}/`;
|
|
15629
|
+
if (subOutdir.startsWith(prefix2)) {
|
|
15630
|
+
return subOutdir.slice(prefix2.length);
|
|
15631
|
+
}
|
|
15632
|
+
return subOutdir;
|
|
15633
|
+
}
|
|
15634
|
+
|
|
15559
15635
|
// src/tasks/reset-task.ts
|
|
15560
15636
|
var import_projen13 = require("projen");
|
|
15561
15637
|
var ResetTask = class _ResetTask extends import_projen13.Component {
|
|
@@ -16064,6 +16140,11 @@ var MonorepoProject = class extends import_typescript3.TypeScriptAppProject {
|
|
|
16064
16140
|
* By default treat as a registry consumer (upgrade workflow syncs configulator).
|
|
16065
16141
|
*/
|
|
16066
16142
|
configulatorRegistryConsumer: true,
|
|
16143
|
+
/**
|
|
16144
|
+
* ADR-006 layout enforcement defaults to "warn" during rollout so
|
|
16145
|
+
* legacy outdirs log actionable warnings but do not break synth.
|
|
16146
|
+
*/
|
|
16147
|
+
layoutEnforcement: LAYOUT_ENFORCEMENT.WARN,
|
|
16067
16148
|
/**
|
|
16068
16149
|
* We don't want sample code generated for the root project.
|
|
16069
16150
|
*/
|
|
@@ -16177,6 +16258,7 @@ var MonorepoProject = class extends import_typescript3.TypeScriptAppProject {
|
|
|
16177
16258
|
this.tsconfig?.removeInclude(`${this.srcdir}/**/*.ts`);
|
|
16178
16259
|
this.pnpmVersion = options.pnpmVersion;
|
|
16179
16260
|
this.configulatorRegistryConsumer = options.configulatorRegistryConsumer ?? true;
|
|
16261
|
+
this.layoutEnforcement = options.layoutEnforcement ?? LAYOUT_ENFORCEMENT.WARN;
|
|
16180
16262
|
new VSCodeConfig(this);
|
|
16181
16263
|
new PnpmWorkspace(this, options.pnpmOptions?.pnpmWorkspaceOptions);
|
|
16182
16264
|
if (options.turbo) {
|
|
@@ -16271,6 +16353,32 @@ var MonorepoProject = class extends import_typescript3.TypeScriptAppProject {
|
|
|
16271
16353
|
);
|
|
16272
16354
|
}
|
|
16273
16355
|
}
|
|
16356
|
+
/**
|
|
16357
|
+
* Validate sub-project `outdir` values against the ADR-006 monorepo
|
|
16358
|
+
* layout contract. Runs in `preSynthesize` so all sub-projects are
|
|
16359
|
+
* attached by the time we inspect the tree.
|
|
16360
|
+
*
|
|
16361
|
+
* Behavior is controlled by `layoutEnforcement`:
|
|
16362
|
+
* - `"off"` — skip validation.
|
|
16363
|
+
* - `"warn"` — log a `console.warn` per violation; continue.
|
|
16364
|
+
* - `"error"` — throw on the first violation.
|
|
16365
|
+
*/
|
|
16366
|
+
preSynthesize() {
|
|
16367
|
+
super.preSynthesize();
|
|
16368
|
+
if (this.layoutEnforcement === LAYOUT_ENFORCEMENT.OFF) {
|
|
16369
|
+
return;
|
|
16370
|
+
}
|
|
16371
|
+
const violations = validateMonorepoLayout(this);
|
|
16372
|
+
if (violations.length === 0) {
|
|
16373
|
+
return;
|
|
16374
|
+
}
|
|
16375
|
+
if (this.layoutEnforcement === LAYOUT_ENFORCEMENT.ERROR) {
|
|
16376
|
+
throw new Error(formatLayoutViolation(violations[0]));
|
|
16377
|
+
}
|
|
16378
|
+
for (const violation of violations) {
|
|
16379
|
+
console.warn(formatLayoutViolation(violation));
|
|
16380
|
+
}
|
|
16381
|
+
}
|
|
16274
16382
|
/**
|
|
16275
16383
|
* Allows a sub project to request installation of dependency at the Monorepo root
|
|
16276
16384
|
* They must provide a function that is executed after dependencies have been installed
|
|
@@ -17388,10 +17496,13 @@ var TypeScriptConfig = class extends import_projen22.Component {
|
|
|
17388
17496
|
DEFAULT_TEARDOWN_BRANCH_PATTERNS,
|
|
17389
17497
|
DEFAULT_TYPE_LABELS,
|
|
17390
17498
|
JsiiFaker,
|
|
17499
|
+
LAYOUT_ENFORCEMENT,
|
|
17500
|
+
LAYOUT_ROOT_BY_PROJECT_TYPE,
|
|
17391
17501
|
MCP_TRANSPORT,
|
|
17392
17502
|
MERGE_METHODS,
|
|
17393
17503
|
MIMIMUM_RELEASE_AGE,
|
|
17394
17504
|
MINIMUM_RELEASE_AGE,
|
|
17505
|
+
MONOREPO_LAYOUT,
|
|
17395
17506
|
MonorepoProject,
|
|
17396
17507
|
PROD_DEPLOY_NAME,
|
|
17397
17508
|
PnpmWorkspace,
|
|
@@ -17418,6 +17529,7 @@ var TypeScriptConfig = class extends import_projen22.Component {
|
|
|
17418
17529
|
baseBundle,
|
|
17419
17530
|
bcmWriterBundle,
|
|
17420
17531
|
companyProfileBundle,
|
|
17532
|
+
formatLayoutViolation,
|
|
17421
17533
|
getLatestEligibleVersion,
|
|
17422
17534
|
githubWorkflowBundle,
|
|
17423
17535
|
industryDiscoveryBundle,
|
|
@@ -17439,6 +17551,7 @@ var TypeScriptConfig = class extends import_projen22.Component {
|
|
|
17439
17551
|
softwareProfileBundle,
|
|
17440
17552
|
turborepoBundle,
|
|
17441
17553
|
typescriptBundle,
|
|
17554
|
+
validateMonorepoLayout,
|
|
17442
17555
|
vitestBundle
|
|
17443
17556
|
});
|
|
17444
17557
|
//# sourceMappingURL=index.js.map
|