@codedrifters/configulator 0.0.239 → 0.0.241
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 +27 -1
- package/lib/index.d.ts +27 -1
- package/lib/index.js +133 -4
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +131 -4
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.d.mts
CHANGED
|
@@ -3597,6 +3597,32 @@ declare class ProjectMetadata extends Component {
|
|
|
3597
3597
|
private autoDetectRepository;
|
|
3598
3598
|
}
|
|
3599
3599
|
|
|
3600
|
+
/**
|
|
3601
|
+
* Resolve a sub-project's `outdir` from its package name.
|
|
3602
|
+
*
|
|
3603
|
+
* Given a scoped package name like `@codedrifters/foo`, returns
|
|
3604
|
+
* `<root>/@codedrifters/foo` where `<root>` comes from
|
|
3605
|
+
* {@link MONOREPO_LAYOUT}. The scope segment is preserved verbatim —
|
|
3606
|
+
* including the leading `@` — so the resulting path mirrors the npm
|
|
3607
|
+
* name exactly (e.g. `packages/@codedrifters/foo`).
|
|
3608
|
+
*
|
|
3609
|
+
* Throws when the package name is unscoped or empty. Callers must
|
|
3610
|
+
* either supply a scoped name or pass `outdir` explicitly.
|
|
3611
|
+
*
|
|
3612
|
+
* @param packageName - The npm package name. Typically sourced from
|
|
3613
|
+
* `userOptions.packageName ?? userOptions.name` — both are valid
|
|
3614
|
+
* inputs because projen itself falls back from `packageName` to
|
|
3615
|
+
* `name` when rendering `package.json`.
|
|
3616
|
+
* @param root - Which top-level monorepo folder to place the
|
|
3617
|
+
* sub-project under (e.g. `packages`, `apps`, `sites`).
|
|
3618
|
+
*/
|
|
3619
|
+
declare function resolveOutdirFromPackageName(packageName: string | undefined, root: MonorepoLayoutRoot): string;
|
|
3620
|
+
/**
|
|
3621
|
+
* Convenience wrapper that resolves an `outdir` for a `TypeScriptProject`
|
|
3622
|
+
* under the canonical `packages/` root.
|
|
3623
|
+
*/
|
|
3624
|
+
declare function resolveTypeScriptProjectOutdir(packageName: string | undefined): string;
|
|
3625
|
+
|
|
3600
3626
|
/**
|
|
3601
3627
|
* A single Starlight social icon link.
|
|
3602
3628
|
*/
|
|
@@ -3738,4 +3764,4 @@ declare const COMPLETE_JOB_ID = "complete";
|
|
|
3738
3764
|
*/
|
|
3739
3765
|
declare function addBuildCompleteJob(buildWorkflow: BuildWorkflow): void;
|
|
3740
3766
|
|
|
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 };
|
|
3767
|
+
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, resolveOutdirFromPackageName, resolveTemplateVariables, resolveTypeScriptProjectOutdir, slackBundle, softwareProfileBundle, turborepoBundle, typescriptBundle, validateMonorepoLayout, vitestBundle };
|
package/lib/index.d.ts
CHANGED
|
@@ -3646,6 +3646,32 @@ declare class ProjectMetadata extends Component {
|
|
|
3646
3646
|
private autoDetectRepository;
|
|
3647
3647
|
}
|
|
3648
3648
|
|
|
3649
|
+
/**
|
|
3650
|
+
* Resolve a sub-project's `outdir` from its package name.
|
|
3651
|
+
*
|
|
3652
|
+
* Given a scoped package name like `@codedrifters/foo`, returns
|
|
3653
|
+
* `<root>/@codedrifters/foo` where `<root>` comes from
|
|
3654
|
+
* {@link MONOREPO_LAYOUT}. The scope segment is preserved verbatim —
|
|
3655
|
+
* including the leading `@` — so the resulting path mirrors the npm
|
|
3656
|
+
* name exactly (e.g. `packages/@codedrifters/foo`).
|
|
3657
|
+
*
|
|
3658
|
+
* Throws when the package name is unscoped or empty. Callers must
|
|
3659
|
+
* either supply a scoped name or pass `outdir` explicitly.
|
|
3660
|
+
*
|
|
3661
|
+
* @param packageName - The npm package name. Typically sourced from
|
|
3662
|
+
* `userOptions.packageName ?? userOptions.name` — both are valid
|
|
3663
|
+
* inputs because projen itself falls back from `packageName` to
|
|
3664
|
+
* `name` when rendering `package.json`.
|
|
3665
|
+
* @param root - Which top-level monorepo folder to place the
|
|
3666
|
+
* sub-project under (e.g. `packages`, `apps`, `sites`).
|
|
3667
|
+
*/
|
|
3668
|
+
declare function resolveOutdirFromPackageName(packageName: string | undefined, root: MonorepoLayoutRoot): string;
|
|
3669
|
+
/**
|
|
3670
|
+
* Convenience wrapper that resolves an `outdir` for a `TypeScriptProject`
|
|
3671
|
+
* under the canonical `packages/` root.
|
|
3672
|
+
*/
|
|
3673
|
+
declare function resolveTypeScriptProjectOutdir(packageName: string | undefined): string;
|
|
3674
|
+
|
|
3649
3675
|
/**
|
|
3650
3676
|
* A single Starlight social icon link.
|
|
3651
3677
|
*/
|
|
@@ -3787,5 +3813,5 @@ declare const COMPLETE_JOB_ID = "complete";
|
|
|
3787
3813
|
*/
|
|
3788
3814
|
declare function addBuildCompleteJob(buildWorkflow: BuildWorkflow): void;
|
|
3789
3815
|
|
|
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 };
|
|
3816
|
+
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, resolveOutdirFromPackageName, resolveTemplateVariables, resolveTypeScriptProjectOutdir, slackBundle, softwareProfileBundle, turborepoBundle, typescriptBundle, validateMonorepoLayout, vitestBundle };
|
|
3791
3817
|
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
|
@@ -245,7 +245,9 @@ __export(index_exports, {
|
|
|
245
245
|
requirementsWriterBundle: () => requirementsWriterBundle,
|
|
246
246
|
researchPipelineBundle: () => researchPipelineBundle,
|
|
247
247
|
resolveModelAlias: () => resolveModelAlias,
|
|
248
|
+
resolveOutdirFromPackageName: () => resolveOutdirFromPackageName,
|
|
248
249
|
resolveTemplateVariables: () => resolveTemplateVariables,
|
|
250
|
+
resolveTypeScriptProjectOutdir: () => resolveTypeScriptProjectOutdir,
|
|
249
251
|
slackBundle: () => slackBundle,
|
|
250
252
|
softwareProfileBundle: () => softwareProfileBundle,
|
|
251
253
|
turborepoBundle: () => turborepoBundle,
|
|
@@ -850,6 +852,91 @@ var baseBundle = {
|
|
|
850
852
|
].join("\n"),
|
|
851
853
|
tags: ["workflow"]
|
|
852
854
|
},
|
|
855
|
+
{
|
|
856
|
+
name: "monorepo-layout",
|
|
857
|
+
description: "Canonical monorepo top-level folders (docs, apps, packages, sites), the @ownerscope/<name> scoping rule, the docs-singleton carve-out, and the scaffolding skills that place new sub-projects",
|
|
858
|
+
scope: AGENT_RULE_SCOPE.ALWAYS,
|
|
859
|
+
content: [
|
|
860
|
+
"# Monorepo Layout",
|
|
861
|
+
"",
|
|
862
|
+
"Every monorepo built with `@codedrifters/configulator` uses a single,",
|
|
863
|
+
"fixed top-level folder layout. Agents, scaffolding skills, pnpm-workspace",
|
|
864
|
+
"globs, Turbo filters, and CI cache keys all assume these roots.",
|
|
865
|
+
"",
|
|
866
|
+
"## Four Canonical Top-Level Folders",
|
|
867
|
+
"",
|
|
868
|
+
"| Folder | Purpose | Examples |",
|
|
869
|
+
"|--------|---------|----------|",
|
|
870
|
+
"| `/docs` | **Single** Starlight site covering the entire monorepo. The one site that lives outside `/sites`. | Monorepo-wide developer docs, ADRs, how-to guides. |",
|
|
871
|
+
"| `/apps/@scope/<name>` | Deployable applications \u2014 anything that runs or ships as a running process. | AWS CDK stacks, mobile apps (iOS/Android), backend services. |",
|
|
872
|
+
"| `/packages/@scope/<name>` | Shared libraries \u2014 published npm packages and workspace-internal libraries. | `@codedrifters/configulator`, `@codedrifters/constructs`, `@codedrifters/utils`. |",
|
|
873
|
+
"| `/sites/@scope/<name>` | User-facing web front ends that are **not** the monorepo-wide docs site. | Marketing sites, SPAs, per-client static sites. |",
|
|
874
|
+
"",
|
|
875
|
+
"No other top-level folder is part of this contract. Generated roots",
|
|
876
|
+
"(`.projen/`, `.github/`, `node_modules/`, `.turbo/`, etc.) are orthogonal",
|
|
877
|
+
"and unchanged.",
|
|
878
|
+
"",
|
|
879
|
+
"## Scoping Rule",
|
|
880
|
+
"",
|
|
881
|
+
"Every sub-project under `apps/`, `packages/`, or `sites/` is named",
|
|
882
|
+
"`@ownerscope/<name>`, where **scope is the owning party** (not a category).",
|
|
883
|
+
"",
|
|
884
|
+
"- `@codedrifters/configulator` \u2014 a shared library owned by CodeDrifters \u2192 `packages/@codedrifters/configulator`",
|
|
885
|
+
"- `@codedrifters/infrastructure-stack` \u2014 an AWS CDK app owned by CodeDrifters \u2192 `apps/@codedrifters/infrastructure-stack`",
|
|
886
|
+
"- `@clientA/iphone-app` \u2014 a mobile app owned by Client A \u2192 `apps/@clientA/iphone-app`",
|
|
887
|
+
"- `@clientB/marketing-site` \u2014 a marketing site owned by Client B \u2192 `sites/@clientB/marketing-site`",
|
|
888
|
+
"",
|
|
889
|
+
"The scope identifies **who owns the sub-project**, not what kind of",
|
|
890
|
+
"sub-project it is. Kind is captured by the top-level folder (`apps/`,",
|
|
891
|
+
"`packages/`, `sites/`). Never scope by category (e.g. `@apps/foo`,",
|
|
892
|
+
"`@libs/bar`) \u2014 the top-level folder already carries that information.",
|
|
893
|
+
"",
|
|
894
|
+
"## Docs-Singleton Carve-Out",
|
|
895
|
+
"",
|
|
896
|
+
"There is **exactly one** Starlight docs site per monorepo, and it lives",
|
|
897
|
+
"at `/docs`. It is **not** `sites/@scope/docs`.",
|
|
898
|
+
"",
|
|
899
|
+
"- The docs site is monorepo-wide. Sub-project documentation belongs",
|
|
900
|
+
" inside that single site (under `docs/content/`), not in a per-package",
|
|
901
|
+
" `docs/` folder.",
|
|
902
|
+
"- Configulator's `StarlightProject` defaults its `outdir` to `/docs`.",
|
|
903
|
+
"- `/sites` is reserved for end-user-facing web front ends (marketing",
|
|
904
|
+
" sites, SPAs, client-facing apps). It deliberately does not host the",
|
|
905
|
+
" dev-docs site.",
|
|
906
|
+
"",
|
|
907
|
+
"## Project-Type \u2192 `outdir` Mapping",
|
|
908
|
+
"",
|
|
909
|
+
"Configulator project types default their `outdir` according to the",
|
|
910
|
+
"following table. Override `outdir` explicitly only when you have a",
|
|
911
|
+
"genuine reason \u2014 the defaults cover the common path.",
|
|
912
|
+
"",
|
|
913
|
+
"| Configulator project type | Default `outdir` |",
|
|
914
|
+
"|---------------------------|------------------|",
|
|
915
|
+
"| `TypeScriptProject` | `packages/<scope>/<name>` |",
|
|
916
|
+
"| `AwsCdkProject` | `apps/<scope>/<name>` |",
|
|
917
|
+
"| `AstroProject` | `sites/<scope>/<name>` |",
|
|
918
|
+
"| `StarlightProject` (role = docs) | `docs/` |",
|
|
919
|
+
"",
|
|
920
|
+
"`<scope>` is parsed from the sub-project's package name (everything",
|
|
921
|
+
"after `@` and before `/`). `<name>` is the unscoped part of the",
|
|
922
|
+
"package name.",
|
|
923
|
+
"",
|
|
924
|
+
"## Placing New Sub-Projects",
|
|
925
|
+
"",
|
|
926
|
+
"Never hand-roll a sub-project path. Use one of the scaffolding skills,",
|
|
927
|
+
"which take `@scope/<name>` as input, validate it, and place the new",
|
|
928
|
+
"project in the correct folder:",
|
|
929
|
+
"",
|
|
930
|
+
"- `/create-package` \u2014 scaffolds a new `TypeScriptProject` under `packages/<scope>/<name>`",
|
|
931
|
+
"- `/create-app` \u2014 scaffolds a new `AwsCdkProject` under `apps/<scope>/<name>`",
|
|
932
|
+
"- `/create-site` \u2014 scaffolds a new `AstroProject` under `sites/<scope>/<name>`",
|
|
933
|
+
"",
|
|
934
|
+
"The monorepo-wide docs site at `/docs` is a singleton and is created",
|
|
935
|
+
"once per repo via `StarlightProject` \u2014 it is not scaffolded per",
|
|
936
|
+
"sub-project."
|
|
937
|
+
].join("\n"),
|
|
938
|
+
tags: ["project"]
|
|
939
|
+
},
|
|
853
940
|
{
|
|
854
941
|
name: "issue-conventions",
|
|
855
942
|
description: "Issue title prefixes, GitHub issue type mapping, prerequisite issues",
|
|
@@ -16407,6 +16494,40 @@ var MonorepoProject = class extends import_typescript3.TypeScriptAppProject {
|
|
|
16407
16494
|
}
|
|
16408
16495
|
};
|
|
16409
16496
|
|
|
16497
|
+
// src/projects/resolve-outdir.ts
|
|
16498
|
+
function parseScopedName(input) {
|
|
16499
|
+
if (!input.startsWith("@")) {
|
|
16500
|
+
return void 0;
|
|
16501
|
+
}
|
|
16502
|
+
const slashIndex = input.indexOf("/");
|
|
16503
|
+
if (slashIndex < 2) {
|
|
16504
|
+
return void 0;
|
|
16505
|
+
}
|
|
16506
|
+
const scope = input.slice(0, slashIndex);
|
|
16507
|
+
const name = input.slice(slashIndex + 1);
|
|
16508
|
+
if (name.length === 0 || name.includes("/")) {
|
|
16509
|
+
return void 0;
|
|
16510
|
+
}
|
|
16511
|
+
return { scope, name };
|
|
16512
|
+
}
|
|
16513
|
+
function resolveOutdirFromPackageName(packageName, root) {
|
|
16514
|
+
if (packageName === void 0 || packageName.length === 0) {
|
|
16515
|
+
throw new Error(
|
|
16516
|
+
"Cannot derive outdir: packageName (or name) is required when outdir is omitted. Either pass a scoped `packageName` / `name` like `@scope/foo`, or set `outdir` explicitly."
|
|
16517
|
+
);
|
|
16518
|
+
}
|
|
16519
|
+
const parsed = parseScopedName(packageName);
|
|
16520
|
+
if (parsed === void 0) {
|
|
16521
|
+
throw new Error(
|
|
16522
|
+
`Cannot derive outdir from unscoped packageName "${packageName}". Either use a scoped name like \`@scope/foo\`, or set \`outdir\` explicitly. Configulator places sub-projects at "${root}/<scope>/<name>".`
|
|
16523
|
+
);
|
|
16524
|
+
}
|
|
16525
|
+
return `${root}/${parsed.scope}/${parsed.name}`;
|
|
16526
|
+
}
|
|
16527
|
+
function resolveTypeScriptProjectOutdir(packageName) {
|
|
16528
|
+
return resolveOutdirFromPackageName(packageName, MONOREPO_LAYOUT.PACKAGES);
|
|
16529
|
+
}
|
|
16530
|
+
|
|
16410
16531
|
// src/projects/typescript-project.ts
|
|
16411
16532
|
var TestRunner = {
|
|
16412
16533
|
JEST: "jest",
|
|
@@ -16422,6 +16543,9 @@ var TypeScriptProject = class extends import_projen16.typescript.TypeScriptProje
|
|
|
16422
16543
|
const parent = userOptions.parent;
|
|
16423
16544
|
const pnpmVersion = parent.pnpmVersion;
|
|
16424
16545
|
const pnpmWorkspace = PnpmWorkspace.of(parent);
|
|
16546
|
+
const resolvedOutdir = userOptions.outdir ?? resolveTypeScriptProjectOutdir(
|
|
16547
|
+
userOptions.packageName ?? userOptions.name
|
|
16548
|
+
);
|
|
16425
16549
|
const testRunner = userOptions.testRunner ?? TestRunner.JEST;
|
|
16426
16550
|
const useJest = testRunner === TestRunner.JEST;
|
|
16427
16551
|
const defaultOptions = {
|
|
@@ -16429,6 +16553,12 @@ var TypeScriptProject = class extends import_projen16.typescript.TypeScriptProje
|
|
|
16429
16553
|
* This is a standard, so don't require it to passed in everywhere.
|
|
16430
16554
|
*/
|
|
16431
16555
|
defaultReleaseBranch: "main",
|
|
16556
|
+
/**
|
|
16557
|
+
* Outdir defaults to `packages/<scope>/<name>` when the caller
|
|
16558
|
+
* omits it. Explicit overrides in `userOptions` always win via
|
|
16559
|
+
* the merge below.
|
|
16560
|
+
*/
|
|
16561
|
+
outdir: resolvedOutdir,
|
|
16432
16562
|
/**
|
|
16433
16563
|
* Enable reset task by default.
|
|
16434
16564
|
*/
|
|
@@ -16499,10 +16629,7 @@ var TypeScriptProject = class extends import_projen16.typescript.TypeScriptProje
|
|
|
16499
16629
|
* (version, dependencies) changes.
|
|
16500
16630
|
*/
|
|
16501
16631
|
releaseTrigger: import_release.ReleaseTrigger.continuous({
|
|
16502
|
-
paths: [
|
|
16503
|
-
`${userOptions.outdir}/src/**`,
|
|
16504
|
-
`${userOptions.outdir}/package.json`
|
|
16505
|
-
]
|
|
16632
|
+
paths: [`${resolvedOutdir}/src/**`, `${resolvedOutdir}/package.json`]
|
|
16506
16633
|
})
|
|
16507
16634
|
};
|
|
16508
16635
|
const options = (0, import_ts_deepmerge2.merge)(defaultOptions, userOptions);
|
|
@@ -17546,7 +17673,9 @@ var TypeScriptConfig = class extends import_projen22.Component {
|
|
|
17546
17673
|
requirementsWriterBundle,
|
|
17547
17674
|
researchPipelineBundle,
|
|
17548
17675
|
resolveModelAlias,
|
|
17676
|
+
resolveOutdirFromPackageName,
|
|
17549
17677
|
resolveTemplateVariables,
|
|
17678
|
+
resolveTypeScriptProjectOutdir,
|
|
17550
17679
|
slackBundle,
|
|
17551
17680
|
softwareProfileBundle,
|
|
17552
17681
|
turborepoBundle,
|