From fd3987fe1c80986dc2b9713bae337cb06f6757c4 Mon Sep 17 00:00:00 2001 From: "Anantachai Saothong (Manta)" Date: Sun, 14 Jan 2024 01:18:01 +0700 Subject: [PATCH] Upgrade Node.js to v16 --- .circleci/config.yml | 38 --------------------------- .github/workflows/api-report.yml | 22 ---------------- .github/workflows/cd.yml | 27 +++++++++++++++++++ .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++++++++ .github/workflows/docs.yml | 23 ---------------- package.json | 31 +++++++++++----------- tsconfig.json | 17 ++++++------ yarn.lock | 16 ++++++------ 8 files changed, 105 insertions(+), 114 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 .github/workflows/api-report.yml create mode 100644 .github/workflows/cd.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/docs.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 5b93271..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: 2 -jobs: - build: - working_directory: ~/src - docker: - - image: circleci/node:14.8.0-browsers-legacy - steps: - - checkout - - restore_cache: - key: dependency-cache-{{ checksum "yarn.lock" }} - - run: - name: yarn - command: yarn install --frozen-lockfile - - save_cache: - key: dependency-cache-{{ checksum "yarn.lock" }} - paths: - - ./node_modules - - run: - name: lint - command: yarn lint - - run: - name: test - command: yarn test - - run: - name: build - command: yarn build - - run: - name: examples - command: ALLURE_SUITE_NAME=prescript-examples yarn run test-examples - - run: - name: allure - when: always - command: | - mkdir -p /tmp/allure-report - yarn allure generate allure-results -o "/tmp/allure-report" - - store_artifacts: - path: /tmp/allure-report - prefix: allure-report diff --git a/.github/workflows/api-report.yml b/.github/workflows/api-report.yml deleted file mode 100644 index 7dbf1b8..0000000 --- a/.github/workflows/api-report.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: CI -on: - push: -jobs: - build: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 14.x - - name: Install dependencies - run: yarn - - name: Update API reports - run: mkdir -p api && yarn api-extractor run --local - - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Update API report as of ${{ github.sha }} - file_pattern: api - commit_user_name: rebasecop - commit_user_email: rebasecop@users.noreply.github.com - commit_author: rebasecop diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..833b297 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,27 @@ +on: + push: + branches: + - master + - docs-revamp + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - uses: actions/setup-node@v4 + with: + node-version-file: package.json + cache: yarn + + - run: yarn install --frozen-lockfile + + - run: yarn docs:build + + - uses: peaceiris/actions-gh-pages@8457ade3d7045b4842e5a10f733d4153b7d05238 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/.vuepress/dist diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..85d4e9f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +on: + pull_request: + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version-file: package.json + cache: yarn + + - run: yarn install --frozen-lockfile + + - run: yarn lint + + - run: yarn test + + - run: yarn build + + build: + needs: check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: yarn + + - run: yarn install --frozen-lockfile + + - name: Update API reports + run: mkdir -p api && yarn api-extractor run --local + + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Update API report as of ${{ github.sha }} + file_pattern: api + commit_user_name: rebasecop + commit_user_email: rebasecop@users.noreply.github.com + commit_author: rebasecop diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index d6a122e..0000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Deploy documentation site -on: - push: - branches: - - master - - docs-revamp -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v2 - with: - persist-credentials: false - - name: Build documentation 🔧 - run: | - yarn - yarn docs:build - - name: Deploy - uses: peaceiris/actions-gh-pages@8457ade3d7045b4842e5a10f733d4153b7d05238 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/.vuepress/dist diff --git a/package.json b/package.json index 64af10b..26e1bbe 100644 --- a/package.json +++ b/package.json @@ -2,16 +2,26 @@ "name": "prescript", "version": "0.55555555.0", "description": "Object-oriented acceptance test tool", - "main": "./lib/singletonApi.js", - "types": "./api/prescript.d.ts", "author": "Thai Pangsakulyanont ", "license": "MIT", + "main": "./lib/singletonApi.js", + "types": "./api/prescript.d.ts", + "bin": "./bin/prescript", "files": [ "lib", "bin", "api/prescript.d.ts", "cli.js" ], + "scripts": { + "lint": "eslint . --ext .ts,.js", + "build": "tsc", + "prepare": "rm -rf lib && yarn build", + "test": "jest", + "test-examples": "node examples/testAll.js", + "docs:dev": "vuepress dev docs", + "docs:build": "vuepress build docs" + }, "dependencies": { "@types/cosmiconfig": "^5.0.3", "allure-js-commons": "^2.0.0-beta.7", @@ -32,7 +42,7 @@ "@types/invariant": "^2.2.29", "@types/jest": "^22.2.3", "@types/ms": "^0.7.30", - "@types/node": "^10.0.0", + "@types/node": "^16.0.0", "@typescript-eslint/parser": "^2.2.0", "allure-commandline": "^2.13.0", "eslint": "^6.3.0", @@ -42,19 +52,10 @@ "jest": "^22.4.3", "prettier": "^1.18.2", "ts-jest": "^22.4.4", - "typescript": "~3.5.1", + "typescript": "^5.3.3", "vuepress": "^1.4.1" }, - "scripts": { - "lint": "eslint . --ext .ts,.js", - "build": "tsc", - "prepare": "rm -rf lib && yarn build", - "test": "jest", - "test-examples": "node examples/testAll.js", - "docs:dev": "vuepress dev docs", - "docs:build": "vuepress build docs" - }, - "bin": { - "prescript": "./bin/prescript" + "volta": { + "node": "16.20.2" } } diff --git a/tsconfig.json b/tsconfig.json index 414c3f8..c94e9ff 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,18 +1,19 @@ { "compilerOptions": { - "moduleResolution": "node", - "target": "es2017", - "module": "commonjs", - "strict": true, - "sourceMap": true, "declaration": true, "declarationMap": true, "esModuleInterop": true, - "outDir": "lib", - "skipLibCheck": true, + "module": "commonjs", + "moduleResolution": "node", "noImplicitAny": false, "noUnusedLocals": true, - "rootDir": "src" + "outDir": "lib", + "rootDir": "src", + "skipLibCheck": true, + "sourceMap": true, + "strict": true, + "target": "es2017", + "useUnknownInCatchVariables": false }, "include": ["src/**/*"] } diff --git a/yarn.lock b/yarn.lock index a674163..429c856 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1065,10 +1065,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.13.tgz#ccebcdb990bd6139cd16e84c39dc2fb1023ca90c" integrity sha512-pMCcqU2zT4TjqYFrWtYHKal7Sl30Ims6ulZ4UFXxI4xbtQqK/qqKwkDoBFCfooRqqmRu9vY3xaJRwxSh673aYg== -"@types/node@^10.0.0": - version "10.17.28" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.28.tgz#0e36d718a29355ee51cec83b42d921299200f6d9" - integrity sha512-dzjES1Egb4c1a89C7lKwQh8pwjYmlOAG9dW1pBgxEk57tMrLnssOfEthz8kdkNaBd7lIqQx7APm5+mZ619IiCQ== +"@types/node@^16.0.0": + version "16.18.70" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.70.tgz#d4c819be1e9f8b69a794d6f2fd929d9ff76f6d4b" + integrity sha512-8eIk20G5VVVQNZNouHjLA2b8utE2NvGybLjMaF4lyhA9uhGwnmXF8o+icdXKGSQSNANJewXva/sFUoZLwAaYAg== "@types/q@^1.5.1": version "1.5.4" @@ -9650,10 +9650,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@~3.5.1: - version "3.5.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977" - integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g== +typescript@^5.3.3: + version "5.3.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37" + integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== typescript@~4.3.5: version "4.3.5"