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 instead of Yarn #3365

Closed
wants to merge 21 commits into from
Closed
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
20 changes: 9 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,23 @@ x-job-setup: &job-setup
# Download and cache dependencies
x-restore-cache: &restore-cache
keys:
- v15-dependencies-{{ checksum "yarn.lock" }}
- v16-dependencies-{{ checksum "pnpm-lock.yaml" }}
# fallback to using the latest cache if no exact match is found
- v15-dependencies-
- v16-dependencies-

x-save-cache: &save-cache
paths:
- node_modules
key: v15-dependencies-{{ checksum "yarn.lock" }}
key: v16-dependencies-{{ checksum "pnpm-lock.yaml" }}

x-integration-steps: &integration-steps
steps:
- checkout
- run: npm i --prefix=$HOME/.local -g pnpm
- restore_cache: *restore-cache
- run:
name: Yarn - Install packages
command: CYPRESS_CACHE_FOLDER=$CIRCLE_WORKING_DIRECTORY/node_modules/cypress/.cache/ yarn
- save_cache: *save-cache
command: CYPRESS_CACHE_FOLDER=$CIRCLE_WORKING_DIRECTORY/node_modules/cypress/.cache/ pnpm i --store-dir=node_modules/.pnpm-store
- run:
name: 'Is test required'
command: node ./.circleci/run-or-bail.js
Expand Down Expand Up @@ -65,10 +66,12 @@ x-integration-steps: &integration-steps
x-simple-tests: &simple-tests
steps:
- checkout
- run: npm i --prefix=$HOME/.local -g pnpm
- restore_cache: *save-cache
# Set Cypress cache dir here, in case this job runs/completes first, and
# hence clobbers the `node_modules` cache with a non-cypress version,
# causing the other job to fail with a "Missing Cypress" error.
- run: CYPRESS_CACHE_FOLDER=$CIRCLE_WORKING_DIRECTORY/node_modules/cypress/.cache/ yarn
- run: CYPRESS_CACHE_FOLDER=$CIRCLE_WORKING_DIRECTORY/node_modules/cypress/.cache/ pnpm i --store-dir=node_modules/.pnpm-store
- save_cache: *save-cache
- run: yarn lint:eslint --format junit -o reports/junit/js-lint-results.xml
- run: yarn lint:prettier
Expand Down Expand Up @@ -96,7 +99,6 @@ x-simple-tests: &simple-tests
jobs:
simple_tests:
<<: *job-setup
<<: *restore-cache
<<: *simple-tests

integration_tests_basic:
Expand All @@ -107,15 +109,13 @@ jobs:
CLOUDINARY_SECRET: $CLOUDINARY_SECRET
PORT: 3000
<<: *job-setup
<<: *restore-cache
<<: *integration-steps

integration_tests_login:
environment:
PROJECT_DIRECTORY: test-projects/login
PORT: 3000
<<: *job-setup
<<: *restore-cache
<<: *integration-steps

integration_tests_accesscontrol:
Expand All @@ -124,7 +124,6 @@ jobs:
PROJECT_NAME: 'Cypress Test Project For Access Control'
PORT: 3000
<<: *job-setup
<<: *restore-cache
<<: *integration-steps

integration_tests_clientvalidation:
Expand All @@ -133,7 +132,6 @@ jobs:
PROJECT_NAME: 'Cypress Test Project For Client Validation'
PORT: 3000
<<: *job-setup
<<: *restore-cache
<<: *integration-steps

# integration_tests_twitterlogin:
Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
reporter=append-only
save-workspace-protocol=false
3 changes: 3 additions & 0 deletions contributing-guide.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
console.log('📝 Contributing to KeystoneJS?');
console.log('Read the full Contributing Guide');
console.log('https://github.com/keystonejs/keystone/blob/master/CONTRIBUTING.md');
9 changes: 5 additions & 4 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[build]
command = "yarn website build"
command = "npm i -g pnpm && pnpm i -store-dir=node_modules/.pnpm-store && pnpm run website -- build"
publish = "website/public"

