-
-
Notifications
You must be signed in to change notification settings - Fork 558
chore: use pnpm instead of npm #1567
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
Changes from all commits
2bac42e
12dfced
ae4c0f1
adae213
4fddc69
6a6e06f
9df99a8
1c7ea67
5ad3d23
0000fb3
13815cd
9b5776e
1407a86
6ceaefa
6bb2b57
f62b69a
b5d1500
d09309b
ebd5694
622d44b
6533c02
5a9f08f
888b3e6
74e6d60
4f889e4
1aa8e88
8297374
769e48a
a950f9f
7a31bb9
ffe6bd3
dfab96e
d96e803
12b62c1
ac817c7
c8d3c19
2cbf924
f9dc6a6
5c0dc1c
73c5664
07b3553
59e3a31
4733b80
a7c5b28
4ac0ea3
7e5e28a
0c89b93
6d3fd35
b704869
a1eba33
928146e
55ad362
2ae4c71
b637e0b
8ecfc6c
4e2491f
29044b6
fa31ada
ce9d478
8a45fbd
067ba7b
285ba9c
f89bc8c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,59 +6,70 @@ on: | |
pull_request: | ||
types: [opened, synchronize, reopened, edited] | ||
|
||
env: | ||
NX_REJECT_UNKNOWN_LOCAL_CACHE: 0 | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 100 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
|
||
- uses: nrwl/nx-set-shas@v3 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.x" | ||
cache: "npm" | ||
cache-dependency-path: "**/package-lock.json" | ||
cache: "pnpm" | ||
cache-dependency-path: "**/pnpm-lock.yaml" | ||
node-version-file: ".nvmrc" | ||
|
||
- name: Cache NX | ||
uses: actions/cache@v4 | ||
with: | ||
path: node_modules/.cache/nx/ | ||
path: .nx/cache | ||
key: nx-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-${{ github.sha }} | ||
restore-keys: | | ||
nx-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}- | ||
nx-${{ env.NX_BRANCH }}- | ||
nx- | ||
|
||
# This is needed for the canvas dep, Tiptap V3 should remove the need for this | ||
- run: sudo apt-get update && sudo apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev pkg-config | ||
- name: Install Dependencies | ||
run: npm ci --prefer-offline --no-audit | ||
|
||
- name: Bootstrap packages | ||
run: npm run bootstrap | ||
run: pnpm install | ||
|
||
- name: Lint packages | ||
run: npm run lint | ||
run: pnpm run lint | ||
|
||
- name: Build packages | ||
run: npm run build | ||
run: pnpm run build | ||
|
||
- name: Run unit tests | ||
run: npm run test | ||
run: pnpm run test | ||
|
||
- name: Upload webpack stats artifact (editor) | ||
uses: relative-ci/agent-upload-artifact-action@v2 | ||
with: | ||
webpackStatsFile: ./playground/dist/webpack-stats.json | ||
artifactName: relative-ci-artifacts-editor | ||
|
||
- name: Soft release | ||
id: soft-release | ||
run: pnpx pkg-pr-new publish './packages/*' # --compact enable compact after release | ||
Comment on lines
+63
to
+65
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This adds support for pkg.pr.new which allows us to publish preliminary versions of packages to their registry, which should decrease the burden of releasing things when people need them as they can always use the preliminary version. Also great for testing things out in development There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can see an example on this PR: #1567 (comment) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cool! when do you use it for testing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It allows you to install the "final" package into another repository so it is very useful for testing in a real project. |
||
|
||
playwright: | ||
name: "Playwright Tests - ${{ matrix.browser }}" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
container: | ||
image: mcr.microsoft.com/playwright:v1.49.1-noble | ||
image: mcr.microsoft.com/playwright:v1.51.1-noble | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -68,37 +79,38 @@ jobs: | |
with: | ||
fetch-depth: 100 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
|
||
- uses: nrwl/nx-set-shas@v3 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.x" | ||
cache: "npm" | ||
cache-dependency-path: "**/package-lock.json" | ||
cache: "pnpm" | ||
cache-dependency-path: "**/pnpm-lock.yaml" | ||
node-version-file: ".nvmrc" | ||
|
||
- name: Cache NX | ||
uses: actions/cache@v4 | ||
with: | ||
path: node_modules/.cache/nx/ | ||
key: nx-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-${{ github.sha }} | ||
path: .nx/cache | ||
key: nx-${{ matrix.browser }}-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-${{ github.sha }} | ||
restore-keys: | | ||
nx-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}- | ||
nx-${{ env.NX_BRANCH }}- | ||
nx-${{ matrix.browser }}-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}- | ||
nx-${{ matrix.browser }}-${{ env.NX_BRANCH }}- | ||
nx- | ||
|
||
- run: apt-get update && apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev | ||
- run: apt-get update && apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev pkg-config | ||
|
||
- name: Install dependencies | ||
run: npm ci --prefer-offline --no-audit | ||
run: pnpm install | ||
|
||
- name: Build packages | ||
run: npm run build | ||
run: pnpm run build | ||
|
||
- name: Run server and Playwright tests | ||
run: | | ||
npm run start:built > /dev/null & | ||
npx wait-on http://localhost:3000 | ||
cd tests && HOME=/root npx playwright test --project ${{ matrix.browser }} | ||
HOME=/root PLAYWRIGHT_CONFIG="--project ${{ matrix.browser }}" pnpm run e2e | ||
|
||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# ./.github/workflows/publish.yml | ||
name: Publish | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We now have automatic publishing, need to work out the kinks and then will write a guide on how to release stuff There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. awesome! very curious about this! |
||
|
||
on: | ||
push: | ||
tags: | ||
- v*.*.* | ||
|
||
env: | ||
NX_REJECT_UNKNOWN_LOCAL_CACHE: 0 | ||
|
||
jobs: | ||
publish: | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
id-token: write # needed for provenance data generation | ||
attestations: write | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 100 | ||
- run: jq '.packageManager' package.json | tr -d '"pnpm@' | ||
id: package-manager-version | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v4 | ||
with: | ||
version: ${{ steps.package-manager-version.outputs.stdout }} | ||
|
||
- uses: nrwl/nx-set-shas@v3 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
cache: "pnpm" | ||
cache-dependency-path: "**/pnpm-lock.yaml" | ||
node-version-file: ".nvmrc" | ||
|
||
- name: Cache NX | ||
uses: actions/cache@v4 | ||
with: | ||
path: .nx/cache | ||
key: nx-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}-${{ github.sha }} | ||
restore-keys: | | ||
nx-${{ env.NX_BRANCH }}-${{ env.NX_RUN_GROUP }}- | ||
nx-${{ env.NX_BRANCH }}- | ||
nx- | ||
|
||
- run: sudo apt-get update && sudo apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev pkg-config | ||
|
||
- name: Install Dependencies & Build | ||
run: pnpm install && pnpm build | ||
|
||
- name: Print Environment Info | ||
run: pnpm exec nx report | ||
|
||
- name: Publish packages | ||
run: pnpm exec nx release publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} | ||
NPM_CONFIG_PROVENANCE: true | ||
GITHUB_TOKEN: "${{ github.token }}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,4 @@ release | |
/test-results/ | ||
/playwright-report/ | ||
/playwright/.cache/ | ||
.nx/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v20.11.0 | ||
v22.14.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true, | ||
"[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, | ||
"[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. intentional? |
||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
{ | ||
"extends": "next/core-web-vitals", | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ "@typescript-eslint"], | ||
"rules": { | ||
"import/extensions": 0 | ||
} | ||
"import/extensions": 0, | ||
"@next/next/no-img-element": "off" | ||
}, | ||
"root": true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,18 +4,18 @@ | |
"private": true, | ||
"scripts": { | ||
"dev": "next dev", | ||
"docs:build": "next build", | ||
"build:site": "next build", | ||
"start": "next start", | ||
"lint": "next lint" | ||
}, | ||
"dependencies": { | ||
"@blocknote/ariakit": "^0.26.0", | ||
"@blocknote/core": "^0.26.0", | ||
"@blocknote/code-block": "^0.26.0", | ||
"@blocknote/mantine": "^0.26.0", | ||
"@blocknote/react": "^0.26.0", | ||
"@blocknote/shadcn": "^0.26.0", | ||
"@blocknote/xl-multi-column": "^0.26.0", | ||
"@blocknote/ariakit": "workspace:*", | ||
"@blocknote/core": "workspace:*", | ||
"@blocknote/code-block": "workspace:*", | ||
"@blocknote/mantine": "workspace:*", | ||
"@blocknote/react": "workspace:*", | ||
"@blocknote/shadcn": "workspace:*", | ||
"@blocknote/xl-multi-column": "workspace:*", | ||
Comment on lines
+12
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. great! previous setup was annoying when merging old branches |
||
"@headlessui/react": "^1.7.18", | ||
"@heroicons/react": "^2.1.4", | ||
"@mantine/core": "^7.10.1", | ||
|
@@ -26,7 +26,7 @@ | |
"classnames": "2.3.2", | ||
"clsx": "^2.1.0", | ||
"framer-motion": "^10.16.16", | ||
"next": "^14.2.3", | ||
"next": "^15", | ||
"next-auth": "^5.0.0-beta.19", | ||
"nextra": "^2.13.2", | ||
"nextra-theme-docs": "^2.13.2", | ||
|
@@ -41,8 +41,8 @@ | |
}, | ||
"devDependencies": { | ||
"@types/node": "^20", | ||
"@types/react": "^18", | ||
"@types/react-dom": "^18", | ||
"@types/react": "^18.0.25", | ||
"@types/react-dom": "^18.0.9", | ||
"autoprefixer": "^10.0.1", | ||
"eslint": "^8", | ||
"eslint-config-next": "14.1.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
declare module '*.mdx' { | ||
import type { ComponentType } from 'react' | ||
const component: ComponentType<any> | ||
export default component | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,8 @@ | |
"scripts": { | ||
"start": "vite", | ||
"dev": "vite", | ||
"build": "tsc && vite build", | ||
"preview": "vite preview", | ||
"lint": "eslint . --max-warnings 0" | ||
"build:prod": "tsc && vite build", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"@blocknote/core": "latest", | ||
|
@@ -23,15 +22,6 @@ | |
"@types/react": "^18.0.25", | ||
"@types/react-dom": "^18.0.9", | ||
"@vitejs/plugin-react": "^4.3.1", | ||
"eslint": "^8.10.0", | ||
"vite": "^5.3.4" | ||
}, | ||
"eslintConfig": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. intentional to remove eslint from examples, or is it solved in a different way? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. eslint is global, so still works locally the referenced config file never worked for the sandboxes, so better to just remove altogether |
||
"extends": [ | ||
"../../../.eslintrc.js" | ||
] | ||
}, | ||
"eslintIgnore": [ | ||
"dist" | ||
] | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.