@codedrifters/configulator 0.0.163 → 0.0.164
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 +6 -1
- package/lib/index.d.ts +6 -1
- package/lib/index.js +228 -23
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +227 -23
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.d.mts
CHANGED
|
@@ -848,6 +848,11 @@ declare const awsCdkBundle: AgentRuleBundle;
|
|
|
848
848
|
*/
|
|
849
849
|
declare const baseBundle: AgentRuleBundle;
|
|
850
850
|
|
|
851
|
+
/**
|
|
852
|
+
* GitHub workflow bundle — auto-detected when the project has a GitHub component.
|
|
853
|
+
*/
|
|
854
|
+
declare const githubWorkflowBundle: AgentRuleBundle;
|
|
855
|
+
|
|
851
856
|
/**
|
|
852
857
|
* Jest bundle — auto-detected when Jest is in dependencies.
|
|
853
858
|
*/
|
|
@@ -2793,4 +2798,4 @@ declare const COMPLETE_JOB_ID = "complete";
|
|
|
2793
2798
|
*/
|
|
2794
2799
|
declare function addBuildCompleteJob(buildWorkflow: BuildWorkflow): void;
|
|
2795
2800
|
|
|
2796
|
-
export { AGENT_MODEL, AGENT_PLATFORM, AGENT_RULE_SCOPE, AgentConfig, type AgentConfigOptions, type AgentModel, type AgentPlatform, type AgentPlatformOverrides, type AgentRule, type AgentRuleBundle, type AgentRuleScope, type AgentSkill, type AgentSubAgent, type AgentSubAgentPlatformOverrides, type ApproveMergeUpgradeOptions, type AwsAccount, AwsDeployWorkflow, AwsDeploymentConfig, AwsDeploymentTarget, type AwsDeploymentTargetOptions, type AwsLocalDeploymentConfig, type AwsOrganization, type AwsRegion, 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, type DeployWorkflowOptions, type DeploymentMetadata, type GitBranch, type GitHubBoardMetadata, type GitHubProjectMetadata, type GitHubSprintMetadata, type IDependencyResolver, JsiiFaker, MCP_TRANSPORT, MERGE_METHODS, MIMIMUM_RELEASE_AGE, type McpServerConfig, type McpTransport, type MergeMethod, MonorepoProject, type MonorepoProjectOptions, type OrganizationMetadata, PROD_DEPLOY_NAME, PnpmWorkspace, type PnpmWorkspaceOptions, ProjectMetadata, type ProjectMetadataOptions, ROOT_CI_TASK_NAME, ROOT_TURBO_TASK_NAME, type RemoteCacheOptions, type RepositoryMetadata, ResetTask, type ResetTaskOptions, type ResolvedProjectMetadata, type SlackMetadata, 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, awsCdkBundle, baseBundle, getLatestEligibleVersion, jestBundle, pnpmBundle, projenBundle, resolveTemplateVariables, turborepoBundle, typescriptBundle, vitestBundle };
|
|
2801
|
+
export { AGENT_MODEL, AGENT_PLATFORM, AGENT_RULE_SCOPE, AgentConfig, type AgentConfigOptions, type AgentModel, type AgentPlatform, type AgentPlatformOverrides, type AgentRule, type AgentRuleBundle, type AgentRuleScope, type AgentSkill, type AgentSubAgent, type AgentSubAgentPlatformOverrides, type ApproveMergeUpgradeOptions, type AwsAccount, AwsDeployWorkflow, AwsDeploymentConfig, AwsDeploymentTarget, type AwsDeploymentTargetOptions, type AwsLocalDeploymentConfig, type AwsOrganization, type AwsRegion, 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, type DeployWorkflowOptions, type DeploymentMetadata, type GitBranch, type GitHubBoardMetadata, type GitHubProjectMetadata, type GitHubSprintMetadata, type IDependencyResolver, JsiiFaker, MCP_TRANSPORT, MERGE_METHODS, MIMIMUM_RELEASE_AGE, type McpServerConfig, type McpTransport, type MergeMethod, MonorepoProject, type MonorepoProjectOptions, type OrganizationMetadata, PROD_DEPLOY_NAME, PnpmWorkspace, type PnpmWorkspaceOptions, ProjectMetadata, type ProjectMetadataOptions, ROOT_CI_TASK_NAME, ROOT_TURBO_TASK_NAME, type RemoteCacheOptions, type RepositoryMetadata, ResetTask, type ResetTaskOptions, type ResolvedProjectMetadata, type SlackMetadata, 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, awsCdkBundle, baseBundle, getLatestEligibleVersion, githubWorkflowBundle, jestBundle, pnpmBundle, projenBundle, resolveTemplateVariables, turborepoBundle, typescriptBundle, vitestBundle };
|
package/lib/index.d.ts
CHANGED
|
@@ -897,6 +897,11 @@ declare const awsCdkBundle: AgentRuleBundle;
|
|
|
897
897
|
*/
|
|
898
898
|
declare const baseBundle: AgentRuleBundle;
|
|
899
899
|
|
|
900
|
+
/**
|
|
901
|
+
* GitHub workflow bundle — auto-detected when the project has a GitHub component.
|
|
902
|
+
*/
|
|
903
|
+
declare const githubWorkflowBundle: AgentRuleBundle;
|
|
904
|
+
|
|
900
905
|
/**
|
|
901
906
|
* Jest bundle — auto-detected when Jest is in dependencies.
|
|
902
907
|
*/
|
|
@@ -2842,5 +2847,5 @@ declare const COMPLETE_JOB_ID = "complete";
|
|
|
2842
2847
|
*/
|
|
2843
2848
|
declare function addBuildCompleteJob(buildWorkflow: BuildWorkflow): void;
|
|
2844
2849
|
|
|
2845
|
-
export { AGENT_MODEL, AGENT_PLATFORM, AGENT_RULE_SCOPE, AgentConfig, AwsDeployWorkflow, AwsDeploymentConfig, AwsDeploymentTarget, BUILT_IN_BUNDLES, CLAUDE_RULE_TARGET, COMPLETE_JOB_ID, JsiiFaker, MCP_TRANSPORT, MERGE_METHODS, MIMIMUM_RELEASE_AGE, MonorepoProject, PROD_DEPLOY_NAME, PnpmWorkspace, ProjectMetadata, ROOT_CI_TASK_NAME, ROOT_TURBO_TASK_NAME, ResetTask, TestRunner, TurboRepo, TurboRepoTask, TypeScriptConfig, TypeScriptProject, VERSION, VERSION_KEYS_SKIP, VERSION_NPM_PACKAGES, VSCodeConfig, Vitest, addApproveMergeUpgradeWorkflow, addBuildCompleteJob, awsCdkBundle, baseBundle, getLatestEligibleVersion, jestBundle, pnpmBundle, projenBundle, resolveTemplateVariables, turborepoBundle, typescriptBundle, vitestBundle };
|
|
2850
|
+
export { AGENT_MODEL, AGENT_PLATFORM, AGENT_RULE_SCOPE, AgentConfig, AwsDeployWorkflow, AwsDeploymentConfig, AwsDeploymentTarget, BUILT_IN_BUNDLES, CLAUDE_RULE_TARGET, COMPLETE_JOB_ID, JsiiFaker, MCP_TRANSPORT, MERGE_METHODS, MIMIMUM_RELEASE_AGE, MonorepoProject, PROD_DEPLOY_NAME, PnpmWorkspace, ProjectMetadata, ROOT_CI_TASK_NAME, ROOT_TURBO_TASK_NAME, ResetTask, TestRunner, TurboRepo, TurboRepoTask, TypeScriptConfig, TypeScriptProject, VERSION, VERSION_KEYS_SKIP, VERSION_NPM_PACKAGES, VSCodeConfig, Vitest, addApproveMergeUpgradeWorkflow, addBuildCompleteJob, awsCdkBundle, baseBundle, getLatestEligibleVersion, githubWorkflowBundle, jestBundle, pnpmBundle, projenBundle, resolveTemplateVariables, turborepoBundle, typescriptBundle, vitestBundle };
|
|
2846
2851
|
export type { AgentConfigOptions, AgentModel, AgentPlatform, AgentPlatformOverrides, AgentRule, AgentRuleBundle, AgentRuleScope, AgentSkill, AgentSubAgent, AgentSubAgentPlatformOverrides, ApproveMergeUpgradeOptions, AwsAccount, AwsDeploymentTargetOptions, AwsLocalDeploymentConfig, AwsOrganization, AwsRegion, CiDeploymentConfig, ClassTypeOptions, ClaudeAutoModeConfig, ClaudeHookAction, ClaudeHookEntry, ClaudeHooksConfig, ClaudePermissionsConfig, ClaudeRuleTarget, ClaudeSandboxConfig, ClaudeSettingsConfig, CopilotHandoff, CursorHookAction, CursorHooksConfig, CursorSettingsConfig, DeployWorkflowOptions, DeploymentMetadata, GitBranch, GitHubBoardMetadata, GitHubProjectMetadata, GitHubSprintMetadata, IDependencyResolver, McpServerConfig, McpTransport, MergeMethod, MonorepoProjectOptions, OrganizationMetadata, PnpmWorkspaceOptions, ProjectMetadataOptions, RemoteCacheOptions, RepositoryMetadata, ResetTaskOptions, ResolvedProjectMetadata, SlackMetadata, TemplateResolveResult, TurboRepoOptions, TurboRepoTaskOptions, TypeScriptProjectOptions, VersionKey, VitestConfigOptions, VitestOptions };
|
package/lib/index.js
CHANGED
|
@@ -211,6 +211,7 @@ __export(index_exports, {
|
|
|
211
211
|
awsCdkBundle: () => awsCdkBundle,
|
|
212
212
|
baseBundle: () => baseBundle,
|
|
213
213
|
getLatestEligibleVersion: () => getLatestEligibleVersion,
|
|
214
|
+
githubWorkflowBundle: () => githubWorkflowBundle,
|
|
214
215
|
jestBundle: () => jestBundle,
|
|
215
216
|
pnpmBundle: () => pnpmBundle,
|
|
216
217
|
projenBundle: () => projenBundle,
|
|
@@ -311,6 +312,37 @@ var awsCdkBundle = {
|
|
|
311
312
|
"}",
|
|
312
313
|
"```",
|
|
313
314
|
"",
|
|
315
|
+
"## L2 Over L1 Construct Preference",
|
|
316
|
+
"",
|
|
317
|
+
"- Always prefer L2 constructs (e.g., `s3.Bucket`, `lambda.Function`) over L1 escape hatches (`CfnBucket`, `CfnFunction`)",
|
|
318
|
+
"- Only drop to L1 when the L2 construct is missing the feature you need or does not exist yet",
|
|
319
|
+
"- When using L1, add a comment explaining why the L2 was insufficient",
|
|
320
|
+
"",
|
|
321
|
+
"## Filename / Class Name Matching",
|
|
322
|
+
"",
|
|
323
|
+
"- Kebab-case filenames must mirror PascalCase class names (e.g., `my-construct.ts` \u2192 `MyConstruct`)",
|
|
324
|
+
"- One primary construct per file; supporting types (props interface, enums) live in the same file",
|
|
325
|
+
"- Test files follow the same pattern: `my-construct.spec.ts`",
|
|
326
|
+
"",
|
|
327
|
+
"## Cross-Stack Lookup Patterns",
|
|
328
|
+
"",
|
|
329
|
+
"- Lookups live on **service classes**, not component/construct classes",
|
|
330
|
+
"- Use static methods for cross-stack lookups so consumers don't need an instance:",
|
|
331
|
+
"",
|
|
332
|
+
"```typescript",
|
|
333
|
+
"export class MyService {",
|
|
334
|
+
" /** Look up a resource from another stack via SSM. */",
|
|
335
|
+
" public static lookupArn(scope: Construct, id: string): string {",
|
|
336
|
+
" return StringParameter.valueForStringParameter(",
|
|
337
|
+
" scope,",
|
|
338
|
+
" `/my-app/my-resource-arn`,",
|
|
339
|
+
" );",
|
|
340
|
+
" }",
|
|
341
|
+
"}",
|
|
342
|
+
"```",
|
|
343
|
+
"",
|
|
344
|
+
"- Store outputs in SSM parameters with well-known paths; do not pass values between stacks via props",
|
|
345
|
+
"",
|
|
314
346
|
"## AWS Best Practices",
|
|
315
347
|
"",
|
|
316
348
|
"- Use AWS CDK v2 (`aws-cdk-lib`)",
|
|
@@ -324,8 +356,30 @@ var awsCdkBundle = {
|
|
|
324
356
|
"",
|
|
325
357
|
"- Mock `Code.fromAsset` in any test file that synthesizes CDK stacks",
|
|
326
358
|
"- Use static S3 values (`mock-assets-bucket`, `mock-asset-key.zip`) so snapshots are stable",
|
|
327
|
-
"- Add the mock in `beforeAll` and restore in `afterAll
|
|
328
|
-
"
|
|
359
|
+
"- Add the mock in `beforeAll` and restore in `afterAll`:",
|
|
360
|
+
"",
|
|
361
|
+
"```typescript",
|
|
362
|
+
"let fromAssetMock: MockInstance;",
|
|
363
|
+
"",
|
|
364
|
+
"beforeAll(() => {",
|
|
365
|
+
' fromAssetMock = vi.spyOn(Code, "fromAsset").mockReturnValue({',
|
|
366
|
+
" isInline: false,",
|
|
367
|
+
" bind: () => ({",
|
|
368
|
+
" s3Location: {",
|
|
369
|
+
' bucketName: "mock-assets-bucket",',
|
|
370
|
+
' objectKey: "mock-asset-key.zip",',
|
|
371
|
+
" },",
|
|
372
|
+
" }),",
|
|
373
|
+
" } as unknown as AssetCode);",
|
|
374
|
+
"});",
|
|
375
|
+
"",
|
|
376
|
+
"afterAll(() => {",
|
|
377
|
+
" fromAssetMock.mockRestore();",
|
|
378
|
+
"});",
|
|
379
|
+
"```",
|
|
380
|
+
"",
|
|
381
|
+
"- Normalize the template before snapshotting when the stack includes asset-based Lambdas",
|
|
382
|
+
"- Use `Template.fromStack(stack)` and assert with `hasResourceProperties` for targeted checks"
|
|
329
383
|
].join("\n"),
|
|
330
384
|
tags: ["infrastructure"]
|
|
331
385
|
}
|
|
@@ -634,6 +688,98 @@ var baseBundle = {
|
|
|
634
688
|
]
|
|
635
689
|
};
|
|
636
690
|
|
|
691
|
+
// src/agent/bundles/github-workflow.ts
|
|
692
|
+
var import_github = require("projen/lib/github");
|
|
693
|
+
var githubWorkflowBundle = {
|
|
694
|
+
name: "github-workflow",
|
|
695
|
+
description: "GitHub issue and PR workflow automation patterns",
|
|
696
|
+
appliesWhen: (project) => hasComponent(project, import_github.GitHub),
|
|
697
|
+
rules: [
|
|
698
|
+
{
|
|
699
|
+
name: "issue-workflow",
|
|
700
|
+
description: "Automated workflow for starting work on a GitHub issue",
|
|
701
|
+
scope: AGENT_RULE_SCOPE.ALWAYS,
|
|
702
|
+
content: [
|
|
703
|
+
"# Issue Workflow",
|
|
704
|
+
"",
|
|
705
|
+
'## "Work on issue X" Automation',
|
|
706
|
+
"",
|
|
707
|
+
"When the user says **work on issue X** (or similar), follow these steps exactly:",
|
|
708
|
+
"",
|
|
709
|
+
"1. **Fetch issue details** \u2014 use `gh issue view <number>` to get the title, body, and labels",
|
|
710
|
+
"2. **Determine branch type** from the issue title prefix:",
|
|
711
|
+
" - `feat:` / `feature:` \u2192 `feat/`",
|
|
712
|
+
" - `fix:` / `bug:` \u2192 `fix/`",
|
|
713
|
+
" - `docs:` \u2192 `docs/`",
|
|
714
|
+
" - `chore:` / `refactor:` \u2192 `chore/`",
|
|
715
|
+
" - `test:` \u2192 `test/`",
|
|
716
|
+
" - No prefix \u2192 `feat/`",
|
|
717
|
+
"3. **Create a branch** following the naming convention: `<type>/<short-slug>-<issue-number>` (e.g., `feat/add-login-42`)",
|
|
718
|
+
"4. **Checkout the branch** locally",
|
|
719
|
+
"5. **Link the branch to the issue** by posting a comment: `gh issue comment <number> --body 'Branch: \\`<branch-name>\\`'`",
|
|
720
|
+
"6. **Stop and wait** for user instructions \u2014 do **NOT** start implementing",
|
|
721
|
+
"",
|
|
722
|
+
"### Important",
|
|
723
|
+
"",
|
|
724
|
+
"- Never begin implementation without explicit user direction",
|
|
725
|
+
"- If the issue title has no conventional prefix, default to `feat/`",
|
|
726
|
+
"- Keep the slug short (3-5 words max, kebab-case)"
|
|
727
|
+
].join("\n"),
|
|
728
|
+
tags: ["workflow"]
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
name: "pr-workflow",
|
|
732
|
+
description: "Automated workflow for opening a pull request",
|
|
733
|
+
scope: AGENT_RULE_SCOPE.ALWAYS,
|
|
734
|
+
content: [
|
|
735
|
+
"# PR Workflow",
|
|
736
|
+
"",
|
|
737
|
+
'## "Open a PR" Automation',
|
|
738
|
+
"",
|
|
739
|
+
"When the user says **open a PR** (or similar), follow these steps exactly:",
|
|
740
|
+
"",
|
|
741
|
+
"1. **Check for uncommitted changes** \u2014 if any exist, commit them with a conventional commit message",
|
|
742
|
+
"2. **Push the branch** to origin: `git push -u origin <branch>`",
|
|
743
|
+
"3. **Create the PR** using `gh pr create`:",
|
|
744
|
+
" - **Title**: use a conventional commit style title (e.g., `feat(scope): short description`)",
|
|
745
|
+
" - **Body**: include `Closes #<issue-number>` (derived from the branch name) and a brief summary of changes",
|
|
746
|
+
"4. **Display merge dialog text** for the user to copy-paste when merging:",
|
|
747
|
+
"",
|
|
748
|
+
"```",
|
|
749
|
+
"Commit message:",
|
|
750
|
+
"<conventional-commit-title>",
|
|
751
|
+
"",
|
|
752
|
+
"Extended description:",
|
|
753
|
+
"- Bullet points summarizing the changes",
|
|
754
|
+
"- Closes #<issue-number>",
|
|
755
|
+
"```",
|
|
756
|
+
"",
|
|
757
|
+
"### PR Body Template",
|
|
758
|
+
"",
|
|
759
|
+
"```markdown",
|
|
760
|
+
"## Summary",
|
|
761
|
+
"",
|
|
762
|
+
"<1-3 bullet points describing what changed and why>",
|
|
763
|
+
"",
|
|
764
|
+
"Closes #<issue-number>",
|
|
765
|
+
"",
|
|
766
|
+
"## Test Plan",
|
|
767
|
+
"",
|
|
768
|
+
"- [ ] Tests pass locally",
|
|
769
|
+
"- [ ] Relevant changes have been reviewed",
|
|
770
|
+
"```",
|
|
771
|
+
"",
|
|
772
|
+
"### Important",
|
|
773
|
+
"",
|
|
774
|
+
"- Always derive the issue number from the branch name (e.g., `feat/add-login-42` \u2192 `#42`)",
|
|
775
|
+
"- Use conventional commit format for the PR title",
|
|
776
|
+
"- Do not merge the PR \u2014 only create it and display the merge text"
|
|
777
|
+
].join("\n"),
|
|
778
|
+
tags: ["workflow"]
|
|
779
|
+
}
|
|
780
|
+
]
|
|
781
|
+
};
|
|
782
|
+
|
|
637
783
|
// src/agent/bundles/jest.ts
|
|
638
784
|
var jestBundle = {
|
|
639
785
|
name: "jest",
|
|
@@ -820,6 +966,28 @@ var projenBundle = {
|
|
|
820
966
|
description: "Projen conventions, synthesis workflow, .projenrc.ts patterns",
|
|
821
967
|
appliesWhen: (project) => hasDep(project, "projen"),
|
|
822
968
|
rules: [
|
|
969
|
+
{
|
|
970
|
+
name: "projen-sandbox-restrictions",
|
|
971
|
+
description: "Commands the agent must never run in Projen-managed projects",
|
|
972
|
+
scope: AGENT_RULE_SCOPE.ALWAYS,
|
|
973
|
+
content: [
|
|
974
|
+
"# Projen Sandbox Restrictions",
|
|
975
|
+
"",
|
|
976
|
+
"## Prohibited Commands",
|
|
977
|
+
"",
|
|
978
|
+
"The agent must **never** run the following commands \u2014 always ask the user to run them instead:",
|
|
979
|
+
"",
|
|
980
|
+
"- `pnpm install` / `pnpm i` \u2014 modifies the lockfile and may trigger synthesis",
|
|
981
|
+
"- `npx projen` \u2014 synthesizes generated files and must be run by the user",
|
|
982
|
+
"",
|
|
983
|
+
"## Rationale",
|
|
984
|
+
"",
|
|
985
|
+
"Projen-managed projects rely on synthesized files (`package.json`, `tsconfig.json`, etc.) that are regenerated from `.projenrc.ts`.",
|
|
986
|
+
"Running install or synthesis in the agent's sandbox can cause lockfile drift, phantom dependency changes, or overwrite user-controlled configuration.",
|
|
987
|
+
"The user must run these commands locally so they can review the resulting changes."
|
|
988
|
+
].join("\n"),
|
|
989
|
+
tags: ["workflow", "safety"]
|
|
990
|
+
},
|
|
823
991
|
{
|
|
824
992
|
name: "projen-conventions",
|
|
825
993
|
description: "Projen configuration patterns and best practices",
|
|
@@ -836,6 +1004,41 @@ var projenBundle = {
|
|
|
836
1004
|
" - `projenrc/*.ts` (package-specific)",
|
|
837
1005
|
"- After making Projen changes, ask the user to run `npx projen` locally (agent must not run it)",
|
|
838
1006
|
"",
|
|
1007
|
+
"## DO NOT Use Manual Package Manager Commands",
|
|
1008
|
+
"",
|
|
1009
|
+
"- **Never** run `pnpm add`, `pnpm remove`, `npm install`, or `yarn add` to modify dependencies",
|
|
1010
|
+
"- Dependencies must be added through Projen configuration (e.g., `project.addDeps()`, `project.addDevDeps()`)",
|
|
1011
|
+
"- Manual package manager commands bypass Projen's dependency management and will be overwritten on the next synthesis",
|
|
1012
|
+
"- Correct workflow: edit `.projenrc.ts` \u2192 ask user to run `npx projen` \u2192 user runs `pnpm install` if needed",
|
|
1013
|
+
"",
|
|
1014
|
+
"## Workspace Dependencies",
|
|
1015
|
+
"",
|
|
1016
|
+
"When adding dependencies between packages in a monorepo:",
|
|
1017
|
+
"",
|
|
1018
|
+
'- Use the workspace protocol: `project.addDeps("@org/sibling-pkg@workspace:*")`',
|
|
1019
|
+
"- This ensures the local version is always resolved, not a registry version",
|
|
1020
|
+
'- For dev dependencies: `project.addDevDeps("@org/sibling-pkg@workspace:*")`',
|
|
1021
|
+
"",
|
|
1022
|
+
"## The `configureMyProject` Pattern",
|
|
1023
|
+
"",
|
|
1024
|
+
"Each package should expose a `configureMyProject(options)` factory function that creates and configures its Projen project:",
|
|
1025
|
+
"",
|
|
1026
|
+
"```typescript",
|
|
1027
|
+
"export function configureMyProject(",
|
|
1028
|
+
" options: MyProjectOptions,",
|
|
1029
|
+
"): TypeScriptProject {",
|
|
1030
|
+
" const project = new TypeScriptProject({",
|
|
1031
|
+
" ...options,",
|
|
1032
|
+
" // package-specific defaults",
|
|
1033
|
+
" });",
|
|
1034
|
+
"",
|
|
1035
|
+
" // Attach components, configure rules, etc.",
|
|
1036
|
+
" return project;",
|
|
1037
|
+
"}",
|
|
1038
|
+
"```",
|
|
1039
|
+
"",
|
|
1040
|
+
"This pattern keeps `.projenrc.ts` clean and makes package configuration reusable and testable.",
|
|
1041
|
+
"",
|
|
839
1042
|
"## Custom Projen Components",
|
|
840
1043
|
"",
|
|
841
1044
|
"All custom components must extend `Component` from Projen and use a static `.of()` factory for discovery:",
|
|
@@ -1442,7 +1645,8 @@ var BUILT_IN_BUNDLES = [
|
|
|
1442
1645
|
turborepoBundle,
|
|
1443
1646
|
pnpmBundle,
|
|
1444
1647
|
awsCdkBundle,
|
|
1445
|
-
projenBundle
|
|
1648
|
+
projenBundle,
|
|
1649
|
+
githubWorkflowBundle
|
|
1446
1650
|
];
|
|
1447
1651
|
|
|
1448
1652
|
// src/projects/project-metadata.ts
|
|
@@ -2274,7 +2478,7 @@ ${extra}`
|
|
|
2274
2478
|
|
|
2275
2479
|
// src/aws/aws-deployment-config.ts
|
|
2276
2480
|
var import_node_path = require("path");
|
|
2277
|
-
var
|
|
2481
|
+
var import_utils9 = __toESM(require_lib());
|
|
2278
2482
|
var import_projen9 = require("projen");
|
|
2279
2483
|
var AwsDeploymentConfig = class _AwsDeploymentConfig extends import_projen9.Component {
|
|
2280
2484
|
constructor(project) {
|
|
@@ -2331,17 +2535,17 @@ var AwsDeploymentConfig = class _AwsDeploymentConfig extends import_projen9.Comp
|
|
|
2331
2535
|
*/
|
|
2332
2536
|
get prodTargets() {
|
|
2333
2537
|
return this.awsDeploymentTargets.filter(
|
|
2334
|
-
(target) => target.awsStageType ===
|
|
2538
|
+
(target) => target.awsStageType === import_utils9.AWS_STAGE_TYPE.PROD
|
|
2335
2539
|
);
|
|
2336
2540
|
}
|
|
2337
2541
|
get prodTargetsForCI() {
|
|
2338
2542
|
return this.awsDeploymentTargets.filter(
|
|
2339
|
-
(target) => target.awsStageType ===
|
|
2543
|
+
(target) => target.awsStageType === import_utils9.AWS_STAGE_TYPE.PROD && target.ciDeployment
|
|
2340
2544
|
);
|
|
2341
2545
|
}
|
|
2342
2546
|
get prodTargetsForLocal() {
|
|
2343
2547
|
return this.awsDeploymentTargets.filter(
|
|
2344
|
-
(target) => target.awsStageType ===
|
|
2548
|
+
(target) => target.awsStageType === import_utils9.AWS_STAGE_TYPE.PROD && target.localDeployment
|
|
2345
2549
|
);
|
|
2346
2550
|
}
|
|
2347
2551
|
/**
|
|
@@ -2350,17 +2554,17 @@ var AwsDeploymentConfig = class _AwsDeploymentConfig extends import_projen9.Comp
|
|
|
2350
2554
|
*/
|
|
2351
2555
|
get stageTargets() {
|
|
2352
2556
|
return this.awsDeploymentTargets.filter(
|
|
2353
|
-
(target) => target.awsStageType ===
|
|
2557
|
+
(target) => target.awsStageType === import_utils9.AWS_STAGE_TYPE.STAGE
|
|
2354
2558
|
);
|
|
2355
2559
|
}
|
|
2356
2560
|
get stageTargetsForCI() {
|
|
2357
2561
|
return this.awsDeploymentTargets.filter(
|
|
2358
|
-
(target) => target.awsStageType ===
|
|
2562
|
+
(target) => target.awsStageType === import_utils9.AWS_STAGE_TYPE.STAGE && target.ciDeployment
|
|
2359
2563
|
);
|
|
2360
2564
|
}
|
|
2361
2565
|
get stageTargetsForLocal() {
|
|
2362
2566
|
return this.awsDeploymentTargets.filter(
|
|
2363
|
-
(target) => target.awsStageType ===
|
|
2567
|
+
(target) => target.awsStageType === import_utils9.AWS_STAGE_TYPE.STAGE && target.localDeployment
|
|
2364
2568
|
);
|
|
2365
2569
|
}
|
|
2366
2570
|
/**
|
|
@@ -2369,17 +2573,17 @@ var AwsDeploymentConfig = class _AwsDeploymentConfig extends import_projen9.Comp
|
|
|
2369
2573
|
*/
|
|
2370
2574
|
get devTargets() {
|
|
2371
2575
|
return this.awsDeploymentTargets.filter(
|
|
2372
|
-
(target) => target.awsStageType ===
|
|
2576
|
+
(target) => target.awsStageType === import_utils9.AWS_STAGE_TYPE.DEV
|
|
2373
2577
|
);
|
|
2374
2578
|
}
|
|
2375
2579
|
get devTargetsForCI() {
|
|
2376
2580
|
return this.awsDeploymentTargets.filter(
|
|
2377
|
-
(target) => target.awsStageType ===
|
|
2581
|
+
(target) => target.awsStageType === import_utils9.AWS_STAGE_TYPE.DEV && target.ciDeployment
|
|
2378
2582
|
);
|
|
2379
2583
|
}
|
|
2380
2584
|
get devTargetsForLocal() {
|
|
2381
2585
|
return this.awsDeploymentTargets.filter(
|
|
2382
|
-
(target) => target.awsStageType ===
|
|
2586
|
+
(target) => target.awsStageType === import_utils9.AWS_STAGE_TYPE.DEV && target.localDeployment
|
|
2383
2587
|
);
|
|
2384
2588
|
}
|
|
2385
2589
|
preSynthesize() {
|
|
@@ -2392,7 +2596,7 @@ var AwsDeploymentConfig = class _AwsDeploymentConfig extends import_projen9.Comp
|
|
|
2392
2596
|
};
|
|
2393
2597
|
|
|
2394
2598
|
// src/aws/aws-deployment-target.ts
|
|
2395
|
-
var
|
|
2599
|
+
var import_utils10 = __toESM(require_lib());
|
|
2396
2600
|
var import_projen10 = require("projen");
|
|
2397
2601
|
var AwsDeploymentTarget = class _AwsDeploymentTarget extends import_projen10.Component {
|
|
2398
2602
|
constructor(project, options) {
|
|
@@ -2459,11 +2663,11 @@ var AwsDeploymentTarget = class _AwsDeploymentTarget extends import_projen10.Com
|
|
|
2459
2663
|
};
|
|
2460
2664
|
this.account = options.account;
|
|
2461
2665
|
this.region = options.region;
|
|
2462
|
-
this.awsStageType = options.awsStageType ||
|
|
2463
|
-
const role = options.deploymentTargetRole ?? options.awsEnvironmentType ??
|
|
2666
|
+
this.awsStageType = options.awsStageType || import_utils10.AWS_STAGE_TYPE.DEV;
|
|
2667
|
+
const role = options.deploymentTargetRole ?? options.awsEnvironmentType ?? import_utils10.DEPLOYMENT_TARGET_ROLE.PRIMARY;
|
|
2464
2668
|
this.deploymentTargetRole = role;
|
|
2465
2669
|
this.awsEnvironmentType = role;
|
|
2466
|
-
this.branches = options.branches ?? (this.awsStageType ===
|
|
2670
|
+
this.branches = options.branches ?? (this.awsStageType === import_utils10.AWS_STAGE_TYPE.PROD ? [
|
|
2467
2671
|
{
|
|
2468
2672
|
branch: "main"
|
|
2469
2673
|
}
|
|
@@ -2472,7 +2676,7 @@ var AwsDeploymentTarget = class _AwsDeploymentTarget extends import_projen10.Com
|
|
|
2472
2676
|
branch: "feature/*"
|
|
2473
2677
|
}
|
|
2474
2678
|
]);
|
|
2475
|
-
this.localDeployment = options.localDeployment ?? this.awsStageType ===
|
|
2679
|
+
this.localDeployment = options.localDeployment ?? this.awsStageType === import_utils10.AWS_STAGE_TYPE.DEV;
|
|
2476
2680
|
if (this.localDeployment) {
|
|
2477
2681
|
const roleName = options.localDeploymentConfig?.roleName?.toLowerCase() || "poweruseraccess";
|
|
2478
2682
|
const profile = options.localDeploymentConfig?.profile || `${roleName}-${this.awsStageType}-${this.account}-${this.region}`;
|
|
@@ -3398,10 +3602,10 @@ var TypeScriptConfig = class extends import_projen15.Component {
|
|
|
3398
3602
|
};
|
|
3399
3603
|
|
|
3400
3604
|
// src/workflows/aws-deploy-workflow.ts
|
|
3401
|
-
var
|
|
3605
|
+
var import_utils11 = __toESM(require_lib());
|
|
3402
3606
|
var import_projen16 = require("projen");
|
|
3403
3607
|
var import_build = require("projen/lib/build");
|
|
3404
|
-
var
|
|
3608
|
+
var import_github2 = require("projen/lib/github");
|
|
3405
3609
|
var import_workflows_model4 = require("projen/lib/github/workflows-model");
|
|
3406
3610
|
var PROD_DEPLOY_NAME = "prod-deploy";
|
|
3407
3611
|
var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen16.Component {
|
|
@@ -3415,7 +3619,7 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen16.Compone
|
|
|
3415
3619
|
* @deprecated Use deployment target role terminology elsewhere. This property is maintained for backward compatibility.
|
|
3416
3620
|
* @default 'primary' (this is the only type supported currently)
|
|
3417
3621
|
*/
|
|
3418
|
-
this.awsEnvironmentType =
|
|
3622
|
+
this.awsEnvironmentType = import_utils11.DEPLOYMENT_TARGET_ROLE.PRIMARY;
|
|
3419
3623
|
this.setupNode = () => {
|
|
3420
3624
|
return [
|
|
3421
3625
|
{
|
|
@@ -3517,7 +3721,7 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen16.Compone
|
|
|
3517
3721
|
);
|
|
3518
3722
|
}
|
|
3519
3723
|
this.rootProject = project.root;
|
|
3520
|
-
const github =
|
|
3724
|
+
const github = import_github2.GitHub.of(this.rootProject);
|
|
3521
3725
|
if (!github) {
|
|
3522
3726
|
throw new Error(
|
|
3523
3727
|
"AwsDeployWorkflow requires a GitHub component in the root project"
|
|
@@ -3525,7 +3729,7 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen16.Compone
|
|
|
3525
3729
|
}
|
|
3526
3730
|
const turbo = TurboRepo.of(this.rootProject);
|
|
3527
3731
|
const buildWorkflowOptions = turbo?.remoteCacheOptions ? TurboRepo.buildWorkflowOptions(turbo.remoteCacheOptions) : {};
|
|
3528
|
-
this.awsStageType = options.awsStageType ??
|
|
3732
|
+
this.awsStageType = options.awsStageType ?? import_utils11.AWS_STAGE_TYPE.DEV;
|
|
3529
3733
|
this.awsDeploymentTargets = options.awsDeploymentTargets ?? AwsDeploymentConfig.of(project)?.awsDeploymentTargets.filter(
|
|
3530
3734
|
(target) => target.awsStageType === this.awsStageType && target.ciDeployment
|
|
3531
3735
|
) ?? [];
|
|
@@ -3705,6 +3909,7 @@ var AwsDeployWorkflow = class _AwsDeployWorkflow extends import_projen16.Compone
|
|
|
3705
3909
|
awsCdkBundle,
|
|
3706
3910
|
baseBundle,
|
|
3707
3911
|
getLatestEligibleVersion,
|
|
3912
|
+
githubWorkflowBundle,
|
|
3708
3913
|
jestBundle,
|
|
3709
3914
|
pnpmBundle,
|
|
3710
3915
|
projenBundle,
|