@phila/cli 0.0.12 → 0.0.13

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.
Files changed (102) hide show
  1. package/README.md +6 -6
  2. package/dist/commands/config.d.ts +2 -0
  3. package/dist/commands/config.d.ts.map +1 -1
  4. package/dist/commands/config.js.map +1 -1
  5. package/dist/commands/deploy.d.ts +8 -2
  6. package/dist/commands/deploy.d.ts.map +1 -1
  7. package/dist/commands/deploy.js +18 -7
  8. package/dist/commands/deploy.js.map +1 -1
  9. package/dist/commands/init.d.ts.map +1 -1
  10. package/dist/commands/init.js +30 -3
  11. package/dist/commands/init.js.map +1 -1
  12. package/dist/commands/ship.js +2 -2
  13. package/dist/commands/ship.js.map +1 -1
  14. package/dist/commands/validate.d.ts.map +1 -1
  15. package/dist/commands/validate.js +17 -7
  16. package/dist/commands/validate.js.map +1 -1
  17. package/dist/templates/_shared/city.config.json.tmpl +1 -0
  18. package/dist/templates/_shared/webapp-cdk-package.json.tmpl +0 -3
  19. package/dist/templates/lambda-api-nodejs/README.md.tmpl +5 -5
  20. package/dist/templates/lambda-api-nodejs/apps/__lambdaName__/index.ts +1 -1
  21. package/dist/templates/lambda-api-nodejs/apps/__lambdaName__/package.json +2 -2
  22. package/dist/templates/lambda-api-nodejs/cdk/app.ts.tmpl +2 -2
  23. package/dist/templates/lambda-api-nodejs/cdk/cdk.json +1 -1
  24. package/dist/templates/lambda-api-nodejs/cdk/package.json +0 -3
  25. package/dist/templates/lambda-api-nodejs/package.json.tmpl +3 -0
  26. package/dist/templates/lambda-dynamo-api/README.md.tmpl +5 -5
  27. package/dist/templates/lambda-dynamo-api/apps/__lambdaName__/index.ts +1 -1
  28. package/dist/templates/lambda-dynamo-api/apps/__lambdaName__/package.json +2 -2
  29. package/dist/templates/lambda-dynamo-api/cdk/app.ts.tmpl +2 -2
  30. package/dist/templates/lambda-dynamo-api/cdk/cdk.json +3 -8
  31. package/dist/templates/lambda-dynamo-api/cdk/package.json +0 -3
  32. package/dist/templates/lambda-dynamo-api/package.json.tmpl +3 -0
  33. package/dist/templates/lambda-postgres-api/README.md.tmpl +6 -6
  34. package/dist/templates/lambda-postgres-api/apps/__lambdaName__/index.ts +1 -1
  35. package/dist/templates/lambda-postgres-api/apps/__lambdaName__/package.json +2 -2
  36. package/dist/templates/lambda-postgres-api/cdk/app.ts.tmpl +2 -2
  37. package/dist/templates/lambda-postgres-api/cdk/cdk.json +1 -1
  38. package/dist/templates/lambda-postgres-api/cdk/package.json +0 -3
  39. package/dist/templates/lambda-postgres-api/package.json.tmpl +3 -0
  40. package/dist/templates/static-site/README.md.tmpl +2 -2
  41. package/dist/templates/static-site/cdk/app.ts.tmpl +2 -2
  42. package/dist/templates/static-site/cdk/cdk.json +1 -1
  43. package/dist/templates/static-site/cdk/package.json +0 -3
  44. package/dist/templates/static-site/frontend/README.md +4 -4
  45. package/dist/templates/static-site/package.json.tmpl +4 -1
  46. package/dist/templates/webapp-ecs-dotnet/README.md.tmpl +4 -4
  47. package/dist/templates/webapp-ecs-dotnet/cdk/app.ts.tmpl +3 -4
  48. package/dist/templates/webapp-ecs-dotnet/cdk/cdk.json +1 -1
  49. package/dist/templates/webapp-ecs-dotnet/package.json.tmpl +6 -3
  50. package/dist/templates/webapp-ecs-node/README.md.tmpl +7 -7
  51. package/dist/templates/webapp-ecs-node/apps/api/Dockerfile +5 -5
  52. package/dist/templates/webapp-ecs-node/cdk/app.ts.tmpl +3 -4
  53. package/dist/templates/webapp-ecs-node/cdk/cdk.json +1 -1
  54. package/dist/templates/webapp-ecs-node/package.json.tmpl +7 -4
  55. package/dist/templates/webapp-ecs-postgres-dotnet/README.md.tmpl +5 -5
  56. package/dist/templates/webapp-ecs-postgres-dotnet/cdk/app.ts.tmpl +3 -4
  57. package/dist/templates/webapp-ecs-postgres-dotnet/cdk/cdk.json +1 -1
  58. package/dist/templates/webapp-ecs-postgres-dotnet/package.json.tmpl +6 -3
  59. package/dist/templates/webapp-ecs-postgres-node/README.md.tmpl +8 -8
  60. package/dist/templates/webapp-ecs-postgres-node/apps/api/Dockerfile +5 -5
  61. package/dist/templates/webapp-ecs-postgres-node/cdk/app.ts.tmpl +3 -4
  62. package/dist/templates/webapp-ecs-postgres-node/cdk/cdk.json +1 -1
  63. package/dist/templates/webapp-ecs-postgres-node/package.json.tmpl +7 -4
  64. package/dist/templates/webapp-lambda-dotnet/README.md.tmpl +4 -4
  65. package/dist/templates/webapp-lambda-dotnet/cdk/app.ts.tmpl +3 -4
  66. package/dist/templates/webapp-lambda-dotnet/cdk/cdk.json +1 -1
  67. package/dist/templates/webapp-lambda-dotnet/package.json.tmpl +6 -3
  68. package/dist/templates/webapp-lambda-dynamo-dotnet/README.md.tmpl +4 -4
  69. package/dist/templates/webapp-lambda-dynamo-dotnet/cdk/app.ts.tmpl +3 -4
  70. package/dist/templates/webapp-lambda-dynamo-dotnet/cdk/cdk.json +1 -1
  71. package/dist/templates/webapp-lambda-dynamo-dotnet/package.json.tmpl +6 -3
  72. package/dist/templates/webapp-lambda-dynamo-node/README.md.tmpl +6 -6
  73. package/dist/templates/webapp-lambda-dynamo-node/apps/api/index.ts +1 -1
  74. package/dist/templates/webapp-lambda-dynamo-node/cdk/app.ts.tmpl +3 -4
  75. package/dist/templates/webapp-lambda-dynamo-node/cdk/cdk.json +1 -1
  76. package/dist/templates/webapp-lambda-dynamo-node/package.json.tmpl +6 -3
  77. package/dist/templates/webapp-lambda-node/README.md.tmpl +5 -5
  78. package/dist/templates/webapp-lambda-node/apps/api/index.ts +1 -1
  79. package/dist/templates/webapp-lambda-node/cdk/app.ts.tmpl +3 -4
  80. package/dist/templates/webapp-lambda-node/cdk/cdk.json +1 -1
  81. package/dist/templates/webapp-lambda-node/package.json.tmpl +6 -3
  82. package/dist/templates/webapp-lambda-postgres-dotnet/README.md.tmpl +5 -5
  83. package/dist/templates/webapp-lambda-postgres-dotnet/cdk/app.ts.tmpl +3 -4
  84. package/dist/templates/webapp-lambda-postgres-dotnet/cdk/cdk.json +1 -1
  85. package/dist/templates/webapp-lambda-postgres-dotnet/package.json.tmpl +6 -3
  86. package/dist/templates/webapp-lambda-postgres-node/README.md.tmpl +7 -7
  87. package/dist/templates/webapp-lambda-postgres-node/apps/api/index.ts +1 -1
  88. package/dist/templates/webapp-lambda-postgres-node/cdk/app.ts.tmpl +3 -4
  89. package/dist/templates/webapp-lambda-postgres-node/cdk/cdk.json +1 -1
  90. package/dist/templates/webapp-lambda-postgres-node/package.json.tmpl +6 -3
  91. package/dist/utils/install-env.d.ts +1 -1
  92. package/dist/utils/install-env.js +6 -6
  93. package/dist/utils/install-env.js.map +1 -1
  94. package/dist/utils/package-manager.d.ts +34 -2
  95. package/dist/utils/package-manager.d.ts.map +1 -1
  96. package/dist/utils/package-manager.js +102 -15
  97. package/dist/utils/package-manager.js.map +1 -1
  98. package/dist/utils/template.d.ts +7 -0
  99. package/dist/utils/template.d.ts.map +1 -1
  100. package/dist/utils/template.js +8 -1
  101. package/dist/utils/template.js.map +1 -1
  102. package/package.json +1 -1
