@mavogel/mvc-projen 0.0.24 → 0.0.26
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/.claude/rules/mvc-projen-contribution-workflows.md +22 -0
- package/.claude/rules/mvc-projen-project.md +90 -0
- package/.claude/rules/mvc-projen-toolchain-maintenance.md +43 -0
- package/.codegraph/.gitignore +5 -0
- package/.jsii +11 -11
- package/.nvmrc +1 -0
- package/API.md +152 -574
- package/README.md +1 -1
- package/assets/cdk-construct/src_crd-example.ts +45 -34
- package/assets/cdk-construct/src_placeholder.ts +5 -12
- package/assets/cdk-construct/test_index.test.ts +16 -24
- package/lib/projects/cdk-construct.js +52 -13
- package/mavogelmvcprojen/jsii/jsii.go +2 -2
- package/mavogelmvcprojen/version +1 -1
- package/package.json +42 -43
- package/CLAUDE.md +0 -201
package/package.json
CHANGED
|
@@ -6,28 +6,29 @@
|
|
|
6
6
|
"url": "https://github.com/MV-Consulting/mvc-projen"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "
|
|
10
|
-
"bump": "
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"package
|
|
20
|
-
"package
|
|
21
|
-
"package:
|
|
22
|
-
"package:
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"test
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
9
|
+
"build": "projen build",
|
|
10
|
+
"bump": "projen bump",
|
|
11
|
+
"bump:releasable-commits": "projen bump:releasable-commits",
|
|
12
|
+
"clobber": "projen clobber",
|
|
13
|
+
"compat": "projen compat",
|
|
14
|
+
"compile": "projen compile",
|
|
15
|
+
"default": "projen default",
|
|
16
|
+
"docgen": "projen docgen",
|
|
17
|
+
"eject": "projen eject",
|
|
18
|
+
"eslint": "projen eslint",
|
|
19
|
+
"package": "projen package",
|
|
20
|
+
"package-all": "projen package-all",
|
|
21
|
+
"package:go": "projen package:go",
|
|
22
|
+
"package:js": "projen package:js",
|
|
23
|
+
"package:python": "projen package:python",
|
|
24
|
+
"post-compile": "projen post-compile",
|
|
25
|
+
"pre-compile": "projen pre-compile",
|
|
26
|
+
"release": "projen release",
|
|
27
|
+
"test": "projen test",
|
|
28
|
+
"test:watch": "projen test:watch",
|
|
29
|
+
"unbump": "projen unbump",
|
|
30
|
+
"watch": "projen watch",
|
|
31
|
+
"projen": "projen",
|
|
31
32
|
"prepare": "husky"
|
|
32
33
|
},
|
|
33
34
|
"author": {
|
|
@@ -36,38 +37,38 @@
|
|
|
36
37
|
"organization": false
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"@commitlint/cli": "^
|
|
40
|
-
"@commitlint/config-conventional": "^
|
|
40
|
+
"@commitlint/cli": "^21.2.1",
|
|
41
|
+
"@commitlint/config-conventional": "^21.2.0",
|
|
41
42
|
"@stylistic/eslint-plugin": "^2",
|
|
42
43
|
"@types/jest": "^30.0.0",
|
|
43
|
-
"@types/node": "
|
|
44
|
+
"@types/node": "ts6.0",
|
|
44
45
|
"@typescript-eslint/eslint-plugin": "^8",
|
|
45
46
|
"@typescript-eslint/parser": "^8",
|
|
46
47
|
"commit-and-tag-version": "^12",
|
|
47
48
|
"constructs": "10.5.1",
|
|
48
49
|
"eslint": "^9",
|
|
49
|
-
"eslint-import-resolver-typescript": "^4.4.
|
|
50
|
+
"eslint-import-resolver-typescript": "^4.4.5",
|
|
50
51
|
"eslint-plugin-import": "^2.32.0",
|
|
51
52
|
"husky": "^9.1.7",
|
|
52
|
-
"jest": "^30.
|
|
53
|
-
"jest-junit": "^
|
|
54
|
-
"jsii": "~
|
|
55
|
-
"jsii-diff": "^1.
|
|
53
|
+
"jest": "^30.4.2",
|
|
54
|
+
"jest-junit": "^17",
|
|
55
|
+
"jsii": "~6.0.0",
|
|
56
|
+
"jsii-diff": "^1.139.0",
|
|
56
57
|
"jsii-docgen": "^10.5.0",
|
|
57
|
-
"jsii-pacmak": "^1.
|
|
58
|
-
"jsii-rosetta": "~
|
|
59
|
-
"projen": "0.
|
|
60
|
-
"ts-jest": "^29.4.
|
|
58
|
+
"jsii-pacmak": "^1.139.0",
|
|
59
|
+
"jsii-rosetta": "~6.0.0",
|
|
60
|
+
"projen": "0.101.17",
|
|
61
|
+
"ts-jest": "^29.4.11",
|
|
61
62
|
"ts-node": "^10",
|
|
62
63
|
"typescript": "^6.0.2"
|
|
63
64
|
},
|
|
64
65
|
"peerDependencies": {
|
|
65
66
|
"constructs": "^10.5.1",
|
|
66
|
-
"projen": "^0.
|
|
67
|
+
"projen": "^0.101.17"
|
|
67
68
|
},
|
|
68
69
|
"dependencies": {
|
|
69
70
|
"constructs": "^10.5.1",
|
|
70
|
-
"projen": "^0.
|
|
71
|
+
"projen": "^0.101.17"
|
|
71
72
|
},
|
|
72
73
|
"keywords": [
|
|
73
74
|
"aws",
|
|
@@ -83,10 +84,11 @@
|
|
|
83
84
|
},
|
|
84
85
|
"main": "lib/index.js",
|
|
85
86
|
"license": "Apache-2.0",
|
|
87
|
+
"stability": "stable",
|
|
86
88
|
"publishConfig": {
|
|
87
89
|
"access": "public"
|
|
88
90
|
},
|
|
89
|
-
"version": "0.0.
|
|
91
|
+
"version": "0.0.26",
|
|
90
92
|
"jest": {
|
|
91
93
|
"coverageProvider": "v8",
|
|
92
94
|
"testMatch": [
|
|
@@ -127,13 +129,12 @@
|
|
|
127
129
|
"^.+\\.[t]sx?$": [
|
|
128
130
|
"ts-jest",
|
|
129
131
|
{
|
|
130
|
-
"tsconfig": "tsconfig.
|
|
132
|
+
"tsconfig": "test/tsconfig.json"
|
|
131
133
|
}
|
|
132
134
|
]
|
|
133
135
|
}
|
|
134
136
|
},
|
|
135
137
|
"types": "lib/index.d.ts",
|
|
136
|
-
"stability": "stable",
|
|
137
138
|
"jsii": {
|
|
138
139
|
"outdir": "dist",
|
|
139
140
|
"targets": {
|
|
@@ -145,10 +146,8 @@
|
|
|
145
146
|
"moduleName": "github.com/MV-Consulting/mvc-projen"
|
|
146
147
|
}
|
|
147
148
|
},
|
|
148
|
-
"
|
|
149
|
-
|
|
150
|
-
"rootDir": "src"
|
|
151
|
-
}
|
|
149
|
+
"tsconfig": "tsconfig.json",
|
|
150
|
+
"validateTsconfig": "strict"
|
|
152
151
|
},
|
|
153
152
|
"//": "~~ Generated by projen. To modify, edit .projenrc.ts and run \"npx projen\"."
|
|
154
153
|
}
|
package/CLAUDE.md
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
# CLAUDE.md
|
|
2
|
-
|
|
3
|
-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
-
|
|
5
|
-
## Repository Overview
|
|
6
|
-
|
|
7
|
-
`mvc-projen` is a baseline projen module for MV Consulting projects, providing scaffolding templates for AWS CDK constructs with best practices and unified setup. The project is built using [projen](https://projen.io/) and uses JSII to compile TypeScript into multiple target languages (Python, Go).
|
|
8
|
-
|
|
9
|
-
## Core Architecture
|
|
10
|
-
|
|
11
|
-
### Project Structure
|
|
12
|
-
- **src/projects/cdk-construct.ts**: Main class `MvcCdkConstructLibrary` that extends `AwsCdkConstructLibrary` from projen
|
|
13
|
-
- Configures opinionated defaults: Node 20.x, commitlint, husky, awslint, dependabot, ESLint
|
|
14
|
-
- Generates GitHub workflows, issue templates, pull request templates, and funding configuration
|
|
15
|
-
- Includes `SampleCode` component that generates boilerplate code, tests, and integration tests
|
|
16
|
-
- **assets/**: Template files for generated projects
|
|
17
|
-
- `cdk-construct/`: TypeScript templates for constructs, lambdas, tests, and integration tests
|
|
18
|
-
- `common/`: Reusable GitHub templates (bug reports, feature requests, PR templates, contributing guide)
|
|
19
|
-
- **src/index.ts**: Exports all projects from src/projects
|
|
20
|
-
|
|
21
|
-
### Key Design Patterns
|
|
22
|
-
1. **Asset-based Generation**: Template files in `assets/` directory are copied into generated projects during synthesis
|
|
23
|
-
2. **Dynamic Configuration**: Base assets directory defaults to `${cwd()}/node_modules/@mavogel/mvc-projen/assets` but can be overridden
|
|
24
|
-
3. **Workflow Modification**: Post-processes GitHub workflows to inject custom build steps (awslint)
|
|
25
|
-
4. **Multi-language Publishing**: Uses JSII to publish to npm (JavaScript/TypeScript), PyPI (Python), and Go modules
|
|
26
|
-
|
|
27
|
-
## Common Development Commands
|
|
28
|
-
|
|
29
|
-
### Building and Testing
|
|
30
|
-
```bash
|
|
31
|
-
# Install dependencies and build project
|
|
32
|
-
npm run build
|
|
33
|
-
|
|
34
|
-
# Run tests with coverage
|
|
35
|
-
npm test
|
|
36
|
-
|
|
37
|
-
# Run tests in watch mode
|
|
38
|
-
npm run test:watch
|
|
39
|
-
|
|
40
|
-
# Lint code
|
|
41
|
-
npm run eslint
|
|
42
|
-
|
|
43
|
-
# Compile TypeScript only (without full build)
|
|
44
|
-
npm run compile
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### Packaging and Publishing
|
|
48
|
-
```bash
|
|
49
|
-
# Package for all targets (npm, Python, Go)
|
|
50
|
-
npm run package-all
|
|
51
|
-
|
|
52
|
-
# Package individual targets
|
|
53
|
-
npm run package:js
|
|
54
|
-
npm run package:python
|
|
55
|
-
npm run package:go
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### Release Management
|
|
59
|
-
```bash
|
|
60
|
-
# Create a new release (triggered by CI on main branch)
|
|
61
|
-
npm run release
|
|
62
|
-
|
|
63
|
-
# Bump version manually
|
|
64
|
-
npm run bump
|
|
65
|
-
|
|
66
|
-
# Revert version bump
|
|
67
|
-
npm run unbump
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### Projen Maintenance
|
|
71
|
-
```bash
|
|
72
|
-
# Regenerate project files from .projenrc.ts
|
|
73
|
-
npx projen
|
|
74
|
-
|
|
75
|
-
# Remove all generated files and dependencies
|
|
76
|
-
npm run clobber
|
|
77
|
-
|
|
78
|
-
# Run default projen task
|
|
79
|
-
npm run default
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### Using mvc-projen to Create New Projects
|
|
83
|
-
```bash
|
|
84
|
-
# Create new CDK construct project
|
|
85
|
-
mkdir my-new-construct && cd my-new-construct
|
|
86
|
-
npx projen new \
|
|
87
|
-
--from @mavogel/mvc-projen@~0 \
|
|
88
|
-
--cdkVersion=2.177.0 \
|
|
89
|
-
--package-manager=npm
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
## Important Configuration Details
|
|
93
|
-
|
|
94
|
-
### Projen Configuration (.projenrc.ts)
|
|
95
|
-
- **jsiiVersion**: Currently `~5.7.0` - must stay in sync with dependencies
|
|
96
|
-
- **projenVersion**: Currently `0.91.8` - pinned for stability
|
|
97
|
-
- **Node version**: 20.x minimum
|
|
98
|
-
- **Commit types**: Uses conventional commits with specific allowed types (feat, fix, chore, refactor, perf, docs, style, test, build, ci)
|
|
99
|
-
- **Dependencies**: Both `projen` and `constructs` are listed in deps and peerDeps to ensure compatibility
|
|
100
|
-
|
|
101
|
-
### Generated Project Defaults (MvcCdkConstructLibrary)
|
|
102
|
-
When using `MvcCdkConstructLibrary`, projects get these defaults:
|
|
103
|
-
- **Copyright**: MV Consulting GmbH, 2025
|
|
104
|
-
- **License**: Apache-2.0
|
|
105
|
-
- **Node**: 20.x runtime
|
|
106
|
-
- **Lambda Runtime**: NODEJS_20_X
|
|
107
|
-
- **Package Manager**: npm
|
|
108
|
-
- **Auto-approve**: Configured for dependabot and bot accounts using `PROJEN_GITHUB_TOKEN` secret
|
|
109
|
-
- **Dependabot**: Weekly schedule, excludes aws-cdk-lib and aws-cdk from updates
|
|
110
|
-
- **Integration tests**: Configured for eu-west-1 and eu-west-2 regions by default
|
|
111
|
-
- **Build workflow**: Includes awslint step after compilation
|
|
112
|
-
|
|
113
|
-
### Git and Commits
|
|
114
|
-
- **Husky**: Pre-commit hooks configured via `npm run prepare`
|
|
115
|
-
- **Commitlint**: Enforces conventional commit messages via `.commitlintrc.js`
|
|
116
|
-
- **Conventional commits**: Semantic PR titles required, release notes generated from commit types
|
|
117
|
-
- **Releasable commits**: Only feat, fix, chore, refactor, and perf trigger releases
|
|
118
|
-
|
|
119
|
-
## Testing Strategy
|
|
120
|
-
|
|
121
|
-
### Unit Tests (test/)
|
|
122
|
-
- Uses Jest with ts-jest transformer
|
|
123
|
-
- Coverage reports in multiple formats (json, lcov, clover, cobertura, text)
|
|
124
|
-
- Test patterns: `**/*(*.)@(spec|test).ts?(x)` and `**/__tests__/**/*.ts?(x)`
|
|
125
|
-
- Configuration in package.json jest section
|
|
126
|
-
|
|
127
|
-
### Integration Tests (Generated Projects)
|
|
128
|
-
- Uses `@aws-cdk/integ-runner` and `@aws-cdk/integ-tests-alpha`
|
|
129
|
-
- Run via: `npm run integ-test`
|
|
130
|
-
- Tests deployed to AWS regions specified in `integTestRegions` option
|
|
131
|
-
- Updates snapshots on failure with `--update-on-failed`
|
|
132
|
-
|
|
133
|
-
## JSII Multi-language Support
|
|
134
|
-
|
|
135
|
-
### Publishing Targets
|
|
136
|
-
- **JavaScript/TypeScript**: npm registry as `@mavogel/mvc-projen`
|
|
137
|
-
- **Python**: PyPI as `mvc-projen` module
|
|
138
|
-
- **Go**: GitHub module at `github.com/MV-Consulting/mvc-projen`
|
|
139
|
-
|
|
140
|
-
### Important JSII Constraints
|
|
141
|
-
- All public APIs must be JSII-compatible (no TypeScript-only features)
|
|
142
|
-
- Use `readonly` for immutable properties
|
|
143
|
-
- Interface names should start with capital letter
|
|
144
|
-
- Enums must use PascalCase values
|
|
145
|
-
|
|
146
|
-
## Common Development Tasks
|
|
147
|
-
|
|
148
|
-
### Modifying Generated Templates
|
|
149
|
-
1. Edit files in `assets/cdk-construct/` or `assets/common/`
|
|
150
|
-
2. Run `npx projen` to regenerate
|
|
151
|
-
3. Run tests to verify changes: `npm test`
|
|
152
|
-
4. Create a test project to verify end-to-end: `npx projen new --from @mavogel/mvc-projen@~0`
|
|
153
|
-
|
|
154
|
-
### Adding New Project Types
|
|
155
|
-
1. Create new class in `src/projects/` extending appropriate projen base class
|
|
156
|
-
2. Export from `src/projects/index.ts`
|
|
157
|
-
3. Add corresponding assets directory if needed
|
|
158
|
-
4. Update tests to cover new project type
|
|
159
|
-
5. Document in README.md
|
|
160
|
-
|
|
161
|
-
### Updating Projen Version
|
|
162
|
-
1. Update `projenVersion` in `.projenrc.ts`
|
|
163
|
-
2. Update version in `dependencies` and `peerDependencies` arrays
|
|
164
|
-
3. Run `npm run clobber && npm install`
|
|
165
|
-
4. Run `npx projen` to regenerate with new version
|
|
166
|
-
5. Test thoroughly as projen updates can cause breaking changes
|
|
167
|
-
|
|
168
|
-
## Workflow Integration
|
|
169
|
-
|
|
170
|
-
### GitHub Actions Workflows
|
|
171
|
-
- **build.yml**: Runs on all PRs and main branch - compiles, tests, and runs awslint
|
|
172
|
-
- **release.yml**: Publishes to npm, PyPI, and Go on version tags
|
|
173
|
-
- **auto-approve.yml**: Auto-approves dependabot PRs
|
|
174
|
-
- **pull-request-lint.yml**: Validates PR titles follow conventional commit format
|
|
175
|
-
|
|
176
|
-
### Dependabot Configuration
|
|
177
|
-
- Weekly schedule for dependency updates
|
|
178
|
-
- Groups all dependencies except aws-cdk-lib, aws-cdk, and projen
|
|
179
|
-
- Auto-labeled with `dependencies` and `auto-approve`
|
|
180
|
-
- Ignored packages: aws-cdk-lib, aws-cdk (managed manually)
|
|
181
|
-
|
|
182
|
-
## Asset File Conventions
|
|
183
|
-
|
|
184
|
-
Generated projects receive these files from assets:
|
|
185
|
-
- `.github/ISSUE_TEMPLATE/bug_report.md` - Bug report template
|
|
186
|
-
- `.github/ISSUE_TEMPLATE/feature_request.md` - Feature request template
|
|
187
|
-
- `.github/pull_request_template.md` - PR checklist and structure
|
|
188
|
-
- `.github/FUNDING.yaml` - GitHub sponsors configuration
|
|
189
|
-
- `CONTRIBUTING.md` - Contribution guidelines
|
|
190
|
-
- `.prettierrc` - Prettier configuration (empty file, uses defaults)
|
|
191
|
-
- `docs/placeholder.drawio` - Placeholder architecture diagram
|
|
192
|
-
- Sample code in src/, test/, integ-tests/, and examples/
|
|
193
|
-
|
|
194
|
-
## Important Notes
|
|
195
|
-
|
|
196
|
-
- **Never commit changes to generated files** - Always modify `.projenrc.ts` and run `npx projen`
|
|
197
|
-
- **Package manager**: This project uses npm (not yarn or pnpm)
|
|
198
|
-
- **ESLint patterns**: Ignores `**/*-function.ts` and `examples/` directories
|
|
199
|
-
- **Sample code**: Automatically generated unless `sampleCode: false` in options
|
|
200
|
-
- **Integration test regions**: Default to eu-west-1 and eu-west-2, override with `integTestRegions`
|
|
201
|
-
- **Lambda runtime**: Defaults to NODEJS_20_X, no AWS SDK connection reuse in v3
|