Skip to content

Commit f498a4d

Browse files
authored
add support for node 18 (#118)
1 parent 69b88d4 commit f498a4d

File tree

5 files changed

+2002
-36
lines changed

5 files changed

+2002
-36
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- '**'
1212

1313
env:
14-
PRIMARY_NODE_VERSION: 16.x
14+
PRIMARY_NODE_VERSION: 18.x
1515
PRIMARY_OS: ubuntu-latest
1616
REGISTRY: https://registry.npmjs.org/
1717

@@ -22,7 +22,7 @@ jobs:
2222
strategy:
2323
matrix:
2424
os: [ubuntu-latest, macos-latest, windows-latest]
25-
node-version: [6.x, 8.x, 10.x, 12.x, 14.x, 16.x]
25+
node-version: [6.x, 8.x, 10.x, 12.x, 14.x, 16.x, 18.x]
2626

2727
steps:
2828

@@ -44,23 +44,24 @@ jobs:
4444
uses: actions/setup-node@v2
4545
with:
4646
node-version: ${{ matrix.node-version }}
47-
- name: Get npm cache directory
48-
id: npm-cache-dir
47+
48+
- name: Get yarn cache directory
49+
id: yarn-cache-dir
4950
run: |
50-
echo "::set-output name=dir::$(npm config get cache)"
51+
echo "::set-output name=dir::$(yarn cache dir)"
5152
5253
- uses: actions/cache@v2
53-
id: npm-cache
54+
id: yarn-cache
5455
with:
55-
path: ${{ steps.npm-cache-dir.outputs.dir }}
56-
key: ${{ matrix.os }}-${{ matrix.node-version }}-node
56+
path: ${{ steps.yarn-cache-dir.outputs.dir }}
57+
key: ${{ matrix.os }}-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
5758
restore-keys: |
58-
${{ matrix.os }}-${{ matrix.node-version }}-node
59+
${{ matrix.os }}-${{ matrix.node-version }}-yarn-
5960
6061
- name: Install dependencies and build
6162
run: |
62-
npm install
63-
npm run build
63+
yarn install --frozen-lockfile
64+
yarn build
6465
6566
- name: Snyk security check
6667
if: matrix.node-version == env.PRIMARY_NODE_VERSION && matrix.os == env.PRIMARY_OS
@@ -74,11 +75,11 @@ jobs:
7475
env:
7576
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
7677
with:
77-
coverageCommand: npm run cover
78+
coverageCommand: yarn cover
7879

7980
- name: Run unit tests
8081
if: "!(matrix.node-version == env.PRIMARY_NODE_VERSION && matrix.os == env.PRIMARY_OS)"
81-
run: npm run test
82+
run: yarn test
8283

8384
publish_version:
8485
name: Publish
@@ -104,23 +105,23 @@ jobs:
104105
node-version: ${{ matrix.node-version }}
105106
registry-url: ${{ env.REGISTRY }}
106107

107-
- name: Get npm cache directory
108-
id: npm-cache-dir
108+
- name: Get yarn cache directory
109+
id: yarn-cache-dir
109110
run: |
110-
echo "::set-output name=dir::$(npm config get cache)"
111+
echo "::set-output name=dir::$(yarn cache dir)"
111112
112113
- uses: actions/cache@v2
113-
id: npm-cache
114+
id: yarn-cache
114115
with:
115-
path: ${{ steps.npm-cache-dir.outputs.dir }}
116-
key: ${{ matrix.os }}-${{ matrix.node-version }}-node
116+
path: ${{ steps.yarn-cache-dir.outputs.dir }}
117+
key: ${{ matrix.os }}-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
117118
restore-keys: |
118-
${{ matrix.os }}-${{ matrix.node-version }}-node
119+
${{ matrix.os }}-${{ matrix.node-version }}-yarn-
119120
120121
- name: Install dependencies and build
121122
run: |
122-
npm install
123-
npm run build
123+
yarn install --frozen-lockfile
124+
yarn build
124125
125126
- name: Publish
126127
uses: JS-DevTools/npm-publish@v1

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ logs
44
npm-debug.log*
55
yarn-debug.log*
66
yarn-error.log*
7-
7+
packages
88
# Runtime data
99
pids
1010
*.pid
1111
*.seed
1212
*.pid.lock
13+
package-lock.json
1314

1415
# Directory for instrumented libs generated by jscoverage/JSCover
1516
lib-cov

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"name": "squiss-ts",
3-
"version": "4.2.2",
3+
"version": "4.3.0",
44
"description": "High-volume SQS poller",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"engines": {
8-
"node": "^6 || ^8 || ^10 || ^12 || ^14 || ^16"
8+
"node": "^6 || ^8 || ^10 || ^12 || ^14 || ^16 || ^18"
99
},
1010
"scripts": {
11-
"postinstall": "node -e \"const semver = require('semver');process.exit(semver.lt(process.version, '10.16.0'));\" || npm install --no-save iltorb@2.4.3",
11+
"postinstall": " node -e \"const semver = require('semver');const relevant = semver.lt(process.version, '10.16.0');if (relevant == false) {process.exit(0);}try {require('iltorb'); process.exit(0);} catch (err){process.exit(1);}\" || yarn add --pure-lockfile --ignore-engines iltorb@2.4.3",
1212
"clean": "rm -rf node_modules build coverage dist",
13-
"build": "npm run lint && npm run compile",
13+
"build": "yarn lint && yarn compile",
1414
"compile": "tsc",
15-
"test": "npm run lint && npm run mocha",
15+
"test": "yarn lint && yarn mocha",
1616
"mocha": "_mocha --opts src/test/mocha.opts",
17-
"cover": "nyc --reporter=lcov --reporter=text-summary npm run test",
17+
"cover": "nyc --reporter=lcov --reporter=text-summary npm run mocha",
1818
"lint": "tslint -c tslint.json \"src/**/*.ts\" \"test/**/*.ts\""
1919
},
2020
"repository": {
@@ -47,9 +47,9 @@
4747
},
4848
"homepage": "https://github.com/PruvoNet/squiss-ts#readme",
4949
"dependencies": {
50-
"aws-sdk": "^2.720.0",
50+
"aws-sdk": "2.814.0",
5151
"linked-list": "^2.1.0",
52-
"semver": "7.3.5",
52+
"semver": "6.3.0",
5353
"ts-type-guards": "^0.7.0",
5454
"uuid": "^8.3.2"
5555
},
@@ -70,11 +70,11 @@
7070
"mocha": "6.2.2",
7171
"nyc": "14.1.1",
7272
"proxyquire": "^2.1.3",
73-
"sinon": "^9.0.2",
73+
"sinon": "^7.5.0",
7474
"sinon-chai": "^3.5.0",
7575
"source-map-support": "^0.5.19",
76-
"ts-node": "^9.1.1",
77-
"tslint": "^6.1.2",
78-
"typescript": "^4.3.5"
76+
"ts-node": "^8.10.2",
77+
"tslint": "^6.1.3",
78+
"typescript": "4.6.4"
7979
}
8080
}

0 commit comments

Comments
 (0)