skuba 4.2.1-beta.0 → 4.3.0-beta.0
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/README.md +1 -1
- package/jest-preset.js +5 -1
- package/lib/api/git/index.d.ts +1 -0
- package/lib/api/git/index.js +3 -1
- package/lib/api/git/index.js.map +1 -1
- package/lib/api/git/pull.d.ts +35 -0
- package/lib/api/git/pull.js +34 -0
- package/lib/api/git/pull.js.map +1 -0
- package/lib/api/github/index.d.ts +1 -0
- package/lib/api/github/index.js +5 -1
- package/lib/api/github/index.js.map +1 -1
- package/lib/api/github/push.d.ts +62 -0
- package/lib/api/github/push.js +133 -0
- package/lib/api/github/push.js.map +1 -0
- package/lib/api/jest/index.d.ts +26 -11
- package/lib/cli/adapter/eslint.d.ts +2 -1
- package/lib/cli/adapter/eslint.js +5 -1
- package/lib/cli/adapter/eslint.js.map +1 -1
- package/lib/cli/configure/analysis/diff.d.ts +1 -1
- package/lib/cli/configure/analysis/package.d.ts +1 -1
- package/lib/cli/configure/processing/ignoreFile.d.ts +1 -1
- package/lib/cli/configure/processing/javascript.d.ts +1 -1
- package/lib/cli/configure/processing/json.d.ts +1 -1
- package/lib/cli/configure/processing/package.d.ts +11 -11
- package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
- package/lib/cli/lint/autofix.d.ts +7 -1
- package/lib/cli/lint/autofix.js +35 -18
- package/lib/cli/lint/autofix.js.map +1 -1
- package/lib/cli/lint/external.d.ts +1 -0
- package/lib/cli/lint/external.js +16 -16
- package/lib/cli/lint/external.js.map +1 -1
- package/lib/cli/test/reporters/github/annotations.js +19 -7
- package/lib/cli/test/reporters/github/annotations.js.map +1 -1
- package/lib/cli/test/reporters/github/index.d.ts +2 -2
- package/lib/cli/test/reporters/github/index.js +11 -1
- package/lib/cli/test/reporters/github/index.js.map +1 -1
- package/lib/utils/args.js +1 -1
- package/lib/utils/args.js.map +1 -1
- package/lib/utils/error.d.ts +14 -0
- package/lib/utils/error.js +14 -1
- package/lib/utils/error.js.map +1 -1
- package/lib/utils/version.js +3 -4
- package/lib/utils/version.js.map +1 -1
- package/lib/utils/wait.d.ts +17 -0
- package/lib/utils/wait.js +32 -0
- package/lib/utils/wait.js.map +1 -0
- package/lib/wrapper/http.d.ts +1 -1
- package/package.json +23 -20
- package/template/express-rest-api/.buildkite/pipeline.yml +5 -4
- package/template/express-rest-api/package.json +1 -1
- package/template/greeter/.buildkite/pipeline.yml +2 -1
- package/template/koa-rest-api/.buildkite/pipeline.yml +5 -4
- package/template/koa-rest-api/package.json +6 -6
- package/template/koa-rest-api/src/api/jobs/getJobs.ts +2 -2
- package/template/koa-rest-api/src/api/jobs/postJob.ts +2 -2
- package/template/koa-rest-api/src/framework/logging.ts +8 -5
- package/template/koa-rest-api/src/framework/metrics.ts +2 -2
- package/template/koa-rest-api/src/framework/server.test.ts +21 -21
- package/template/koa-rest-api/src/framework/server.ts +4 -3
- package/template/koa-rest-api/src/listen.ts +2 -2
- package/template/koa-rest-api/src/testing/logging.ts +5 -20
- package/template/lambda-sqs-worker/.buildkite/pipeline.yml +2 -1
- package/template/lambda-sqs-worker/.nvmrc +1 -1
- package/template/lambda-sqs-worker/Dockerfile +1 -1
- package/template/lambda-sqs-worker/package.json +5 -5
- package/template/lambda-sqs-worker/serverless.yml +2 -2
- package/template/lambda-sqs-worker/src/app.test.ts +9 -9
- package/template/lambda-sqs-worker/src/app.ts +2 -1
- package/template/lambda-sqs-worker/src/framework/handler.test.ts +10 -10
- package/template/lambda-sqs-worker/src/framework/handler.ts +14 -17
- package/template/lambda-sqs-worker/src/framework/logging.ts +11 -6
- package/template/lambda-sqs-worker/src/testing/logging.ts +7 -5
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -1
- package/template/lambda-sqs-worker-cdk/.nvmrc +1 -1
- package/template/lambda-sqs-worker-cdk/Dockerfile +1 -1
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +2 -2
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +1 -1
- package/template/lambda-sqs-worker-cdk/package.json +9 -11
- package/template/private-npm-package/.buildkite/pipeline.yml +1 -1
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from 'async_hooks';
|
|
2
|
+
|
|
1
3
|
import createLogger from '@seek/logger';
|
|
2
|
-
import { Context } from 'aws-lambda';
|
|
3
4
|
|
|
4
5
|
import { config } from 'src/config';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
interface LoggerContext {
|
|
8
|
+
awsRequestId: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const loggerContext = new AsyncLocalStorage<LoggerContext>();
|
|
12
|
+
|
|
13
|
+
export const logger = createLogger({
|
|
7
14
|
base: {
|
|
8
15
|
environment: config.environment,
|
|
9
16
|
version: config.version,
|
|
@@ -11,12 +18,10 @@ export const rootLogger = createLogger({
|
|
|
11
18
|
|
|
12
19
|
level: config.logLevel,
|
|
13
20
|
|
|
21
|
+
mixin: () => ({ ...loggerContext.getStore() }),
|
|
22
|
+
|
|
14
23
|
name: config.name,
|
|
15
24
|
|
|
16
25
|
transport:
|
|
17
26
|
config.environment === 'local' ? { target: 'pino-pretty' } : undefined,
|
|
18
27
|
});
|
|
19
|
-
|
|
20
|
-
/* istanbul ignore next: @seek/logger interface */
|
|
21
|
-
export const contextLogger = ({ awsRequestId }: Context) =>
|
|
22
|
-
rootLogger.child({ awsRequestId });
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import * as logging from 'src/framework/logging';
|
|
2
2
|
|
|
3
|
-
export const
|
|
3
|
+
export const logger = {
|
|
4
4
|
error: jest.fn(),
|
|
5
5
|
info: jest.fn(),
|
|
6
6
|
|
|
7
7
|
clear: () => {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
logger.error.mockClear();
|
|
9
|
+
logger.info.mockClear();
|
|
10
10
|
},
|
|
11
11
|
|
|
12
|
-
spy: () =>
|
|
13
|
-
jest.spyOn(logging, '
|
|
12
|
+
spy: () => {
|
|
13
|
+
jest.spyOn(logging.logger, 'error').mockImplementation(logger.error);
|
|
14
|
+
jest.spyOn(logging.logger, 'info').mockImplementation(logger.info);
|
|
15
|
+
},
|
|
14
16
|
};
|
|
@@ -9,7 +9,7 @@ configs:
|
|
|
9
9
|
NPM_READ_TOKEN: arn:aws:secretsmanager:ap-southeast-2:987872074697:secret:npm/npm-read-token
|
|
10
10
|
|
|
11
11
|
- &docker-ecr-cache
|
|
12
|
-
seek-oss/docker-ecr-cache#
|
|
12
|
+
seek-oss/docker-ecr-cache#v2.0.0:
|
|
13
13
|
cache-on:
|
|
14
14
|
- package.json
|
|
15
15
|
- yarn.lock
|
|
@@ -59,6 +59,7 @@ steps:
|
|
|
59
59
|
- *docker-ecr-cache
|
|
60
60
|
- docker-compose#v3.9.0:
|
|
61
61
|
run: app
|
|
62
|
+
timeout_in_minutes: 10
|
|
62
63
|
|
|
63
64
|
- agents:
|
|
64
65
|
queue: <%- devBuildkiteQueueName %>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
16
|
|
@@ -174,7 +174,7 @@ Object {
|
|
|
174
174
|
"Arn",
|
|
175
175
|
],
|
|
176
176
|
},
|
|
177
|
-
"Runtime": "
|
|
177
|
+
"Runtime": "nodejs16.x",
|
|
178
178
|
},
|
|
179
179
|
"Type": "AWS::Lambda::Function",
|
|
180
180
|
},
|
|
@@ -530,7 +530,7 @@ Object {
|
|
|
530
530
|
"Arn",
|
|
531
531
|
],
|
|
532
532
|
},
|
|
533
|
-
"Runtime": "
|
|
533
|
+
"Runtime": "nodejs16.x",
|
|
534
534
|
},
|
|
535
535
|
"Type": "AWS::Lambda::Function",
|
|
536
536
|
},
|
|
@@ -52,7 +52,7 @@ export class AppStack extends Stack {
|
|
|
52
52
|
|
|
53
53
|
const worker = new aws_lambda.Function(this, 'worker', {
|
|
54
54
|
code: new aws_lambda.AssetCode('./lib'),
|
|
55
|
-
runtime: aws_lambda.Runtime.
|
|
55
|
+
runtime: aws_lambda.Runtime.NODEJS_16_X,
|
|
56
56
|
handler: 'app.handler',
|
|
57
57
|
functionName: '<%- serviceName %>',
|
|
58
58
|
environmentEncryption: kmsKey,
|
|
@@ -4,12 +4,16 @@
|
|
|
4
4
|
"runtypes": "^6.3.2"
|
|
5
5
|
},
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"@aws-cdk/assert": "^2.
|
|
7
|
+
"@aws-cdk/assert": "^2.24.0",
|
|
8
8
|
"@types/aws-lambda": "^8.10.82",
|
|
9
|
-
"@types/node": "^
|
|
10
|
-
"aws-cdk": "^2.
|
|
11
|
-
"aws-cdk-lib": "^2.
|
|
12
|
-
"constructs": "^10.0.17"
|
|
9
|
+
"@types/node": "^16.0.0",
|
|
10
|
+
"aws-cdk": "^2.24.0",
|
|
11
|
+
"aws-cdk-lib": "^2.24.0",
|
|
12
|
+
"constructs": "^10.0.17",
|
|
13
|
+
"skuba": "*"
|
|
14
|
+
},
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=16"
|
|
13
17
|
},
|
|
14
18
|
"license": "UNLICENSED",
|
|
15
19
|
"private": true,
|
|
@@ -22,11 +26,5 @@
|
|
|
22
26
|
"test": "skuba test",
|
|
23
27
|
"test:ci": "skuba test --coverage",
|
|
24
28
|
"test:watch": "skuba test --watch"
|
|
25
|
-
},
|
|
26
|
-
"skuba": {
|
|
27
|
-
"entryPoint": "src/app.ts#handler",
|
|
28
|
-
"template": "lambda-sqs-worker-cdk",
|
|
29
|
-
"type": "application",
|
|
30
|
-
"version": "3.16.2"
|
|
31
29
|
}
|
|
32
30
|
}
|