[build.environment]
NODE_VERSION = "10"
YARN_VERSION = "1.15.2"
YARN_FLAGS = "--frozen-lockfile"
# This essentially means "don't run npm install"
NPM_FLAGS="--prefix=/"
NODE_VERSION="12"
28 changes: 3 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@
"lint": "yarn lint:prettier && yarn lint:eslint && yarn lint:markdown",
"test": "yarn lint && yarn test:unit && yarn cypress:run",
"test:unit": "cross-env DISABLE_LOGGING=true NODE_ENV=test jest --maxWorkers=1 --logHeapUsage",
"test:unit:debug": "cross-env NODE_ENV=test node --inspect-brk `which jest` --runInBand",
"test:unit:debug": "cross-env NODE_ENV=test node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand",
"benchmark": "yarn workspace @keystonejs/benchmarks go",
"changeset": "changeset",
"publish-changed": "yarn build && changeset publish --public",
"version-packages": "changeset version && node .github/write-release-count.js",
"build": "preconstruct build",
"prepare": "manypkg check && preconstruct dev && yarn run --silent contributing-guide",
"contributing-guide": "is-ci && exit 0 || chalk -t \"{bold 📝 Contributing to KeystoneJS?}\" && link \"🔗 Read the full Contributing Guide\" \"https://github.com/keystonejs/keystone/blob/master/CONTRIBUTING.md\"",
"contributing-guide": "node ./contributing-guide.js",
"contributors:add": "all-contributors add",
"contributors:generate": "all-contributors generate",
"heroku-postbuild": "yarn build && yarn workspace @keystonejs/demo-project-blog build"
Expand All @@ -52,13 +52,11 @@
"@changesets/changelog-github": "^0.2.1",
"@changesets/cli": "^2.5.1",
"@manypkg/cli": "^0.11.0",
"@preconstruct/cli": "1.1.20",
"@preconstruct/cli": "1.1.22",
"@types/jest": "^25.1.2",
"all-contributors-cli": "^6.2.0",
"babel-eslint": "^10.0.1",
"babel-plugin-emotion": "^10.0.27",
"chalk": "^2.4.2",
"chalk-cli": "^4.1.0",
"cross-env": "^7.0.0",
"cypress": "^4.5.0",
"cypress-multi-reporters": "^1.2.4",
Expand Down Expand Up @@ -109,8 +107,6 @@
"stack-utils": "^2.0.2",
"start-server-and-test": "^1.11.0",
"supertest-light": "^1.0.3",
"terminal-link": "^1.3.0",
"terminal-link-cli": "^2.0.0",
"terser": "^3.14.1",
"testcheck": "^1.0.0-rc.2",
"tinymce": "^5.2.2",
Expand Down Expand Up @@ -141,24 +137,6 @@
"remark-toc"
]
},
"workspaces": {
"packages": [
"packages/*",
"!packages/arch",
"packages/arch/docs",
"packages/arch/packages/*",
"demo-projects/*",
"test-projects/*",
"api-tests",
"benchmarks",
"website",
"packages/create-keystone-app/example-projects/*",
"projects/*"
],
"nohoist": [
"**/cypress-multi-reporters"
]
},
"preconstruct": {
"packages": [
"packages/arch/packages/*",
Expand Down
2 changes: 1 addition & 1 deletion packages/fields-cloudinary-image/src/resolve-view.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path';

const pkgDir = path.dirname(require.resolve('@keystonejs/fields-cloudinary-image/package.json'));
const pkgDir = path.dirname(__dirname);

export const resolveView = pathname => path.join(pkgDir, pathname);
2 changes: 1 addition & 1 deletion packages/fields-color/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Text } from '@keystonejs/fields';
import path from 'path';

const pkgDir = path.dirname(require.resolve('@keystonejs/fields-color/package.json'));
const pkgDir = path.dirname(__dirname);

export const Color = {
type: 'Color',
Expand Down
2 changes: 1 addition & 1 deletion packages/fields-content/src/resolve-view.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path';

const pkgDir = path.dirname(require.resolve('@keystonejs/fields-content/package.json'));
const pkgDir = path.dirname(__dirname);

export const resolveView = pathname => path.join(pkgDir, pathname);
2 changes: 1 addition & 1 deletion packages/fields-location-google/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from './Implementation';
import path from 'path';

const pkgDir = path.dirname(require.resolve('@keystonejs/fields-location-google/package.json'));
const pkgDir = path.dirname(__dirname);

export const LocationGoogle = {
type: 'LocationGoogle',
Expand Down
2 changes: 1 addition & 1 deletion packages/fields-markdown/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path';
import { Text } from '@keystonejs/fields';

const pkgDir = path.dirname(require.resolve('@keystonejs/fields-markdown/package.json'));
const pkgDir = path.dirname(__dirname);

export let Markdown = {
type: 'Markdown',
Expand Down
2 changes: 1 addition & 1 deletion packages/fields-mongoid/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from './Implementation';
import { Text } from '@keystonejs/fields';

const pkgDir = path.dirname(require.resolve('@keystonejs/fields-mongoid/package.json'));
const pkgDir = path.dirname(__dirname);

export const MongoId = {
type: 'MongoId',
Expand Down
2 changes: 1 addition & 1 deletion packages/fields-oembed/src/resolve-view.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path';

const pkgDir = path.dirname(require.resolve('@keystonejs/fields-oembed/package.json'));
const pkgDir = path.dirname(__dirname);

export const resolveView = pathname => path.join(pkgDir, pathname);
5 changes: 1 addition & 4 deletions packages/fields-unsplash/src/UnsplashBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ const RelationshipWrapper = {
},
};

const unsplashBlockView = path.join(
path.dirname(require.resolve('@keystonejs/fields-unsplash/package.json')),
'views/blocks/unsplash-image'
);
const unsplashBlockView = path.join(path.dirname(__dirname), 'views/blocks/unsplash-image');

export class UnsplashBlock extends Block {
constructor(
Expand Down
2 changes: 1 addition & 1 deletion packages/fields-unsplash/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from './Implementation';
import { UnsplashBlock } from './UnsplashBlock';

const pkgDir = path.dirname(require.resolve('@keystonejs/fields-unsplash/package.json'));
const pkgDir = path.dirname(__dirname);

export const Unsplash = {
type: 'Unsplash',
Expand Down
2 changes: 1 addition & 1 deletion packages/fields/src/resolve-view.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path';

const pkgDir = path.dirname(require.resolve('@keystonejs/fields/package.json'));
const pkgDir = path.dirname(__dirname);

export const resolveView = pathname => path.join(pkgDir, pathname);
Loading