Skip to content

Commit 28cc87c

Browse files
refactor: cleanup (#9)
1 parent 9197b3c commit 28cc87c

File tree

8 files changed

+42
-83
lines changed

8 files changed

+42
-83
lines changed

.babelrc renamed to .babelrc.json

File renamed without changes.

.github/workflows/documentationjs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
- name: Build documentation
1414
uses: zakodium/documentationjs-action@v1
1515
- name: Deploy to GitHub pages
16-
uses: JamesIves/github-pages-deploy-action@releases/v3
16+
uses: JamesIves/github-pages-deploy-action@releases/v4
1717
with:
18-
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
19-
BRANCH: gh-pages
20-
FOLDER: docs
21-
CLEAN: true
18+
token: ${{ secrets.BOT_TOKEN }}
19+
branch: gh-pages
20+
folder: docs
21+
clean: true

.github/workflows/nodejs.yml

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,13 @@ name: Node.js CI
22

33
on:
44
push:
5-
branches: master
5+
branches:
6+
- master
67
pull_request:
78

8-
env:
9-
NODE_VERSION: 14.x
10-
119
jobs:
12-
lint:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: actions/checkout@v2
16-
- uses: actions/setup-node@v2
17-
with:
18-
node-version: ${{ env.NODE_VERSION }}
19-
- name: Install dependencies
20-
run: npm install
21-
- name: Run ESLint
22-
run: npm run eslint
23-
test:
24-
runs-on: ubuntu-latest
25-
strategy:
26-
matrix:
27-
node-version: [12.x, 14.x, 15.x]
28-
fail-fast: false
29-
steps:
30-
- uses: actions/checkout@v2
31-
- name: Use Node.js ${{ matrix.node-version }}
32-
uses: actions/setup-node@v2
33-
with:
34-
node-version: ${{ matrix.node-version }}
35-
- name: Install dependencies
36-
run: npm install
37-
- name: Run tests
38-
run: npm run test-coverage
39-
- name: Send coverage report to Codecov
40-
uses: codecov/codecov-action@v1
10+
nodejs:
11+
# Documentation: https://github.com/zakodium/workflows#nodejs-ci
12+
uses: zakodium/workflows/.github/workflows/nodejs.yml@nodejs-v1
13+
with:
14+
node-version-matrix: '[12, 14, 16]'

.github/workflows/release.yml

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,13 @@ on:
55
branches:
66
- master
77

8-
env:
9-
NODE_VERSION: 14.x
10-
118
jobs:
12-
release-please:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- name: Get package name
16-
run: echo "PACKAGE_NAME=$(jq .name package.json | tr -d '"')" >> $GITHUB_ENV
17-
- uses: GoogleCloudPlatform/release-please-action@v2
18-
id: release
19-
with:
20-
token: ${{ secrets.BOT_TOKEN }}
21-
release-type: node
22-
package-name: ${{ env.PACKAGE_NAME }}
23-
bump-minor-pre-major: Yes
24-
- uses: actions/checkout@v2
25-
# These if statements ensure that a publication only occurs when a new release is created
26-
if: ${{ steps.release.outputs.release_created }}
27-
- uses: actions/setup-node@v2
28-
with:
29-
node-version: ${{ env.NODE_VERSION }}
30-
registry-url: 'https://registry.npmjs.org'
31-
if: ${{ steps.release.outputs.release_created }}
32-
- run: npm install
33-
if: ${{ steps.release.outputs.release_created }}
34-
- run: npm publish --access public
35-
env:
36-
NODE_AUTH_TOKEN: ${{ secrets.NPM_BOT_TOKEN }}
37-
if: ${{ steps.release.outputs.release_created }}
9+
release:
10+
# Documentation: https://github.com/zakodium/workflows#release
11+
uses: zakodium/workflows/.github/workflows/release.yml@release-v1
12+
with:
13+
npm: true
14+
secrets:
15+
github-token: ${{ secrets.BOT_TOKEN }}
16+
npm-token: ${{ secrets.NPM_BOT_TOKEN }}
17+

.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"arrowParens": "always",
3+
"tabWidth": 2,
4+
"singleQuote": true,
5+
"semi": true,
6+
"trailingComma": "all"
7+
}

History.md renamed to CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Changelog
2+
13
## [2.1.0](https://github.com/mljs/sparse-matrix/compare/v2.0.0...v2.1.0) (2021-03-03)
24

35

package.json

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
"compile": "rollup -c",
1313
"eslint": "eslint src",
1414
"eslint-fix": "npm run eslint -- --fix",
15-
"prepublishOnly": "npm run compile",
16-
"test": "npm run test-coverage && npm run eslint",
17-
"test-only": "jest",
18-
"test-coverage": "jest --coverage"
15+
"prepack": "npm run compile",
16+
"prettier": "prettier --check src",
17+
"prettier-write": "prettier --write src",
18+
"test": "npm run test-only && npm run eslint && npm run prettier",
19+
"test-only": "jest --coverage"
1920
},
2021
"repository": {
2122
"type": "git",
@@ -28,20 +29,15 @@
2829
"url": "https://github.com/mljs/sparse-matrix/issues"
2930
},
3031
"homepage": "https://github.com/mljs/sparse-matrix#readme",
31-
"jest": {
32-
"testEnvironment": "node"
33-
},
3432
"dependencies": {
3533
"ml-hash-table": "^1.0.0"
3634
},
3735
"devDependencies": {
38-
"@babel/plugin-transform-modules-commonjs": "^7.13.8",
39-
"eslint": "^7.21.0",
40-
"eslint-config-cheminfo": "^5.2.3",
41-
"eslint-plugin-import": "^2.22.1",
42-
"eslint-plugin-jest": "^24.1.5",
43-
"jest": "^26.6.3",
44-
"prettier": "^2.2.1",
45-
"rollup": "^2.40.0"
36+
"@babel/plugin-transform-modules-commonjs": "^7.16.8",
37+
"eslint": "^8.10.0",
38+
"eslint-config-cheminfo": "^7.2.2",
39+
"jest": "^27.5.1",
40+
"prettier": "^2.5.1",
41+
"rollup": "^2.69.0"
4642
}
4743
}

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ let methods = [['~', 'not']];
366366
'tan',
367367
'tanh',
368368
'trunc',
369-
].forEach(function (mathMethod) {
369+
].forEach((mathMethod) => {
370370
methods.push([`Math.${mathMethod}`, mathMethod]);
371371
});
372372

0 commit comments

Comments
 (0)