From e6e5cd951e8a4f6dc0b41fad3065d91920e66ccd Mon Sep 17 00:00:00 2001 From: Omer Cohen Date: Tue, 26 Dec 2023 15:54:29 +0200 Subject: [PATCH] fix --- .github/workflows/ci.yml | 45 ++-------- .github/workflows/publish-next.yml | 16 +--- .github/workflows/publish.yml | 17 +--- package.json | 127 ++++++++++++++--------------- 4 files changed, 76 insertions(+), 129 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e64d5fc..c42f53d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: - init # TODO: remove this branch env: - NODE_VERSION: 18.12 + NODE_VERSION: 20 jobs: build: @@ -21,13 +21,8 @@ jobs: with: node-version: ${{ env.NODE_VERSION }} registry-url: https://npm.pkg.github.com/ - # Skip post-install scripts here, as a malicious - # script could steal NODE_AUTH_TOKEN. - name: Install dependencies - run: npm ci --ignore-scripts - env: - CI: true - # NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_READ_ORG }} + run: npm ci - name: Building Lib run: npm run build:lib - name: Building Demo App @@ -43,13 +38,8 @@ jobs: with: node-version: ${{ env.NODE_VERSION }} registry-url: https://npm.pkg.github.com/ - # Skip post-install scripts here, as a malicious - # script could steal NODE_AUTH_TOKEN. - name: Install dependencies - run: npm ci --ignore-scripts - env: - CI: true - # NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_READ_ORG }} + run: npm ci - name: Linting run: npm run lint - name: Format check @@ -61,16 +51,11 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} - # Skip post-install scripts here, as a malicious - # script could steal NODE_AUTH_TOKEN. - name: Install dependencies - run: npm ci --ignore-scripts - env: - CI: true - NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_READ_ORG }} + run: npm ci - name: Gitleaks run: npm run leaks shell: bash @@ -85,13 +70,8 @@ jobs: with: node-version: ${{ env.NODE_VERSION }} registry-url: https://npm.pkg.github.com/ - # Skip post-install scripts here, as a malicious - # script could steal NODE_AUTH_TOKEN. - name: Install dependencies - run: npm ci --ignore-scripts - env: - CI: true - # NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_READ_ORG }} + run: npm ci - name: Testing run: npm run test - name: Coverage check @@ -108,19 +88,12 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} registry-url: https://npm.pkg.github.com/ - # Skip post-install scripts here, as a malicious - # script could steal NODE_AUTH_TOKEN. - name: Install dependencies - run: npm ci --ignore-scripts - env: - CI: true - NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_READ_ORG }} - # `npm rebuild` will run all those post-install scripts for us. - - run: npm rebuild && npm run prepare --if-present + run: npm ci - name: License validation shell: bash - run: ./thirdPartyLicenseCollector_linux_amd64 -npm-project ./projects/angular-sdk -npm-node-modules . # We are checking the + run: ./thirdPartyLicenseCollector_linux_amd64 -npm-project ./projects/angular-sdk -npm-node-modules . diff --git a/.github/workflows/publish-next.yml b/.github/workflows/publish-next.yml index 564a0ae..e2fa938 100644 --- a/.github/workflows/publish-next.yml +++ b/.github/workflows/publish-next.yml @@ -7,21 +7,15 @@ on: - init # TODO: remove this branch env: - NODE_VERSION: 16.14 + NODE_VERSION: 20 jobs: publish: name: 📢 Publish Next - permissions: - packages: write - contents: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token - fetch-depth: 0 # otherwise, you will failed to push refs to dest repo - uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} @@ -39,14 +33,8 @@ jobs: yarn version --new-version ${NEW_VERSION} cat package.json - name: Install dependencies - run: npm ci --ignore-scripts - env: - CI: true - NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_READ_ORG }} - # `npm rebuild` will run all those post-install scripts for us. - - run: npm rebuild && npm run prepare --if-present + run: npm ci - name: Publish to NPM Package Registry run: npm publish --access=public --tag next env: - CI: true NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_REGISTRY }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5ea6982..23d9b95 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,17 +3,14 @@ name: 📢 publish on: push: tags: - - 'release/**' + - "release/**" env: - NODE_VERSION: 16.14 + NODE_VERSION: 20 jobs: publish: name: 📢 Publish - permissions: - packages: write - contents: read runs-on: ubuntu-latest steps: @@ -22,16 +19,8 @@ jobs: with: node-version: ${{ env.NODE_VERSION }} registry-url: https://registry.npmjs.org/ - # Skip post-install scripts here, as a malicious - # script could steal NODE_AUTH_TOKEN. - name: Install dependencies - run: npm ci --ignore-scripts - env: - CI: true - NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_READ_ORG }} - # `npm rebuild` will run all those post-install scripts for us. - - run: npm rebuild && npm run prepare --if-present - + run: npm ci - name: Publish to NPM Package Registry run: npm publish --access=public env: diff --git a/package.json b/package.json index 8874911..40005bd 100644 --- a/package.json +++ b/package.json @@ -1,67 +1,64 @@ { - "name": "@descope/angular-sdk", - "version": "0.0.2", - "license": "MIT", - "engines": { - "node": "^16.14.0 || ^18.10.0", - "npm": ">= 8.1.0" - }, - "scripts": { - "ng": "ng", - "start": "ng serve", - "prepare": "husky install", - "format-lint": "pretty-quick --staged --ignore-path .gitignore && lint-staged", - "prebuild:ci": "node scripts/setversion/setversion.js", - "build:ci": "npm run build:lib", - "build:lib": "ng build angular-sdk", - "build:app": "ng build demo-app", - "watch": "ng build --watch --configuration development", - "test": "jest --config jest.config.js", - "lint": "ng lint", - "format": "prettier . -w --ignore-path .gitignore", - "format-check": "prettier . --check --ignore-path .gitignore", - "leaks": "bash ./scripts/gitleaks/gitleaks.sh" - }, - "lint-staged": { - "+(src|test|examples)/**/*.{js,ts,html}": [ - "npm run lint" - ] - }, - "private": true, - "devDependencies": { - "@angular-devkit/build-angular": "^16.2.6", - "@angular-eslint/builder": "16.3.1", - "@angular-eslint/eslint-plugin": "16.3.1", - "@angular-eslint/eslint-plugin-template": "16.3.1", - "@angular-eslint/schematics": "16.3.1", - "@angular-eslint/template-parser": "16.3.1", - "@angular/animations": "^16.2.9", - "@angular/cli": "^16.2.6", - "@angular/common": "^16.2.9", - "@angular/compiler": "^16.2.9", - "@angular/compiler-cli": "^16.2.9", - "@angular/core": "^16.2.9", - "@angular/forms": "^16.2.9", - "@angular/platform-browser": "^16.2.9", - "@angular/platform-browser-dynamic": "^16.2.9", - "@angular/router": "^16.2.9", - "@descope/web-component": "3.0.0", - "@types/jest": "^29.5.5", - "@typescript-eslint/eslint-plugin": "6.11.0", - "@typescript-eslint/parser": "6.11.0", - "eslint": "^8.51.0", - "eslint-plugin-prettier": "^4.2.1", - "husky": "^8.0.3", - "jest": "^29.7.0", - "jest-preset-angular": "^13.1.2", - "lint-staged": "^15.2.0", - "ng-mocks": "^14.11.0", - "ng-packagr": "^16.2.3", - "prettier": "2.8.8", - "pretty-quick": "^3.1.3", - "rxjs": "~7.8.1", - "tslib": "^2.6.2", - "typescript": "~5.1.6", - "zone.js": "~0.13.0" - } + "name": "@descope/angular-sdk", + "version": "0.0.2", + "license": "MIT", + "engines": { + "node": "^16.14.0 || ^18.10.0", + "npm": ">= 8.1.0" + }, + "scripts": { + "ng": "ng", + "start": "ng serve", + "prepare": "husky install", + "format-lint": "pretty-quick --staged --ignore-path .gitignore && lint-staged", + "prebuild:ci": "node scripts/setversion/setversion.js", + "build:ci": "npm run build:lib", + "build:lib": "ng build angular-sdk", + "build:app": "ng build demo-app", + "watch": "ng build --watch --configuration development", + "test": "jest --config jest.config.js", + "lint": "ng lint", + "format": "prettier . -w --ignore-path .gitignore", + "format-check": "prettier . --check --ignore-path .gitignore", + "leaks": "bash ./scripts/gitleaks/gitleaks.sh" + }, + "lint-staged": { + "+(src|test|examples)/**/*.{js,ts,html}": ["npm run lint"] + }, + "devDependencies": { + "@angular-devkit/build-angular": "^16.2.6", + "@angular-eslint/builder": "16.3.1", + "@angular-eslint/eslint-plugin": "16.3.1", + "@angular-eslint/eslint-plugin-template": "16.3.1", + "@angular-eslint/schematics": "16.3.1", + "@angular-eslint/template-parser": "16.3.1", + "@angular/animations": "^16.2.9", + "@angular/cli": "^16.2.6", + "@angular/common": "^16.2.9", + "@angular/compiler": "^16.2.9", + "@angular/compiler-cli": "^16.2.9", + "@angular/core": "^16.2.9", + "@angular/forms": "^16.2.9", + "@angular/platform-browser": "^16.2.9", + "@angular/platform-browser-dynamic": "^16.2.9", + "@angular/router": "^16.2.9", + "@descope/web-component": "3.0.0", + "@types/jest": "^29.5.5", + "@typescript-eslint/eslint-plugin": "6.11.0", + "@typescript-eslint/parser": "6.11.0", + "eslint": "^8.51.0", + "eslint-plugin-prettier": "^4.2.1", + "husky": "^8.0.3", + "jest": "^29.7.0", + "jest-preset-angular": "^13.1.2", + "lint-staged": "^15.2.0", + "ng-mocks": "^14.11.0", + "ng-packagr": "^16.2.3", + "prettier": "2.8.8", + "pretty-quick": "^3.1.3", + "rxjs": "~7.8.1", + "tslib": "^2.6.2", + "typescript": "~5.1.6", + "zone.js": "~0.13.0" + } }