skuba 0.0.0-master-20230318051429 → 0.0.0-master-20230718070720

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 (187) hide show
  1. package/README.md +1 -1
  2. package/config/tsconfig.json +3 -1
  3. package/lib/api/buildkite/md.js.map +1 -1
  4. package/lib/api/git/currentBranch.js +2 -1
  5. package/lib/api/git/currentBranch.js.map +2 -2
  6. package/lib/api/git/findRoot.d.ts +9 -0
  7. package/lib/api/git/findRoot.js +52 -0
  8. package/lib/api/git/findRoot.js.map +7 -0
  9. package/lib/api/git/index.d.ts +1 -0
  10. package/lib/api/git/index.js +3 -0
  11. package/lib/api/git/index.js.map +2 -2
  12. package/lib/api/git/pull.js.map +1 -1
  13. package/lib/api/git/push.js.map +1 -1
  14. package/lib/api/git/remote.js +2 -1
  15. package/lib/api/git/remote.js.map +2 -2
  16. package/lib/api/git/reset.js.map +1 -1
  17. package/lib/api/github/checkRun.d.ts +1 -1
  18. package/lib/api/github/checkRun.js.map +2 -2
  19. package/lib/api/github/environment.js.map +1 -1
  20. package/lib/api/github/issueComment.js.map +1 -1
  21. package/lib/api/github/pullRequest.js +3 -2
  22. package/lib/api/github/pullRequest.js.map +2 -2
  23. package/lib/api/github/push.js.map +1 -1
  24. package/lib/api/jest/index.d.ts +24 -21
  25. package/lib/api/net/compose.js.map +1 -1
  26. package/lib/api/net/socket.js.map +1 -1
  27. package/lib/cli/adapter/eslint.js +0 -13
  28. package/lib/cli/adapter/eslint.js.map +2 -2
  29. package/lib/cli/adapter/prettier.d.ts +1 -1
  30. package/lib/cli/adapter/prettier.js +14 -11
  31. package/lib/cli/adapter/prettier.js.map +2 -2
  32. package/lib/cli/build/assets.d.ts +10 -0
  33. package/lib/cli/build/assets.js +107 -0
  34. package/lib/cli/build/assets.js.map +7 -0
  35. package/lib/cli/build/esbuild.js +7 -42
  36. package/lib/cli/build/esbuild.js.map +3 -3
  37. package/lib/cli/build/index.js +12 -2
  38. package/lib/cli/build/index.js.map +2 -2
  39. package/lib/cli/build/tsc.d.ts +3 -0
  40. package/lib/cli/build/tsc.js +66 -0
  41. package/lib/cli/build/tsc.js.map +3 -3
  42. package/lib/cli/buildPackage.js +13 -0
  43. package/lib/cli/buildPackage.js.map +2 -2
  44. package/lib/cli/configure/addEmptyExports.js +1 -1
  45. package/lib/cli/configure/addEmptyExports.js.map +2 -2
  46. package/lib/cli/configure/analyseDependencies.js +1 -1
  47. package/lib/cli/configure/analyseDependencies.js.map +2 -2
  48. package/lib/cli/configure/analysis/files.js.map +1 -1
  49. package/lib/cli/configure/analysis/package.js.map +1 -1
  50. package/lib/cli/configure/analysis/project.js +7 -3
  51. package/lib/cli/configure/analysis/project.js.map +2 -2
  52. package/lib/cli/configure/ensureTemplateCompletion.js +1 -1
  53. package/lib/cli/configure/ensureTemplateCompletion.js.map +2 -2
  54. package/lib/cli/configure/getEntryPoint.js +3 -0
  55. package/lib/cli/configure/getEntryPoint.js.map +3 -3
  56. package/lib/cli/configure/index.js.map +1 -1
  57. package/lib/cli/configure/modules/jest.js +3 -3
  58. package/lib/cli/configure/modules/jest.js.map +2 -2
  59. package/lib/cli/configure/modules/package.js +3 -3
  60. package/lib/cli/configure/modules/package.js.map +1 -1
  61. package/lib/cli/configure/modules/skubaDive.js.map +1 -1
  62. package/lib/cli/configure/modules/tsconfig.js +1 -1
  63. package/lib/cli/configure/modules/tsconfig.js.map +2 -2
  64. package/lib/cli/configure/patchRenovateConfig.js +9 -4
  65. package/lib/cli/configure/patchRenovateConfig.js.map +2 -2
  66. package/lib/cli/configure/patchServerListener.d.ts +3 -0
  67. package/lib/cli/configure/patchServerListener.js +87 -0
  68. package/lib/cli/configure/patchServerListener.js.map +7 -0
  69. package/lib/cli/configure/processing/ignoreFile.js.map +1 -1
  70. package/lib/cli/configure/processing/javascript.js.map +1 -1
  71. package/lib/cli/configure/processing/json.d.ts +1 -1
  72. package/lib/cli/configure/processing/json.js.map +1 -1
  73. package/lib/cli/configure/processing/module.js.map +1 -1
  74. package/lib/cli/configure/processing/package.d.ts +2 -2
  75. package/lib/cli/configure/processing/prettier.d.ts +1 -1
  76. package/lib/cli/configure/processing/typescript.d.ts +2 -2
  77. package/lib/cli/configure/processing/typescript.js +14 -6
  78. package/lib/cli/configure/processing/typescript.js.map +2 -2
  79. package/lib/cli/configure/refreshIgnoreFiles.js.map +1 -1
  80. package/lib/cli/configure/types.d.ts +1 -1
  81. package/lib/cli/configure/types.js.map +1 -1
  82. package/lib/cli/format.js +2 -0
  83. package/lib/cli/format.js.map +2 -2
  84. package/lib/cli/init/getConfig.js +4 -1
  85. package/lib/cli/init/getConfig.js.map +2 -2
  86. package/lib/cli/init/git.js.map +1 -1
  87. package/lib/cli/init/index.js.map +1 -1
  88. package/lib/cli/init/prompts.js +1 -1
  89. package/lib/cli/init/prompts.js.map +2 -2
  90. package/lib/cli/init/writePackageJson.js +1 -1
  91. package/lib/cli/init/writePackageJson.js.map +2 -2
  92. package/lib/cli/lint/annotate/buildkite/prettier.js.map +2 -2
  93. package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
  94. package/lib/cli/lint/annotate/github/index.js.map +1 -1
  95. package/lib/cli/lint/annotate/github/tsc.js +1 -1
  96. package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
  97. package/lib/cli/lint/autofix.js +9 -1
  98. package/lib/cli/lint/autofix.js.map +2 -2
  99. package/lib/cli/lint/external.js +1 -4
  100. package/lib/cli/lint/external.js.map +1 -1
  101. package/lib/cli/lint/index.js +2 -0
  102. package/lib/cli/lint/index.js.map +2 -2
  103. package/lib/cli/lint/internal.js.map +1 -1
  104. package/lib/cli/lint/tsc.js.map +1 -1
  105. package/lib/cli/start.js +1 -1
  106. package/lib/cli/start.js.map +1 -1
  107. package/lib/cli/test/index.js +1 -2
  108. package/lib/cli/test/index.js.map +1 -1
  109. package/lib/cli/test/reporters/github/annotations.js +2 -2
  110. package/lib/cli/test/reporters/github/annotations.js.map +2 -2
  111. package/lib/cli/test/reporters/github/index.js +0 -2
  112. package/lib/cli/test/reporters/github/index.js.map +1 -1
  113. package/lib/skuba.js +1 -0
  114. package/lib/skuba.js.map +2 -2
  115. package/lib/utils/args.d.ts +1 -1
  116. package/lib/utils/args.js.map +2 -2
  117. package/lib/utils/command.js +1 -1
  118. package/lib/utils/command.js.map +2 -2
  119. package/lib/utils/copy.d.ts +1 -0
  120. package/lib/utils/copy.js +6 -1
  121. package/lib/utils/copy.js.map +2 -2
  122. package/lib/utils/dir.d.ts +3 -2
  123. package/lib/utils/dir.js +6 -6
  124. package/lib/utils/dir.js.map +2 -2
  125. package/lib/utils/exec.js +1 -4
  126. package/lib/utils/exec.js.map +1 -1
  127. package/lib/utils/logging.js.map +1 -1
  128. package/lib/utils/logo.js.map +1 -1
  129. package/lib/utils/manifest.d.ts +1 -0
  130. package/lib/utils/manifest.js +8 -2
  131. package/lib/utils/manifest.js.map +2 -2
  132. package/lib/utils/validation.d.ts +2 -2
  133. package/lib/utils/validation.js.map +2 -2
  134. package/lib/utils/version.js.map +1 -1
  135. package/lib/utils/wait.js.map +1 -1
  136. package/lib/utils/worker.js.map +1 -1
  137. package/lib/wrapper/functionHandler.js.map +1 -1
  138. package/lib/wrapper/http.js.map +1 -1
  139. package/lib/wrapper/index.js.map +1 -1
  140. package/lib/wrapper/main.js.map +2 -2
  141. package/lib/wrapper/requestListener.js +3 -0
  142. package/lib/wrapper/requestListener.js.map +2 -2
  143. package/package.json +28 -25
  144. package/template/base/.github/CODEOWNERS +0 -4
  145. package/template/base/_.prettierignore +0 -13
  146. package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
  147. package/template/express-rest-api/gantry.apply.yml +0 -2
  148. package/template/express-rest-api/package.json +2 -2
  149. package/template/express-rest-api/src/api/healthCheck.ts +1 -1
  150. package/template/express-rest-api/src/api/smokeTest.ts +1 -1
  151. package/template/greeter/.buildkite/pipeline.yml +1 -1
  152. package/template/greeter/package.json +1 -1
  153. package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
  154. package/template/koa-rest-api/gantry.apply.yml +0 -2
  155. package/template/koa-rest-api/package.json +7 -7
  156. package/template/koa-rest-api/src/api/healthCheck.ts +1 -1
  157. package/template/koa-rest-api/src/api/jobs/getJobs.ts +1 -1
  158. package/template/koa-rest-api/src/api/jobs/postJob.ts +1 -1
  159. package/template/koa-rest-api/src/api/smokeTest.ts +1 -1
  160. package/template/koa-rest-api/src/framework/server.test.ts +1 -1
  161. package/template/koa-rest-api/src/framework/validation.ts +2 -2
  162. package/template/koa-rest-api/src/storage/jobs.ts +1 -1
  163. package/template/koa-rest-api/src/testing/server.ts +2 -2
  164. package/template/koa-rest-api/src/testing/types.ts +1 -1
  165. package/template/koa-rest-api/src/tracing.ts +3 -8
  166. package/template/koa-rest-api/tsconfig.json +18 -0
  167. package/template/lambda-sqs-worker/.buildkite/pipeline.yml +2 -2
  168. package/template/lambda-sqs-worker/package.json +9 -9
  169. package/template/lambda-sqs-worker/src/app.test.ts +1 -1
  170. package/template/lambda-sqs-worker/src/app.ts +10 -5
  171. package/template/lambda-sqs-worker/src/framework/handler.test.ts +4 -4
  172. package/template/lambda-sqs-worker/src/framework/handler.ts +1 -1
  173. package/template/lambda-sqs-worker/src/framework/validation.ts +1 -1
  174. package/template/lambda-sqs-worker/src/mapping/jobScorer.ts +5 -2
  175. package/template/lambda-sqs-worker/src/services/jobScorer.ts +6 -6
  176. package/template/lambda-sqs-worker/src/testing/handler.ts +3 -3
  177. package/template/lambda-sqs-worker/src/testing/logging.ts +3 -0
  178. package/template/lambda-sqs-worker/src/testing/types.ts +1 -1
  179. package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
  180. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +1 -1
  181. package/template/lambda-sqs-worker-cdk/package.json +2 -2
  182. package/template/lambda-sqs-worker-cdk/src/app.ts +1 -1
  183. package/template/oss-npm-package/.github/workflows/release.yml +1 -0
  184. package/template/oss-npm-package/_package.json +22 -16
  185. package/template/oss-npm-package/tsconfig.json +2 -2
  186. package/template/private-npm-package/_package.json +19 -16
  187. package/template/private-npm-package/tsconfig.json +2 -2
