Skip to content

Commit

Permalink
Merge pull request #28 from JDIZM/jdizm/update-testing
Browse files Browse the repository at this point in the history
update deps, testing and release workflow
  • Loading branch information
JDIZM authored Jul 28, 2024
2 parents b9eb9d0 + 63ac3b6 commit ddb7770
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
root: true,
env: {
es2021: true,
es2022: true,
node: true
},
extends: [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ jobs:
- run: npm run lint
- run: npm run format:check
- run: npm run tsc:check
- run: npm run build
- run: npm run test
- run: npm run build
24 changes: 21 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: node tests
name: release

on:
release:
Expand All @@ -19,8 +19,8 @@ jobs:
- run: npm run lint
- run: npm run format:check
- run: npm run tsc:check
- run: npm run build
- run: npm run test
- run: npm run build
publish:
runs-on: ubuntu-latest
needs: test-and-build
Expand All @@ -33,6 +33,24 @@ jobs:
registry-url: "https://registry.npmjs.org"
- run: npm install
- run: npm run build
- run: npm publish --access public

- name: Update version based on tag
run: |
VERSION=$(echo "${{ github.event.release.tag_name }}" | sed 's/^v//')
echo "Updating package.json version to $VERSION"
npm version $VERSION --no-git-tag-version
- name: Commit version change
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add package.json
git commit -m "chore(release): update version to $VERSION"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
9 changes: 0 additions & 9 deletions .prettierrc.js

This file was deleted.

10 changes: 10 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": true,
"tabWidth": 2,
"singleQuote": false,
"printWidth": 120,
"trailingComma": "none",
"bracketSpacing": true,
"endOfLine": "lf"
}
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
"author": "JDIZM",
"license": "ISC",
"devDependencies": {
"@types/node": "^20.2.1",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"@vitest/coverage-v8": "^2.0.0",
"@types/node": "^22.0.0",
"@typescript-eslint/eslint-plugin": "^7.17.0",
"@typescript-eslint/parser": "^7.17.0",
"@vitest/coverage-istanbul": "^2.0.4",
"eslint": "^8.37.0",
"eslint-config-prettier": "^9.0.0",
"eslint-import-resolver-alias": "^1.1.2",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-import": "^2.29.1",
"npm-dts": "^1.3.12",
"prettier": "^3.0.0",
"typescript": "^5.4.0",
"prettier": "^3.3.3",
"typescript": "^5.5.4",
"vite-node": "^2.0.0",
"vitest": "^2.0.0"
},
Expand Down
1 change: 1 addition & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { defineConfig } from "vite";
export default defineConfig({
test: {
coverage: {
provider: "istanbul", // or 'v8'
exclude: ["**/node_modules/**", "test*", "build.*", ".*.js", "types", "index.ts"]
}
}
Expand Down

0 comments on commit ddb7770

Please sign in to comment.