From 564c2710a684afc3e79d9ab6017b9b92f6a8afcd Mon Sep 17 00:00:00 2001 From: Guido de Rooij Date: Tue, 2 Apr 2024 15:50:13 +0200 Subject: [PATCH] Cleanup the scripts in package.json --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 12 +++--- angular.json | 79 ----------------------------------- package.json | 7 ++-- 4 files changed, 10 insertions(+), 90 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f78ac6a..953614b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,7 @@ jobs: run: npm run lint - name: Build - run: npm run build:build + run: npm run build:prod - name: Start Application run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4601a93..e51d73c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,16 +25,16 @@ jobs: id: dev-bump uses: phips28/gh-action-bump-version@v11.0.4 with: - tag-prefix: 'v' + tag-prefix: "v" skip-tag: true - commit-message: '[CI/CD]: bump dev-app to {{version}}' + commit-message: "[CI/CD]: bump dev-app to {{version}}" - name: Bump lib version id: lib-bump uses: phips28/gh-action-bump-version@v11.0.4 with: - tag-prefix: 'v' - commit-message: '[CI/CD]: bump lib to {{version}}' + tag-prefix: "v" + commit-message: "[CI/CD]: bump lib to {{version}}" env: PACKAGEJSON_DIR: projects/politie/ngx-sherlock @@ -74,7 +74,7 @@ jobs: run: npm ci - name: Build - run: npm run build:ci + run: npm run build:prod - name: Add token to .npmrc env: @@ -83,6 +83,6 @@ jobs: # for the four sherlock packages only. npmToken: ${{ secrets.WORKFLOW_NPM_TOKEN }} run: echo "//registry.npmjs.org/:_authToken=$npmToken" >> .npmrc - + - name: Release run: npm publish ./dist/politie/ngx-sherlock diff --git a/angular.json b/angular.json index 32df906..9abf558 100644 --- a/angular.json +++ b/angular.json @@ -104,85 +104,6 @@ "**/node_modules/**" ] } - }, - "cypress-run": { - "builder": "@cypress/schematic:cypress", - "options": { - "devServerTarget": "ngx-sherlock-dev:serve" - }, - "configurations": { - "production": { - "devServerTarget": "ngx-sherlock-dev:serve:production" - } - } - }, - "cypress-open": { - "builder": "@cypress/schematic:cypress", - "options": { - "watch": true, - "headless": false - } - }, - "e2e": { - "builder": "@cypress/schematic:cypress", - "options": { - "devServerTarget": "ngx-sherlock-dev:serve", - "watch": true, - "headless": false - }, - "configurations": { - "production": { - "devServerTarget": "ngx-sherlock-dev:serve:production" - } - } - } - } - }, - "ngx-sherlock-dev-e2e": { - "root": "e2e/", - "projectType": "application", - "architect": { - "e2e": { - "builder": "@cypress/schematic:cypress", - "options": { - "devServerTarget": "ngx-sherlock-dev-e2e:serve", - "watch": true, - "headless": false - }, - "configurations": { - "production": { - "devServerTarget": "ngx-sherlock-dev-e2e:serve:production" - } - } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": "", - "exclude": [ - "**/node_modules/**" - ] - } - }, - "cypress-run": { - "builder": "@cypress/schematic:cypress", - "options": { - "devServerTarget": "ngx-sherlock-dev-e2e:serve", - "configFile": "e2e//cypress.config.ts" - }, - "configurations": { - "production": { - "devServerTarget": "ngx-sherlock-dev-e2e:serve:production" - } - } - }, - "cypress-open": { - "builder": "@cypress/schematic:cypress", - "options": { - "watch": true, - "headless": false, - "configFile": "e2e//cypress.config.ts" - } } } }, diff --git a/package.json b/package.json index 8765ff7..3781f70 100644 --- a/package.json +++ b/package.json @@ -7,14 +7,13 @@ "watch:lib": "ng build @politie/ngx-sherlock --watch", "watch:app": "sleep 10 && ng serve --open", "clean": "rimraf coverage dist", - "build": "npm-run-all clean lint test:ci build:build e2e", - "build:ci": "npm-run-all clean lint test:ci build:prod e2e", - "build:build": "ng build @politie/ngx-sherlock", + "build:dev": "ng build @politie/ngx-sherlock", "build:prod": "ng build @politie/ngx-sherlock --configuration production", "test": "ng test @politie/ngx-sherlock", "test:ci": "ng test @politie/ngx-sherlock --no-watch --browsers=ChromeHeadless --code-coverage", "lint": "ng lint", - "e2e": "export NODE_OPTIONS=--openssl-legacy-provider && ng e2e", + "precommit": "npm-run-all clean lint test:ci build:prod precommit:e2e", + "precommit:e2e": "run-p start:app cypress:run", "cypress:open": "cypress open --e2e --browser chrome", "cypress:run": "cypress run --e2e --browser chrome" },