Skip to content

Commit 0e0b497

Browse files
committed
chore: format example app
1 parent 09064fd commit 0e0b497

File tree

8 files changed

+51
-65
lines changed

8 files changed

+51
-65
lines changed

examples/app/functions/commons/powertools/logger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { Logger } from '@aws-lambda-powertools/logger';
21
import { PT_VERSION as version } from '@aws-lambda-powertools/commons';
3-
import { serviceName, defaultValues } from './constants.js';
2+
import { Logger } from '@aws-lambda-powertools/logger';
3+
import { defaultValues, serviceName } from './constants.js';
44

55
/**
66
* Create logger instance with centralized configuration so that

examples/app/functions/commons/powertools/metrics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Metrics } from '@aws-lambda-powertools/metrics';
2-
import { serviceName, metricsNamespace, defaultValues } from './constants.js';
2+
import { defaultValues, metricsNamespace, serviceName } from './constants.js';
33

44
/**
55
* Create metrics instance with centralized configuration so that

examples/app/functions/get-all-items.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import { scanItemsDynamoDB } from '#helpers/scan-items';
2-
import { assertIsError } from '#helpers/utils';
3-
import { logger, metrics, tracer } from '#powertools';
41
import { injectLambdaContext } from '@aws-lambda-powertools/logger/middleware';
52
import { logMetrics } from '@aws-lambda-powertools/metrics/middleware';
63
import { captureLambdaHandler } from '@aws-lambda-powertools/tracer/middleware';
@@ -10,6 +7,9 @@ import type {
107
APIGatewayProxyResult,
118
Context,
129
} from 'aws-lambda';
10+
import { scanItemsDynamoDB } from '#helpers/scan-items';
11+
import { assertIsError } from '#helpers/utils';
12+
import { logger, metrics, tracer } from '#powertools';
1313

1414
/*
1515
*

examples/app/functions/get-by-id.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { ItemNotFound } from '#errors';
2-
import { getItemDynamoDB } from '#helpers/get-item';
3-
import { assertIsError } from '#helpers/utils';
4-
import { logger, metrics, tracer } from '#powertools';
51
import type { LambdaInterface } from '@aws-lambda-powertools/commons/types';
62
import type {
73
APIGatewayProxyEvent,
84
APIGatewayProxyResult,
95
Context,
106
} from 'aws-lambda';
7+
import { ItemNotFound } from '#errors';
8+
import { getItemDynamoDB } from '#helpers/get-item';
9+
import { assertIsError } from '#helpers/utils';
10+
import { logger, metrics, tracer } from '#powertools';
1111

1212
/*
1313
*

examples/app/functions/process-items-stream.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import { assertIsError } from '#helpers/utils';
2-
import { logger } from '#powertools/logger';
3-
import { tracer } from '#powertools/tracer';
1+
import { equal } from 'node:assert/strict';
42
import {
53
BatchProcessor,
64
EventType,
@@ -14,7 +12,9 @@ import type {
1412
DynamoDBRecord,
1513
DynamoDBStreamEvent,
1614
} from 'aws-lambda';
17-
import { equal } from 'node:assert/strict';
15+
import { assertIsError } from '#helpers/utils';
16+
import { logger } from '#powertools/logger';
17+
import { tracer } from '#powertools/tracer';
1818

1919
const processor = new BatchProcessor(EventType.DynamoDBStreams);
2020

examples/app/functions/put-item.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
import { ddbClient } from '#clients/dynamodb';
2-
import { getSSMStringParameter } from '#helpers/get-string-param';
3-
import { putItemInDynamoDB } from '#helpers/put-item';
4-
import { assertIsError, getStringFromEnv } from '#helpers/utils';
5-
import { logger, metrics, tracer } from '#powertools';
61
import {
72
IdempotencyConfig,
83
makeIdempotent,
@@ -15,6 +10,11 @@ import type {
1510
Context,
1611
} from 'aws-lambda';
1712
import type { Subsegment } from 'aws-xray-sdk-core';
13+
import { ddbClient } from '#clients/dynamodb';
14+
import { getSSMStringParameter } from '#helpers/get-string-param';
15+
import { putItemInDynamoDB } from '#helpers/put-item';
16+
import { assertIsError, getStringFromEnv } from '#helpers/utils';
17+
import { logger, metrics, tracer } from '#powertools';
1818

1919
// Initialize the persistence store for idempotency
2020
const ssmParameterName = getStringFromEnv('SSM_PARAMETER_NAME');

examples/app/tests/tsconfig.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,5 @@
44
"rootDir": "../",
55
"noEmit": true
66
},
7-
"include": [
8-
"../src/**/*",
9-
"./**/*",
10-
]
11-
}
7+
"include": ["../src/**/*", "./**/*"]
8+
}

examples/app/tsconfig.json

Lines changed: 30 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,31 @@
11
{
2-
"$schema": "https://json.schemastore.org/tsconfig",
3-
"compilerOptions": {
4-
"esModuleInterop": true,
5-
"skipLibCheck": true,
6-
"target": "es2022",
7-
"moduleDetection": "force",
8-
"isolatedModules": true,
9-
"strict": true,
10-
"noUncheckedIndexedAccess": true,
11-
"moduleResolution": "NodeNext",
12-
"module": "NodeNext",
13-
"outDir": "lib/esm",
14-
"sourceMap": true,
15-
"experimentalDecorators": true,
16-
"declaration": true,
17-
"declarationMap": true,
18-
"removeComments": false,
19-
"pretty": true,
20-
"lib": [
21-
"ES2022"
22-
],
23-
"rootDir": "."
24-
},
25-
"include": [
26-
"functions/**/*",
27-
"cdk/**/*",
28-
"test/**/*",
29-
"bin/**/*",
30-
],
31-
"exclude": [
32-
"./node_modules"
33-
],
34-
"watchOptions": {
35-
"watchFile": "useFsEvents",
36-
"watchDirectory": "useFsEvents",
37-
"fallbackPolling": "dynamicPriority"
38-
},
39-
"types": [
40-
"node"
41-
]
42-
}
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"compilerOptions": {
4+
"esModuleInterop": true,
5+
"skipLibCheck": true,
6+
"target": "es2022",
7+
"moduleDetection": "force",
8+
"isolatedModules": true,
9+
"strict": true,
10+
"noUncheckedIndexedAccess": true,
11+
"moduleResolution": "NodeNext",
12+
"module": "NodeNext",
13+
"outDir": "lib/esm",
14+
"sourceMap": true,
15+
"experimentalDecorators": true,
16+
"declaration": true,
17+
"declarationMap": true,
18+
"removeComments": false,
19+
"pretty": true,
20+
"lib": ["ES2022"],
21+
"rootDir": "."
22+
},
23+
"include": ["functions/**/*", "cdk/**/*", "test/**/*", "bin/**/*"],
24+
"exclude": ["./node_modules"],
25+
"watchOptions": {
26+
"watchFile": "useFsEvents",
27+
"watchDirectory": "useFsEvents",
28+
"fallbackPolling": "dynamicPriority"
29+
},
30+
"types": ["node"]
31+
}

0 commit comments

Comments
 (0)