Skip to content

Commit

Permalink
chore: init workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamorosi committed Jul 15, 2023
1 parent a57dc11 commit 339483c
Show file tree
Hide file tree
Showing 12 changed files with 199 additions and 1 deletion.
11 changes: 11 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"docs/snippets",
"layers",
"examples/cdk",
"examples/sam"
"examples/sam",
"packages/batch"
],
"scripts": {
"init-environment": "husky install",
Expand Down
28 changes: 28 additions & 0 deletions packages/batch/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
displayName: {
name: 'Powertools for AWS Lambda (TypeScript) utility: BATCH',
color: 'orange',
},
runner: 'groups',
preset: 'ts-jest',
transform: {
'^.+\\.ts?$': 'ts-jest',
},
moduleFileExtensions: ['js', 'ts'],
collectCoverageFrom: ['**/src/**/*.ts', '!**/node_modules/**'],
testMatch: ['**/?(*.)+(spec|test).ts'],
roots: ['<rootDir>/src', '<rootDir>/tests'],
testPathIgnorePatterns: ['/node_modules/'],
testEnvironment: 'node',
coveragePathIgnorePatterns: ['/node_modules/', '/types/'],
coverageThreshold: {
global: {
statements: 100,
branches: 100,
functions: 100,
lines: 100,
},
},
coverageReporters: ['json-summary', 'text', 'lcov'],
setupFiles: ['<rootDir>/tests/helpers/populateEnvironmentVariables.ts'],
};
53 changes: 53 additions & 0 deletions packages/batch/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "@aws-lambda-powertools/batch",
"version": "1.10.0",
"description": "The batch processing package for the Powertools for AWS Lambda (TypeScript) library.",
"author": {
"name": "Amazon Web Services",
"url": "https://aws.amazon.com"
},
"private": true,
"scripts": {
"test": "npm run test:unit",
"test:unit": "jest --group=unit --detectOpenHandles --coverage --verbose",
"test:e2e:nodejs14x": "echo 'Not Implemented'",
"test:e2e:nodejs16x": "echo 'Not Implemented'",
"test:e2e:nodejs18x": "echo 'Not Implemented'",
"test:e2e": "echo 'Not Implemented'",
"watch": "jest --watch",
"build": "tsc",
"lint": "eslint --ext .ts,.js --no-error-on-unmatched-pattern .",
"lint-fix": "eslint --fix --ext .ts,.js --no-error-on-unmatched-pattern .",
"prebuild": "rimraf ./lib",
"prepack": "node ../../.github/scripts/release_patch_package_json.js ."
},
"lint-staged": {
"*.ts": "npm run lint-fix",
"*.js": "npm run lint-fix"
},
"homepage": "https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/packages/batch#readme",
"license": "MIT-0",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"files": [
"lib"
],
"repository": {
"type": "git",
"url": "git+https://github.com/aws-powertools/powertools-lambda-typescript.git"
},
"bugs": {
"url": "https://github.com/aws-powertools/powertools-lambda-typescript/issues"
},
"dependencies": {},
"keywords": [
"aws",
"lambda",
"powertools",
"batch",
"batch-processing",
"serverless",
"nodejs"
],
"devDependencies": {}
}
3 changes: 3 additions & 0 deletions packages/batch/src/BatchProcessor.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class BatchProcessor {}

export { BatchProcessor };
1 change: 1 addition & 0 deletions packages/batch/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './BatchProcessor';
12 changes: 12 additions & 0 deletions packages/batch/tests/helpers/populateEnvironmentVariables.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Reserved variables
process.env._X_AMZN_TRACE_ID = '1-abcdef12-3456abcdef123456abcdef12';
process.env.AWS_LAMBDA_FUNCTION_NAME = 'my-lambda-function';
process.env.AWS_EXECUTION_ENV = 'nodejs18.x';
process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE = '128';
if (
process.env.AWS_REGION === undefined &&
process.env.CDK_DEFAULT_REGION === undefined
) {
process.env.AWS_REGION = 'eu-west-1';
}
process.env._HANDLER = 'index.handler';
26 changes: 26 additions & 0 deletions packages/batch/tests/unit/BatchProcessor.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Test BatchProcessor class
*
* @group unit/batch/class/batchprocessor
*/
import { BatchProcessor } from '../../src';

describe('Class: IdempotencyConfig', () => {
const ENVIRONMENT_VARIABLES = process.env;

beforeEach(() => {
jest.clearAllMocks();
jest.resetModules();
process.env = { ...ENVIRONMENT_VARIABLES };
});

afterAll(() => {
process.env = ENVIRONMENT_VARIABLES;
});

describe('remove me', () => {
test('does stuff', () => {
expect(BatchProcessor).toBeDefined();
});
});
});
11 changes: 11 additions & 0 deletions packages/batch/tsconfig-dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declarationMap": true,
"esModuleInterop": false
},
"include": [ "src/**/*", "examples/**/*", "**/tests/**/*" ],
"types": [
"jest"
]
}
11 changes: 11 additions & 0 deletions packages/batch/tsconfig.es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declarationMap": true,
"esModuleInterop": false
},
"include": [ "src/**/*", "examples/**/*", "**/tests/**/*" ],
"types": [
"jest"
]
}
29 changes: 29 additions & 0 deletions packages/batch/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"noImplicitAny": true,
"target": "ES2020",
"module": "commonjs",
"declaration": true,
"outDir": "lib",
"strict": true,
"inlineSourceMap": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"pretty": true,
"baseUrl": "src/",
"rootDirs": [ "src/" ],
"esModuleInterop": true
},
"include": [ "src/**/*" ],
"exclude": [ "./node_modules"],
"watchOptions": {
"watchFile": "useFsEvents",
"watchDirectory": "useFsEvents",
"fallbackPolling": "dynamicPriority"
},
"lib": [ "es2020" ],
"types": [
"node"
]
}
12 changes: 12 additions & 0 deletions packages/batch/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": [
"../../typedoc.base.json"
],
"entryPoints": [
"./src/index.ts",
"./src/types/index.ts",
"./src/middleware/index.ts",
"./src/persistence/index.ts"
],
"readme": "README.md"
}

0 comments on commit 339483c

Please sign in to comment.