skuba 12.1.0-hoist-less-20250722131939 → 12.1.0-main-20250812041011
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 -2
- package/config/tsconfig.json +3 -2
- package/lib/cli/build/assets.js +1 -1
- package/lib/cli/build/assets.js.map +2 -2
- package/lib/cli/build/tsc.d.ts +5 -1
- package/lib/cli/build/tsc.js +12 -0
- package/lib/cli/build/tsc.js.map +3 -3
- package/lib/cli/init/getConfig.js +1 -1
- package/lib/cli/init/getConfig.js.map +2 -2
- package/lib/cli/lint/internal.js +1 -1
- package/lib/cli/lint/internal.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.d.ts +2 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js +35 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.d.ts +4 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js +162 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js.map +2 -2
- package/lib/cli/node/index.js +8 -2
- package/lib/cli/node/index.js.map +2 -2
- package/lib/cli/start/index.js +8 -2
- package/lib/cli/start/index.js.map +2 -2
- package/lib/cli/test/index.d.ts +1 -1
- package/lib/cli/test/index.js +18 -4
- package/lib/cli/test/index.js.map +2 -2
- package/lib/utils/args.d.ts +2 -0
- package/lib/utils/args.js +5 -0
- package/lib/utils/args.js.map +2 -2
- package/package.json +16 -17
- package/template/base/_pnpm-workspace.yaml +1 -0
- package/template/base/jest.setup.ts +1 -1
- package/template/express-rest-api/.buildkite/pipeline.yml +6 -0
- package/template/express-rest-api/.env +1 -1
- package/template/express-rest-api/.gantry/dev.yml +5 -1
- package/template/express-rest-api/.gantry/prod.yml +5 -1
- package/template/express-rest-api/Dockerfile +1 -1
- package/template/express-rest-api/README.md +5 -5
- package/template/express-rest-api/gantry.apply.yml +17 -1
- package/template/express-rest-api/package.json +11 -5
- package/template/express-rest-api/src/api/healthCheck.ts +2 -2
- package/template/express-rest-api/src/config.ts +7 -7
- package/template/express-rest-api/src/framework/logging.ts +11 -7
- package/template/express-rest-api/src/framework/metrics.ts +1 -1
- package/template/express-rest-api/src/listen.ts +6 -0
- package/template/express-rest-api/src/tracing.ts +56 -0
- package/template/greeter/README.md +2 -2
- package/template/greeter/package.json +2 -2
- package/template/koa-rest-api/.buildkite/pipeline.yml +6 -0
- package/template/koa-rest-api/.env +1 -1
- package/template/koa-rest-api/.gantry/dev.yml +3 -3
- package/template/koa-rest-api/.gantry/prod.yml +3 -3
- package/template/koa-rest-api/README.md +6 -6
- package/template/koa-rest-api/gantry.apply.yml +15 -3
- package/template/koa-rest-api/package.json +9 -10
- package/template/koa-rest-api/src/api/healthCheck.ts +2 -2
- package/template/koa-rest-api/src/config.ts +7 -7
- package/template/koa-rest-api/src/framework/logging.ts +12 -8
- package/template/koa-rest-api/src/framework/metrics.ts +1 -1
- package/template/koa-rest-api/src/framework/server.test.ts +7 -8
- package/template/koa-rest-api/src/framework/server.ts +1 -4
- package/template/koa-rest-api/src/listen.ts +6 -0
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +6 -2
- package/template/lambda-sqs-worker-cdk/.env +1 -1
- package/template/lambda-sqs-worker-cdk/README.md +8 -8
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +50 -10
- package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +5 -8
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +15 -5
- package/template/lambda-sqs-worker-cdk/infra/config.ts +30 -18
- package/template/lambda-sqs-worker-cdk/infra/index.ts +1 -1
- package/template/lambda-sqs-worker-cdk/package.json +7 -7
- package/template/lambda-sqs-worker-cdk/src/app.test.ts +91 -51
- package/template/lambda-sqs-worker-cdk/src/app.ts +7 -9
- package/template/lambda-sqs-worker-cdk/src/config.ts +11 -16
- package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +10 -5
- package/template/lambda-sqs-worker-cdk/src/framework/handler.ts +44 -24
- package/template/lambda-sqs-worker-cdk/src/framework/logging.ts +23 -11
- package/template/lambda-sqs-worker-cdk/src/framework/metrics.ts +1 -4
- package/template/lambda-sqs-worker-cdk/src/testing/handler.ts +4 -1
- package/template/oss-npm-package/.github/workflows/release.yml +1 -1
- package/template/oss-npm-package/.github/workflows/validate.yml +1 -1
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { createDestination, createLogger } from '@seek/logger';
|
|
4
4
|
|
|
5
5
|
import { config } from 'src/config.js';
|
|
6
6
|
|
|
7
|
-
interface
|
|
7
|
+
interface LambdaContext {
|
|
8
8
|
awsRequestId: string;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
interface RecordContext {
|
|
12
|
+
sqsMessageId: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const lambdaContext = new AsyncLocalStorage<LambdaContext>();
|
|
16
|
+
export const recordContext = new AsyncLocalStorage<RecordContext>();
|
|
12
17
|
|
|
13
18
|
const { destination, stdoutMock } = createDestination({
|
|
14
|
-
mock: config.
|
|
19
|
+
mock: config.deployment === 'test' && {
|
|
15
20
|
redact: ['awsRequestId'],
|
|
16
21
|
},
|
|
17
22
|
});
|
|
@@ -20,19 +25,26 @@ export { stdoutMock };
|
|
|
20
25
|
|
|
21
26
|
export const logger = createLogger(
|
|
22
27
|
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
eeeoh: {
|
|
29
|
+
/**
|
|
30
|
+
* TODO: choose an appropriate Datadog log tier.
|
|
31
|
+
*
|
|
32
|
+
* https://github.com/seek-oss/logger/blob/master/docs/eeeoh.md#datadog-log-tiers
|
|
33
|
+
*/
|
|
34
|
+
datadog: 'tin',
|
|
35
|
+
team: '<%- teamName %>',
|
|
36
|
+
use: 'environment',
|
|
26
37
|
},
|
|
27
38
|
|
|
28
39
|
level: config.logLevel,
|
|
29
40
|
|
|
30
|
-
mixin: () => ({
|
|
31
|
-
|
|
32
|
-
|
|
41
|
+
mixin: () => ({
|
|
42
|
+
...lambdaContext.getStore(),
|
|
43
|
+
...recordContext.getStore(),
|
|
44
|
+
}),
|
|
33
45
|
|
|
34
46
|
transport:
|
|
35
|
-
config.
|
|
47
|
+
config.deployment === 'local' ? { target: 'pino-pretty' } : undefined,
|
|
36
48
|
},
|
|
37
49
|
destination,
|
|
38
50
|
);
|
|
@@ -7,8 +7,5 @@ const prefix = `${config.name}.`;
|
|
|
7
7
|
export const metricsClient = {
|
|
8
8
|
distribution: (
|
|
9
9
|
...[name, ...rest]: Parameters<typeof sendDistributionMetric>
|
|
10
|
-
) =>
|
|
11
|
-
config.metrics
|
|
12
|
-
? sendDistributionMetric(`${prefix}${name}`, ...rest)
|
|
13
|
-
: undefined,
|
|
10
|
+
) => sendDistributionMetric(`${prefix}${name}`, ...rest),
|
|
14
11
|
};
|