skuba 8.1.0-configure-stdin-20240509055640 → 8.1.0-main-20240625003658

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 (87) hide show
  1. package/lib/api/git/pull.js.map +2 -2
  2. package/lib/api/git/push.d.ts +10 -1
  3. package/lib/api/git/push.js.map +2 -2
  4. package/lib/api/github/environment.d.ts +0 -1
  5. package/lib/api/github/push.d.ts +7 -1
  6. package/lib/api/github/push.js.map +2 -2
  7. package/lib/api/jest/index.d.ts +1 -1
  8. package/lib/cli/adapter/eslint.d.ts +1 -1
  9. package/lib/cli/adapter/prettier.d.ts +2 -2
  10. package/lib/cli/configure/ensureTemplateCompletion.js +2 -2
  11. package/lib/cli/configure/ensureTemplateCompletion.js.map +2 -2
  12. package/lib/cli/configure/index.js +6 -3
  13. package/lib/cli/configure/index.js.map +2 -2
  14. package/lib/cli/configure/processing/configFile.d.ts +1 -1
  15. package/lib/cli/configure/processing/package.d.ts +56 -58
  16. package/lib/cli/init/getConfig.d.ts +1 -1
  17. package/lib/cli/init/index.js +15 -1
  18. package/lib/cli/init/index.js.map +2 -2
  19. package/lib/cli/init/prompts.d.ts +0 -1
  20. package/lib/cli/init/types.d.ts +22 -5
  21. package/lib/cli/lint/external.d.ts +0 -2
  22. package/lib/cli/lint/index.d.ts +0 -1
  23. package/lib/cli/lint/internal.d.ts +1 -1
  24. package/lib/cli/lint/internalLints/noSkubaTemplateJs.d.ts +1 -1
  25. package/lib/cli/lint/internalLints/patchRenovateConfig.d.ts +1 -1
  26. package/lib/cli/lint/internalLints/patchRenovateConfig.js +4 -1
  27. package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
  28. package/lib/cli/lint/internalLints/refreshConfigFiles.d.ts +2 -2
  29. package/lib/cli/lint/internalLints/upgrade/index.d.ts +10 -2
  30. package/lib/cli/lint/internalLints/upgrade/index.js +15 -5
  31. package/lib/cli/lint/internalLints/upgrade/index.js.map +2 -2
  32. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +1 -1
  33. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
  34. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/moveNpmrcOutOfIgnoreManagedSection.d.ts +1 -1
  35. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/moveNpmrcOutOfIgnoreManagedSection.js +1 -1
  36. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/moveNpmrcOutOfIgnoreManagedSection.js.map +2 -2
  37. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +4 -1
  38. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
  39. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +4 -1
  40. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
  41. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.d.ts +2 -0
  42. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +35 -0
  43. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +7 -0
  44. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.d.ts +2 -0
  45. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +147 -0
  46. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +7 -0
  47. package/lib/cli/lint/types.d.ts +0 -1
  48. package/lib/utils/args.d.ts +0 -1
  49. package/lib/utils/copy.d.ts +1 -1
  50. package/lib/utils/env.d.ts +0 -1
  51. package/lib/utils/error.d.ts +0 -1
  52. package/lib/utils/exec.d.ts +0 -1
  53. package/lib/utils/template.d.ts +3 -3
  54. package/lib/wrapper/http.d.ts +0 -1
  55. package/package.json +15 -15
  56. package/template/express-rest-api/.gantry/dev.yml +0 -2
  57. package/template/express-rest-api/.gantry/prod.yml +0 -2
  58. package/template/express-rest-api/Dockerfile.dev-deps +1 -1
  59. package/template/express-rest-api/docker-compose.yml +0 -2
  60. package/template/express-rest-api/gantry.apply.yml +0 -7
  61. package/template/express-rest-api/package.json +5 -2
  62. package/template/express-rest-api/src/config.ts +14 -6
  63. package/template/express-rest-api/src/framework/logging.ts +1 -1
  64. package/template/express-rest-api/src/framework/metrics.ts +11 -0
  65. package/template/express-rest-api/src/listen.ts +2 -2
  66. package/template/greeter/Dockerfile +1 -1
  67. package/template/greeter/docker-compose.yml +0 -2
  68. package/template/greeter/package.json +3 -2
  69. package/template/koa-rest-api/.gantry/dev.yml +0 -2
  70. package/template/koa-rest-api/.gantry/prod.yml +0 -2
  71. package/template/koa-rest-api/Dockerfile.dev-deps +1 -1
  72. package/template/koa-rest-api/docker-compose.yml +0 -2
  73. package/template/koa-rest-api/gantry.apply.yml +0 -7
  74. package/template/koa-rest-api/package.json +12 -12
  75. package/template/koa-rest-api/src/config.ts +14 -4
  76. package/template/lambda-sqs-worker/Dockerfile +1 -1
  77. package/template/lambda-sqs-worker/docker-compose.yml +0 -2
  78. package/template/lambda-sqs-worker/package.json +3 -2
  79. package/template/lambda-sqs-worker/src/config.ts +9 -4
  80. package/template/lambda-sqs-worker-cdk/Dockerfile +1 -1
  81. package/template/lambda-sqs-worker-cdk/docker-compose.yml +0 -2
  82. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +12 -0
  83. package/template/lambda-sqs-worker-cdk/infra/config.ts +14 -6
  84. package/template/lambda-sqs-worker-cdk/package.json +5 -2
  85. package/template/lambda-sqs-worker-cdk/src/app.ts +14 -2
  86. package/template/lambda-sqs-worker-cdk/src/config.ts +47 -0
  87. package/template/oss-npm-package/.github/workflows/validate.yml +1 -0
