Skip to content

Commit

Permalink
migrated npm leftovers, updated CI with pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrpospiech committed Oct 28, 2024
1 parent b4458a9 commit 86b44d1
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 61 deletions.
2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
/coverage

/node_modules
/npm-debug.log
/npm-debug.log*
/packages/*/cjs
/packages/*/esm
/packages/*/node_modules
Expand Down
24 changes: 6 additions & 18 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).`
Expand All @@ -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

Expand All @@ -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.
57 changes: 21 additions & 36 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,40 @@ jobs:
steps:
- name: Checkout
uses: actions/[email protected]

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/[email protected]
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/[email protected]
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/[email protected]
- name: Use Node.js 20
uses: actions/[email protected]
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/[email protected]
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
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
.turbo

/node_modules
/npm-debug.log
/npm-debug.log*
/packages/*/cjs
/packages/*/esm
/packages/*/node_modules
Expand Down
2 changes: 1 addition & 1 deletion .lintstagedrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
/.parcel-cache
/coverage
/node_modules
/npm-debug.log
/npm-debug.log*
/packages/*/cjs
/packages/*/esm
/packages/*/node_modules
Expand Down

0 comments on commit 86b44d1

Please sign in to comment.