Skip to content

Commit 64a352d

Browse files
committed
Build scripts
1 parent 7537bf3 commit 64a352d

File tree

7 files changed

+1072
-1051
lines changed

7 files changed

+1072
-1051
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Build - CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Use Node.js 16
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: 16
22+
23+
- name: Cache Node Modules
24+
id: cache-node-modules
25+
uses: actions/cache@v3
26+
with:
27+
path: |
28+
node_modules
29+
packages/**/node_modules
30+
!node_modules/.cache
31+
key: node-modules-${{ hashFiles('package.json', 'yarn.lock', 'patches/*') }}
32+
33+
- name: Install Modules
34+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
35+
run: yarn install --frozen-lockfile
36+
37+
- name: Build
38+
run: npm run build
39+
40+
- name: Lint
41+
run: npm run lint
42+
43+
- name: Test
44+
run: npm run test

.github/workflows/publish.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Package and Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v3
13+
14+
- name: Use Node.js 16
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: 16
18+
19+
- name: Use the Release Tag Version
20+
run: |
21+
npm version from-git --allow-same-version --no-git-tag-version
22+
23+
- name: Cache Node Modules
24+
id: cache-node-modules
25+
uses: actions/cache@v3
26+
with:
27+
path: |
28+
node_modules
29+
packages/**/node_modules
30+
!node_modules/.cache
31+
key: node-modules-${{ hashFiles('package.json', 'yarn.lock', 'patches/*') }}
32+
33+
- name: Install Modules
34+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
35+
run: yarn install --frozen-lockfile
36+
37+
- name: Build
38+
run: npm run build
39+
40+
- name: Lint
41+
run: npm run lint
42+
43+
- name: Test
44+
run: npm run test
45+
46+
- name: NPM registry authentication
47+
run: npm set //registry.npmjs.org/:_authToken ${{ secrets.NPMJSORG_PUBLISH_TOKEN }}
48+
49+
- name: Publish with CLI to Code Artifact
50+
run: |
51+
npm publish --access public --ignore-scripts --dry-run

package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
},
1010
"private": true,
1111
"scripts": {
12+
"build": "tsc --build",
13+
"lint": "eslint ./ --ext .ts --ext .tsx",
14+
"lint-and-fix": "eslint ./ --ext .ts --ext .tsx --fix",
1215
"test": "AWS_EMF_ENVIRONMENT=Local jest"
1316
},
1417
"repository": {
@@ -20,26 +23,26 @@
2023
"node": ">= 12.0.0"
2124
},
2225
"devDependencies": {
23-
"@types/jest": "^27.0.0",
26+
"@types/jest": "29.5.2",
2427
"@types/node": "^12.13.0",
2528
"@typescript-eslint/eslint-plugin": "^4.9.0",
2629
"@typescript-eslint/parser": "^4.9.0",
2730
"aws-sdk-client-mock": "^0.6.2",
28-
"esbuild": "^0.14.39",
31+
"esbuild": "0.18.0",
2932
"eslint": "^7.15.0",
3033
"eslint-config-prettier": "^7.0.0",
3134
"eslint-import-resolver-node": "^0.3.6",
3235
"eslint-import-resolver-typescript": "^2.5.0",
3336
"eslint-plugin-import": "^2.25.3",
3437
"eslint-plugin-prettier": "^3.2.0",
3538
"husky": "^4.2.5",
36-
"jest": "^27.0.0",
37-
"jest-dynalite": "^3.4.4",
39+
"jest": "29.5.0",
40+
"jest-dynalite": "3.6.1",
3841
"lint-staged": "^10.2.11",
39-
"prettier": "^2.6.2",
42+
"prettier": "2.8.8",
4043
"start-server-and-test": "^1.14.0",
41-
"ts-jest": "^27.0.0",
42-
"ts-node": "^10.7.0",
44+
"ts-jest": "29.1.0",
45+
"ts-node": "10.9.1",
4346
"typescript": "^4.6.0"
4447
},
4548
"author": "PwrDrvr LLC",

packages/connect-dynamodb-v3/src/lib/dynamodb-store.mock.spec.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1+
/* eslint-disable no-console */
12
import * as dynamodb from '@aws-sdk/client-dynamodb';
2-
import {
3-
DynamoDBDocumentClient,
4-
GetCommand,
5-
PutCommand,
6-
UpdateCommand,
7-
} from '@aws-sdk/lib-dynamodb';
3+
import { DynamoDBDocumentClient, GetCommand } from '@aws-sdk/lib-dynamodb';
84
import { mockClient, AwsClientStub } from 'aws-sdk-client-mock';
95
import { DynamoDBStore } from './dynamodb-store';
106

packages/connect-dynamodb-v3/src/lib/dynamodb-store.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
DescribeTableCommand,
77
UpdateTimeToLiveCommand,
88
} from '@aws-sdk/client-dynamodb';
9-
import { DynamoDBDocument, GetCommand, PutCommand, UpdateCommand } from '@aws-sdk/lib-dynamodb';
9+
import { DynamoDBDocument } from '@aws-sdk/lib-dynamodb';
1010
import Debug from 'debug';
1111
import { promisify } from 'util';
1212

@@ -309,7 +309,7 @@ export class DynamoDBStore extends session.Store {
309309
return store;
310310
}
311311

312-
public get(sid: string, callback: (err: any, session?: session.SessionData) => void): void {
312+
public get(sid: string, callback: (err: unknown, session?: session.SessionData) => void): void {
313313
void (async () => {
314314
try {
315315
const { Item } = await this._ddbDocClient.get({
@@ -335,7 +335,7 @@ export class DynamoDBStore extends session.Store {
335335
})();
336336
}
337337

338-
public set(sid: string, session: session.SessionData, callback?: (err?: any) => void): void {
338+
public set(sid: string, session: session.SessionData, callback?: (err?: unknown) => void): void {
339339
void (async () => {
340340
try {
341341
await this._ddbDocClient.put({
@@ -353,11 +353,19 @@ export class DynamoDBStore extends session.Store {
353353
})();
354354
}
355355

356-
public touch(sid: string, session: session.SessionData, callback?: (err?: any) => void): void {
356+
public touch(
357+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
358+
sid: string,
359+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
360+
session: session.SessionData,
361+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
362+
callback?: (err?: unknown) => void,
363+
): void {
357364
throw new Error('Method not implemented.');
358365
}
359366

360-
public destroy(sid: string, callback?: (err?: any) => void): void {
367+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
368+
public destroy(sid: string, callback?: (err?: unknown) => void): void {
361369
throw new Error('Method not implemented.');
362370
}
363371
}

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"files": [],
33
"references": [
44
{
5-
"path": "packages/dynamodb-connect-v3/"
5+
"path": "packages/connect-dynamodb-v3/"
66
},
77
]
88
}

0 commit comments

Comments
 (0)