Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,18 @@ jobs:
- 8000:8000
strategy:
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [20.x, 22.x, 24.x]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Cache Npm
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}

- name: Install
run: npm install

Expand All @@ -51,10 +43,17 @@ jobs:
- name: Run Jest Tests
run: npm run test:ci
env:
AWS_ACCESS_KEY_ID: ${{ matrix.node-version }}
AWS_SECRET_ACCESS_KEY: ${{ matrix.node-version }}
AWS_DEFAULT_REGION: "us-east-1"
CODECOV_TOKEN: ${{ matrix.node-version == '16.x' && secrets.CODECOV_TOKEN || '' }}
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: 'us-east-1'

- name: Upload coverage to Codecov
if: matrix.node-version == '24.x'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage/lcov.info
fail_ci_if_error: false

- name: Publish Unit Test Results
uses: mikepenz/action-junit-report@v3
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: "3.8"
version: '3.8'
services:
dynamodb-local:
command: "-jar DynamoDBLocal.jar -inMemory -sharedDb"
image: "amazon/dynamodb-local:latest"
command: '-jar DynamoDBLocal.jar -inMemory -sharedDb'
image: 'amazon/dynamodb-local:latest'
ports:
- "8000:8000"
- '8000:8000'
working_dir: /home/dynamodblocal
6 changes: 2 additions & 4 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ export default {
testEnvironment: 'node',
reporters: ['default', 'jest-junit'],
testPathIgnorePatterns: ['^.+\\.js$'],
globals: {
'ts-jest': {
isolatedModules: true,
},
transform: {
'^.+\\.ts$': ['ts-jest'],
},
};
6 changes: 3 additions & 3 deletions lib/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export async function deleteSingleItem<
T,
PK extends Keys<T>,
SK extends Keys<T>,
U = Pick<T, PK | SK> & Partial<T>,
U extends Partial<T> = Pick<T, PK | SK> & Partial<T>,
>(
facet: Facet<T, PK, SK>,
record: U,
Expand Down Expand Up @@ -100,7 +100,7 @@ export async function deleteItems<
T,
PK extends Keys<T>,
SK extends Keys<T>,
U = Pick<T, PK | SK> & Partial<T>,
U extends Partial<T> = Pick<T, PK | SK> & Partial<T>,
>(facet: Facet<T, PK, SK>, records: U[]): Promise<DeleteResponse<U>> {
const recordsToBatch: U[] = [...records];
const deleteResponse: DeleteResponse<U> = {
Expand Down Expand Up @@ -153,7 +153,7 @@ async function deleteBatch<
T,
PK extends Keys<T>,
SK extends Keys<T>,
U = Pick<T, PK | SK> & Partial<T>,
U extends Partial<T> = Pick<T, PK | SK> & Partial<T>,
>(facet: Facet<T, PK, SK>, batchToDelete: U[]): Promise<DeleteResponse<U>> {
const deleteRequests: Record<string, WriteRequest> = {};
const deleteResponse: DeleteResponse<U> = {
Expand Down
42 changes: 20 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"main": "index.js",
"scripts": {
"test": "jest --runInBand --silent --coverage",
"test:ci": "jest --ci --runInBand --silent --coverage && codecov",
"test:ci": "jest --ci --runInBand --silent --coverage",
"build:clean": "tsc -b --clean",
"build": "tsc -b --clean && tsc -b",
"prepublishOnly": "npm run build"
},
"engines": {
"node": ">=12.4.0"
"node": ">=20.0.0"
},
"keywords": [
"DynamoDB"
Expand All @@ -33,32 +33,30 @@
},
"homepage": "https://github.com/faceteer/facet#readme",
"devDependencies": {
"@aws-sdk/client-dynamodb": ">=3.0.0 <=3.193.0",
"@types/jest": "^27.0.1",
"@types/node": "^15.6.1",
"@typescript-eslint/eslint-plugin": "^4.26.0",
"@typescript-eslint/parser": "^4.26.0",
"codecov": "^3.8.2",
"eslint": "^7.27.0",
"@aws-sdk/client-dynamodb": ">=3.0.0 <=3.859.0",
"@types/jest": "^29.0.0",
"@types/node": "^20.0.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.0.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-standard": "^16.0.1",
"eslint-config-prettier": "^9.0.0",
"eslint-config-standard": "^17.0.0",
"eslint-import-resolver-node": "^0.3.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^5.0.0",
"jest": "^27.0.6",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-promise": "^6.0.0",
"jest": "^29.0.0",
"jest-junit": "^12.2.0",
"prettier": "^2.3.0",
"ts-jest": "^27.0.5",
"prettier": "^3.0.0",
"ts-jest": "^29.0.0",
"ts-node": "^10.1.0",
"typedoc": "^0.22.10",
"typescript": "~4.3.2"
"typedoc": "^0.25.0",
"typescript": "^5.0.0"
},
"peerDependencies": {
"@aws-sdk/client-dynamodb": ">=3.0.0 <=3.193.0"
"@aws-sdk/client-dynamodb": ">=3.0.0 <=3.859.0"
},
"dependencies": {
"@faceteer/converter": "^2.0.3",
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"lib": ["ES2020"],
"target": "ES2019",
"lib": ["ES2022"],
"target": "ES2022",
"module": "CommonJS",
"moduleResolution": "node",
"noUnusedLocals": true,
Expand Down