@jaypie/mcp 0.2.5 → 0.2.6
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/dist/index.js
CHANGED
|
@@ -885,7 +885,7 @@ function listLlmProviders() {
|
|
|
885
885
|
};
|
|
886
886
|
}
|
|
887
887
|
|
|
888
|
-
const BUILD_VERSION_STRING = "@jaypie/mcp@0.2.
|
|
888
|
+
const BUILD_VERSION_STRING = "@jaypie/mcp@0.2.6#e43f0153"
|
|
889
889
|
;
|
|
890
890
|
const __filename$1 = fileURLToPath(import.meta.url);
|
|
891
891
|
const __dirname$1 = path.dirname(__filename$1);
|
package/package.json
CHANGED
|
@@ -291,6 +291,76 @@ Common usage:
|
|
|
291
291
|
- `resolveHostedZone(scope, { zone })`: Gets IHostedZone from string or object
|
|
292
292
|
- `extendDatadogRole(lambda)`: Adds Datadog IAM permissions when CDK_ENV_DATADOG_ROLE_ARN set
|
|
293
293
|
|
|
294
|
+
### DynamoDB Tables
|
|
295
|
+
|
|
296
|
+
Use `JaypieDynamoDb` for single-table design with Jaypie GSI patterns:
|
|
297
|
+
```typescript
|
|
298
|
+
// Shorthand: tableName becomes "myApp", construct id is "JaypieDynamoDb-myApp"
|
|
299
|
+
const table = new JaypieDynamoDb(this, "myApp");
|
|
300
|
+
|
|
301
|
+
// No GSIs
|
|
302
|
+
const table = new JaypieDynamoDb(this, "MyTable", {
|
|
303
|
+
globalSecondaryIndexes: false,
|
|
304
|
+
});
|
|
305
|
+
|
|
306
|
+
// Use only specific GSIs
|
|
307
|
+
const table = new JaypieDynamoDb(this, "MyTable", {
|
|
308
|
+
globalSecondaryIndexes: [
|
|
309
|
+
JaypieDynamoDb.GlobalSecondaryIndex.Ou,
|
|
310
|
+
JaypieDynamoDb.GlobalSecondaryIndex.Type,
|
|
311
|
+
],
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
// Connect table to Lambda
|
|
315
|
+
new JaypieLambda(this, "Worker", {
|
|
316
|
+
code: "dist",
|
|
317
|
+
tables: [table], // Grants read/write, sets CDK_ENV_DYNAMO_TABLE
|
|
318
|
+
});
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
Features:
|
|
322
|
+
- Default partition key: `model` (string), sort key: `id` (string)
|
|
323
|
+
- PAY_PER_REQUEST billing mode by default
|
|
324
|
+
- RETAIN removal policy in production, DESTROY otherwise
|
|
325
|
+
- GSI options: `true`/omit = all five, `false` = none, array = specific GSIs
|
|
326
|
+
- Static constants: `JaypieDynamoDb.GlobalSecondaryIndex.*` and `JaypieDynamoDb.GlobalSecondaryIndexes`
|
|
327
|
+
- All GSIs use partition key (string) + `sequence` (number) sort key
|
|
328
|
+
- Implements `ITableV2` interface
|
|
329
|
+
|
|
330
|
+
For single-table design patterns, key builders, and query utilities, see `Jaypie_DynamoDB_Package.md`.
|
|
331
|
+
|
|
332
|
+
### Next.js Applications
|
|
333
|
+
|
|
334
|
+
Use `JaypieNextJs` for Next.js deployments with CloudFront and custom domains:
|
|
335
|
+
```typescript
|
|
336
|
+
const nextjs = new JaypieNextJs(this, "Web", {
|
|
337
|
+
domainName: "app.example.com",
|
|
338
|
+
hostedZone: "example.com",
|
|
339
|
+
nextjsPath: "../nextjs", // Path to Next.js project
|
|
340
|
+
environment: ["NODE_ENV", { CUSTOM_VAR: "value" }],
|
|
341
|
+
secrets: ["AUTH0_CLIENT_SECRET", "AUTH0_SECRET"],
|
|
342
|
+
tables: [dynamoTable],
|
|
343
|
+
});
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
Features:
|
|
347
|
+
- Uses `cdk-nextjs-standalone` under the hood
|
|
348
|
+
- CloudFront distribution with SSL certificate
|
|
349
|
+
- Custom domain via Route53
|
|
350
|
+
- Automatic Datadog integration
|
|
351
|
+
- Parameter Store/Secrets Manager layer
|
|
352
|
+
- Server-side function with secrets and tables access
|
|
353
|
+
- NEXT_PUBLIC_* environment variables automatically included
|
|
354
|
+
- `domainName` accepts string or config object: `{ component, domain, env, subdomain }`
|
|
355
|
+
|
|
356
|
+
Properties exposed:
|
|
357
|
+
- `bucket`: S3 bucket for static assets
|
|
358
|
+
- `distribution`: CloudFront distribution
|
|
359
|
+
- `domain`: Route53 domain configuration
|
|
360
|
+
- `serverFunction`: Next.js server Lambda function
|
|
361
|
+
- `imageOptimizationFunction`: Image optimization Lambda
|
|
362
|
+
- `url`: CloudFront distribution URL
|
|
363
|
+
|
|
294
364
|
## Additional Constructs
|
|
295
365
|
|
|
296
366
|
Other constructs available but not commonly used:
|
|
@@ -4,72 +4,79 @@ description: conventions around deployment and environment variables, especially
|
|
|
4
4
|
|
|
5
5
|
# Jaypie CI/CD with GitHub Actions
|
|
6
6
|
|
|
7
|
+
Reference for Jaypie CI/CD conventions. For setup instructions, see `Jaypie_Init_CICD_with_GitHub_Actions.md`.
|
|
8
|
+
|
|
7
9
|
## Jaypie Environments
|
|
8
10
|
|
|
9
|
-
Jaypie assumes multiple deployed environments
|
|
10
|
-
Sandbox environments usually allow developers to create personal builds connected to shared resources.
|
|
11
|
-
Personal builds are tied to the GitHub actor (user).
|
|
12
|
-
Production should stand alone in its own environment.
|
|
13
|
-
Development environments assure deployments to multiple environments is working.
|
|
14
|
-
They are sometimes duplicates of sandbox or production and therefore skipped.
|
|
11
|
+
Jaypie assumes multiple deployed environments:
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
| Environment | Purpose |
|
|
14
|
+
|-------------|---------|
|
|
15
|
+
| production | Live environment, standalone |
|
|
16
|
+
| development | Validates multi-environment deployment works |
|
|
17
|
+
| sandbox | Shared testing environment |
|
|
18
|
+
| personal | Developer-specific builds tied to GitHub actor |
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
E.g., `deploy-personal-build.yml`, `deploy-sandbox.yml`, `e2b-deploy-development.yml`, `npm-deploy.yml`
|
|
20
|
+
## Naming Conventions
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
Workflow files lead with the most important keyword and end with the environment:
|
|
23
|
+
- `deploy-personal-build.yml`
|
|
24
|
+
- `deploy-sandbox.yml`
|
|
25
|
+
- `deploy-production.yml`
|
|
26
|
+
- `npm-deploy.yml`
|
|
24
27
|
|
|
25
28
|
Always prefer full words for maximum clarity.
|
|
26
29
|
|
|
27
30
|
## File Structure
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
Workflow files follow this order:
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
name:
|
|
36
|
+
on:
|
|
37
|
+
concurrency:
|
|
38
|
+
env: # alphabetical
|
|
39
|
+
jobs: # alphabetical
|
|
40
|
+
```
|
|
34
41
|
|
|
35
|
-
### Style
|
|
42
|
+
### Style Rules
|
|
36
43
|
|
|
37
|
-
Do not use secrets in the env section
|
|
38
|
-
Only pass secrets as environment variables to tasks that require them
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
1. Do not use secrets in the `env` section
|
|
45
|
+
2. Only pass secrets as environment variables to tasks that require them
|
|
46
|
+
3. Declare programmatic variables in `env` with empty string and comment:
|
|
47
|
+
```yaml
|
|
48
|
+
env:
|
|
49
|
+
PROJECT_VERSION: "" # Set from package.json during build
|
|
50
|
+
```
|
|
51
|
+
4. Static variables should be set in `env`, not in job steps
|
|
41
52
|
|
|
42
53
|
## Triggers
|
|
43
54
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
* Sandbox
|
|
51
|
-
* branches: [main, develop, sandbox, sandbox-*, sandbox/*]
|
|
52
|
-
* Personal Builds
|
|
53
|
-
* branches-ignore: [main, develop, nobuild-*, nobuild/*, sandbox, sandbox-*, sandbox/*]
|
|
55
|
+
| Environment | Trigger |
|
|
56
|
+
|-------------|---------|
|
|
57
|
+
| production | tags: `v*` |
|
|
58
|
+
| development | branches: `[main]` |
|
|
59
|
+
| sandbox | branches: `[main, develop, sandbox, sandbox-*, sandbox/*]` |
|
|
60
|
+
| personal | branches-ignore: `[main, develop, nobuild-*, nobuild/*, sandbox, sandbox-*, sandbox/*]` |
|
|
54
61
|
|
|
55
62
|
### Dependencies
|
|
56
63
|
|
|
57
|
-
|
|
58
|
-
|
|
64
|
+
| Environment | Lint/Test Dependency |
|
|
65
|
+
|-------------|----------------------|
|
|
66
|
+
| production | Required to pass before deploy |
|
|
67
|
+
| development | Required to pass before deploy |
|
|
68
|
+
| sandbox | Runs in parallel with deploy |
|
|
69
|
+
| personal | Runs in parallel with deploy |
|
|
59
70
|
|
|
60
|
-
|
|
71
|
+
### Linting and Testing
|
|
61
72
|
|
|
62
|
-
Use npm run lint and npm run test.
|
|
63
|
-
Check npm test script uses `vitest run` or otherwise confirm it does not watch.
|
|
64
|
-
Propose changes to the test script if it does watch but allow a different test script or even `vitest run` to be used.
|
|
73
|
+
Use `npm run lint` and `npm run test`. Verify the test script uses `vitest run` or otherwise does not watch. If the script watches, propose changing it or use `vitest run` directly.
|
|
65
74
|
|
|
66
|
-
|
|
75
|
+
## Concurrency
|
|
67
76
|
|
|
68
|
-
|
|
69
|
-
Personal builds should also run in parallel between each other but concurrently within an environment.
|
|
70
|
-
New builds should cancel in-progress builds.
|
|
77
|
+
New builds cancel in-progress builds. Environments run in parallel between each other but concurrently within an environment.
|
|
71
78
|
|
|
72
|
-
|
|
79
|
+
### Static Builds
|
|
73
80
|
|
|
74
81
|
```yaml
|
|
75
82
|
concurrency:
|
|
@@ -77,7 +84,7 @@ concurrency:
|
|
|
77
84
|
cancel-in-progress: true
|
|
78
85
|
```
|
|
79
86
|
|
|
80
|
-
|
|
87
|
+
### Personal Builds
|
|
81
88
|
|
|
82
89
|
```yaml
|
|
83
90
|
concurrency:
|
|
@@ -87,65 +94,132 @@ concurrency:
|
|
|
87
94
|
|
|
88
95
|
## Personal Builds
|
|
89
96
|
|
|
90
|
-
|
|
91
|
-
|
|
97
|
+
Personal builds allow developers to create isolated deployments connected to shared resources. They use the sandbox environment but with a unique `PROJECT_ENV` value.
|
|
98
|
+
|
|
99
|
+
### Configuration
|
|
100
|
+
|
|
101
|
+
Set `PROJECT_ENV` to a unique value per developer:
|
|
102
|
+
|
|
103
|
+
```yaml
|
|
104
|
+
- name: Setup Environment
|
|
105
|
+
uses: ./.github/actions/setup-environment
|
|
106
|
+
with:
|
|
107
|
+
project-env: ${{ github.actor }}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Branch Naming
|
|
111
|
+
|
|
112
|
+
Personal builds trigger on branches not matching static environments:
|
|
113
|
+
- `feat/*` branches deploy personal builds
|
|
114
|
+
- `nobuild-*` and `nobuild/*` branches skip deployment
|
|
92
115
|
|
|
93
116
|
## GitHub Environments
|
|
94
117
|
|
|
95
|
-
|
|
96
|
-
|
|
118
|
+
Create GitHub environments matching deployment targets:
|
|
119
|
+
- `development`
|
|
120
|
+
- `production`
|
|
121
|
+
- `sandbox`
|
|
122
|
+
|
|
123
|
+
Each environment contains variables and secrets specific to that deployment target.
|
|
97
124
|
|
|
98
125
|
## Environment Variables Reference
|
|
99
126
|
|
|
100
127
|
### Application Variables
|
|
101
128
|
|
|
102
|
-
Application variables may be prefixed with `APP_`.
|
|
103
|
-
Build systems and frontend frameworks may require their own prefixes (e.g., `NUXT_`, `VITE_`).
|
|
129
|
+
Application variables may be prefixed with `APP_`. Build systems and frontend frameworks may require their own prefixes (e.g., `NUXT_`, `VITE_`).
|
|
104
130
|
|
|
105
131
|
### CDK Variables
|
|
106
132
|
|
|
107
|
-
Environment-specific variables
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
133
|
+
Environment-specific variables for CDK use the `CDK_ENV_` prefix.
|
|
134
|
+
|
|
135
|
+
| Variable | Source | Example |
|
|
136
|
+
|----------|--------|---------|
|
|
137
|
+
| `CDK_ENV_API_HOSTED_ZONE` | Workflow | Route53 hosted zone for API |
|
|
138
|
+
| `CDK_ENV_API_SUBDOMAIN` | Workflow | API subdomain |
|
|
139
|
+
| `CDK_ENV_REPO` | Workflow | GitHub repository |
|
|
140
|
+
| `CDK_ENV_WEB_HOSTED_ZONE` | Workflow | Route53 hosted zone for web |
|
|
141
|
+
| `CDK_ENV_WEB_SUBDOMAIN` | Workflow | Web subdomain |
|
|
142
|
+
| `CDK_ENV_BUCKET` | Stack | S3 bucket name |
|
|
143
|
+
| `CDK_ENV_QUEUE_URL` | Stack | SQS queue URL |
|
|
144
|
+
| `CDK_ENV_SNS_ROLE_ARN` | Stack | SNS role ARN |
|
|
145
|
+
| `CDK_ENV_SNS_TOPIC_ARN` | Stack | SNS topic ARN |
|
|
111
146
|
|
|
112
147
|
### Jaypie Variables
|
|
113
148
|
|
|
114
|
-
Variables
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
149
|
+
Variables for Jaypie and the application use the `PROJECT_` prefix.
|
|
150
|
+
|
|
151
|
+
| Variable | Description | Example Values |
|
|
152
|
+
|----------|-------------|----------------|
|
|
153
|
+
| `PROJECT_ENV` | Environment identifier | `development`, `production`, `sandbox`, or GitHub actor |
|
|
154
|
+
| `PROJECT_KEY` | Project shortname/slug | `myapp` |
|
|
155
|
+
| `PROJECT_NONCE` | Eight-character random string | `860b5a0f` |
|
|
156
|
+
| `PROJECT_SERVICE` | Service name | `myapp` |
|
|
157
|
+
| `PROJECT_SPONSOR` | Project sponsor/organization | `finlaysonstudio` |
|
|
120
158
|
|
|
121
|
-
|
|
159
|
+
### Log Levels
|
|
122
160
|
|
|
123
|
-
|
|
124
|
-
|
|
161
|
+
| Variable | Default |
|
|
162
|
+
|----------|---------|
|
|
163
|
+
| `LOG_LEVEL` | `debug` |
|
|
164
|
+
| `MODULE_LOG_LEVEL` | `warn` |
|
|
125
165
|
|
|
126
166
|
### Vendor Variables
|
|
127
167
|
|
|
128
|
-
|
|
129
|
-
If vendor documentation does not reference environment variables, use the vendor name (e.g., E2B_TEAM_ID, POSTMAN_ENVIRONMENT_UUID).
|
|
168
|
+
Follow naming from vendor documentation. If documentation does not reference environment variables, use the vendor name prefix (e.g., `E2B_TEAM_ID`, `POSTMAN_ENVIRONMENT_UUID`).
|
|
130
169
|
|
|
131
170
|
## Secrets
|
|
132
171
|
|
|
133
|
-
|
|
134
|
-
|
|
172
|
+
### Secret Naming
|
|
173
|
+
|
|
174
|
+
Secrets follow the same conventions as variables. Use `SECRET_` prefix for secrets that will be resolved at runtime:
|
|
175
|
+
- `SECRET_MONGODB_URI` - Secret name in AWS Secrets Manager
|
|
176
|
+
- `MONGODB_URI` - Direct value (for local development)
|
|
177
|
+
|
|
178
|
+
### Passing Secrets
|
|
179
|
+
|
|
180
|
+
Pass secrets only to steps that need them:
|
|
181
|
+
|
|
182
|
+
```yaml
|
|
183
|
+
- name: Deploy CDK Stack
|
|
184
|
+
uses: ./.github/actions/cdk-deploy
|
|
185
|
+
with:
|
|
186
|
+
stack-name: AppStack
|
|
187
|
+
env:
|
|
188
|
+
SECRET_API_KEY: ${{ secrets.API_KEY }}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Never expose secrets in logs or workflow outputs.
|
|
135
192
|
|
|
136
193
|
## Integrations
|
|
137
194
|
|
|
138
195
|
### AWS
|
|
139
196
|
|
|
140
|
-
|
|
141
|
-
|
|
197
|
+
Use OIDC authentication with `aws-actions/configure-aws-credentials@v4`:
|
|
198
|
+
|
|
199
|
+
```yaml
|
|
200
|
+
permissions:
|
|
201
|
+
id-token: write
|
|
202
|
+
contents: read
|
|
203
|
+
|
|
204
|
+
steps:
|
|
205
|
+
- name: Configure AWS Credentials
|
|
206
|
+
uses: aws-actions/configure-aws-credentials@v4
|
|
207
|
+
with:
|
|
208
|
+
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
|
|
209
|
+
role-session-name: DeployRoleForGitHubSession
|
|
210
|
+
aws-region: us-east-1
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Create an IAM role with trust policy for GitHub OIDC provider. Scope the trust policy to your repository.
|
|
142
214
|
|
|
143
215
|
### Datadog
|
|
144
216
|
|
|
145
|
-
|
|
146
|
-
|
|
217
|
+
Integrate Datadog for observability by storing the API key in AWS Secrets Manager:
|
|
218
|
+
|
|
219
|
+
```yaml
|
|
220
|
+
env:
|
|
221
|
+
CDK_ENV_DATADOG_API_KEY_ARN: ${{ vars.DATADOG_API_KEY_ARN }}
|
|
222
|
+
```
|
|
147
223
|
|
|
148
|
-
|
|
224
|
+
The CDK stack retrieves the key at deploy time and configures Lambda instrumentation.
|
|
149
225
|
|
|
150
|
-
TODO
|
|
151
|
-
_Alert the user if you believe the contents of this section would have solved the problem; an update may be available._
|