From 5a65aad35db7039c792ed968e8242ea2485fdd82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rge=20N=C3=A6ss?= Date: Sat, 20 Jan 2024 18:17:50 +0100 Subject: [PATCH] chore: rename mentions of yarn => pnpm --- .github/workflows/cli-test.yml | 8 +- .github/workflows/depCheck.yml | 6 +- .github/workflows/docReport.yml | 12 +-- .github/workflows/e2e-ct.yml | 10 +-- .github/workflows/e2e-pte.yml | 6 +- .github/workflows/e2e.yml | 22 ++--- .github/workflows/etl.yml | 8 +- .github/workflows/formatCheck.yml | 6 +- .github/workflows/lint-fix-if-needed.yml | 12 +-- .github/workflows/lintPr.yml | 6 +- .github/workflows/perf.yml | 6 +- .github/workflows/pr-cleanup.yml | 12 +-- .github/workflows/prettier-if-needed.yml | 12 +-- .github/workflows/test.yml | 12 +-- .github/workflows/typeCheck.yml | 6 +- .github/workflows/yarn-if-needed.yml | 20 ++--- .gitignore | 4 +- .husky/pre-commit | 2 +- CONTRIBUTING.md | 16 ++-- dev/test-studio/.env.example | 2 +- dev/test-studio/sanity.cli.ts | 2 +- package.json | 82 ++++++++----------- .../cli/util/checkRequiredDependencies.ts | 6 +- .../cli/util/checkStudioDependencyVersions.ts | 13 ++- .../definitions/operators/arrayOperators.ts | 2 +- .../definitions/operators/assetOperators.ts | 2 +- .../definitions/operators/booleanOperators.ts | 2 +- .../definitions/operators/dateOperators.ts | 2 +- .../definitions/operators/numberOperators.ts | 2 +- .../operators/portableTextOperators.ts | 2 +- .../operators/referenceOperators.ts | 2 +- .../definitions/operators/slugOperators.ts | 2 +- .../definitions/operators/stringOperators.ts | 2 +- perf/readme.md | 2 +- perf/tests/package.json | 6 +- playwright.config.ts | 2 +- scripts/etl.ts | 4 +- scripts/normalizeDependencyVersions.ts | 2 +- scripts/publish/tarball.ts | 2 +- test/e2e/README.md | 10 +-- 40 files changed, 167 insertions(+), 170 deletions(-) diff --git a/.github/workflows/cli-test.yml b/.github/workflows/cli-test.yml index 392352a8655..92d73d3d3e6 100644 --- a/.github/workflows/cli-test.yml +++ b/.github/workflows/cli-test.yml @@ -44,7 +44,7 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- @@ -52,17 +52,17 @@ jobs: - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Build CLI - run: yarn build:cli # Needed for CLI tests + run: pnpm build:cli # Needed for CLI tests - name: Test id: test run: | node -v npm -v - yarn test --silent --selectProjects=@sanity/cli + pnpm test --silent --selectProjects=@sanity/cli env: # Update token in github and change below to ${{ secrets.SANITY_CI_CLI_AUTH_TOKEN }} after merge to next SANITY_CI_CLI_AUTH_TOKEN_STAGING: ${{ secrets.SANITY_CI_CLI_AUTH_TOKEN_STAGING }} diff --git a/.github/workflows/depCheck.yml b/.github/workflows/depCheck.yml index 3fcdc2e06fa..381d09c5e5f 100644 --- a/.github/workflows/depCheck.yml +++ b/.github/workflows/depCheck.yml @@ -18,7 +18,7 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- @@ -26,10 +26,10 @@ jobs: - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Check for unused/missing dependencies id: depcheck - run: yarn depcheck + run: pnpm depcheck env: NODE_OPTIONS: --max_old_space_size=8192 diff --git a/.github/workflows/docReport.yml b/.github/workflows/docReport.yml index b7dc14629df..096389b1442 100644 --- a/.github/workflows/docReport.yml +++ b/.github/workflows/docReport.yml @@ -25,7 +25,7 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- @@ -33,10 +33,10 @@ jobs: - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Build packages - run: yarn build + run: pnpm build env: NODE_OPTIONS: --max_old_space_size=8192 @@ -45,21 +45,21 @@ jobs: env: DOCS_REPORT_TOKEN: ${{ secrets.DOCS_REPORT_DATASET_TOKEN }} DOCS_REPORT_DATASET: ${{ github.ref == 'refs/heads/current' && 'production' || 'next'}} - run: yarn docs:report:create + run: pnpm docs:report:create - name: Create Docs Report on PR if: ${{ github.event_name == 'pull_request' }} env: DOCS_REPORT_TOKEN: ${{ secrets.DOCS_REPORT_DATASET_TOKEN }} DOCS_REPORT_DATASET: pr-${{ github.event.number }} - run: yarn docs:report:create + run: pnpm docs:report:create - name: Compare Docs Coverage on PR if: ${{ github.event_name == 'pull_request' }} env: DOCS_REPORT_TOKEN: ${{ secrets.DOCS_REPORT_DATASET_TOKEN }} DOCS_REPORT_DATASET: pr-${{ github.event.number }} - run: yarn docs:report + run: pnpm docs:report - name: PR comment with report uses: thollander/actions-comment-pull-request@1d3973dc4b8e1399c0620d3f2b1aa5e795465308 # v2 diff --git a/.github/workflows/e2e-ct.yml b/.github/workflows/e2e-ct.yml index 11eac12fb0c..e76a0af576b 100644 --- a/.github/workflows/e2e-ct.yml +++ b/.github/workflows/e2e-ct.yml @@ -24,7 +24,7 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- @@ -32,7 +32,7 @@ jobs: - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --immutable --immutable-cache --check-cache + run: pnpm install --frozen-lockfile - name: Store Playwright's Version run: | @@ -48,9 +48,9 @@ jobs: - name: Install Playwright Browsers run: npx playwright install --with-deps - name: Build CLI - run: yarn build:cli # Needed for CLI tests + run: pnpm build:cli # Needed for CLI tests - name: Run end-to-end tests - run: yarn workspace sanity test:ct + run: pnpm --filter sanity test:ct env: NODE_OPTIONS: --max_old_space_size=8192 - name: Get Current Job Log URL @@ -63,7 +63,7 @@ jobs: - name: Parse playwright report id: parse-playwright-report if: always() - run: yarn workspace sanity write:playwright-report-as-pr-comment + run: pnpm --filter sanity write:playwright-report-as-pr-comment env: GITHUB_WORKFLOW_URL: '${{ steps.job_html_url.outputs.html_url }}' - name: PR comment with report diff --git a/.github/workflows/e2e-pte.yml b/.github/workflows/e2e-pte.yml index c2611de8fe4..6355a071d8c 100644 --- a/.github/workflows/e2e-pte.yml +++ b/.github/workflows/e2e-pte.yml @@ -32,7 +32,7 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- @@ -40,7 +40,7 @@ jobs: - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Store Playwright's Version run: | @@ -60,4 +60,4 @@ jobs: run: npx playwright install --with-deps - name: Run end-to-end tests - run: cd packages/@sanity/portable-text-editor && yarn test:e2e --silent --shard=${{ matrix.shardIndex}}/${{ matrix.shardTotal }} + run: cd packages/@sanity/portable-text-editor && pnpm test:e2e --silent --shard=${{ matrix.shardIndex}}/${{ matrix.shardTotal }} diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index b312a9130f6..7c2cbe32232 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -30,7 +30,7 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- @@ -38,7 +38,7 @@ jobs: - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Store Playwright's Version run: | @@ -58,7 +58,7 @@ jobs: run: npx playwright install --with-deps - name: Build CLI - run: yarn build:cli # Needed for CLI tests + run: pnpm build:cli # Needed for CLI tests - name: Build E2E test studio on next if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/next' }} @@ -69,7 +69,7 @@ jobs: SANITY_E2E_SESSION_TOKEN: ${{ secrets.SANITY_E2E_SESSION_TOKEN_NEW }} SANITY_E2E_PROJECT_ID: ${{ secrets.SANITY_E2E_PROJECT_ID }} SANITY_E2E_DATASET: ${{ secrets.SANITY_E2E_DATASET }} - run: yarn e2e:setup && yarn e2e:build + run: pnpm e2e:setup && pnpm e2e:build - name: Build E2E test studio on PR if: ${{ github.event_name == 'pull_request' }} @@ -80,7 +80,7 @@ jobs: SANITY_E2E_SESSION_TOKEN: ${{ secrets.SANITY_E2E_SESSION_TOKEN_NEW }} SANITY_E2E_PROJECT_ID: ${{ secrets.SANITY_E2E_PROJECT_ID }} SANITY_E2E_DATASET: pr-${{ matrix.project }}-${{ github.event.number }} - run: yarn e2e:setup && yarn e2e:build + run: pnpm e2e:setup && pnpm e2e:build # Caches build from either PR or next - name: Cache build @@ -121,7 +121,7 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- @@ -129,7 +129,7 @@ jobs: - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Store Playwright's Version run: | @@ -171,7 +171,7 @@ jobs: SANITY_E2E_SESSION_TOKEN: ${{ secrets.SANITY_E2E_SESSION_TOKEN_NEW }} SANITY_E2E_PROJECT_ID: ${{ secrets.SANITY_E2E_PROJECT_ID }} SANITY_E2E_DATASET: ${{ secrets.SANITY_E2E_DATASET }} - run: yarn test:e2e --project ${{ matrix.project }} --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} + run: npx playwright test --project ${{ matrix.project }} --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} - name: Run E2E tests on PR if: ${{ github.event_name == 'pull_request' }} @@ -185,7 +185,7 @@ jobs: SANITY_E2E_SESSION_TOKEN: ${{ secrets.SANITY_E2E_SESSION_TOKEN_NEW }} SANITY_E2E_PROJECT_ID: ${{ secrets.SANITY_E2E_PROJECT_ID }} SANITY_E2E_DATASET: pr-${{ matrix.project }}-${{ github.event.number }} - run: yarn test:e2e --project ${{ matrix.project }} --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} + run: npx playwright test --project ${{ matrix.project }} --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} - uses: actions/upload-artifact@v3 if: always() @@ -210,7 +210,7 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- @@ -218,7 +218,7 @@ jobs: - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Download blob reports from Github Actions Artifacts uses: actions/download-artifact@v3 diff --git a/.github/workflows/etl.yml b/.github/workflows/etl.yml index ddad8b052e0..0a7b974f4d7 100644 --- a/.github/workflows/etl.yml +++ b/.github/workflows/etl.yml @@ -25,7 +25,7 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- @@ -33,10 +33,10 @@ jobs: - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Build packages - run: yarn build + run: pnpm build env: NODE_OPTIONS: --max_old_space_size=8192 @@ -45,4 +45,4 @@ jobs: EXTRACT_SANITY_PROJECT_ID: "${{(github.event_name == 'push' && github.ref == 'refs/heads/current') && secrets.EXTRACT_SANITY_PROJECT_ID || secrets.DEV_EXTRACT_SANITY_PROJECT_ID}}" EXTRACT_SANITY_DATASET: "${{(github.event_name == 'push' && github.ref == 'refs/heads/current') && secrets.EXTRACT_SANITY_DATASET || secrets.DEV_EXTRACT_SANITY_DATASET}}" EXTRACT_SANITY_API_TOKEN: "${{(github.event_name == 'push' && github.ref == 'refs/heads/current') && secrets.EXTRACT_SANITY_API_TOKEN || secrets.DEV_EXTRACT_SANITY_API_TOKEN}}" - run: yarn etl sanity + run: pnpm etl sanity diff --git a/.github/workflows/formatCheck.yml b/.github/workflows/formatCheck.yml index 4beb99ec88e..bd324818571 100644 --- a/.github/workflows/formatCheck.yml +++ b/.github/workflows/formatCheck.yml @@ -23,7 +23,7 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- @@ -31,7 +31,7 @@ jobs: - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Run format check - run: yarn turbo run check:format + run: pnpm turbo run check:format diff --git a/.github/workflows/lint-fix-if-needed.yml b/.github/workflows/lint-fix-if-needed.yml index a8aca0ceea8..cf15d5c3b2b 100644 --- a/.github/workflows/lint-fix-if-needed.yml +++ b/.github/workflows/lint-fix-if-needed.yml @@ -31,32 +31,32 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- ${{ runner.os }}- - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Cache ESLint cache uses: actions/cache@v3 with: path: .eslintcache key: eslint-v1-${{ hashFiles('.eslintrc.cjs') }} - - run: "yarn lint:fix --rule 'prettier/prettier: [off]'" + - run: "pnpm lint:fix --rule 'prettier/prettier: [off]'" - uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2 - # Run even if `yarn lint:fix` fails + # Run even if `pnpm lint:fix` fails if: always() id: generate-token with: app_id: ${{ secrets.ECOSPARK_APP_ID }} private_key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }} - uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v6 - # Run even if `yarn lint:fix` fails + # Run even if `lint:fix` fails if: always() with: - body: "I ran `yarn lint:fix --rule 'prettier/prettier: [off]'` 🧑‍💻" + body: "I ran `lint:fix --rule 'prettier/prettier: [off]'` 🧑‍💻" branch: actions/lint-fix-if-needed commit-message: 'chore(lint): fix linter issues 🤖 ✨' labels: 🤖 bot diff --git a/.github/workflows/lintPr.yml b/.github/workflows/lintPr.yml index 78e2cd700d6..f33adba8fcd 100644 --- a/.github/workflows/lintPr.yml +++ b/.github/workflows/lintPr.yml @@ -25,7 +25,7 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- @@ -33,7 +33,7 @@ jobs: - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Lint files - run: yarn lint + run: pnpm lint diff --git a/.github/workflows/perf.yml b/.github/workflows/perf.yml index dd0f7a715d6..4eafd0d7b07 100644 --- a/.github/workflows/perf.yml +++ b/.github/workflows/perf.yml @@ -22,7 +22,7 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- @@ -31,7 +31,7 @@ jobs: - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' working-directory: ./perf - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Store Playwright's Version run: | @@ -58,4 +58,4 @@ jobs: PERF_TEST_BRANCH: 'next' PERF_TEST_SANITY_TOKEN: ${{ secrets.PERF_TEST_SANITY_TOKEN }} PERF_TEST_METRICS_TOKEN: ${{ secrets.PERF_TEST_METRICS_TOKEN }} - run: yarn perf:test:ci + run: pnpm perf:test:ci diff --git a/.github/workflows/pr-cleanup.yml b/.github/workflows/pr-cleanup.yml index d85410e11c9..572f8654db5 100644 --- a/.github/workflows/pr-cleanup.yml +++ b/.github/workflows/pr-cleanup.yml @@ -23,7 +23,7 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- @@ -31,13 +31,13 @@ jobs: - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Remove docs report datasets for closed PRs env: DOCS_REPORT_TOKEN: ${{ secrets.DOCS_REPORT_DATASET_TOKEN }} DOCS_REPORT_DATASET: pr-${{ github.event.number }} - run: yarn docs:report:cleanup + run: pnpm docs:report:cleanup e2e-cleanup: runs-on: ubuntu-latest @@ -59,7 +59,7 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- @@ -67,11 +67,11 @@ jobs: - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Remove E2E datasets for closed PRs env: SANITY_E2E_SESSION_TOKEN: ${{ secrets.SANITY_E2E_SESSION_TOKEN_NEW }} SANITY_E2E_PROJECT_ID: ${{ secrets.SANITY_E2E_PROJECT_ID }} SANITY_E2E_DATASET: pr-${{ matrix.project }}-${{ github.event.number }} - run: yarn e2e:cleanup + run: pnpm e2e:cleanup diff --git a/.github/workflows/prettier-if-needed.yml b/.github/workflows/prettier-if-needed.yml index 7f26e4782c6..07c02128883 100644 --- a/.github/workflows/prettier-if-needed.yml +++ b/.github/workflows/prettier-if-needed.yml @@ -31,22 +31,22 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- ${{ runner.os }}- - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --ignore-scripts --frozen-lockfile + run: pnpm install --ignore-scripts --frozen-lockfile - name: Cache Prettier uses: actions/cache@v3 with: path: node_modules/.cache/prettier/.prettier-cache - key: prettier-${{ hashFiles('yarn.lock') }} - - run: yarn prettier --write + key: prettier-${{ hashFiles('pnpm-lock.yaml') }} + - run: pnpm prettier --write - name: GitHub blocks PRs from automation that alter workflows in any way - run: git restore .github/workflows yarn.lock + run: git restore .github/workflows pnpm-lock.yaml - uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2 id: generate-token with: @@ -54,7 +54,7 @@ jobs: private_key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }} - uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v6 with: - body: I ran `yarn prettier` 🧑‍💻 + body: I ran `prettier` 🧑‍💻 branch: actions/prettier-if-needed commit-message: 'chore(prettier): fix unformatted files 🤖 ✨' labels: 🤖 bot diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bfd8f784830..6782fb6c381 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,7 +44,7 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- @@ -62,10 +62,10 @@ jobs: - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Build CLI - run: yarn build:cli # Needed for CLI tests + run: pnpm build:cli # Needed for CLI tests test: timeout-minutes: 60 @@ -107,7 +107,7 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- @@ -126,14 +126,14 @@ jobs: - name: Install project dependencies if: steps.restore-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Test id: test run: | node -v npm -v - yarn test --silent --shard=${{ matrix.shardIndex}}/${{ matrix.shardTotal }} --ignoreProjects=@sanity/cli + pnpm test --silent --shard=${{ matrix.shardIndex}}/${{ matrix.shardTotal }} --ignoreProjects=@sanity/cli env: GITHUB_SHARD_IDENTIFIER: ${{ matrix.shardIndex }}-${{ matrix.shardTotal }} diff --git a/.github/workflows/typeCheck.yml b/.github/workflows/typeCheck.yml index 8cb4fe93e48..9017aa1aecd 100644 --- a/.github/workflows/typeCheck.yml +++ b/.github/workflows/typeCheck.yml @@ -18,7 +18,7 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- @@ -26,12 +26,12 @@ jobs: - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --frozen-lockfile + run: pnpm install --frozen-lockfile - name: Check type system # If TypeScript project references is set up properly, `tsc --build` should work right after dependencies # has been installed, no extra build/compile step required id: typeCheckModules - run: yarn type-check + run: pnpm type-check env: NODE_OPTIONS: --max_old_space_size=8192 diff --git a/.github/workflows/yarn-if-needed.yml b/.github/workflows/yarn-if-needed.yml index aa0435d93b0..3efe06f01f1 100644 --- a/.github/workflows/yarn-if-needed.yml +++ b/.github/workflows/yarn-if-needed.yml @@ -1,11 +1,11 @@ --- -name: Dedupe yarn lockfile +name: Dedupe lockfile on: push: branches: [next] paths: - - 'yarn.lock' + - 'pnpm-lock.yaml' workflow_dispatch: concurrency: @@ -17,7 +17,7 @@ permissions: jobs: run: - name: Can yarn.lock be deduped? 🤔 + name: Can pnpm-lock.yaml be deduped? 🤔 runs-on: ubuntu-latest # workflow_dispatch always lets you select the branch ref, even though in this case we only ever want to run the action on `main` thus we need an if check if: ${{ github.ref_name == 'next' }} @@ -30,15 +30,15 @@ jobs: cache-name: cache-node-modules with: path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-modules-${{ env.cache-name }}- ${{ runner.os }}-modules- ${{ runner.os }}- - name: Install project dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' - run: yarn install --ignore-scripts --frozen-lockfile --update-checksums --force - - run: npx yarn-deduplicate -- yarn.lock --strategy highest + run: pnpm install --ignore-scripts --frozen-lockfile --force + - run: pnpm dedupe - uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2 id: generate-token with: @@ -46,9 +46,9 @@ jobs: private_key: ${{ secrets.ECOSPARK_APP_PRIVATE_KEY }} - uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v6 with: - body: I ran `npx yarn-deduplicate -- yarn.lock --strategy highest` 🧑‍💻 - branch: actions/yarn-if-needed - commit-message: 'chore(deps): dedupe yarn.lock' + body: I ran `pnpm dedupe` 🧑‍💻 + branch: actions/dedupe-if-needed + commit-message: 'chore(deps): dedupe pnpm-lock.yaml' labels: 🤖 bot - title: 'chore(deps): dedupe yarn.lock' + title: 'chore(deps): dedupe pnpm-lock.yaml' token: ${{ steps.generate-token.outputs.token }} diff --git a/.gitignore b/.gitignore index a4b96d97078..afe43e1e51f 100644 --- a/.gitignore +++ b/.gitignore @@ -73,9 +73,7 @@ etc /test/e2e/state blob-report -# Temporary files made by yarn when running canary releases -.yarn -.yarnrc +# Temporary files made when running canary releases .turbo .yalc yalc.lock diff --git a/.husky/pre-commit b/.husky/pre-commit index d2ae35e84b0..fab6428a1a7 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,4 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -yarn lint-staged +pnpm lint-staged diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9fb177bcd1b..a0484d5840b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,14 +8,14 @@ Contributions are always welcome, no matter how large or small. Before contributing, please read our [code of conduct](https://github.com/sanity-io/sanity/blob/current/CODE_OF_CONDUCT.md). -Then make sure you have _Node.js version 16 or newer_. We currently use [Yarn](https://classic.yarnpkg.com/en/docs/install) 1 as our package manager, so make sure you have that installed as well. +Then make sure you have _Node.js version 18 or newer_. We currently use [pnpm](https://pnpm.io/installation) as our package manager, so make sure you have that installed as well. ```sh git clone git@github.com:sanity-io/sanity.git cd sanity -yarn -yarn build -yarn dev +pnpm install +pnpm build +pnpm dev ``` # Release/workflow guidelines @@ -72,15 +72,15 @@ If you find yourself wishing for a feature that doesn't exist in Sanity, you are # Troubleshooting -If you run into build issues, you might want to run `yarn init`, which will delete all `node_modules` folders, then run a fresh `yarn bootstrap` to install and cross-symlink all modules, followed by building all ES6 code to ES5. +If you run into build issues, you might want to run `pnpm clean && pnpm clean:deps`, which will delete all `node_modules` folders, then run a fresh `pnpm bootstrap` to install and cross-symlink all modules, followed by building all ES6 code to ES5. # Testing Some tests are based on compiled files, so you will need to build the repository first before running the tests: ```sh -yarn build -yarn test +pnpm build +pnpm test ``` -Note: this runs `yarn test` for all the Sanity packages - the output can be quite hard to read. If you encounter an issue, it's usually best to figure out which module is failing, then run `yarn test` in that individual module. +Note: this runs `pnpm test` for all the Sanity packages - the output can be quite hard to read. If you encounter an issue, it's usually best to figure out which module is failing, then run `pnpm test` in that individual module. diff --git a/dev/test-studio/.env.example b/dev/test-studio/.env.example index bbc8f819483..d434e6971eb 100644 --- a/dev/test-studio/.env.example +++ b/dev/test-studio/.env.example @@ -1,4 +1,4 @@ # To disable strict mode on your local checkout: # `cp .env.example .env.development` -# Then restart your `sanity dev` or `yarn dev` command +# Then restart your `sanity dev` or `pnpm dev` command SANITY_STUDIO_REACT_STRICT_MODE=false diff --git a/dev/test-studio/sanity.cli.ts b/dev/test-studio/sanity.cli.ts index 84ec402e0b5..1752dd16ea7 100644 --- a/dev/test-studio/sanity.cli.ts +++ b/dev/test-studio/sanity.cli.ts @@ -9,7 +9,7 @@ export default defineCliConfig({ }, // Can be overriden by: - // A) `SANITY_STUDIO_REACT_STRICT_MODE=false yarn dev` + // A) `SANITY_STUDIO_REACT_STRICT_MODE=false pnpm dev` // B) creating a `.env` file locally that sets the same env variable as above reactStrictMode: true, vite(viteConfig: UserConfig): UserConfig { diff --git a/package.json b/package.json index a45ca992ae9..088978de41d 100644 --- a/package.json +++ b/package.json @@ -2,18 +2,8 @@ "name": "sanity-root", "version": "0.0.0", "private": true, - "workspaces": [ - "dev/*", - "perf/tests", - "perf/studio", - "examples/*", - "packages/@sanity/*", - "packages/create-sanity", - "packages/groq", - "packages/sanity" - ], "scripts": { - "bootstrap": "yarn install && yarn build:dts && yarn build:cli", + "bootstrap": "pnpm install && pnpm build:dts && pnpm build:cli", "build": "turbo run --filter=@sanity/* --filter=groq --filter=sanity build", "build:cli": "turbo run --filter=@sanity/cli --filter=sanity build", "build:dts": "tsc --build tsconfig.lib.json", @@ -23,63 +13,63 @@ "clean:deps": "rimraf packages/@sanity/*/node_modules packages/*/node_modules node_modules perf/tests/node_modules perf/studio/node_modules", "check:deps-updates": "npx npm-check-updates --workspaces --root -m", "check:versions": "node -r esbuild-register scripts/normalizeDependencyVersions.ts", - "depcheck": "lerna exec depcheck --no-bail --parallel", - "deploy:movies": "yarn build && cd examples/movies-studio && sanity deploy", - "deploy:test": "yarn build && cd dev/test-studio && sanity deploy", - "dev": "yarn start", - "dev:i18n": "SANITY_STUDIO_DEBUG_I18N=triangles yarn start", - "dev:i18n:reverse": "SANITY_STUDIO_DEBUG_I18N=reverse yarn start", - "dev:design-studio": "yarn --cwd dev/design-studio dev", - "dev:starter-studio": "yarn --cwd dev/starter-studio dev", - "dev:strict-studio": "yarn --cwd dev/strict-studio dev", - "dev:test-studio": "yarn --cwd dev/test-studio dev", - "dev:embedded-studio": "yarn --cwd dev/embedded-studio dev", + "depcheck": "pnpm exec -r depcheck", + "deploy:movies": "pnpm build && cd examples/movies-studio && sanity deploy", + "deploy:test": "pnpm build && cd dev/test-studio && sanity deploy", + "dev": "pnpm start", + "dev:i18n": "SANITY_STUDIO_DEBUG_I18N=triangles pnpm start", + "dev:i18n:reverse": "SANITY_STUDIO_DEBUG_I18N=reverse pnpm start", + "dev:design-studio": "pnpm --cwd dev/design-studio dev", + "dev:starter-studio": "pnpm --cwd dev/starter-studio dev", + "dev:strict-studio": "pnpm --cwd dev/strict-studio dev", + "dev:test-studio": "pnpm --cwd dev/test-studio dev", + "dev:embedded-studio": "pnpm --cwd dev/embedded-studio dev", "docs:report": "node -r dotenv-flow/config -r esbuild-register scripts/doc-report/docReport", "docs:report:create": "node -r dotenv-flow/config -r esbuild-register scripts/doc-report/docReportCreate", "docs:report:cleanup": "node -r dotenv-flow/config -r esbuild-register scripts/doc-report/docReportCleanup", "eslint": "eslint --ext=.cjs,.js,.jsx,.mjs,.ts,.tsx --quiet", - "example:blog-studio": "yarn --cwd examples/blog-studio start", - "example:clean-studio": "yarn --cwd examples/clean-studio start", - "example:ecommerce-studio": "yarn --cwd examples/ecommerce-studio start", - "example:example-studio": "yarn --cwd dev/example-studio start", - "example:movies-studio": "yarn --cwd examples/movies-studio start", - "e2e:dev": "yarn --cwd dev/studio-e2e-testing dev", - "e2e:build": "yarn --cwd dev/studio-e2e-testing build", + "example:blog-studio": "pnpm --cwd examples/blog-studio start", + "example:clean-studio": "pnpm --cwd examples/clean-studio start", + "example:ecommerce-studio": "pnpm --cwd examples/ecommerce-studio start", + "example:example-studio": "pnpm --cwd dev/example-studio start", + "example:movies-studio": "pnpm --cwd examples/movies-studio start", + "e2e:dev": "pnpm --cwd dev/studio-e2e-testing dev", + "e2e:build": "pnpm --cwd dev/studio-e2e-testing build", "e2e:cleanup": "node -r dotenv-flow/config -r esbuild-register scripts/e2e/cleanup", "e2e:codegen": "node -r dotenv-flow/config ./node_modules/.bin/sanity-test codegen", - "e2e:preview": "yarn e2e:build && yarn --cwd dev/studio-e2e-testing start", + "e2e:preview": "pnpm e2e:build && pnpm --cwd dev/studio-e2e-testing start", "e2e:setup": "node -r dotenv-flow/config -r esbuild-register scripts/e2e/setup", - "e2e:start": "yarn --cwd dev/studio-e2e-testing start", + "e2e:start": "pnpm --cwd dev/studio-e2e-testing start", "etl": "node -r dotenv-flow/config -r esbuild-register scripts/etl", "init": "lerna clean --yes && run-s bootstrap build", "lerna:clean": "lerna clean", - "lint": "turbo run lint --continue -- --quiet", - "lint:fix": "yarn lint --quiet --fix", - "lint:exhaustive-deps": "yarn lint --quiet --rule 'react-hooks/exhaustive-deps: [error, {additionalHooks: \"(useAsync|useMemoObservable|useObservableCallback)\"}]'", + "lint": "turbo run lint --continue --quiet", + "lint:fix": "pnpm lint --quiet --fix", + "lint:exhaustive-deps": "pnpm lint --quiet --rule 'react-hooks/exhaustive-deps: [error, {additionalHooks: \"(useAsync|useMemoObservable|useObservableCallback)\"}]'", "normalize-pkgfields": "node -r esbuild-register scripts/normalizePackageFields", "postinstall": "husky install", "prettier": "prettier --cache .", "prettify": "lerna run clean && prettier --write .", "prettify:dts": "prettier --loglevel warn --write packages/@sanity/*/lib/dts && prettier --loglevel warn --write packages/*/lib/dts", - "release": "yarn build && lerna publish --exact --force-publish", - "release-canary": "RELEASE_TAG=canary yarn release-tag", - "release-current-branch": "RELEASE_TAG=`git rev-parse --abbrev-ref HEAD | sed 's/\\//\\_/g'` yarn release-tag", - "release-rc": "yarn build && lerna publish --force-publish --dist-tag=dev-preview --preid=rc --exact", - "release-tag": "RELEASE_TAG=\"${RELEASE_TAG:-canary}\"; yarn build && lerna publish --canary --force-publish --no-git-tag-version --dist-tag=$RELEASE_TAG --preid=$RELEASE_TAG --exact", + "release": "pnpm build && lerna publish --exact --force-publish", + "release-canary": "RELEASE_TAG=canary pnpm release-tag", + "release-current-branch": "RELEASE_TAG=`git rev-parse --abbrev-ref HEAD | sed 's/\\//\\_/g'` pnpm release-tag", + "release-rc": "pnpm build && lerna publish --force-publish --dist-tag=dev-preview --preid=rc --exact", + "release-tag": "RELEASE_TAG=\"${RELEASE_TAG:-canary}\"; pnpm build && lerna publish --canary --force-publish --no-git-tag-version --dist-tag=$RELEASE_TAG --preid=$RELEASE_TAG --exact", "publish:tarball": "node -r esbuild-register scripts/publish/tarball", "release-notes": "node -r esbuild-register scripts/printReleaseNotesTemplate", - "start": "yarn dev:test-studio", + "start": "pnpm dev:test-studio", "test": "jest --forceExit", "test:e2e": "playwright test", - "perf:test": "cd perf/tests && yarn perf:test", - "perf:studio": "cd perf/studio && yarn preview", - "perf:studio:dev": "cd perf/studio && yarn dev", - "perf:codegen": "cd perf/tests && yarn perf:codegen", + "perf:test": "cd perf/tests && pnpm perf:test", + "perf:studio": "cd perf/studio && pnpm preview", + "perf:studio:dev": "cd perf/studio && pnpm dev", + "perf:codegen": "cd perf/tests && pnpm perf:codegen", "tsdoc:dev": "sanity-tsdoc dev", "type-check": "tsc --build", "updated": "lerna updated", - "build:test-studio": "yarn build --filter=sanity-test-studio", - "build:performance-studio": "yarn build --filter=perf-studio", + "build:test-studio": "pnpm build --filter=sanity-test-studio", + "build:performance-studio": "pnpm build --filter=perf-studio", "watch": "lerna run --parallel --scope '{@sanity/*,sanity}' watch" }, "lint-staged": { diff --git a/packages/sanity/src/_internal/cli/util/checkRequiredDependencies.ts b/packages/sanity/src/_internal/cli/util/checkRequiredDependencies.ts index ea01d00599a..72a05689918 100644 --- a/packages/sanity/src/_internal/cli/util/checkRequiredDependencies.ts +++ b/packages/sanity/src/_internal/cli/util/checkRequiredDependencies.ts @@ -88,7 +88,7 @@ export async function checkRequiredDependencies(context: CliCommandContext): Pro if (!installedStyledComponentsVersion) { throw new Error(oneline` Declared dependency \`styled-components\` is not installed - run - \`npm install\` or \`yarn\` to install it before re-running this command. + \`npm install\`, \`yarn install\` or \`pnpm install\` to install it before re-running this command. `) } @@ -145,8 +145,8 @@ async function readPackageManifest( /** * Install the passed dependencies at the given version/version range, - * prompting the user whether to use yarn or npm. If a `yarn.lock` file - * is found in the working directory, we will default the choice to yarn + * prompting the user which package manager to use. We will try to detect + * a package manager from files in the directory and show that as the default * * @param dependencies - Object of dependencies `({[package name]: version})` * @param context - CLI context diff --git a/packages/sanity/src/_internal/cli/util/checkStudioDependencyVersions.ts b/packages/sanity/src/_internal/cli/util/checkStudioDependencyVersions.ts index 20a9d079e30..114fbf55b30 100644 --- a/packages/sanity/src/_internal/cli/util/checkStudioDependencyVersions.ts +++ b/packages/sanity/src/_internal/cli/util/checkStudioDependencyVersions.ts @@ -134,11 +134,16 @@ function getUpgradeInstructions(pkgs: PackageInfo[]) { return `To upgrade, run either: + npm install ${inst} + + or + yarn add ${inst} or - npm install ${inst} + pnpm add ${inst} + Read more at ${generateHelpUrl('upgrade-packages')}` } @@ -160,7 +165,11 @@ function getDowngradeInstructions(pkgs: PackageInfo[]) { or - npm install ${inst}` + npm install ${inst} + + or + + pnpm install ${inst}` } function readPackageJson(filePath: string): PackageJson { diff --git a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/arrayOperators.ts b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/arrayOperators.ts index 926e03edb4d..04eb501c573 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/arrayOperators.ts +++ b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/arrayOperators.ts @@ -18,7 +18,7 @@ import { import {toJSON} from './operatorUtils' // @todo: don't manually cast `buttonValueComponent` and `inputComponent` once -// we understand why `yarn etl` fails with 'Unable to follow symbol' errors +// we understand why `npm run etl` fails with 'Unable to follow symbol' errors export const arrayOperators = { arrayCountEqual: defineSearchOperator({ nameKey: 'search.operator.array-count-equal.name', diff --git a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/assetOperators.ts b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/assetOperators.ts index 539b4e697bb..1b51f9f77e2 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/assetOperators.ts +++ b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/assetOperators.ts @@ -6,7 +6,7 @@ import {defineSearchOperator, type SearchOperatorButtonValue} from './operatorTy import {toJSON} from './operatorUtils' // @todo: don't manually cast `buttonValueComponent` and `inputComponent` once -// we understand why `yarn etl` fails with 'Unable to follow symbol' errors +// we understand why `npm run etl` fails with 'Unable to follow symbol' errors export const assetOperators = { assetFileEqual: defineSearchOperator({ nameKey: 'search.operator.asset-file-equal.name', diff --git a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/booleanOperators.ts b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/booleanOperators.ts index ea195d029e2..31b2485f498 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/booleanOperators.ts +++ b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/booleanOperators.ts @@ -7,7 +7,7 @@ import { import {toJSON} from './operatorUtils' // @todo: don't manually cast `buttonValueComponent` and `inputComponent` once -// we understand why `yarn etl` fails with 'Unable to follow symbol' errors +// we understand why `npm run etl` fails with 'Unable to follow symbol' errors export const booleanOperators = { booleanEqual: defineSearchOperator({ nameKey: 'search.operator.boolean-equal.name', diff --git a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/dateOperators.ts b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/dateOperators.ts index ce3a7cb684e..e23114b21a0 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/dateOperators.ts +++ b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/dateOperators.ts @@ -53,7 +53,7 @@ export interface OperatorDateLastValue { } // @todo: don't manually cast `buttonValueComponent` and `inputComponent` once -// we understand why `yarn etl` fails with 'Unable to follow symbol' errors +// we understand why `npm run etl` fails with 'Unable to follow symbol' errors // Common values shared between date & datetime defs const COMMON = { diff --git a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/numberOperators.ts b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/numberOperators.ts index c49a18290c3..9e14614f1c7 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/numberOperators.ts +++ b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/numberOperators.ts @@ -9,7 +9,7 @@ import {defineSearchOperator, type SearchOperatorInput} from './operatorTypes' import {toJSON} from './operatorUtils' // @todo: don't manually cast `buttonValueComponent` and `inputComponent` once -// we understand why `yarn etl` fails with 'Unable to follow symbol' errors +// we understand why `npm etl` fails with 'Unable to follow symbol' errors export const numberOperators = { numberEqual: defineSearchOperator({ nameKey: 'search.operator.number-equal.name', diff --git a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/portableTextOperators.ts b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/portableTextOperators.ts index 3f6990020dc..8a0c09db639 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/portableTextOperators.ts +++ b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/portableTextOperators.ts @@ -3,7 +3,7 @@ import {defineSearchOperator, type SearchOperatorInput} from './operatorTypes' import {toJSON} from './operatorUtils' // @todo: don't manually cast `buttonValueComponent` and `inputComponent` once -// we understand why `yarn etl` fails with 'Unable to follow symbol' errors +// we understand why `npm etl` fails with 'Unable to follow symbol' errors export const portableTextOperators = { portableTextEqual: defineSearchOperator({ nameKey: 'search.operator.portable-text-equal.name', diff --git a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/referenceOperators.ts b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/referenceOperators.ts index 846a4e21d12..da1a63b5e45 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/referenceOperators.ts +++ b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/referenceOperators.ts @@ -11,7 +11,7 @@ import { import {toJSON} from './operatorUtils' // @todo: don't manually cast `buttonValueComponent` and `inputComponent` once -// we understand why `yarn etl` fails with 'Unable to follow symbol' errors +// we understand why `npm etl` fails with 'Unable to follow symbol' errors export const referenceOperators = { referenceEqual: defineSearchOperator({ nameKey: 'search.operator.reference-equal.name', diff --git a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/slugOperators.ts b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/slugOperators.ts index 76da8b77a2b..68c088f963c 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/slugOperators.ts +++ b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/slugOperators.ts @@ -3,7 +3,7 @@ import {defineSearchOperator, type SearchOperatorInput} from './operatorTypes' import {toJSON} from './operatorUtils' // @todo: don't manually cast `buttonValueComponent` and `inputComponent` once -// we understand why `yarn etl` fails with 'Unable to follow symbol' errors +// we understand why `npm etl` fails with 'Unable to follow symbol' errors export const slugOperators = { slugEqual: defineSearchOperator({ nameKey: 'search.operator.slug-equal.name', diff --git a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/stringOperators.ts b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/stringOperators.ts index 188725b3a1f..06188c70286 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/stringOperators.ts +++ b/packages/sanity/src/core/studio/components/navbar/search/definitions/operators/stringOperators.ts @@ -4,7 +4,7 @@ import {defineSearchOperator, type SearchOperatorInput} from './operatorTypes' import {toJSON} from './operatorUtils' // @todo: don't manually cast `buttonValueComponent` and `inputComponent` once -// we understand why `yarn etl` fails with 'Unable to follow symbol' errors +// we understand why `npm etl` fails with 'Unable to follow symbol' errors export const stringOperators = { stringEqual: defineSearchOperator({ nameKey: 'search.operator.string-equal.name', diff --git a/perf/readme.md b/perf/readme.md index 89137c948a3..d2efa9adc7e 100644 --- a/perf/readme.md +++ b/perf/readme.md @@ -15,7 +15,7 @@ Before you can run the perf tests you need to add a session token so the tests a Run the perf tests against the perf studio locally to see how it compares to the current `next`-build of the same studio: ``` -$ yarn perf:test +$ pnpm perf:test ``` This will build the perf studio and run it in preview mode locally and run each test defined in the `perf/tests/tests`-folder against it. diff --git a/perf/tests/package.json b/perf/tests/package.json index 3c324764187..8bad20ac142 100644 --- a/perf/tests/package.json +++ b/perf/tests/package.json @@ -6,13 +6,13 @@ "license": "MIT", "author": "Sanity.io ", "scripts": { - "build": "yarn build:cli && (cd studio && yarn build)", + "build": "pnpm build:cli && (cd studio && pnpm build)", "perf:codegen": "ts-node --files -r dotenv/config codegen", "perf:test": "ts-node --files cli", "perf:test:ci": "ts-node --files cli", "lint": "eslint .", - "studio": "yarn --cwd studio build && yarn --cwd studio start", - "studio:dev": "SANITY_STUDIO_DATASET=dev yarn --cwd studio dev" + "studio": "cd perf/studio && (pnpm build && pnpm start)", + "studio:dev": "cd perf/studio && SANITY_STUDIO_DATASET=dev pnpm dev" }, "devDependencies": { "@jest/globals": "^29.7.0", diff --git a/playwright.config.ts b/playwright.config.ts index 778193de1e9..f29766d4f33 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -20,7 +20,7 @@ const playwrightConfig = createPlaywrightConfig({ }, webServer: { ...config.webServer, - command: CI ? 'yarn e2e:start' : 'yarn e2e:dev', + command: CI ? 'pnpm e2e:start' : 'pnpm e2e:dev', port: 3339, }, } diff --git a/scripts/etl.ts b/scripts/etl.ts index c4e45388ea0..371dba16c55 100644 --- a/scripts/etl.ts +++ b/scripts/etl.ts @@ -5,7 +5,7 @@ import chalk from 'chalk' import ora from 'ora' import path from 'path' -const cli = cac('yarn etl') +const cli = cac('pnpm etl') cli .command('[packageName]', 'Extract, transform, and load API documents for a package') @@ -24,7 +24,7 @@ async function main(options: {packageName: string; releaseVersion?: string}): Pr const {packageName, releaseVersion} = options if (!packageName) { - throw new Error('Missing package name. Usage: yarn etl [packageName]') + throw new Error('Missing package name. Usage: pnpm etl [packageName]') } const packagePath = path.resolve(__dirname, '../packages', packageName) diff --git a/scripts/normalizeDependencyVersions.ts b/scripts/normalizeDependencyVersions.ts index daa371d6e53..48c7508d193 100644 --- a/scripts/normalizeDependencyVersions.ts +++ b/scripts/normalizeDependencyVersions.ts @@ -170,7 +170,7 @@ if (fixablePackages.length > 0) { console.log( [ 'Updated version ranges for %d packages,', - 'you might want to run "yarn bootstrap"', + 'you might want to run "pnpm bootstrap"', 'and run some tests before pushing changes', ].join(' '), fixablePackages.length, diff --git a/scripts/publish/tarball.ts b/scripts/publish/tarball.ts index 8b538480904..69f51786ddc 100644 --- a/scripts/publish/tarball.ts +++ b/scripts/publish/tarball.ts @@ -55,7 +55,7 @@ function _pack(opts: {cwd: string; filename: string}): Promise { const {cwd, filename} = opts return new Promise((resolve, reject) => { - const stream = spawn('yarn', ['pack', '--filename', filename], {cwd}) + const stream = spawn('pnpm', ['pack', '--filename', filename], {cwd}) stream.on('close', () => resolve()) stream.on('error', (err) => reject(err)) diff --git a/test/e2e/README.md b/test/e2e/README.md index 7ecba7c26cf..aded1200fcd 100644 --- a/test/e2e/README.md +++ b/test/e2e/README.md @@ -15,31 +15,31 @@ To run E2E tests run the following commands from the root of the project - Run all the tests ```sh - yarn test:e2e + pnpm test:e2e ``` - Run all tests in specific directory, it runs relative to the `test/e2e/tests` ```sh - yarn test:e2e tests/default-layout + pnpm test:e2e tests/default-layout ``` - Run files that have my-spec or my-spec-2 in the file name ```sh - yarn test:e2e my-spec my-spec-2 + pnpm test:e2e my-spec my-spec-2 ``` - For help, run ```sh - yarn test:e2e --help + pnpm test:e2e --help ``` Other useful helper commands - "e2e:dev": Starts the E2E studio using `sanity dev` - "e2e:build": Runs `sanity build` on E2E studio -- "e2e:codegen": Runs [playwright codegen](https://playwright.dev/docs/codegen). **Note: Requires the studio to be running. Run `yarn e2e:dev` in another terminal first** +- "e2e:codegen": Runs [playwright codegen](https://playwright.dev/docs/codegen). **Note: Requires the studio to be running. Run `pnpm e2e:dev` in another terminal first** - "e2e:start": Runs `sanity build` on E2E studio - "e2e:preview": Runs builds and runs`sanity start` on E2E studio