Skip to content

Commit 247a6b4

Browse files
committed
chore: init workspace
1 parent 2eb7ab3 commit 247a6b4

12 files changed

+199
-1
lines changed

Diff for: package-lock.json

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"docs/snippets",
1313
"layers",
1414
"examples/cdk",
15-
"examples/sam"
15+
"examples/sam",
16+
"packages/batch"
1617
],
1718
"scripts": {
1819
"init-environment": "husky install",

Diff for: packages/batch/jest.config.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
displayName: {
3+
name: 'Powertools for AWS Lambda (TypeScript) utility: BATCH',
4+
color: 'orange',
5+
},
6+
runner: 'groups',
7+
preset: 'ts-jest',
8+
transform: {
9+
'^.+\\.ts?$': 'ts-jest',
10+
},
11+
moduleFileExtensions: ['js', 'ts'],
12+
collectCoverageFrom: ['**/src/**/*.ts', '!**/node_modules/**'],
13+
testMatch: ['**/?(*.)+(spec|test).ts'],
14+
roots: ['<rootDir>/src', '<rootDir>/tests'],
15+
testPathIgnorePatterns: ['/node_modules/'],
16+
testEnvironment: 'node',
17+
coveragePathIgnorePatterns: ['/node_modules/', '/types/'],
18+
coverageThreshold: {
19+
global: {
20+
statements: 100,
21+
branches: 100,
22+
functions: 100,
23+
lines: 100,
24+
},
25+
},
26+
coverageReporters: ['json-summary', 'text', 'lcov'],
27+
setupFiles: ['<rootDir>/tests/helpers/populateEnvironmentVariables.ts'],
28+
};

Diff for: packages/batch/package.json

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"name": "@aws-lambda-powertools/batch",
3+
"version": "1.10.0",
4+
"description": "The batch processing package for the Powertools for AWS Lambda (TypeScript) library.",
5+
"author": {
6+
"name": "Amazon Web Services",
7+
"url": "https://aws.amazon.com"
8+
},
9+
"private": true,
10+
"scripts": {
11+
"test": "npm run test:unit",
12+
"test:unit": "jest --group=unit --detectOpenHandles --coverage --verbose",
13+
"test:e2e:nodejs14x": "echo 'Not Implemented'",
14+
"test:e2e:nodejs16x": "echo 'Not Implemented'",
15+
"test:e2e:nodejs18x": "echo 'Not Implemented'",
16+
"test:e2e": "echo 'Not Implemented'",
17+
"watch": "jest --watch",
18+
"build": "tsc",
19+
"lint": "eslint --ext .ts,.js --no-error-on-unmatched-pattern .",
20+
"lint-fix": "eslint --fix --ext .ts,.js --no-error-on-unmatched-pattern .",
21+
"prebuild": "rimraf ./lib",
22+
"prepack": "node ../../.github/scripts/release_patch_package_json.js ."
23+
},
24+
"lint-staged": {
25+
"*.ts": "npm run lint-fix",
26+
"*.js": "npm run lint-fix"
27+
},
28+
"homepage": "https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/packages/batch#readme",
29+
"license": "MIT-0",
30+
"main": "./lib/index.js",
31+
"types": "./lib/index.d.ts",
32+
"files": [
33+
"lib"
34+
],
35+
"repository": {
36+
"type": "git",
37+
"url": "git+https://github.com/aws-powertools/powertools-lambda-typescript.git"
38+
},
39+
"bugs": {
40+
"url": "https://github.com/aws-powertools/powertools-lambda-typescript/issues"
41+
},
42+
"dependencies": {},
43+
"keywords": [
44+
"aws",
45+
"lambda",
46+
"powertools",
47+
"batch",
48+
"batch-processing",
49+
"serverless",
50+
"nodejs"
51+
],
52+
"devDependencies": {}
53+
}

Diff for: packages/batch/src/BatchProcessor.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class BatchProcessor {}
2+
3+
export { BatchProcessor };

Diff for: packages/batch/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './BatchProcessor';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Reserved variables
2+
process.env._X_AMZN_TRACE_ID = '1-abcdef12-3456abcdef123456abcdef12';
3+
process.env.AWS_LAMBDA_FUNCTION_NAME = 'my-lambda-function';
4+
process.env.AWS_EXECUTION_ENV = 'nodejs18.x';
5+
process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE = '128';
6+
if (
7+
process.env.AWS_REGION === undefined &&
8+
process.env.CDK_DEFAULT_REGION === undefined
9+
) {
10+
process.env.AWS_REGION = 'eu-west-1';
11+
}
12+
process.env._HANDLER = 'index.handler';

Diff for: packages/batch/tests/unit/BatchProcessor.test.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Test BatchProcessor class
3+
*
4+
* @group unit/batch/class/batchprocessor
5+
*/
6+
import { BatchProcessor } from '../../src';
7+
8+
describe('Class: IdempotencyConfig', () => {
9+
const ENVIRONMENT_VARIABLES = process.env;
10+
11+
beforeEach(() => {
12+
jest.clearAllMocks();
13+
jest.resetModules();
14+
process.env = { ...ENVIRONMENT_VARIABLES };
15+
});
16+
17+
afterAll(() => {
18+
process.env = ENVIRONMENT_VARIABLES;
19+
});
20+
21+
describe('remove me', () => {
22+
test('does stuff', () => {
23+
expect(BatchProcessor).toBeDefined();
24+
});
25+
});
26+
});

Diff for: packages/batch/tsconfig-dev.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"declarationMap": true,
5+
"esModuleInterop": false
6+
},
7+
"include": [ "src/**/*", "examples/**/*", "**/tests/**/*" ],
8+
"types": [
9+
"jest"
10+
]
11+
}

Diff for: packages/batch/tsconfig.es.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"declarationMap": true,
5+
"esModuleInterop": false
6+
},
7+
"include": [ "src/**/*", "examples/**/*", "**/tests/**/*" ],
8+
"types": [
9+
"jest"
10+
]
11+
}

Diff for: packages/batch/tsconfig.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"compilerOptions": {
3+
"experimentalDecorators": true,
4+
"noImplicitAny": true,
5+
"target": "ES2020",
6+
"module": "commonjs",
7+
"declaration": true,
8+
"outDir": "lib",
9+
"strict": true,
10+
"inlineSourceMap": true,
11+
"moduleResolution": "node",
12+
"resolveJsonModule": true,
13+
"pretty": true,
14+
"baseUrl": "src/",
15+
"rootDirs": [ "src/" ],
16+
"esModuleInterop": true
17+
},
18+
"include": [ "src/**/*" ],
19+
"exclude": [ "./node_modules"],
20+
"watchOptions": {
21+
"watchFile": "useFsEvents",
22+
"watchDirectory": "useFsEvents",
23+
"fallbackPolling": "dynamicPriority"
24+
},
25+
"lib": [ "es2020" ],
26+
"types": [
27+
"node"
28+
]
29+
}

Diff for: packages/batch/typedoc.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": [
3+
"../../typedoc.base.json"
4+
],
5+
"entryPoints": [
6+
"./src/index.ts",
7+
"./src/types/index.ts",
8+
"./src/middleware/index.ts",
9+
"./src/persistence/index.ts"
10+
],
11+
"readme": "README.md"
12+
}

0 commit comments

Comments
 (0)