@@ -1,7 +1,7 @@
1
1
  import { ErrorMiddleware } from 'seek-koala';
2
- import { z } from 'zod';
2
+ import type { z } from 'zod';
3
3
 
4
- import { Context } from 'src/types/koa';
4
+ import type { Context } from 'src/types/koa';
5
5
 
6
6
  /**
7
7
  * Converts a `ZodError` into an `invalidFields` object
@@ -1,6 +1,6 @@
1
1
  import { randomUUID } from 'crypto';
2
2
 
3
- import { Job, JobInput } from 'src/types/jobs';
3
+ import type { Job, JobInput } from 'src/types/jobs';
4
4
 
5
5
  const jobStore: Record<string, Job> = {};
6
6
 
@@ -1,5 +1,5 @@
1
- import Router from '@koa/router';
2
- import Koa from 'koa';
1
+ import type Router from '@koa/router';
2
+ import type Koa from 'koa';
3
3
  import request from 'supertest';
4
4
 
5
5
  import { createApp } from 'src/framework/server';
@@ -1,7 +1,7 @@
1
1
  import { Chance } from 'chance';
2
2
  import { z } from 'zod';
3
3
 
4
- import { JobInput } from 'src/types/jobs';
4
+ import type { JobInput } from 'src/types/jobs';
5
5
 
6
6
  export type IdDescription = z.infer<typeof IdDescriptionSchema>;
7
7
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  import { propagation } from '@opentelemetry/api';
8
8
  import { CompositePropagator } from '@opentelemetry/core';
9
- import { CollectorTraceExporter } from '@opentelemetry/exporter-collector-grpc';
9
+ import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-grpc';
10
10
  import { AwsInstrumentation } from '@opentelemetry/instrumentation-aws-sdk';
11
11
  import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
12
12
  import { B3InjectEncoding, B3Propagator } from '@opentelemetry/propagator-b3';
@@ -31,17 +31,12 @@ const main = () => {
31
31
  );
32
32
 
33
33
  const sdk = new NodeSDK({
34
- traceExporter: new CollectorTraceExporter(),
34
+ traceExporter: new OTLPTraceExporter(),
35
35
  autoDetectResources: false,
36
36
  instrumentations: [new HttpInstrumentation(), new AwsInstrumentation()],
37
37
  });
38
38
 
39
- sdk
40
- .start()
41
- .then(() => log('info', 'OpenTelemetry initialised'))
42
- .catch((err: Error) =>
43
- log('error', 'OpenTelemetry not initialised', { err }),
44
- );
39
+ sdk.start();
45
40
 
46
41
  process.on('SIGTERM', () => {
47
42
  sdk
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "baseUrl": ".",
4
+ "lib": [
5
+ // open-telemetry/opentelemetry-js#3580
6
+ "DOM",
7
+
8
+ "ES2022"
9
+ ],
10
+ "outDir": "lib",
11
+ "paths": {
12
+ "src": ["src"]
13
+ },
14
+ "target": "ES2022"
15
+ },
16
+ "exclude": ["lib*/**/*"],
17
+ "extends": "skuba/config/tsconfig.json"
18
+ }
@@ -32,7 +32,7 @@ configs:
32
32
  - *aws-sm
33
33
  - *private-npm
34
34
  - *docker-ecr-cache
35
- - docker-compose#v4.11.0:
35
+ - docker-compose#v4.14.0:
36
36
  dependencies: false
37
37
  run: app
38
38
  retry:
@@ -60,7 +60,7 @@ steps:
60
60
  - *aws-sm
61
61
  - *private-npm
62
62
  - *docker-ecr-cache
63
- - docker-compose#v4.11.0:
63
+ - docker-compose#v4.14.0:
64
64
  run: app
65
65
  timeout_in_minutes: 10
66
66
 
@@ -14,13 +14,13 @@
14
14
  "test:watch": "skuba test --watch"
15
15
  },
16
16
  "dependencies": {
17
- "@aws-sdk/client-codedeploy": "^3.259.0",
18
- "@aws-sdk/client-lambda": "^3.259.0",
19
- "@aws-sdk/client-sns": "^3.259.0",
17
+ "@aws-sdk/client-codedeploy": "^3.363.0",
18
+ "@aws-sdk/client-lambda": "^3.363.0",
19
+ "@aws-sdk/client-sns": "^3.363.0",
20
20
  "@aws-sdk/util-utf8-node": "^3.259.0",
21
- "@seek/logger": "^5.0.1",
22
- "datadog-lambda-js": "^6.83.0",
23
- "dd-trace": "^3.8.0",
21
+ "@seek/logger": "^6.0.0",
22
+ "datadog-lambda-js": "^7.0.0",
23
+ "dd-trace": "^4.0.0",
24
24
  "skuba-dive": "^2.0.0",
25
25
  "zod": "^3.19.1"
26
26
  },
@@ -28,8 +28,8 @@
28
28
  "@types/aws-lambda": "^8.10.84",
29
29
  "@types/chance": "^1.1.3",
30
30
  "@types/node": "^18.11.9",
31
- "aws-sdk-client-mock": "^2.0.1",
32
- "aws-sdk-client-mock-jest": "^2.0.1",
31
+ "aws-sdk-client-mock": "^3.0.0",
32
+ "aws-sdk-client-mock-jest": "^3.0.0",
33
33
  "chance": "^1.1.8",
34
34
  "pino-pretty": "^10.0.0",
35
35
  "serverless": "^3.25.0",
@@ -39,6 +39,6 @@
39
39
  "skuba": "*"
40
40
  },
41
41
  "engines": {
42
- "node": ">=18"
42
+ "node": ">=18.12"
43
43
  }
44
44
  }
@@ -47,7 +47,7 @@ describe('handler', () => {
47
47
 
48
48
  expect(logger.error).not.toHaveBeenCalled();
49
49
 
50
- expect(logger.info.mock.calls).toEqual([
50
+ expect(logger.debug.mock.calls).toEqual([
51
51
  [{ count: 1 }, 'Received jobs'],
52
52
  [{ snsMessageId: expect.any(String) }, 'Scored job'],
53
53
  ['Function succeeded'],
@@ -1,6 +1,6 @@
1
1
  import 'skuba-dive/register';
2
2
 
3
- import { SQSEvent } from 'aws-lambda';
3
+ import type { SQSEvent } from 'aws-lambda';
4
4
 
5
5
  import { createHandler } from 'src/framework/handler';
6
6
  import { logger } from 'src/framework/logging';
@@ -20,7 +20,7 @@ const smokeTest = async () => {
20
20
  export const handler = createHandler<SQSEvent>(async (event) => {
21
21
  // Treat an empty object as our smoke test event.
22
22
  if (!Object.keys(event).length) {
23
- logger.info('Received smoke test request');
23
+ logger.debug('Received smoke test request');
24
24
  return smokeTest();
25
25
  }
26
26
 
@@ -30,23 +30,28 @@ export const handler = createHandler<SQSEvent>(async (event) => {
30
30
  throw Error(`Received ${count} records`);
31
31
  }
32
32
 
33
- logger.info({ count }, 'Received jobs');
33
+ logger.debug({ count }, 'Received jobs');
34
34
 
35
35
  metricsClient.distribution('job.received', event.Records.length);
36
36
 
37
37
  const record = event.Records[0];
38
+ if (!record) {
39
+ throw new Error('Malformed SQS event with no records');
40
+ }
41
+
42
+ const { body } = record;
38
43
 
39
44
  // TODO: this throws an error, which will cause the Lambda function to retry
40
45
  // the event and eventually send it to your dead-letter queue. If you don't
41
46
  // trust your source to provide consistently well-formed input, consider
42
47
  // catching and handling this error in code.
43
- const publishedJob = validateJson(record.body, JobPublishedEventSchema);
48
+ const publishedJob = validateJson(body, JobPublishedEventSchema);
44
49
 
45
50
  const scoredJob = await scoreJobPublishedEvent(publishedJob);
46
51
 
47
52
  const snsMessageId = await sendPipelineEvent(scoredJob);
48
53
 
49
- logger.info({ snsMessageId }, 'Scored job');
54
+ logger.debug({ snsMessageId }, 'Scored job');
50
55
 
51
56
  metricsClient.distribution('job.scored', 1);
52
57
  });
@@ -18,7 +18,7 @@ describe('createHandler', () => {
18
18
  const handler = createHandler((event) => {
19
19
  expect(event).toBe(input);
20
20
 
21
- logger.info('Handler invoked');
21
+ logger.debug('Handler invoked');
22
22
 
23
23
  return Promise.resolve(output);
24
24
  });
@@ -27,7 +27,7 @@ describe('createHandler', () => {
27
27
 
28
28
  expect(logger.error).not.toHaveBeenCalled();
29
29
 
30
- expect(logger.info.mock.calls).toEqual([
30
+ expect(logger.debug.mock.calls).toEqual([
31
31
  ['Handler invoked'],
32
32
  ['Function succeeded'],
33
33
  ]);
@@ -42,7 +42,7 @@ describe('createHandler', () => {
42
42
 
43
43
  expect(logger.error).toHaveBeenCalledWith({ err }, 'Function failed');
44
44
 
45
- expect(logger.info).not.toHaveBeenCalled();
45
+ expect(logger.debug).not.toHaveBeenCalled();
46
46
  });
47
47
 
48
48
  it('handles sync error', async () => {
@@ -56,6 +56,6 @@ describe('createHandler', () => {
56
56
 
57
57
  expect(logger.error).toHaveBeenCalledWith({ err }, 'Function failed');
58
58
 
59
- expect(logger.info).not.toHaveBeenCalled();
59
+ expect(logger.debug).not.toHaveBeenCalled();
60
60
  });
61
61
  });
@@ -31,7 +31,7 @@ export const createHandler = <Event, Output = unknown>(
31
31
  try {
32
32
  const output = await fn(event);
33
33
 
34
- logger.info('Function succeeded');
34
+ logger.debug('Function succeeded');
35
35
 
36
36
  return output;
37
37
  } catch (err) {
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import type { z } from 'zod';
2
2
 
3
3
  export const validateJson = <
4
4
  Output,
@@ -1,5 +1,8 @@
1
- import { JobScorerInput, JobScorerOutput } from 'src/types/jobScorer';
2
- import { JobPublishedEvent, JobScoredEvent } from 'src/types/pipelineEvents';
1
+ import type { JobScorerInput, JobScorerOutput } from 'src/types/jobScorer';
2
+ import type {
3
+ JobPublishedEvent,
4
+ JobScoredEvent,
5
+ } from 'src/types/pipelineEvents';
3
6
 
4
7
  export const jobPublishedEventToScorerInput = (
5
8
  record: JobPublishedEvent,
@@ -2,12 +2,12 @@ import {
2
2
  jobPublishedEventToScorerInput,
3
3
  jobScorerOutputToScoredEvent,
4
4
  } from 'src/mapping/jobScorer';
5
- import {
6
- JobScorerInput,
7
- JobScorerOutput,
8
- JobScorerOutputSchema,
9
- } from 'src/types/jobScorer';
10
- import { JobPublishedEvent, JobScoredEvent } from 'src/types/pipelineEvents';
5
+ import type { JobScorerInput, JobScorerOutput } from 'src/types/jobScorer';
6
+ import { JobScorerOutputSchema } from 'src/types/jobScorer';
7
+ import type {
8
+ JobPublishedEvent,
9
+ JobScoredEvent,
10
+ } from 'src/types/pipelineEvents';
11
11
 
12
12
  /* istanbul ignore next: simulation of an external service */
