Skip to content

Commit e9a2f16

Browse files
Merge pull request #1 from qavajs/initial-implementation
initial implementation
2 parents 9cf060c + 1a1748e commit e9a2f16

File tree

12 files changed

+6090
-0
lines changed

12 files changed

+6090
-0
lines changed

.github/workflows/npm-publish.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3+
4+
name: Node.js Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
publish-npm:
12+
needs: build
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-node@v2
17+
with:
18+
node-version: 16
19+
registry-url: https://registry.npmjs.org/
20+
- run: npm ci
21+
- run: npm run build
22+
- run: npm publish --access public
23+
env:
24+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

.github/workflows/pull-request.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-node@v2
14+
with:
15+
node-version: 16
16+
- run: npm ci
17+
- run: npm run build
18+
- run: npm run test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Logs
2+
coverage/
3+
lib/
24
logs
35
*.log
46
npm-debug.log*

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.github/
2+
test/
3+
coverage/

index.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { getValidation, verify, validationRegexp } from './src/verify';
2+
3+
declare module '@qavajs/validation' {
4+
export { verify, getValidation, validationRegexp }
5+
}

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./lib/verify');

jest.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
2+
module.exports = {
3+
preset: "ts-jest",
4+
testEnvironment: "node",
5+
coveragePathIgnorePatterns: ["/lib/", "/node_modules/"],
6+
coverageThreshold: {
7+
global: {
8+
branches: 90,
9+
functions: 90,
10+
lines: 90,
11+
statements: -10,
12+
},
13+
},
14+
};

0 commit comments

Comments
 (0)