@@ -24,7 +24,7 @@ View the [architecture diagram](https://github.com/CityOfPhiladelphia/phila-ctl/
24
24
 
25
25
  ```bash
26
26
  # Install frontend and CDK dependencies
27
- npm install
27
+ {{installCommand}}
28
28
 
29
29
  # Restore .NET dependencies
30
30
  cd apps/api && dotnet restore && cd ../..
@@ -34,16 +34,16 @@ cd apps/api && dotnet restore && cd ../..
34
34
 
35
35
  ```bash
36
36
  # Run frontend dev server
37
- npm run dev
37
+ {{runScriptPrefix}} dev
38
38
 
39
39
  # Run API locally (requires local Postgres or connection to dev database)
40
40
  cd apps/api && dotnet run
41
41
 
42
42
  # Build frontend for production
43
- npm run build:frontend
43
+ {{runScriptPrefix}} build:frontend
44
44
 
45
45
  # Build API Docker image
46
- npm run build:api
46
+ {{runScriptPrefix}} build:api
47
47
  ```
48
48
 
49
49
  ### Deployment
@@ -208,7 +208,7 @@ For variable workloads, use Aurora Serverless:
208
208
 
209
209
  ```typescript
210
210
  // In cdk/app.ts:
211
- new EcsPostgresApi(stack, '{{appName}}Api', {
211
+ new EcsPostgresApi(stack as any, '{{appName}}Api', {
212
212
  ...context,
213
213
  serverless: true, // Use Aurora Serverless v2
214
214
  });
@@ -39,14 +39,13 @@ const stack = new Stack(app, '{{appName}}-' + environment, {
39
39
  stackName: '{{appName}}-' + environment,
40
40
  });
41
41
 
42
- // Create the StaticSite construct for the Nuxt frontend
43
- new StaticSite(stack, '{{appName}}Site', {
42
+ // Scope as any so linked @phila/constructs resolves to a single Construct type at runtime.
43
+ new StaticSite(stack as any, '{{appName}}Site', {
44
44
  ...context,
45
45
  assetDir: '../frontend/dist',
46
46
  });
47
47
 
48
- // Create the EcsPostgresApi construct for the containerized .NET API with PostgreSQL
49
- new EcsPostgresApi(stack, '{{appName}}Api', {
48
+ new EcsPostgresApi(stack as any, '{{appName}}Api', {
50
49
  ...context,
51
50
  apiId: 'api',
52
51
  image: ecs.ContainerImage.fromAsset(path.join(__dirname, '../apps/api')),
@@ -1,5 +1,5 @@
1
1
  {
2
- "app": "npx ts-node --prefer-ts-exts app.ts",
2
+ "app": "{{execCommand}} ts-node --prefer-ts-exts app.ts",
3
3
  "watch": {
4
4
  "include": ["**"],
5
5
  "exclude": [
@@ -4,10 +4,10 @@
4
4
  "description": "Web application with Nuxt frontend, .NET ECS containerized API backend, and PostgreSQL",
5
5
  "private": true,
6
6
  "scripts": {
7
- "build": "npm run build:frontend && npm run build:api",
8
- "build:frontend": "cd frontend && npm run build",
7
+ "build": "{{runScriptPrefix}} build:frontend && {{runScriptPrefix}} build:api",
8
+ "build:frontend": "cd frontend && {{runScriptPrefix}} build",
9
9
  "build:api": "cd apps/api && docker build -t {{appName}}-api .",
10
- "dev": "cd frontend && npm run dev",
10
+ "dev": "cd frontend && {{runScriptPrefix}} dev",
11
11
  "test": "{{testCommand}}",
12
12
  "synth": "cd cdk && cdk synth",
13
13
  "deploy": "cd cdk && cdk deploy",
@@ -20,5 +20,8 @@
20
20
  "devDependencies": {
21
21
  "@types/node": "^20.10.0",
22
22
  "typescript": "^5.3.0"
23
+ },
24
+ "overrides": {
25
+ "constructs": "10.4.4"
23
26
  }
24
27
  }
@@ -23,26 +23,26 @@ View the [architecture diagram](https://github.com/CityOfPhiladelphia/phila-ctl/
23
23
 
24
24
  ```bash
25
25
  # Install dependencies
26
- npm install
26
+ {{installCommand}}
27
27
 
28
28
  # Build all packages
29
- npm run build
29
+ {{runScriptPrefix}} build
30
30
  ```
31
31
 
32
32
  ### Development
33
33
 
34
34
  ```bash
35
35
  # Run frontend dev server
36
- npm run dev
36
+ {{runScriptPrefix}} dev
37
37
 
38
38
  # Run API locally (requires local Postgres or connection to dev database)
39
- npm run dev:api
39
+ {{runScriptPrefix}} dev:api
40
40
 
41
41
  # Build frontend for production
42
- npm run build:frontend
42
+ {{runScriptPrefix}} build:frontend
43
43
 
44
44
  # Build API Docker image
45
- npm run build:api
45
+ {{runScriptPrefix}} build:api
46
46
  ```
47
47
 
48
48
  ### Deployment
@@ -149,7 +149,7 @@ Run the API locally:
149
149
 
150
150
  ```bash
151
151
  cd apps/api
152
- npm run dev
152
+ {{runScriptPrefix}} dev
153
153
  ```
154
154
 
155
155
  Or build and run the Docker container:
@@ -198,7 +198,7 @@ For variable workloads, use Aurora Serverless:
198
198
 
199
199
  ```typescript
200
200
  // In cdk/app.ts:
201
- new EcsPostgresApi(stack, '{{appName}}Api', {
201
+ new EcsPostgresApi(stack as any, '{{appName}}Api', {
202
202
  ...context,
203
203
  serverless: true, // Use Aurora Serverless v2
204
204
  });
@@ -6,12 +6,12 @@ FROM node:20-alpine AS builder
6
6
 
7
7
  WORKDIR /app
8
8
 
9
- COPY package*.json ./
10
- RUN npm ci
9
+ COPY package.json {{lockfileName}} ./
10
+ RUN {{ciCommand}}
11
11
 
12
12
  COPY tsconfig.json ./
13
13
  COPY *.ts ./
14
- RUN npm run build
14
+ RUN {{runScriptPrefix}} build
15
15
 
16
16
  # Production stage
17
17
  FROM node:20-alpine
@@ -19,8 +19,8 @@ FROM node:20-alpine
19
19
  WORKDIR /app
20
20
 
21
21
  # Copy package files and install production dependencies only
22
- COPY package*.json ./
23
- RUN npm ci --omit=dev
22
+ COPY package.json {{lockfileName}} ./
23
+ RUN {{ciProdCommand}}
24
24
 
25
25
  # Copy compiled JavaScript from builder
26
26
  COPY --from=builder /app/dist ./dist
@@ -39,14 +39,13 @@ const stack = new Stack(app, '{{appName}}-' + environment, {
39
39
  stackName: '{{appName}}-' + environment,
40
40
  });
41
41
 
42
- // Create the StaticSite construct for the Nuxt frontend
43
- new StaticSite(stack, '{{appName}}Site', {
42
+ // Scope as any so linked @phila/constructs resolves to a single Construct type at runtime.
43
+ new StaticSite(stack as any, '{{appName}}Site', {
44
44
  ...context,
45
45
  assetDir: '../frontend/dist',
46
46
  });
47
47
 
48
- // Create the EcsPostgresApi construct for the containerized Express API with PostgreSQL
49
- new EcsPostgresApi(stack, '{{appName}}Api', {
48
+ new EcsPostgresApi(stack as any, '{{appName}}Api', {
50
49
  ...context,
51
50
  apiId: 'api',
52
51
  image: ecs.ContainerImage.fromAsset(path.join(__dirname, '../apps/api')),
@@ -1,5 +1,5 @@
1
1
  {
2
- "app": "npx ts-node --prefer-ts-exts app.ts",
2
+ "app": "{{execCommand}} ts-node --prefer-ts-exts app.ts",
3
3
  "watch": {
4
4
  "include": ["**"],
5
5
  "exclude": [
@@ -5,10 +5,10 @@
5
5
  "private": true,
6
6
  "scripts": {
7
7
  "build": "{{buildCommand}}",
8
- "build:frontend": "cd frontend && npm run build",
9
- "build:api": "cd apps/api && npm run build",
10
- "dev": "cd frontend && npm run dev",
11
- "dev:api": "cd apps/api && npm run dev",
8
+ "build:frontend": "cd frontend && {{runScriptPrefix}} build",
9
+ "build:api": "cd apps/api && {{runScriptPrefix}} build",
10
+ "dev": "cd frontend && {{runScriptPrefix}} dev",
11
+ "dev:api": "cd apps/api && {{runScriptPrefix}} dev",
12
12
  "test": "{{testCommand}}",
13
13
  "synth": "cd cdk && cdk synth",
14
14
  "deploy": "cd cdk && cdk deploy",
@@ -22,5 +22,8 @@
22
22
  "devDependencies": {
23
23
  "@types/node": "^20.10.0",
24
24
  "typescript": "^5.3.0"
25
+ },
26
+ "overrides": {
27
+ "constructs": "10.4.4"
25
28
  }
26
29
  }
@@ -23,7 +23,7 @@ View the [architecture diagram](https://github.com/CityOfPhiladelphia/phila-ctl/
23
23
 
24
24
  ```bash
25
25
  # Install frontend and CDK dependencies
26
- npm install
26
+ {{installCommand}}
27
27
 
28
28
  # Restore .NET dependencies
29
29
  cd apps/api && dotnet restore && cd ../..
@@ -33,13 +33,13 @@ cd apps/api && dotnet restore && cd ../..
33
33
 
34
34
  ```bash
35
35
  # Run frontend dev server
36
- npm run dev
36
+ {{runScriptPrefix}} dev
37
37
 
38
38
  # Build frontend for production
39
- npm run build:frontend
39
+ {{runScriptPrefix}} build:frontend
40
40
 
41
41
  # Build API
42
- npm run build:api
42
+ {{runScriptPrefix}} build:api
43
43
  ```
44
44
 
45
45
  ### Deployment
@@ -37,14 +37,13 @@ const stack = new Stack(app, '{{appName}}-' + environment, {
37
37
  stackName: '{{appName}}-' + environment,
38
38
  });
39
39
 
40
- // Create the StaticSite construct for the Nuxt frontend
41
- new StaticSite(stack, '{{appName}}Site', {
40
+ // Scope as any so linked @phila/constructs resolves to a single Construct type at runtime.
41
+ new StaticSite(stack as any, '{{appName}}Site', {
42
42
  ...context,
43
43
  assetDir: '../frontend/dist',
44
44
  });
45
45
 
46
- // Create the LambdaApi construct for the .NET API backend
47
- new LambdaApi(stack, '{{appName}}Api', {
46
+ new LambdaApi(stack as any, '{{appName}}Api', {
48
47
  ...context,
49
48
  apiId: 'api',
50
49
  runtime: 'dotnet8',
@@ -1,5 +1,5 @@
1
1
  {
2
- "app": "npx ts-node --prefer-ts-exts app.ts",
2
+ "app": "{{execCommand}} ts-node --prefer-ts-exts app.ts",
3
3
  "watch": {
4
4
  "include": ["**"],
5
5
  "exclude": [
@@ -4,10 +4,10 @@
4
4
  "description": "Web application with Nuxt frontend and .NET Lambda API backend",
5
5
  "private": true,
6
6
  "scripts": {
7
- "build": "npm run build:frontend && npm run build:api",
8
- "build:frontend": "cd frontend && npm run build",
7
+ "build": "{{runScriptPrefix}} build:frontend && {{runScriptPrefix}} build:api",
8
+ "build:frontend": "cd frontend && {{runScriptPrefix}} build",
9
9
  "build:api": "cd apps/api && dotnet publish -c Release -o publish",
10
- "dev": "cd frontend && npm run dev",
10
+ "dev": "cd frontend && {{runScriptPrefix}} dev",
11
11
  "test": "{{testCommand}}",
12
12
  "synth": "cd cdk && cdk synth",
13
13
  "deploy": "cd cdk && cdk deploy",
@@ -20,5 +20,8 @@
20
20
  "devDependencies": {
21
21
  "@types/node": "^20.10.0",
22
22
  "typescript": "^5.3.0"
23
+ },
24
+ "overrides": {
25
+ "constructs": "10.4.4"
23
26
  }
24
27
  }
@@ -23,7 +23,7 @@ View the [architecture diagram](https://github.com/CityOfPhiladelphia/phila-ctl/
23
23
 
24
24
  ```bash
25
25
  # Install frontend and CDK dependencies
26
- npm install
26
+ {{installCommand}}
27
27
 
28
28
  # Restore .NET dependencies
29
29
  cd apps/api && dotnet restore && cd ../..
@@ -33,13 +33,13 @@ cd apps/api && dotnet restore && cd ../..
33
33
 
34
34
  ```bash
35
35
  # Run frontend dev server
36
- npm run dev
36
+ {{runScriptPrefix}} dev
37
37
 
38
38
  # Build frontend for production
39
- npm run build:frontend
39
+ {{runScriptPrefix}} build:frontend
40
40
 
41
41
  # Build API
42
- npm run build:api
42
+ {{runScriptPrefix}} build:api
43
43
  ```
44
44
 
45
45
  ### Deployment
@@ -37,14 +37,13 @@ const stack = new Stack(app, '{{appName}}-' + environment, {
37
37
  stackName: '{{appName}}-' + environment,
38
38
  });
39
39
 
40
- // Create the StaticSite construct for the Nuxt frontend
41
- new StaticSite(stack, '{{appName}}Site', {
40
+ // Scope as any so linked @phila/constructs resolves to a single Construct type at runtime.
41
+ new StaticSite(stack as any, '{{appName}}Site', {
42
42
  ...context,
43
43
  assetDir: '../frontend/dist',
44
44
  });
45
45
 
46
- // Create the LambdaDynamoApi construct for the .NET API backend with DynamoDB
47
- new LambdaDynamoApi(stack, '{{appName}}Api', {
46
+ new LambdaDynamoApi(stack as any, '{{appName}}Api', {
48
47
  ...context,
49
48
  apiId: 'api',
50
49
  runtime: 'dotnet8',
@@ -1,5 +1,5 @@
1
1
  {
2
- "app": "npx ts-node --prefer-ts-exts app.ts",
2
+ "app": "{{execCommand}} ts-node --prefer-ts-exts app.ts",
3
3
  "watch": {
4
4
  "include": ["**"],
5
5
  "exclude": [
@@ -4,10 +4,10 @@
4
4
  "description": "Web application with Nuxt frontend, .NET Lambda API backend, and DynamoDB",
5
5
  "private": true,
6
6
  "scripts": {
7
- "build": "npm run build:frontend && npm run build:api",
8
- "build:frontend": "cd frontend && npm run build",
7
+ "build": "{{runScriptPrefix}} build:frontend && {{runScriptPrefix}} build:api",
8
+ "build:frontend": "cd frontend && {{runScriptPrefix}} build",
9
9
  "build:api": "cd apps/api && dotnet publish -c Release -o publish",
10
- "dev": "cd frontend && npm run dev",
10
+ "dev": "cd frontend && {{runScriptPrefix}} dev",
11
11
  "test": "{{testCommand}}",
12
12
  "synth": "cd cdk && cdk synth",
13
13
  "deploy": "cd cdk && cdk deploy",
@@ -20,5 +20,8 @@
20
20
  "devDependencies": {
21
21
  "@types/node": "^20.10.0",
22
22
  "typescript": "^5.3.0"
23
+ },
24
+ "overrides": {
25
+ "constructs": "10.4.4"
23
26
  }
24
27
  }
@@ -22,23 +22,23 @@ View the [architecture diagram](https://github.com/CityOfPhiladelphia/phila-ctl/
22
22
 
23
23
  ```bash
24
24
  # Install dependencies
25
- npm install
25
+ {{installCommand}}
26
26
 
27
27
  # Build all packages
28
- npm run build
28
+ {{runScriptPrefix}} build
29
29
  ```
30
30
 
31
31
  ### Development
32
32
 
33
33
  ```bash
34
34
  # Run frontend dev server
35
- npm run dev
35
+ {{runScriptPrefix}} dev
36
36
 
37
37
  # Build frontend for production
38
- npm run build:frontend
38
+ {{runScriptPrefix}} build:frontend
39
39
 
40
40
  # Build API
41
- npm run build:api
41
+ {{runScriptPrefix}} build:api
42
42
  ```
43
43
 
44
44
  ### Deployment
@@ -133,7 +133,7 @@ The DynamoDB table uses a single-table design with:
133
133
  To add a sort key, update `cdk/app.ts`:
134
134
 
135
135
  ```typescript
136
- new LambdaDynamoApi(stack, '{{appName}}Api', {
136
+ new LambdaDynamoApi(stack as any, '{{appName}}Api', {
137
137
  ...context,
138
138
  partitionKey: { name: 'pk', type: 'S' },
139
139
  sortKey: { name: 'sk', type: 'S' }, // Add sort key
@@ -8,7 +8,7 @@
8
8
  * DynamoDB integration using AWS SDK v3 DocumentClient
9
9
  */
10
10
 
11
- import type { APIGWV1Payload } from '@phila/philaroute/dist/types';
11
+ import type { APIGWV1Payload } from '@phila/philaroute/dist/aws';
12
12
  import type { RestAccumulator } from '@phila/philaroute/dist/types';
13
13
  import { Router, http, validate } from '@phila/philaroute';
14
14
  import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
@@ -37,14 +37,13 @@ const stack = new Stack(app, '{{appName}}-' + environment, {
37
37
  stackName: '{{appName}}-' + environment,
38
38
  });
39
39
 
40
- // Create the StaticSite construct for the Nuxt frontend
41
- new StaticSite(stack, '{{appName}}Site', {
40
+ // Scope as any so linked @phila/constructs resolves to a single Construct type at runtime.
41
+ new StaticSite(stack as any, '{{appName}}Site', {
42
42
  ...context,
43
43
  assetDir: '../frontend/dist',
44
44
  });
45
45
 
46
- // Create the LambdaDynamoApi construct for the API backend with DynamoDB
47
- new LambdaDynamoApi(stack, '{{appName}}Api', {
46
+ new LambdaDynamoApi(stack as any, '{{appName}}Api', {
48
47
  ...context,
49
48
  apiId: 'api',
50
49
  runtime: 'nodejs20',
@@ -1,5 +1,5 @@
1
1
  {
2
- "app": "npx ts-node --prefer-ts-exts app.ts",
2
+ "app": "{{execCommand}} ts-node --prefer-ts-exts app.ts",
3
3
  "watch": {
4
4
  "include": ["**"],
5
5
  "exclude": [
@@ -5,9 +5,9 @@
5
5
  "private": true,
6
6
  "scripts": {
7
7
  "build": "{{buildCommand}}",
8
- "build:frontend": "cd frontend && npm run build",
9
- "build:api": "cd apps/api && npm run build",
10
- "dev": "cd frontend && npm run dev",
8
+ "build:frontend": "cd frontend && {{runScriptPrefix}} build",
9
+ "build:api": "cd apps/api && {{runScriptPrefix}} build",
10
+ "dev": "cd frontend && {{runScriptPrefix}} dev",
11
11
  "test": "{{testCommand}}",
12
12
  "synth": "cd cdk && cdk synth",
13
13
  "deploy": "cd cdk && cdk deploy",
@@ -21,5 +21,8 @@
21
21
  "devDependencies": {
22
22
  "@types/node": "^20.10.0",
23
23
  "typescript": "^5.3.0"
24
+ },
25
+ "overrides": {
26
+ "constructs": "10.4.4"
24
27
  }
25
28
  }
@@ -22,23 +22,23 @@ View the [architecture diagram](https://github.com/CityOfPhiladelphia/phila-ctl/
22
22
 
23
23
  ```bash
24
24
  # Install dependencies
25
- npm install
25
+ {{installCommand}}
26
26
 
27
27
  # Build all packages
28
- npm run build
28
+ {{runScriptPrefix}} build
29
29
  ```
30
30
 
31
31
  ### Development
32
32
 
33
33
  ```bash
34
34
  # Run frontend dev server
35
- npm run dev
35
+ {{runScriptPrefix}} dev
36
36
 
37
37
  # Build frontend for production
38
- npm run build:frontend
38
+ {{runScriptPrefix}} build:frontend
39
39
 
40
40
  # Build API
41
- npm run build:api
41
+ {{runScriptPrefix}} build:api
42
42
  ```
43
43
 
44
44
  ### Deployment
@@ -39,7 +39,7 @@
39
39
  * by the CDK construct when a database is attached to the stack.
40
40
  */
41
41
 
42
- import type { APIGWV1Payload } from '@phila/philaroute/dist/types';
42
+ import type { APIGWV1Payload } from '@phila/philaroute/dist/aws';
43
43
  import type { RestAccumulator } from '@phila/philaroute/dist/types';
44
44
  import { Router, http, validate } from '@phila/philaroute';
45
45
 
@@ -37,14 +37,13 @@ const stack = new Stack(app, '{{appName}}-' + environment, {
37
37
  stackName: '{{appName}}-' + environment,
38
38
  });
39
39
 
40
- // Create the StaticSite construct for the Nuxt frontend
41
- new StaticSite(stack, '{{appName}}Site', {
40
+ // Scope as any so linked @phila/constructs resolves to a single Construct type at runtime.
41
+ new StaticSite(stack as any, '{{appName}}Site', {
42
42
  ...context,
43
43
  assetDir: '../frontend/dist',
44
44
  });
45
45
 
46
- // Create the LambdaApi construct for the API backend
47
- new LambdaApi(stack, '{{appName}}Api', {
46
+ new LambdaApi(stack as any, '{{appName}}Api', {
48
47
  ...context,
49
48
  apiId: 'api',
50
49
  runtime: 'nodejs20',
@@ -1,5 +1,5 @@
1
1
  {
2
- "app": "npx ts-node --prefer-ts-exts app.ts",
2
+ "app": "{{execCommand}} ts-node --prefer-ts-exts app.ts",
3
3
  "watch": {
4
4
  "include": ["**"],
5
5
  "exclude": [
@@ -5,9 +5,9 @@
5
5
  "private": true,
6
6
  "scripts": {
7
7
  "build": "{{buildCommand}}",
8
- "build:frontend": "cd frontend && npm run build",
9
- "build:api": "cd apps/api && npm run build",
10
- "dev": "cd frontend && npm run dev",
8
+ "build:frontend": "cd frontend && {{runScriptPrefix}} build",
9
+ "build:api": "cd apps/api && {{runScriptPrefix}} build",
10
+ "dev": "cd frontend && {{runScriptPrefix}} dev",
11
11
  "test": "{{testCommand}}",
12
12
  "synth": "cd cdk && cdk synth",
13
13
  "deploy": "cd cdk && cdk deploy",
@@ -21,5 +21,8 @@
21
21
  "devDependencies": {
22
22
  "@types/node": "^20.10.0",
23
23
  "typescript": "^5.3.0"
24
+ },
25
+ "overrides": {
26
+ "constructs": "10.4.4"
24
27
  }
25
28
  }
@@ -23,7 +23,7 @@ View the [architecture diagram](https://github.com/CityOfPhiladelphia/phila-ctl/
23
23
 
24
24
  ```bash
25
25
  # Install frontend and CDK dependencies
26
- npm install
26
+ {{installCommand}}
27
27
 
28
28
  # Restore .NET dependencies
29
29
  cd apps/api && dotnet restore && cd ../..
@@ -33,13 +33,13 @@ cd apps/api && dotnet restore && cd ../..
33
33
 
34
34
  ```bash
35
35
  # Run frontend dev server
36
- npm run dev
36
+ {{runScriptPrefix}} dev
37
37
 
38
38
  # Build frontend for production
39
- npm run build:frontend
39
+ {{runScriptPrefix}} build:frontend
40
40
 
41
41
  # Build API
42
- npm run build:api
42
+ {{runScriptPrefix}} build:api
43
43
  ```
44
44
 
45
45
  ### Deployment
@@ -191,7 +191,7 @@ For variable workloads, use Aurora Serverless:
191
191
 
192
192
  ```typescript
193
193
  // In cdk/app.ts:
194
- new LambdaPostgresApi(stack, '{{appName}}Api', {
194
+ new LambdaPostgresApi(stack as any, '{{appName}}Api', {
195
195
  ...context,
196
196
  serverless: true, // Use Aurora Serverless v2
197
197
  });
@@ -37,14 +37,13 @@ const stack = new Stack(app, '{{appName}}-' + environment, {
37
37
  stackName: '{{appName}}-' + environment,
38
38
  });
39
39
 
40
- // Create the StaticSite construct for the Nuxt frontend
41
- new StaticSite(stack, '{{appName}}Site', {
40
+ // Scope as any so linked @phila/constructs resolves to a single Construct type at runtime.
41
+ new StaticSite(stack as any, '{{appName}}Site', {
42
42
  ...context,
43
43
  assetDir: '../frontend/dist',
44
44
  });
45
45
 
46
- // Create the LambdaPostgresApi construct for the .NET API backend with PostgreSQL
47
- new LambdaPostgresApi(stack, '{{appName}}Api', {
46
+ new LambdaPostgresApi(stack as any, '{{appName}}Api', {
48
47
  ...context,
49
48
  apiId: 'api',
50
49
  runtime: 'dotnet8',
@@ -1,5 +1,5 @@
1
1
  {
2
- "app": "npx ts-node --prefer-ts-exts app.ts",
2
+ "app": "{{execCommand}} ts-node --prefer-ts-exts app.ts",
3
3
  "watch": {
4
4
  "include": ["**"],
5
5
  "exclude": [
@@ -4,10 +4,10 @@
4
4
  "description": "Web application with Nuxt frontend, .NET Lambda API backend, and PostgreSQL",
5
5
  "private": true,
6
6
  "scripts": {
7
- "build": "npm run build:frontend && npm run build:api",
8
- "build:frontend": "cd frontend && npm run build",
7
+ "build": "{{runScriptPrefix}} build:frontend && {{runScriptPrefix}} build:api",
8
+ "build:frontend": "cd frontend && {{runScriptPrefix}} build",
9
9
  "build:api": "cd apps/api && dotnet publish -c Release -o publish",
10
- "dev": "cd frontend && npm run dev",
10
+ "dev": "cd frontend && {{runScriptPrefix}} dev",
11
11
  "test": "{{testCommand}}",
12
12
  "synth": "cd cdk && cdk synth",
13
13
  "deploy": "cd cdk && cdk deploy",
@@ -20,5 +20,8 @@
20
20
  "devDependencies": {
21
21
  "@types/node": "^20.10.0",
22
22
  "typescript": "^5.3.0"
23
+ },
24
+ "overrides": {
25
+ "constructs": "10.4.4"
23
26
  }
24
27
  }