13
13
  export const scoringService = {
@@ -1,13 +1,13 @@
1
- import { Context, SQSEvent } from 'aws-lambda';
1
+ import type { Context, SQSEvent } from 'aws-lambda';
2
2
 
3
3
  import { chance } from './types';
4
4
 
5
5
  export const createCtx = () =>
6
6
  ({
7
7
  awsRequestId: chance.guid({ version: 4 }),
8
- } as Context);
8
+ }) as Context;
9
9
 
10
10
  export const createSqsEvent = (bodies: string[]) =>
11
11
  ({
12
12
  Records: bodies.map((body) => ({ body })),
13
- } as SQSEvent);
13
+ }) as SQSEvent;
@@ -3,14 +3,17 @@ import * as logging from 'src/framework/logging';
3
3
  export const logger = {
4
4
  error: jest.fn(),
5
5
  info: jest.fn(),
6
+ debug: jest.fn(),
6
7
 
7
8
  clear: () => {
8
9
  logger.error.mockClear();
9
10
  logger.info.mockClear();
11
+ logger.debug.mockClear();
10
12
  },
11
13
 
12
14
  spy: () => {
13
15
  jest.spyOn(logging.logger, 'error').mockImplementation(logger.error);
14
16
  jest.spyOn(logging.logger, 'info').mockImplementation(logger.info);
17
+ jest.spyOn(logging.logger, 'debug').mockImplementation(logger.debug);
15
18
  },
16
19
  };
