From 86b44d11e56408d0b8ac2e8a93b6624cb0f5283e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Po=C5=9Bpiech?= <37746259+piotrpospiech@users.noreply.github.com> Date: Mon, 28 Oct 2024 12:57:02 +0100 Subject: [PATCH] migrated npm leftovers, updated CI with pnpm --- .eslintignore | 2 -- .github/CONTRIBUTING.md | 24 +++++------------ .github/workflows/CI.yml | 57 +++++++++++++++------------------------- .gitignore | 2 -- .lintstagedrc.js | 2 +- .prettierignore | 2 -- 6 files changed, 28 insertions(+), 61 deletions(-) diff --git a/.eslintignore b/.eslintignore index 24642d724..d74d30522 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,8 +3,6 @@ /coverage /node_modules -/npm-debug.log -/npm-debug.log* /packages/*/cjs /packages/*/esm /packages/*/node_modules diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 00e6852e9..4f78e944d 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -18,8 +18,8 @@ Our kanban board is public and available [here](https://github.com/orgs/vazco/pr ## Making changes - Create a fork from where you want to base your work. -- Clone the repo and run `npm ci` **in the top-level only**. - - Make sure you are using `npm` that understands the `package-lock.json` format. Check the current version in the `package.json` file. +- Clone the repo and run `pnpm install` **in the top-level only**. + - Make sure you are using `pnpm` that understands the `pnpm-lock.json` format. Check the current version in the `package.json` file. - Make sure your commit messages are in the proper format: - Bugfix or feature: - `Implemented asynchronous validation (closes #17).` @@ -28,7 +28,7 @@ Our kanban board is public and available [here](https://github.com/orgs/vazco/pr - `Refactored joinName tests.` - `Updated README.md.` - Make sure you have added the necessary tests for your changes. Do not worry though, the Codecov bot will report it in the pull request. -- Make sure your code passes _all_ tests: `npm test`. +- Make sure your code passes _all_ tests: `pnpm test`. ### Development @@ -39,33 +39,21 @@ Run the commands below in the root directory. #### Running the build in watch mode ```sh -npm run build:watch +pnpm build:watch ``` #### Running the tests in watch mode ```sh -npm run test -- --watch +pnpm test -- --watch ``` #### Fixing lint issues automatically ```sh -npm run lint:code -- --fix +pnpm lint:code -- --fix ``` -#### Making changes to the documentation website (docusaurus) - -The local version of docs will use the locally built version of uniforms, so make sure to run the build in watch mode for live changes. - -Navigate to `/website` and run - -```sh -npm start -``` - -It will start the docusaurus in development mode supporting hot reload so you should see the changes made to the website immediately. - ## _Work in progress_ PRs are also welcome If you can't or won't finish your PR, submit it anyway - maybe someone else will continue your work. If you don't know how to achieve your desired feature - file an issue for it - maybe someone else will implement it. diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 595ba8bc1..1fe374e76 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -14,55 +14,40 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4.1.1 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4.0.2 with: - cache: npm + cache: pnpm node-version: ${{ matrix.node-version }} + - name: Check dependency duplications uses: vazco/open-standards/actions/npm-dependency-duplications/@master + - name: Check dependency vulnerabilities uses: vazco/open-standards/actions/npm-dependency-vulnerabilities/@master + - name: Install - run: npm i -g npm@8 --no-audit && npm ci --no-audit - - name: Lint - run: npm run lint + run: pnpm install + + - name: Check linting + run: pnpm lint:code + + - name: Check formatting + run: pnpm lint:text + + - name: Check types + run: pnpm lint:types + - name: Test - run: npm run coverage -- --no-cache --runInBand + run: pnpm coverage -- --no-cache --runInBand + - name: Report coverage uses: codecov/codecov-action@v4.3.0 with: fail_ci_if_error: true env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - Docs: - runs-on: ubuntu-latest - needs: CI - if: success() && github.event_name == 'push' && github.ref == 'refs/heads/master' - steps: - - name: Checkout - uses: actions/checkout@v3.3.0 - - name: Use Node.js 20 - uses: actions/setup-node@v3.6.0 - with: - cache: npm - node-version: 20 - - name: Install - run: npm ci --no-audit - - name: Build docs - run: npm --prefix website run build - - name: Deploy docs - uses: peaceiris/actions-gh-pages@v4.0.0 - with: - allow_empty_commit: true - cname: uniforms.tools - force_orphan: true - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./website/build - - name: Create a concentrated doc file - run: node ./scripts/concatenateDocs.js . uniformsConcentratedDocs.md - - name: Upload the concentrated doc file as an artifact - uses: actions/upload-artifact@v3 - with: - name: uniformsConcentratedDocs-${{ github.sha }}-${{ github.run_id }}-$(date +'%Y-%m-%d').md - path: uniformsConcentratedDocs.md diff --git a/.gitignore b/.gitignore index 4d048bd21..51b1b0488 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,6 @@ .turbo /node_modules -/npm-debug.log -/npm-debug.log* /packages/*/cjs /packages/*/esm /packages/*/node_modules diff --git a/.lintstagedrc.js b/.lintstagedrc.js index 1026323e0..4a74558d9 100644 --- a/.lintstagedrc.js +++ b/.lintstagedrc.js @@ -4,5 +4,5 @@ module.exports = { 'eslint --cache --cache-location node_modules/.cache/eslint --cache-strategy content', ], '**/*.{json,md,mdx,yml}': ['prettier --check'], - '**/*.{ts,tsx}': () => 'npm run lint:types' + '**/*.{ts,tsx}': () => 'pnpm lint:types', }; diff --git a/.prettierignore b/.prettierignore index 8811c80c7..084ba3075 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,8 +2,6 @@ /.parcel-cache /coverage /node_modules -/npm-debug.log -/npm-debug.log* /packages/*/cjs /packages/*/esm /packages/*/node_modules