Skip to content

Commit e90edf2

Browse files
authored
chore: update testing, sync with latest patterns (#13)
* update polendina w/ webpack 5 and better esm support * make package.json and semantic-release config more consistent with js-multiformats
1 parent d3923ca commit e90edf2

File tree

3 files changed

+41
-48
lines changed

3 files changed

+41
-48
lines changed

.github/workflows/test-and-release.yml

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
fail-fast: false
77
matrix:
88
node: [14.x, 16.x]
9-
os: [macos-latest, ubuntu-latest]
9+
os: [macos-latest, ubuntu-latest, windows-latest]
1010
runs-on: ${{ matrix.os }}
1111
steps:
1212
- name: Checkout Repository
@@ -17,33 +17,16 @@ jobs:
1717
node-version: ${{ matrix.node }}
1818
- name: Install Dependencies
1919
run: |
20-
npm install --no-progress --no-package-lock
20+
npm install --no-progress
2121
- name: Run tests
2222
run: |
23-
npm test
24-
test-windows:
25-
strategy:
26-
fail-fast: false
27-
matrix:
28-
node: [14.x, 16.x]
29-
os: [windows-latest]
30-
runs-on: ${{ matrix.os }}
31-
steps:
32-
- name: Checkout Repository
33-
uses: actions/checkout@v2.4.0
34-
- name: Use Node.js ${{ matrix.node }}
35-
uses: actions/setup-node@v2.5.0
36-
with:
37-
node-version: ${{ matrix.node }}
38-
- name: Install Dependencies
39-
run: |
40-
npm install --no-progress --no-package-lock
41-
- name: Run tests
42-
run: |
43-
npm run test:node
23+
npm config set script-shell bash
24+
npm run test:ci
25+
- name: Typecheck
26+
uses: gozala/typescript-error-reporter-action@v1.0.8
4427
release:
4528
name: Release
46-
needs: [test, test-windows]
29+
needs: test
4730
runs-on: ubuntu-latest
4831
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
4932
steps:
@@ -75,6 +58,6 @@ jobs:
7558
- name: Release
7659
env:
7760
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78-
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
61+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7962
run: npx semantic-release
8063

package.json

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,53 +5,63 @@
55
"main": "index.js",
66
"type": "module",
77
"scripts": {
8+
"lint": "standard",
89
"build": "npm run build:js && npm run build:types",
910
"build:js": "ipjs build --tests --main && npm run build:copy",
10-
"build:copy": "cp -a tsconfig.json *.js dist/",
11-
"build:types": "npm run build:copy && cd dist && tsc --build",
12-
"publish": "ipjs publish",
13-
"lint": "standard",
11+
"build:copy": "cp -a tsconfig.json *.js test dist/",
12+
"build:types": "tsc --build && mv types dist",
1413
"test:cjs": "npm run build && mocha dist/cjs/node-test/test-*.js && npm run test:cjs:browser",
14+
"test:esm": "npm run build && mocha dist/esm/node-test/test-*.js && npm run test:esm:browser",
1515
"test:node": "c8 --check-coverage --branches 100 --functions 100 --lines 100 mocha test/test-*.js",
1616
"test:cjs:browser": "polendina --cleanup dist/cjs/browser-test/test-*.js",
17-
"test": "npm run lint && npm run test:node && npm run test:cjs",
17+
"test:esm:browser": "polendina --cleanup dist/esm/browser-test/test-*.js",
18+
"test": "npm run lint && npm run test:node && npm run test:esm",
19+
"test:ci": "npm run lint && npm run test:node && npm run test:esm && npm run test:cjs",
1820
"coverage": "c8 --reporter=html mocha test/test-*.js && npm_config_yes=true npx st -d coverage -p 8080"
1921
},
20-
"exports": {
21-
"import": "./index.js"
22-
},
2322
"keywords": [
24-
"IPFS",
25-
"IPLD",
23+
"ipfs",
24+
"ipld",
2625
"multiformats",
2726
"hash",
2827
"multihash",
2928
"blake2"
3029
],
3130
"author": "Mikeal Rogers <mikeal.rogers@gmail.com> (https://www.mikealrogers.com/)",
3231
"license": "(Apache-2.0 AND MIT)",
32+
"exports": {
33+
"import": "./index.js"
34+
},
3335
"dependencies": {
3436
"js-sha3": "^0.8.0",
35-
"multiformats": "^9.4.1"
37+
"multiformats": "^9.5.4"
3638
},
3739
"devDependencies": {
38-
"@ipld/dag-cbor": "^6.0.5",
39-
"c8": "^7.7.3",
40+
"@ipld/dag-cbor": "^6.0.15",
41+
"c8": "^7.10.0",
4042
"chai": "^4.3.4",
41-
"ipjs": "^5.0.2",
42-
"mocha": "^9.0.2",
43-
"polendina": "^2.0.0",
44-
"standard": "^16.0.3",
45-
"typescript": "^4.3.5"
43+
"ipjs": "^5.2.0",
44+
"mocha": "^9.1.3",
45+
"polendina": "~2.0.1",
46+
"standard": "^16.0.4",
47+
"typescript": "~4.5.3"
48+
},
49+
"standard": {
50+
"ignore": [
51+
"dist"
52+
]
53+
},
54+
"directories": {
55+
"test": "test"
4656
},
4757
"repository": {
4858
"type": "git",
49-
"url": "git+https://github.com/mikeal/js-sha3.git"
59+
"url": "git+https://github.com/multiformats/js-sha3.git"
5060
},
5161
"bugs": {
52-
"url": "https://github.com/mikeal/js-sha3/issues"
62+
"url": "https://github.com/multiformats/js-sha3/issues"
5363
},
54-
"homepage": "https://github.com/mikeal/js-sha3#readme",
64+
"homepage": "https://github.com/multiformats/js-sha3#readme",
5565
"typesVersions": {
5666
"*": {
5767
"*": [

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
},
3434
"exclude": [
3535
"node_modules",
36-
"esm",
37-
"cjs"
36+
"test",
37+
"dist"
3838
],
3939
"compileOnSave": false
4040
}

0 commit comments

Comments
 (0)