@@ -47,9 +47,9 @@ export declare const templateConfigSchema: z.ZodObject<{
47
47
  validate?: ((args_0: string, ...args_1: unknown[]) => string | boolean) | undefined;
48
48
  }[];
49
49
  packageManager: "yarn" | "pnpm";
50
+ type?: "package" | "application" | undefined;
50
51
  entryPoint?: string | undefined;
51
52
  noSkip?: boolean | undefined;
52
- type?: "package" | "application" | undefined;
53
53
  }, {
54
54
  fields: {
55
55
  message: string;
@@ -57,10 +57,10 @@ export declare const templateConfigSchema: z.ZodObject<{
57
57
  initial: string;
58
58
  validate?: ((args_0: string, ...args_1: unknown[]) => string | boolean) | undefined;
59
59
  }[];
60
+ type?: "package" | "application" | undefined;
60
61
  entryPoint?: string | undefined;
61
- noSkip?: boolean | undefined;
62
62
  packageManager?: "yarn" | "pnpm" | undefined;
63
- type?: "package" | "application" | undefined;
63
+ noSkip?: boolean | undefined;
64
64
  }>;
65
65
  export declare const TEMPLATE_CONFIG_FILENAME = "skuba.template.js";
66
66
  export declare const TEMPLATE_DIR: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import http from 'http';
3
2
  /**
4
3
  * Create an HTTP request listener based on the supplied function.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skuba",
3
- "version": "8.1.0-configure-stdin-20240509055640",
3
+ "version": "8.1.0-main-20240625003658",
4
4
  "private": false,
5
5
  "description": "SEEK development toolkit for backend applications and packages",
6
6
  "homepage": "https://github.com/seek-oss/skuba#readme",
@@ -63,7 +63,7 @@
63
63
  "dotenv": "^16.0.0",
64
64
  "ejs": "^3.1.6",
65
65
  "enquirer": "^2.3.6",
66
- "esbuild": "~0.20.0",
66
+ "esbuild": "~0.21.0",
67
67
  "eslint": "^8.56.0",
68
68
  "execa": "^5.0.0",
69
69
  "fast-glob": "^3.3.2",
@@ -84,7 +84,7 @@
84
84
  "npm-run-path": "^4.0.1",
85
85
  "npm-which": "^3.0.1",
86
86
  "picomatch": "^4.0.0",
87
- "prettier": "~3.2.5",
87
+ "prettier": "~3.3.0",
88
88
  "prettier-plugin-packagejson": "^2.4.10",
89
89
  "read-pkg-up": "^7.0.1",
90
90
  "semantic-release": "^22.0.12",
@@ -97,20 +97,20 @@
97
97
  "ts-node-dev": "^2.0.0",
98
98
  "tsconfig-paths": "^4.0.0",
99
99
  "tsconfig-seek": "2.0.0",
100
- "typescript": "~5.4.0",
100
+ "typescript": "~5.5.0",
101
101
  "validate-npm-package-name": "^5.0.0",
102
102
  "zod": "^3.22.4",
103
- "eslint-config-skuba": "4.0.0"
103
+ "eslint-config-skuba": "4.1.0-main-20240625003658"
104
104
  },
105
105
  "devDependencies": {
106
- "@changesets/cli": "2.27.1",
106
+ "@changesets/cli": "2.27.5",
107
107
  "@changesets/get-github-info": "0.6.0",
108
108
  "@jest/reporters": "29.7.0",
109
109
  "@jest/test-result": "29.7.0",
110
110
  "@types/ejs": "3.1.5",
111
111
  "@types/express": "4.17.21",
112
112
  "@types/fs-extra": "11.0.4",
113
- "@types/koa": "2.14.0",
113
+ "@types/koa": "2.15.0",
114
114
  "@types/libnpmsearch": "2.0.7",
115
115
  "@types/lodash.mergewith": "4.6.9",
116
116
  "@types/module-alias": "2.0.4",
@@ -118,17 +118,17 @@
118
118
  "@types/picomatch": "2.3.3",
119
119
  "@types/supertest": "6.0.2",
120
120
  "@types/validate-npm-package-name": "4.0.2",
121
- "enhanced-resolve": "5.15.0",
121
+ "enhanced-resolve": "5.17.0",
122
122
  "express": "4.19.2",
123
- "fastify": "4.26.1",
123
+ "fastify": "4.28.0",
124
124
  "jest-diff": "29.7.0",
125
125
  "jsonfile": "6.1.0",
126
- "koa": "2.15.0",
127
- "memfs": "4.6.0",
128
- "remark-cli": "12.0.0",
129
- "remark-preset-lint-recommended": "6.1.3",
130
- "semver": "7.6.0",
131
- "supertest": "6.3.4",
126
+ "koa": "2.15.3",
127
+ "memfs": "4.9.3",
128
+ "remark-cli": "12.0.1",
129
+ "remark-preset-lint-recommended": "7.0.0",
130
+ "semver": "7.6.2",
131
+ "supertest": "7.0.0",
132
132
  "type-fest": "2.19.0"
133
133
  },
134
134
  "peerDependencies": {
@@ -1,6 +1,4 @@
1
1
  environment: dev
2
- env:
3
- SOME_ENVIRONMENT_VARIABLE: dev-value
4
2
 
5
3
  maxInstanceCount: 1
6
4
  minInstanceCount: 1
@@ -1,6 +1,4 @@
1
1
  environment: prod
2
- env:
3
- SOME_ENVIRONMENT_VARIABLE: prod-value
4
2
 
5
3
  maxInstanceCount: 10
6
4
  minInstanceCount: 3
@@ -1,4 +1,4 @@
1
- # syntax=docker/dockerfile:1.7
1
+ # syntax=docker/dockerfile:1.8
2
2
 
3
3
  FROM --platform=<%- platformName %> node:20-alpine AS dev-deps
4
4
 
@@ -1,5 +1,3 @@
1
- version: '3.7'
2
-
3
1
  services:
4
2
  app:
5
3
  image: ${BUILDKITE_PLUGIN_DOCKER_IMAGE:-''}
@@ -9,16 +9,9 @@ owner: '{{values "owner"}}'
9
9
  image: '{{values "image"}}'
10
10
 
11
11
  env:
12
- # https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html
13
- AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1'
14
-
15
12
  ENVIRONMENT: '{{values "environment"}}'
16
13
  SERVICE: '{{values "service"}}'
17
14
 
18
- {{range $key, $value := .Values.env}}
19
- {{$key}}: {{$value}}
20
- {{end}}
21
-
22
15
  {{if .Values.cloudwatchDashboardDisabled}}
23
16
  cloudwatchDashboardDisabled: {{values "cloudwatchDashboardDisabled"}}
24
17
  {{end}}
@@ -1,4 +1,5 @@
1
1
  {
2
+ "name": "@seek/<%- serviceName %>",
2
3
  "private": true,
3
4
  "license": "UNLICENSED",
4
5
  "scripts": {
@@ -14,6 +15,8 @@
14
15
  "dependencies": {
15
16
  "@seek/logger": "^6.0.0",
16
17
  "express": "^4.17.1",
18
+ "hot-shots": "^10.0.0",
19
+ "seek-datadog-custom-metrics": "^4.6.3",
17
20
  "skuba-dive": "^2.0.0"
18
21
  },
19
22
  "devDependencies": {
@@ -23,9 +26,9 @@
23
26
  "mime": "^4.0.1",
24
27
  "pino-pretty": "^11.0.0",
25
28
  "skuba": "*",
26
- "supertest": "^6.1.6"
29
+ "supertest": "^7.0.0"
27
30
  },
28
- "packageManager": "pnpm@9.0.2",
31
+ "packageManager": "pnpm@9.4.0",
29
32
  "engines": {
30
33
  "node": ">=20"
31
34
  }
@@ -7,8 +7,8 @@ interface Config {
7
7
  name: string;
8
8
  version: string;
9
9
 
10
- metricsServer?: string;
11
- port?: number;
10
+ metricsServer: string | null;
11
+ port: number | null;
12
12
  }
13
13
 
14
14
  type Environment = (typeof environments)[number];
@@ -26,19 +26,27 @@ const configs: Record<Environment, () => Omit<Config, 'environment'>> = {
26
26
  logLevel: 'debug',
27
27
  name: '<%- serviceName %>',
28
28
  version: 'local',
29
+
30
+ metricsServer: null,
31
+ port: null,
29
32
  }),
30
33
 
31
34
  test: () => ({
32
- ...configs.local(),
33
-
34
35
  logLevel: Env.string('LOG_LEVEL', { default: 'silent' }),
36
+ name: '<%- serviceName %>',
35
37
  version: 'test',
38
+
39
+ metricsServer: null,
40
+ port: null,
36
41
  }),
37
42
 
38
43
  [dev]: () => ({
39
- ...configs[prod](),
40
-
41
44
  logLevel: 'debug',
45
+ name: Env.string('SERVICE'),
46
+ version: Env.string('VERSION'),
47
+
48
+ metricsServer: 'localhost',
49
+ port: Env.nonNegativeInteger('PORT'),
42
50
  }),
43
51
 
44
52
  [prod]: () => ({
@@ -2,7 +2,7 @@ import createLogger from '@seek/logger';
2
2
 
3
3
  import { config } from 'src/config';
4
4
 
5
- export const rootLogger = createLogger({
5
+ export const logger = createLogger({
6
6
  base: {
7
7
  environment: config.environment,
8
8
  version: config.version,
@@ -0,0 +1,11 @@
1
+ import { StatsD } from 'hot-shots';
2
+ import { createStatsDClient } from 'seek-datadog-custom-metrics';
3
+
4
+ import { config } from 'src/config';
5
+
6
+ import { logger } from './logging';
7
+
8
+ /* istanbul ignore next: StatsD client is not our responsibility */
9
+ export const metricsClient = createStatsDClient(StatsD, config, (err) =>
10
+ logger.error({ err }, 'StatsD error'),
11
+ );
@@ -2,7 +2,7 @@ import './register';
2
2
 
3
3
  import app from './app';
4
4
  import { config } from './config';
5
- import { rootLogger } from './framework/logging';
5
+ import { logger } from './framework/logging';
6
6
 
7
7
  // If your application is deployed with more than 1 vCPU you can delete this
8
8
  // file and use a clustering utility to run `lib/app`.
@@ -11,7 +11,7 @@ const listener = app.listen(config.port, () => {
11
11
  const address = listener.address();
12
12
 
13
13
  if (typeof address === 'object' && address) {
14
- rootLogger.debug(`listening on port ${address.port}`);
14
+ logger.debug(`listening on port ${address.port}`);
15
15
  }
16
16
  });
17
17
 
@@ -1,4 +1,4 @@
1
- # syntax=docker/dockerfile:1.7
1
+ # syntax=docker/dockerfile:1.8
2
2
 
3
3
  FROM --platform=<%- platformName %> node:20-alpine AS dev-deps
4
4
 
@@ -1,5 +1,3 @@
1
- version: '3.7'
2
-
3
1
  services:
4
2
  app:
5
3
  image: ${BUILDKITE_PLUGIN_DOCKER_IMAGE:-''}
@@ -1,4 +1,5 @@
1
1
  {
2
+ "name": "@seek/greeter",
2
3
  "private": true,
3
4
  "license": "UNLICENSED",
4
5
  "scripts": {
@@ -16,9 +17,9 @@
16
17
  },
17
18
  "devDependencies": {
18
19
  "@types/node": "^20.9.0",
19
- "skuba": "*"
20
+ "skuba": "8.1.0-main-20240625003658"
20
21
  },
21
- "packageManager": "pnpm@9.0.2",
22
+ "packageManager": "pnpm@9.4.0",
22
23
  "engines": {
23
24
  "node": ">=20"
24
25
  }
@@ -1,6 +1,4 @@
1
1
  environment: dev
2
- env:
3
- SOME_ENVIRONMENT_VARIABLE: dev-value
4
2
 
5
3
  maxInstanceCount: 1
6
4
  minInstanceCount: 1
@@ -1,6 +1,4 @@
1
1
  environment: prod
2
- env:
3
- SOME_ENVIRONMENT_VARIABLE: prod-value
4
2
 
5
3
  maxInstanceCount: 10
6
4
  minInstanceCount: 3
@@ -1,4 +1,4 @@
1
- # syntax=docker/dockerfile:1.7
1
+ # syntax=docker/dockerfile:1.8
2
2
 
3
3
  FROM --platform=<%- platformName %> node:20-alpine AS dev-deps
4
4
 
@@ -1,5 +1,3 @@
1
- version: '3.7'
2
-
3
1
  services:
4
2
  app:
5
3
  image: ${BUILDKITE_PLUGIN_DOCKER_IMAGE:-''}
@@ -9,17 +9,10 @@ owner: '{{values "owner"}}'
9
9
  image: '{{values "image"}}'
10
10
 
11
11
  env:
12
- # https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html
13
- AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1'
14
-
15
12
  ENVIRONMENT: '{{values "environment"}}'
16
13
  OPENTELEMETRY_ENABLED: '{{.Values.openTelemetry.enabled | default false}}'
17
14
  SERVICE: '{{values "service"}}'
18
15
 
19
- {{range $key, $value := .Values.env}}
20
- {{$key}}: {{$value}}
21
- {{end}}
22
-
23
16
  {{if .Values.cloudwatchDashboardDisabled}}
24
17
  cloudwatchDashboardDisabled: {{values "cloudwatchDashboardDisabled"}}
25
18
  {{end}}
@@ -1,4 +1,5 @@
1
1
  {
2
+ "name": "@seek/<%- serviceName %>",
2
3
  "private": true,
3
4
  "license": "UNLICENSED",
4
5
  "scripts": {
@@ -13,20 +14,19 @@
13
14
  },
14
15
  "dependencies": {
15
16
  "@koa/router": "^12.0.0",
16
- "@opentelemetry/api": "^1.1.0",
17
- "@opentelemetry/core": "^1.18.1",
18
- "@opentelemetry/exporter-trace-otlp-grpc": "^0.50.0",
19
- "@opentelemetry/instrumentation-aws-sdk": "^0.40.0",
20
- "@opentelemetry/instrumentation-http": "^0.50.0",
21
- "@opentelemetry/propagator-b3": "^1.18.1",
22
- "@opentelemetry/sdk-node": "^0.50.0",
17
+ "@opentelemetry/api": "^1.9.0",
18
+ "@opentelemetry/core": "^1.25.0",
19
+ "@opentelemetry/exporter-trace-otlp-grpc": "^0.52.0",
20
+ "@opentelemetry/instrumentation-aws-sdk": "^0.42.0",
21
+ "@opentelemetry/instrumentation-http": "^0.52.0",
22
+ "@opentelemetry/propagator-b3": "^1.25.0",
23
+ "@opentelemetry/sdk-node": "^0.52.0",
23
24
  "@seek/logger": "^6.0.0",
24
- "aws-sdk": "^2.1039.0",
25
25
  "hot-shots": "^10.0.0",
26
26
  "koa": "^2.13.4",
27
27
  "koa-bodyparser": "^4.3.0",
28
- "koa-compose": "^4.2.0",
29
- "seek-datadog-custom-metrics": "^4.2.1",
28
+ "koa-compose": "^4.1.0",
29
+ "seek-datadog-custom-metrics": "^4.6.3",
30
30
  "seek-koala": "^7.0.0",
31
31
  "skuba-dive": "^2.0.0",
32
32
  "zod": "^3.19.1"
@@ -42,9 +42,9 @@
42
42
  "mime": "^4.0.1",
43
43
  "pino-pretty": "^11.0.0",
44
44
  "skuba": "*",
45
- "supertest": "^6.1.6"
45
+ "supertest": "^7.0.0"
46
46
  },
47
- "packageManager": "pnpm@9.0.2",
47
+ "packageManager": "pnpm@9.4.0",
48
48
  "engines": {
49
49
  "node": ">=20"
50
50
  }
@@ -7,8 +7,8 @@ interface Config {
7
7
  name: string;
8
8
  version: string;
9
9
 
10
- metricsServer?: string;
11
- port?: number;
10
+ metricsServer: string | null;
11
+ port: number | null;
12
12
  }
13
13
 
14
14
  type Environment = (typeof environments)[number];
@@ -26,19 +26,29 @@ const configs: Record<Environment, () => Omit<Config, 'environment'>> = {
26
26
  logLevel: 'debug',
27
27
  name: '<%- serviceName %>',
28
28
  version: 'local',
29
+
30
+ metricsServer: null,
31
+ port: null,
29
32
  }),
30
33
 
31
34
  test: () => ({
32
- ...configs.local(),
33
-
34
35
  logLevel: Env.string('LOG_LEVEL', { default: 'silent' }),
36
+ name: '<%- serviceName %>',
35
37
  version: 'test',
38
+
39
+ metricsServer: null,
40
+ port: null,
36
41
  }),
37
42
 
38
43
  [dev]: () => ({
39
44
  ...configs[prod](),
40
45
 
41
46
  logLevel: 'debug',
47
+ name: Env.string('SERVICE'),
48
+ version: Env.string('VERSION'),
49
+
50
+ metricsServer: 'localhost',
51
+ port: Env.nonNegativeInteger('PORT'),
42
52
  }),
43
53
 
44
54
  [prod]: () => ({
@@ -1,4 +1,4 @@
1
- # syntax=docker/dockerfile:1.7
1
+ # syntax=docker/dockerfile:1.8
2
2
 
3
3
  FROM --platform=<%- platformName %> node:20-alpine AS dev-deps
4
4
 
@@ -1,5 +1,3 @@
1
- version: '3.7'
2
-
3
1
  services:
4
2
  app:
5
3
  image: ${BUILDKITE_PLUGIN_DOCKER_IMAGE:-''}
@@ -1,4 +1,5 @@
1
1
  {
2
+ "name": "@seek/<%- serviceName %>",
2
3
  "private": true,
3
4
  "license": "UNLICENSED",
4
5
  "scripts": {
@@ -31,13 +32,13 @@
31
32
  "aws-sdk-client-mock-jest": "^4.0.0",
32
33
  "chance": "^1.1.8",
33
34
  "pino-pretty": "^11.0.0",
34
- "serverless": "^3.37.0",
35
+ "serverless": "^3.39.0",
35
36
  "serverless-plugin-canary-deployments": "^0.8.0",
36
37
  "serverless-plugin-datadog": "^5.12.0",
37
38
  "serverless-prune-plugin": "^2.0.0",
38
39
  "skuba": "*"
39
40
  },
40
- "packageManager": "pnpm@9.0.2",
41
+ "packageManager": "pnpm@9.4.0",
41
42
  "engines": {
42
43
  "node": ">=20"
43
44
  }
@@ -29,16 +29,21 @@ const configs: Record<Environment, () => Omit<Config, 'environment'>> = {
29
29
  }),
30
30
 
31
31
  test: () => ({
32
- ...configs.local(),
33
-
34
32
  logLevel: Env.string('LOG_LEVEL', { default: 'silent' }),
33
+ metrics: false,
34
+ name: '<%- serviceName %>',
35
35
  version: 'test',
36
+
37
+ destinationSnsTopicArn: 'arn:aws:sns:us-east-2:123456789012:destination',
36
38
  }),
37
39
 
38
40
  dev: () => ({
39
- ...configs.prod(),
40
-
41
41
  logLevel: 'debug',
42
+ metrics: true,
43
+ name: Env.string('SERVICE'),
44
+ version: Env.string('VERSION'),
45
+
46
+ destinationSnsTopicArn: Env.string('DESTINATION_SNS_TOPIC_ARN'),
42
47
  }),
43
48
 
44
49
  prod: () => ({
@@ -1,4 +1,4 @@
1
- # syntax=docker/dockerfile:1.7
1
+ # syntax=docker/dockerfile:1.8
2
2
 
3
3
  FROM --platform=<%- platformName %> node:20-alpine AS dev-deps
4
4
 
@@ -1,5 +1,3 @@
1
- version: '3.7'
2
-
3
1
  services:
4
2
  app:
5
3
  image: ${BUILDKITE_PLUGIN_DOCKER_IMAGE:-''}
@@ -451,6 +451,8 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
451
451
  "ENVIRONMENT": "dev",
452
452
  "NODE_ENV": "production",
453
453
  "NODE_OPTIONS": "--enable-source-maps",
454
+ "SERVICE": "serviceName",
455
+ "VERSION": "local",
454
456
  },
455
457
  },
456
458
  "FunctionName": "serviceName",
@@ -644,6 +646,8 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
644
646
  },
645
647
  "NODE_ENV": "production",
646
648
  "NODE_OPTIONS": "--enable-source-maps",
649
+ "SERVICE": "serviceName",
650
+ "VERSION": "local",
647
651
  },
648
652
  },
649
653
  "FunctionName": "serviceName-post-hook",
@@ -796,6 +800,8 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
796
800
  },