@@ -1,7 +1,7 @@
1
1
  import { Chance } from 'chance';
2
2
  import { z } from 'zod';
3
3
 
4
- import { JobPublishedEvent } from 'src/types/pipelineEvents';
4
+ import type { JobPublishedEvent } from 'src/types/pipelineEvents';
5
5
 
6
6
  export type IdDescription = z.infer<typeof IdDescriptionSchema>;
7
7
 
@@ -32,7 +32,7 @@ configs:
32
32
  - *aws-sm
33
33
  - *private-npm
34
34
  - *docker-ecr-cache
35
- - docker-compose#v4.11.0:
35
+ - docker-compose#v4.14.0:
36
36
  dependencies: false
37
37
  run: app
38
38
  retry:
@@ -57,7 +57,7 @@ steps:
57
57
  - *aws-sm
58
58
  - *private-npm
59
59
  - *docker-ecr-cache
60
- - docker-compose#v4.11.0:
60
+ - docker-compose#v4.14.0:
61
61
  run: app
62
62
  timeout_in_minutes: 10
63
63
 
@@ -1,6 +1,6 @@
1
+ import type { StackProps } from 'aws-cdk-lib';
1
2
  import {
2
3
  Stack,
3
- StackProps,
4
4
  aws_iam,
5
5
  aws_kms,
6
6
  aws_lambda,
@@ -12,7 +12,7 @@
12
12
  "test:watch": "skuba test --watch"
13
13
  },
