Skip to content

Commit

Permalink
chore: switch from yarn to pnpm
Browse files Browse the repository at this point in the history
chore: have jest config read workspace config from pnpm-workspace config

chore: use pnpm as package manager for lerna
  • Loading branch information
bjoerge authored and rexxars committed Feb 14, 2024
1 parent ce560b0 commit da9f72e
Show file tree
Hide file tree
Showing 7 changed files with 18,812 additions and 16,354 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@
/turbo.json
/packages/*/turbo.json
/packages/@sanity/*/turbo.json
/pnpm-lock.yaml

/packages/sanity/playwright-ct/template/.cache/**/*
8 changes: 5 additions & 3 deletions jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@

const path = require('path')
const globby = require('globby')
const pkg = require('./package.json')
const yaml = require('js-yaml')
const fs = require('node:fs')

const workspaces = yaml.load(fs.readFileSync('./pnpm-workspace.yaml', 'utf8'))
const jestConfigFiles = globby.sync(
pkg.workspaces.map((workspace) => path.join(__dirname, workspace, '/jest.config.cjs')),
workspaces.packages.map((workspace) => path.join(__dirname, workspace, '/jest.config.cjs')),
)

const IGNORE_PROJECTS = []

/** @type {import('jest').Config} */
/** @type {import("jest").Config} */
module.exports = {
projects: jestConfigFiles
.map((file) => path.relative(__dirname, path.dirname(file)))
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"npmClient": "yarn",
"npmClient": "pnpm",
"packages": [
"dev/*",
"perf/tests",
Expand Down
7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@
"eslint --quiet --fix"
]
},
"resolutions": {
"**/@types/react": "^18.0.25",
"@types/react": "^18.2.37",
"wide-align/string-width": "^4.2.0"
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/preset-env": "^7.23.7",
Expand Down Expand Up @@ -162,6 +157,6 @@
"optionalDependencies": {
"node-notifier": "^10.0.0"
},
"packageManager": "[email protected]",
"packageManager": "[email protected]",
"isSanityMonorepo": true
}
Loading

0 comments on commit da9f72e

Please sign in to comment.