Skip to content

Commit

Permalink
Use pnpm and Nx to manage the monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
nickgros committed Aug 16, 2024
1 parent a7b25e8 commit 113d704
Show file tree
Hide file tree
Showing 56 changed files with 25,185 additions and 36,988 deletions.
10 changes: 6 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,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
13 changes: 6 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,25 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- 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
13 changes: 6 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- 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

0 comments on commit 113d704

Please sign in to comment.