Skip to content

Commit

Permalink
Merge pull request #232 from hckrnews/feature/node-18
Browse files Browse the repository at this point in the history
Test with node 18
  • Loading branch information
w3nl authored Jul 12, 2022
2 parents ef2f6cd + 0c33c30 commit 37fe150
Show file tree
Hide file tree
Showing 22 changed files with 3,405 additions and 14,826 deletions.
28 changes: 28 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"extends": [
"@hckrnews/eslint-config"
],
"plugins": [
"import"
],
"rules": {
"import/extensions": [
"error",
"ignorePackages",
{
"js": "always"
}
],
"consistent-return": "warn",
"eqeqeq": "warn"
},
"env": {
"es6": true,
"node": true,
"jquery": false,
"browser": true
},
"parserOptions": {
"sourceType": "module"
},
}
27 changes: 0 additions & 27 deletions .eslintrc.cjs

This file was deleted.

1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

github: [w3nl]
patreon: w3news
buymeacoffee: https://www.buymeacoffee.com/hckrnews
22 changes: 22 additions & 0 deletions .github/workflows/cpd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Node Copy Paste Detector

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: npm cpd
run: |
npm ci
npm run cpd
env:
CI: true
22 changes: 22 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Node Lint

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: npm lint
run: |
npm ci
npm run lint
env:
CI: true
18 changes: 10 additions & 8 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Node.js Package

on:
Expand All @@ -8,25 +11,24 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
node-version: 18
- run: npm ci
- run: npm run vulnerabilities
- run: npm run lint
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci --production
- run: npm publish
- run: npm ci
- run: npm run build --if-present
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
28 changes: 28 additions & 0 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: SonarCloud

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js 18
uses: actions/setup-node@v1
with:
node-version: 18
cache: 'npm'
- name: npm install, lint, and test
run: |
npm ci
npm run lint:report
npm test
env:
CI: true
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
14 changes: 6 additions & 8 deletions .github/workflows/nodejs.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node CI
name: Node Test

on: [push]

Expand All @@ -9,20 +9,18 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: npm install, lint, and test
cache: 'npm'
- name: npm test
run: |
npm ci
npm run vulnerabilities
npm run lint
npm run cpd
npm test
env:
CI: true
22 changes: 22 additions & 0 deletions .github/workflows/vulnerabilities.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Node Vulnerability Check

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
- name: npm vulnerabilities
run: |
npm ci
npm run vulnerabilities
env:
CI: true
17 changes: 12 additions & 5 deletions .jscpd.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{
"threshold": 0,
"reporters": ["json", "console"],
"ignore": ["**/__snapshots__/**"],
"absolute": true,
"gitignore": true
"threshold": 0,
"reporters": [
"json",
"console"
],
"ignore": [
"**/__snapshots__/**",
"**/__tests__/**",
"**/__fixtures__/**"
],
"absolute": true,
"gitignore": true
}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.5.0
34 changes: 34 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"all": true,
"include": [
"src/**/*.js"
],
"exclude": [
"**/*.spec.js"
],
"reporter": [
"text",
"text-summary",
"lcov",
"clover"
],
"check-coverage": true,
"watermarks": {
"lines": [
80,
95
],
"functions": [
80,
95
],
"branches": [
80,
95
],
"statements": [
80,
95
]
}
}
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ dist: focal
addons:
language: node_js
node_js:
- "14"
- "16"
- "18"
before_script:
- npm run lint
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
Validate the object values by a schema.
I hope you like it.

## Sponsors :tada:

If it has saved you development time, please consider [sponsoring the project](https://github.com/sponsors/w3nl)
with GitHub sponsors!

But me a coffee/book: https://www.buymeacoffee.com/hckrnews
Or on patreon: https://patreon.com/w3news

## Installation

`npm install @hckrnews/validator`
Expand Down
12 changes: 0 additions & 12 deletions babel.config.cjs

This file was deleted.

22 changes: 0 additions & 22 deletions jest.config.cjs

This file was deleted.

Loading

0 comments on commit 37fe150

Please sign in to comment.