Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pnpm and Nx to manage the monorepo #4275

Draft
wants to merge 1 commit into
base: rjsf-v6
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,15 @@ body:
label: Environment
description: |
examples:
- **OS**: Ubuntu 20.04
- **Node**: 13.14.0
- **npm**: 7.6.3
- **OS**: Ubuntu 24.04
- **Browser**: Chrome 127.0
- **Node**: 20.9.0
- **Package Manager**: npm 10.8.1
value: |
- OS:
- Browser:
- Node:
- npm:
- Package Manager:
render: markdown
validations:
required: false
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ updates:
schedule:
interval: 'monthly'

- package-ecosystem: 'npm'
- package-ecosystem: 'pnpm'
directory: '/'
schedule:
interval: 'monthly'
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,27 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: 'package-lock.json'
- run: npm i -g npm@9
- run: npm ci
- run: npm run lint
cache: 'pnpm'
- run: pnpm install
- run: pnpm lint

- name: Build with Netlify badge
if: github.ref != 'refs/heads/main' && matrix.node-version != '14.x'
run: npm run build
run: pnpm build
env:
VITE_SHOW_NETLIFY_BADGE: true
NODE_OPTIONS: --max_old_space_size=4096

- name: Build
if: github.ref == 'refs/heads/main' && matrix.node-version != '14.x'
run: npm run build
run: pnpm build
env:
NODE_OPTIONS: --max_old_space_size=4096

Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'npm'
cache-dependency-path: 'package-lock.json'
- run: npm i -g npm@9
- run: npm ci
- run: npm run build
cache: 'pnpm'
- run: pnpm install
- run: pnpm build
env:
NODE_OPTIONS: --max_old_space_size=4096
- run: npm test
- run: npm run lint
- run: pnpm test
- run: pnpm lint
- run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,6 @@ out/

# typescript tsbuildinfo
*.tsbuildinfo

.nx/cache
.nx/workspace-data
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
. "$(dirname -- "$0")/_/husky.sh"
# Hopefully this disables husky on github CI
[ -n "$CI" ] && exit 0
npm run pre-commit:husky
pnpm pre-commit:husky
2 changes: 1 addition & 1 deletion PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ If your PR is non-trivial and you'd like to schedule a synchronous review, pleas
- [ ] **I'm updating documentation**
- [ ] I've [checked the rendering](https://rjsf-team.github.io/react-jsonschema-form/docs/contributing) of the Markdown text I've added
- [ ] **I'm adding or updating code**
- [ ] I've added and/or updated tests. I've run `npx nx run-many --target=build --exclude=@rjsf/docs && npm run test:update` to update snapshots, if needed.
- [ ] I've added and/or updated tests. I've run `npx nx run-many --target=build --exclude=@rjsf/docs && pnpm test:update` to update snapshots, if needed.
- [ ] I've updated [docs](https://rjsf-team.github.io/react-jsonschema-form/docs) if needed
- [ ] I've updated the [changelog](https://github.com/rjsf-team/react-jsonschema-form/blob/main/CHANGELOG.md) with a description of the PR
- [ ] **I'm adding a new feature**
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build]
base = ""
publish = "packages/playground/dist"
command = "npm run build-serial"
command = "pnpm build-serial"
# Ignore dependabot PRs for deploy previews
ignore = "./netlify-ignore.sh"

Expand Down
80 changes: 49 additions & 31 deletions nx.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,56 @@
{
"extends": "nx/presets/npm.json",
"tasksRunnerOptions": {
"default": {
"runner": "@nrwl/nx-cloud",
"options": {
"cacheableOperations": [
"build",
"cs-check",
"cs-format",
"lint",
"test",
"test:update",
"test:watch",
"precommit",
"publish-to-npm",
"test-coverage",
"build:lib",
"prepublishOnly",
"build:dist",
"publish-to-gh-pages"
]
}
}
},
"targetDefaults": {
"build": {
"dependsOn": [{
"//": "use only dependencies to avoid cycle @rjsf/core:build --> @rjsf/snapshot-tests:build --> @rjsf/core:build",
"projects": "dependencies",
"target": "^build"
}]
"dependsOn": [
{
"//": "use only dependencies to avoid cycle @rjsf/core:build --> @rjsf/snapshot-tests:build --> @rjsf/core:build",
"target": "^build",
"dependencies": true
}
],
"cache": true
},
"cs-check": {
"cache": true
},
"cs-format": {
"cache": true
},
"lint": {
"cache": true
},
"test": {
"cache": true
},
"test:update": {
"cache": true
},
"test:watch": {
"cache": true
},
"precommit": {
"cache": true
},
"publish-to-npm": {
"cache": true
},
"test-coverage": {
"cache": true
},
"build:lib": {
"cache": true
},
"prepublishOnly": {
"cache": true
},
"build:dist": {
"cache": true
},
"publish-to-gh-pages": {
"cache": true
}
},
"affected": {
"defaultBase": "main"
}
"useInferencePlugins": false,
"defaultBase": "main"
}
Loading