diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..2849cd64 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: ci + +on: + pull_request: {} + push: + branches: + - main + +jobs: + quality-check: + name: Quality Check + runs-on: ubuntu-20.04 + + steps: + - name: Checkout branch + uses: actions/checkout@v3 + + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: npm + + - name: Install dependencies + run: npm install + + - name: Run quality-check + run: npm run quality-check diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..d4a43dd1 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npm run pre-commit diff --git a/e2e/protractor.conf.js b/e2e/protractor.conf.js index 2e47d856..b5bc1005 100644 --- a/e2e/protractor.conf.js +++ b/e2e/protractor.conf.js @@ -27,6 +27,7 @@ exports.config = { project: require('path').join(__dirname, './tsconfig.json'), }); jasmine.getEnv().addReporter( + // @ts-ignore new SpecReporter({ spec: { displayStacktrace: StacktraceOption.PRETTY, diff --git a/package-lock.json b/package-lock.json index fbfddec5..8c297fe4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -80,7 +80,7 @@ "@types/uuid": "^8.3.0", "audit-ci": "^4.0.0", "codelyzer": "^6.0.0", - "husky": "^8.0.1", + "husky": "^8.0.3", "jasmine-core": "~3.8.0", "jasmine-spec-reporter": "~5.0.0", "karma": "^6.3.2", diff --git a/package.json b/package.json index d10ae587..b7980733 100644 --- a/package.json +++ b/package.json @@ -3,19 +3,17 @@ "version": "1.0.0", "scripts": { "ng": "ng", - "start": "ng serve --port 4201", + "start": "ng serve --port 4201 -c development", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", "build_prod": "./node_modules/.bin/ng build --configuration production --base-href / --deploy-url /", "ngcc": "./node_modules/.bin/ngcc --properties es2015", - "format": "npx prettier --write ." - }, - "husky": { - "hooks": { - "pre-commit": "pretty-quick --staged" - } + "format": "npx prettier --write src", + "prepare": "husky install", + "pre-commit": "tsc --noEmit && pretty-quick --staged", + "quality-check": "tsc --noEmit && npx prettier --check src" }, "private": true, "dependencies": { @@ -91,7 +89,7 @@ "@types/uuid": "^8.3.0", "audit-ci": "^4.0.0", "codelyzer": "^6.0.0", - "husky": "^8.0.1", + "husky": "^8.0.3", "jasmine-core": "~3.8.0", "jasmine-spec-reporter": "~5.0.0", "karma": "^6.3.2", diff --git a/tsconfig.json b/tsconfig.json index d968f1f7..3088fa87 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,7 +19,7 @@ "module": "es2020", "allowJs": true, "lib": [ - "es2018", + "es2020", "dom" ], "types": [],