Skip to content

Commit d4310a7

Browse files
committed
Improve build
1 parent 7c6231d commit d4310a7

File tree

7 files changed

+33
-13
lines changed

7 files changed

+33
-13
lines changed

.github/workflows/CI.yml

+18-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@ on:
77
pull_request:
88

99
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- uses: actions/setup-node@v2
17+
with:
18+
node-version: '12'
19+
cache: 'yarn'
20+
21+
- name: Install dependencies
22+
run: yarn install --frozen-lockfile --check-files
23+
24+
- name: Build
25+
run: yarn build
26+
1027
test:
1128
runs-on: ubuntu-latest
1229
env:
@@ -26,7 +43,7 @@ jobs:
2643

2744
- uses: actions/setup-node@v2
2845
with:
29-
node-version: '14'
46+
node-version: '12'
3047
cache: 'yarn'
3148

3249
- name: Install dependencies

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# DealMore Sammy
1+
# Sammy
22

33
A Node.js wrapper for [AWS SAM CLI](https://aws.amazon.com/serverless/sam/) for local testing of Lambda functions.
44

@@ -40,7 +40,7 @@ import { generateAPISAM } from '@dealmore/sammy';
4040
const lambdaSAM = await generateAPISAM({
4141
lambdas: {
4242
first: {
43-
filename: 'first.zip',
43+
filename: 'lambda.zip',
4444
handler: 'handler.handler',
4545
runtime: 'nodejs14.x',
4646
route: '/test',

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"url": "https://github.com/dealmore/sammy.git"
99
},
1010
"scripts": {
11-
"build": "tsc",
11+
"build": "tsc --project tsconfig.build.json",
1212
"test": "jest",
1313
"lint:prettier": "prettier --check .",
1414
"fix:prettier": "prettier --write ."
@@ -23,6 +23,7 @@
2323
"yaml": "^1.10.0"
2424
},
2525
"devDependencies": {
26+
"@tsconfig/node12": "^1.0.9",
2627
"@types/archiver": "^5.1.1",
2728
"@types/aws-lambda": "^8.10.71",
2829
"@types/jest": "^27.0.1",

test/event.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jest.setTimeout(120_000);
1313
describe('integration:Event', () => {
1414
describe('single lambda', () => {
1515
const functionName = 'first';
16-
const route = '/test';
1716
let lambdaSAM: LocalSAMGenerator;
1817
let tmpdir: string;
1918

tsconfig.build.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"include": ["lib/**/*"]
4+
}

tsconfig.json

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
{
2+
"extends": "@tsconfig/node12/tsconfig.json",
23
"compilerOptions": {
3-
"target": "es2019",
4-
"lib": ["es2019"],
54
"outDir": "dist",
6-
"module": "commonjs",
7-
"moduleResolution": "node",
8-
"strict": true,
9-
"declaration": true,
10-
"sourceMap": false,
11-
"esModuleInterop": true
5+
"declaration": true
126
},
137
"include": ["lib/**/*", "test/**/*"]
148
}

yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,11 @@
506506
resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82"
507507
integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==
508508

509+
"@tsconfig/node12@^1.0.9":
510+
version "1.0.9"
511+
resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.9.tgz#62c1f6dee2ebd9aead80dc3afa56810e58e1a04c"
512+
integrity sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==
513+
509514
"@types/archiver@^5.1.1":
510515
version "5.1.1"
511516
resolved "https://registry.yarnpkg.com/@types/archiver/-/archiver-5.1.1.tgz#d6d7610de4386b293abd5c1cb1875e0a4f4e1c30"

0 commit comments

Comments
 (0)