797
801
  "NODE_ENV": "production",
798
802
  "NODE_OPTIONS": "--enable-source-maps",
803
+ "SERVICE": "serviceName",
804
+ "VERSION": "local",
799
805
  },
800
806
  },
801
807
  "FunctionName": "serviceName-pre-hook",
@@ -1493,6 +1499,8 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
1493
1499
  "ENVIRONMENT": "prod",
1494
1500
  "NODE_ENV": "production",
1495
1501
  "NODE_OPTIONS": "--enable-source-maps",
1502
+ "SERVICE": "serviceName",
1503
+ "VERSION": "local",
1496
1504
  },
1497
1505
  },
1498
1506
  "FunctionName": "serviceName",
@@ -1686,6 +1694,8 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
1686
1694
  },
1687
1695
  "NODE_ENV": "production",
1688
1696
  "NODE_OPTIONS": "--enable-source-maps",
1697
+ "SERVICE": "serviceName",
1698
+ "VERSION": "local",
1689
1699
  },
1690
1700
  },
1691
1701
  "FunctionName": "serviceName-post-hook",
@@ -1838,6 +1848,8 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
1838
1848
  },
1839
1849
  "NODE_ENV": "production",
1840
1850
  "NODE_OPTIONS": "--enable-source-maps",
1851
+ "SERVICE": "serviceName",
1852
+ "VERSION": "local",
1841
1853
  },