14
14
  "dependencies": {
15
- "@seek/logger": "^5.0.1",
15
+ "@seek/logger": "^6.0.0",
16
16
  "zod": "^3.19.1"
17
17
  },
18
18
  "devDependencies": {
@@ -25,6 +25,6 @@
25
25
  "skuba": "*"
26
26
  },
27
27
  "engines": {
28
- "node": ">=18"
28
+ "node": ">=18.12"
29
29
  }
30
30
  }
@@ -1,5 +1,5 @@
1
1
  import createLogger from '@seek/logger';
2
- import { SQSEvent, SQSHandler } from 'aws-lambda';
2
+ import type { SQSEvent, SQSHandler } from 'aws-lambda';
3
3
 
4
4
  const logger = createLogger({
5
5
  name: '<%- serviceName %>',
@@ -13,6 +13,7 @@ jobs:
13
13
  name: Publish & Deploy
14
14
  permissions:
15
15
  contents: write
16
+ id-token: write
16
17
  runs-on: ubuntu-latest
17
18
  steps:
18
19
  - name: Check out repo
@@ -1,25 +1,22 @@
1
1
  {
2
- "dependencies": {},
2
+ "name": "<%- moduleName %>",
3
+ "version": "0.0.0-semantically-released",
3
4
  "description": "<%- description %>",
4
- "devDependencies": {
5
- "@types/node": "^16.18.3",
6
- "commitizen": "^4.2.4",
7
- "skuba": "*"
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+ssh://git@github.com/<%- orgName %>/<%- repoName %>.git"
8
8
  },
9
+ "license": "MIT",
10
+ "sideEffects": false,
11
+ "main": "./lib-commonjs/index.js",
12
+ "module": "./lib-es2015/index.js",
13
+ "types": "./lib-types/index.d.ts",
9
14
  "files": [
10
15
  "lib*/**/*.d.ts",
11
16
  "lib*/**/*.js",
12
17
  "lib*/**/*.js.map",
13
18
  "lib*/**/*.json"
14
19
  ],
15
- "license": "MIT",
16
- "main": "./lib-commonjs/index.js",
17
- "module": "./lib-es2015/index.js",
18
- "name": "<%- moduleName %>",
19
- "repository": {
20
- "type": "git",
21
- "url": "git+ssh://git@github.com/<%- orgName %>/<%- repoName %>.git"
22
- },
23
20
  "scripts": {
24
21
  "build": "skuba build-package",
25
22
  "commit": "cz",
@@ -35,7 +32,16 @@
35
32
  "path": "cz-conventional-changelog"
36
33
  }
37
34
  },
38
- "sideEffects": false,
39
- "types": "./lib-types/index.d.ts",
40
- "version": "0.0.0-semantically-released"
35
+ "dependencies": {},
36
+ "devDependencies": {
37
+ "@types/node": "^16.18.3",
38
+ "commitizen": "^4.2.4",
39
+ "skuba": "*"
40
+ },
41
+ "engines": {
42
+ "node": ">=18.12"
43
+ },
44
+ "publishConfig": {
45
+ "provenance": true
46
+ }
41
47
  }
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "lib": ["ES2020"],
3
+ "lib": ["ES2022"],
4
4
  "outDir": "lib",
5
5
  "removeComments": false,
6
- "target": "ES2020"
6
+ "target": "ES2022"
7
7
  },
