Skip to content

Commit 55a7193

Browse files
authored
Use npm and update dependencies (#963)
* Use npm and update dependencies * format * Update deployment job dependencies to include test-js
1 parent 3964003 commit 55a7193

20 files changed

+7212
-3445
lines changed

.github/workflows/gh-pages.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
- 'LICENSE'
1515
- 'package.json'
1616
- 'README.md'
17-
- 'yarn.lock'
17+
- 'package-lock.json'
1818
jobs:
1919
test-lib:
2020
runs-on: ubuntu-latest
@@ -24,11 +24,11 @@ jobs:
2424
with:
2525
node-version: 20
2626
- name: Install
27-
run: yarn
27+
run: npm install
2828
- name: Prepare ONNX
29-
run: yarn create-onnx -t
29+
run: npm run create-onnx -t
3030
- name: Test lib
31-
run: yarn test:lib --bail
31+
run: npm run test:lib --bail
3232
- name: Coveralls
3333
uses: coverallsapp/github-action@master
3434
with:
@@ -38,7 +38,7 @@ jobs:
3838
steps:
3939
- uses: actions/checkout@v4
4040
- name: Test js
41-
run: yarn test:js --bail
41+
run: npm run test:js --bail
4242
test-gui:
4343
runs-on: ubuntu-latest
4444
steps:
@@ -47,16 +47,16 @@ jobs:
4747
run: docker compose run --rm test-gui --bail
4848
deploy:
4949
runs-on: ubuntu-latest
50-
needs: [test-lib, test-gui]
50+
needs: [test-lib, test-gui, test-js]
5151
steps:
5252
- uses: actions/checkout@v4
5353
- uses: actions/setup-node@v4
5454
with:
5555
node-version: 20
5656
- name: Install
57-
run: yarn
57+
run: npm install
5858
- name: Build
59-
run: yarn build:gh-pages
59+
run: npm run build:gh-pages
6060
- name: Deploy
6161
uses: peaceiris/actions-gh-pages@v3
6262
with:

.github/workflows/npm.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
with:
1212
node-version: 20
1313
- name: Install
14-
run: yarn
14+
run: npm install
1515
- name: Prepare ONNX
16-
run: yarn create-onnx -t
16+
run: npm run create-onnx -t
1717
- name: Test
18-
run: yarn test:lib --bail
18+
run: npm run test:lib --bail
1919
publish:
2020
runs-on: ubuntu-latest
2121
needs: test
@@ -26,9 +26,9 @@ jobs:
2626
node-version: 20
2727
registry-url: 'https://registry.npmjs.org'
2828
- name: Install
29-
run: yarn
29+
run: npm install
3030
- name: Build
31-
run: yarn build:npm
31+
run: npm run build:npm
3232
- name: Publish
3333
run: npm publish
3434
env:

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ jobs:
99
with:
1010
node-version: 20
1111
- name: Install
12-
run: yarn
12+
run: npm install
1313
- name: Prepare ONNX
14-
run: yarn create-onnx -t
14+
run: npm run create-onnx -t
1515
- name: Test lib
16-
run: yarn test:lib --bail
16+
run: npm run test:lib --bail
1717
- name: Coveralls
1818
uses: coverallsapp/github-action@master
1919
with:
@@ -23,7 +23,7 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v4
2525
- name: Test js
26-
run: yarn test:js --bail
26+
run: npm run test:js --bail
2727
test-gui:
2828
runs-on: ubuntu-latest
2929
steps:

docker-compose.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3'
2-
31
services:
42
test-gui:
53
build:
@@ -15,6 +13,6 @@ services:
1513
working_dir: /app
1614

1715
server:
18-
image: nginx:1.25.5-alpine
16+
image: nginx:1.27.5-alpine
1917
volumes:
2018
- .:/usr/share/nginx/html

lib/model/nns/onnx/layer/argmax.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default {
2828
const keepdims = new onnx.AttributeProto()
2929
keepdims.setName('keepdims')
3030
keepdims.setType(onnx.AttributeProto.AttributeType.INT)
31-
keepdims.setI(obj.keepdims ?? true ? 1 : 0)
31+
keepdims.setI((obj.keepdims ?? true) ? 1 : 0)
3232
node.addAttribute(keepdims)
3333

3434
graph.addNode(node)

lib/model/nns/onnx/layer/argmin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default {
2828
const keepdims = new onnx.AttributeProto()
2929
keepdims.setName('keepdims')
3030
keepdims.setType(onnx.AttributeProto.AttributeType.INT)
31-
keepdims.setI(obj.keepdims ?? true ? 1 : 0)
31+
keepdims.setI((obj.keepdims ?? true) ? 1 : 0)
3232
node.addAttribute(keepdims)
3333

3434
graph.addNode(node)

lib/model/nns/onnx/layer/mean.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default {
2020
node.addInput(input)
2121
node.addOutput(obj.name)
2222

23-
const keepdims = obj.keepdims ?? true ? 1 : 0
23+
const keepdims = (obj.keepdims ?? true) ? 1 : 0
2424
const attrKeepdims = new onnx.AttributeProto()
2525
attrKeepdims.setName('keepdims')
2626
attrKeepdims.setType(onnx.AttributeProto.AttributeType.INT)

lib/model/nns/onnx/layer/prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default {
2020
node.addInput(input)
2121
node.addOutput(obj.name)
2222

23-
const keepdims = obj.keepdims ?? true ? 1 : 0
23+
const keepdims = (obj.keepdims ?? true) ? 1 : 0
2424
const attrKeepdims = new onnx.AttributeProto()
2525
attrKeepdims.setName('keepdims')
2626
attrKeepdims.setType(onnx.AttributeProto.AttributeType.INT)

lib/model/nns/onnx/layer/reduce_max.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default {
2020
node.addInput(input)
2121
node.addOutput(obj.name)
2222

23-
const keepdims = obj.keepdims ?? true ? 1 : 0
23+
const keepdims = (obj.keepdims ?? true) ? 1 : 0
2424
const attrKeepdims = new onnx.AttributeProto()
2525
attrKeepdims.setName('keepdims')
2626
attrKeepdims.setType(onnx.AttributeProto.AttributeType.INT)

lib/model/nns/onnx/layer/reduce_min.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default {
2020
node.addInput(input)
2121
node.addOutput(obj.name)
2222

23-
const keepdims = obj.keepdims ?? true ? 1 : 0
23+
const keepdims = (obj.keepdims ?? true) ? 1 : 0
2424
const attrKeepdims = new onnx.AttributeProto()
2525
attrKeepdims.setName('keepdims')
2626
attrKeepdims.setType(onnx.AttributeProto.AttributeType.INT)

lib/model/nns/onnx/layer/std.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default {
4343
node_variance.addInput(obj.name + '_mul')
4444
node_variance.addOutput(obj.name + '_var')
4545

46-
const keepdims = obj.keepdims ?? true ? 1 : 0
46+
const keepdims = (obj.keepdims ?? true) ? 1 : 0
4747
const attrKeepdims2 = new onnx.AttributeProto()
4848
attrKeepdims2.setName('keepdims')
4949
attrKeepdims2.setType(onnx.AttributeProto.AttributeType.INT)

lib/model/nns/onnx/layer/sum.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default {
2020
node.addInput(input)
2121
node.addOutput(obj.name)
2222

23-
const keepdims = obj.keepdims ?? true ? 1 : 0
23+
const keepdims = (obj.keepdims ?? true) ? 1 : 0
2424
const attrKeepdims = new onnx.AttributeProto()
2525
attrKeepdims.setName('keepdims')
2626
attrKeepdims.setType(onnx.AttributeProto.AttributeType.INT)

lib/model/nns/onnx/layer/variance.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default {
4343
node_variance.addInput(obj.name + '_mul')
4444
node_variance.addOutput(obj.name)
4545

46-
const keepdims = obj.keepdims ?? true ? 1 : 0
46+
const keepdims = (obj.keepdims ?? true) ? 1 : 0
4747
const attrKeepdims2 = new onnx.AttributeProto()
4848
attrKeepdims2.setName('keepdims')
4949
attrKeepdims2.setType(onnx.AttributeProto.AttributeType.INT)

0 commit comments

Comments
 (0)