1842
1854
  },
1843
1855
  "FunctionName": "serviceName-pre-hook",
@@ -1,27 +1,33 @@
1
- import { z } from 'zod';
1
+ import { Env } from 'skuba-dive';
2
2
 
3
- const environment = z.enum(['dev', 'prod']).parse(process.env.ENVIRONMENT);
3
+ const ENVIRONMENTS = ['dev', 'prod'] as const;
4
4
 
5
- type Environment = typeof environment;
5
+ type Environment = (typeof ENVIRONMENTS)[number];
6
6
 
7
- export interface Config {
7
+ const environment = Env.oneOf(ENVIRONMENTS)('ENVIRONMENT');
8
+
9
+ interface Config {
8
10
  appName: string;
9
11
  workerLambda: {
10
12
  reservedConcurrency: number;
11
13
  environment: {
12
14
  ENVIRONMENT: Environment;
15
+ SERVICE: string;
16
+ VERSION: string;
13
17
  };
14
18
  };
15
19
  sourceSnsTopicArn: string;
16
20
  }
17
21
 
18
- export const configs: Record<Environment, Config> = {
22
+ const configs: Record<Environment, Config> = {
19
23
  dev: {
20
24
  appName: '<%- serviceName %>',
21
25
  workerLambda: {
22
26
  reservedConcurrency: 2,
23
27
  environment: {
24
28
  ENVIRONMENT: 'dev',
29
+ SERVICE: '<%- serviceName %>',
30
+ VERSION: Env.string('VERSION', { default: 'local' }),
25
31
  },
26
32
  },
27
33
  sourceSnsTopicArn: 'TODO: sourceSnsTopicArn',
@@ -32,10 +38,12 @@ export const configs: Record<Environment, Config> = {
32
38
  reservedConcurrency: 20,
33
39
  environment: {
34
40
  ENVIRONMENT: 'prod',
41
+ SERVICE: '<%- serviceName %>',
42
+ VERSION: Env.string('VERSION', { default: 'local' }),
35
43
  },
36
44
  },
37
45
  sourceSnsTopicArn: 'TODO: sourceSnsTopicArn',
38
46
  },
39
47
  };
40
48
 
41
- export const config = configs[environment];
49
+ export const config: Config = configs[environment];
@@ -1,4 +1,5 @@
1
1
  {
2
+ "name": "@seek/<%- serviceName %>",
2
3
  "private": true,
3
4
  "license": "UNLICENSED",
4
5
  "scripts": {
@@ -16,6 +17,7 @@
16
17
  "@aws-sdk/client-lambda": "^3.363.0",
17
18
  "@aws-sdk/client-sns": "^3.363.0",
18
19
  "@seek/logger": "^6.0.0",
20
+ "skuba-dive": "^2.0.0",
19
21
  "zod": "^3.19.1"
20
22
  },
21
23
  "devDependencies": {
@@ -24,9 +26,10 @@
24
26
  "aws-cdk": "^2.109.0",
25
27
  "aws-cdk-lib": "^2.109.0",
26
28
  "constructs": "^10.0.17",
27
- "skuba": "*"
29
+ "pino-pretty": "^11.0.0",
30
+ "skuba": "8.1.0-main-20240625003658"
28
31
  },
29
- "packageManager": "pnpm@9.0.2",
32
+ "packageManager": "pnpm@9.4.0",
30
33
  "engines": {
31
34
  "node": ">=20"
32
35
  }