8
8
  "exclude": ["lib*/**/*"],
9
9
  "extends": "skuba/config/tsconfig.json"
@@ -1,25 +1,22 @@
1
1
  {
2
- "dependencies": {},
2
+ "name": "<%- moduleName %>",
3
+ "version": "0.0.0-semantically-released",
3
4
  "description": "<%- description %>",
4
- "devDependencies": {
5
- "@types/node": "^16.18.3",
6
- "commitizen": "^4.2.4",
7
- "skuba": "*"
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+ssh://git@github.com/<%- orgName %>/<%- repoName %>.git"
8
8
  },
9
+ "license": "UNLICENSED",
10
+ "sideEffects": false,
11
+ "main": "./lib-commonjs/index.js",
12
+ "module": "./lib-es2015/index.js",
13
+ "types": "./lib-types/index.d.ts",
9
14
  "files": [
10
15
  "lib*/**/*.d.ts",
11
16
  "lib*/**/*.js",
12
17
  "lib*/**/*.js.map",
13
18
  "lib*/**/*.json"
14
19
  ],
15
- "license": "UNLICENSED",
16
- "main": "./lib-commonjs/index.js",
17
- "module": "./lib-es2015/index.js",
18
- "name": "<%- moduleName %>",
19
- "repository": {
20
- "type": "git",
21
- "url": "git+ssh://git@github.com/<%- orgName %>/<%- repoName %>.git"
22
- },
23
20
  "scripts": {
24
21
  "build": "skuba build-package",
25
22
  "commit": "cz",
@@ -35,7 +32,13 @@
35
32
  "path": "cz-conventional-changelog"
36
33
  }
37
34
  },
38
- "sideEffects": false,
39
- "types": "./lib-types/index.d.ts",
40
- "version": "0.0.0-semantically-released"
35
+ "dependencies": {},
36
+ "devDependencies": {
37
+ "@types/node": "^16.18.3",
38
+ "commitizen": "^4.2.4",
39
+ "skuba": "*"
40
+ },
41
+ "engines": {
42
+ "node": ">=18.12"
43
+ }
41
44
  }
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "lib": ["ES2020"],
3
+ "lib": ["ES2022"],
4
4
  "outDir": "lib",
5
5
  "removeComments": false,
6
- "target": "ES2020"
6
+ "target": "ES2022"
7
7
  },
8
8
  "exclude": ["lib*/**/*"],
9
9
  "extends": "skuba/config/tsconfig.json"