-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
introduce pnpm, fix build tooling #3054
Changes from all commits
f417211
926f2c2
9f50451
a7dba50
fe5c47f
121fec6
f6c6754
192ec94
685162e
d48208e
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ name: License Check | |
on: | ||
pull_request: | ||
paths: | ||
- 'yarn.lock' | ||
- 'pnpm.lock' | ||
|
||
jobs: | ||
check: | ||
|
@@ -11,11 +11,16 @@ jobs: | |
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 7.28.0 | ||
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. Should be 8? |
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
cache: 'yarn' | ||
- run: yarn install --frozen-lockfile --immutable | ||
node-version: 19 | ||
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 can use 20 lts |
||
cache: 'pnpm' | ||
|
||
- run: pnpm install --frozen-lockfile | ||
|
||
- name: License Check | ||
run: yarn license-check | ||
run: pnpm license-check |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -4,7 +4,7 @@ | |||||
.DS_Store | ||||||
.secrets | ||||||
npm-debug.log | ||||||
yarn-error.log | ||||||
pnpm-error.log | ||||||
|
||||||
node_modules/ | ||||||
coverage/ | ||||||
|
@@ -23,13 +23,11 @@ lerna-debug.log | |||||
**/tsconfig.tsbuildinfo | ||||||
**/*.tsbuildinfo | ||||||
|
||||||
.yarnrc | ||||||
yarn-1.18.0.js | ||||||
*.orig | ||||||
.idea/ | ||||||
|
||||||
# Local Netlify folder | ||||||
.netlify | ||||||
|
||||||
examples/*/yarn.lock | ||||||
examples/*/pnpm.lock | ||||||
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.
Suggested change
|
||||||
.eslintcache |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
engine-strict=true | ||
access=public | ||
auto-install-peers=true | ||
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. I guess it’s better install peerdeps explicitly |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"npm.packageManager": "yarn" | ||
"npm.packageManager": "pnpm" | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -6,10 +6,10 @@ If you have not signed the membership agreement (it's free), you will be | |||||
prompted by the EasyCLA bot. For more details, please see the | ||||||
[GraphQL WG repo](https://github.com/graphql/graphql-wg/tree/main/membership). | ||||||
|
||||||
0. First, you will need the latest `git`, `yarn` 1.16, & `node` 12 or greater. | ||||||
0. First, you will need the latest `git`, `pnpm` 1.16, & `node` 12 or greater. | ||||||
macOS, Windows and Linux should all be supported as build environments. | ||||||
|
||||||
_**Note:** None of the commands below will work with `npm`. Please use `yarn` in | ||||||
_**Note:** None of the commands below will work with `npm`. Please use `pnpm` in | ||||||
this repo._ | ||||||
|
||||||
1. Fork this repo by using the "Fork" button in the upper-right | ||||||
|
@@ -23,7 +23,7 @@ this repo._ | |||||
3. Install or Update all dependencies | ||||||
|
||||||
```sh | ||||||
yarn | ||||||
pnpm | ||||||
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.
Suggested change
|
||||||
``` | ||||||
|
||||||
4. Build all interdependencies so the project you are working on can resolve | ||||||
|
@@ -32,19 +32,19 @@ this repo._ | |||||
First you'll need — | ||||||
|
||||||
```sh | ||||||
yarn run build | ||||||
pnpm run build | ||||||
``` | ||||||
|
||||||
— or — | ||||||
|
||||||
```sh | ||||||
yarn run build:watch | ||||||
pnpm run build:watch | ||||||
``` | ||||||
|
||||||
If you are focused on GraphiQL development, you can run — | ||||||
|
||||||
```sh | ||||||
yarn run start-graphiql | ||||||
pnpm run start-graphiql | ||||||
``` | ||||||
|
||||||
5. Get coding! If you've added code, add tests. If you've changed APIs, update | ||||||
|
@@ -54,52 +54,51 @@ this repo._ | |||||
6. Ensure all tests pass, and build everything | ||||||
|
||||||
```sh | ||||||
yarn test | ||||||
pnpm test | ||||||
``` | ||||||
|
||||||
### Fix CI issues with linting | ||||||
|
||||||
If you have `prettier` or `eslint --fix`-able issues you see in CI, use — | ||||||
|
||||||
`yarn format` | ||||||
`pnpm format` | ||||||
|
||||||
If you see `typescript` build issues, do a `yarn build` locally, and make sure | ||||||
If you see `typescript` build issues, do a `pnpm build` locally, and make sure | ||||||
the whole project references tree builds. Changing interfaces can end up | ||||||
breaking their implementations. | ||||||
|
||||||
### Run tests for GraphiQL: | ||||||
|
||||||
- `yarn test graphiql` will run all tests for graphiql. You can also run tests | ||||||
- `pnpm test graphiql` will run all tests for graphiql. You can also run tests | ||||||
from a workspace, but most tooling is at the root. | ||||||
- `yarn test --watch` will run `jest` with `--watch` | ||||||
- `yarn e2e` at the root will run the end-to-end suite | ||||||
- `yarn start-monaco` will launch `webpack` dev server for the `monaco` editor | ||||||
- `pnpm test --watch` will run `jest` with `--watch` | ||||||
- `pnpm e2e` at the root will run the end-to-end suite | ||||||
- `pnpm start-monaco` will launch `webpack` dev server for the `monaco` editor | ||||||
example with GitHub API from the root. This is the fastest way to test changes | ||||||
to `graphql-language-service-interface`, parser, etc. | ||||||
|
||||||
If you want these commands to watch for changes to dependent packages in the | ||||||
repo, then run `yarn build --watch` alongside either of these. | ||||||
repo, then run `pnpm build --watch` alongside either of these. | ||||||
|
||||||
### Developing for GraphiQL | ||||||
|
||||||
If you want to develop just for graphiql, you won't need to execute commands | ||||||
from the package subdirectory at `packages/graphiql`. | ||||||
|
||||||
First, you'll need to `yarn build` all the packages from the root. | ||||||
First, you'll need to `pnpm build` all the packages from the root. | ||||||
|
||||||
Then, you can run these commands: | ||||||
|
||||||
- `yarn start-graphiql` — which will launch `webpack` dev server for graphiql | ||||||
- `pnpm start-graphiql` — which will launch `webpack` dev server for graphiql | ||||||
from the root | ||||||
|
||||||
### Developing Monaco GraphQL | ||||||
|
||||||
1. First run `yarn`. | ||||||
1. run `yarn tsc --watch` to watch `monaco-graphql` and | ||||||
`graphql-language-service` in one screen session/terminal tab/etc | ||||||
1. in another session, run `yarn start-monaco` from anywhere in the repository | ||||||
aside from an individual workspace. | ||||||
1. alternatively to the webpack example, or in addition, you can run monaco or | ||||||
1. First run `pnpm` outside of workspace. | ||||||
1. Then, run `pnpm tsc --watch` to watch `monaco-graphql` and | ||||||
`graphql-language-service` in one session/tab | ||||||
1. In another session/tab, run `pnpm start-monaco` outside of a workspace | ||||||
1. Alternatively to the webpack example, or in addition, you can run monaco or | ||||||
next.js examples, though these examples are simpler. They also require their | ||||||
own `yarn` or `npm install` as they are excluded from the `workspaces` | ||||||
resolved on global `yarn install` | ||||||
own `pnpm` or `npm install` as they are excluded from the `workspaces` | ||||||
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.
Suggested change
|
||||||
resolved on global `pnpm install` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,6 +96,7 @@ onegraph | |
openvsx | ||
ovsx | ||
picomatch | ||
pnpm | ||
snyk | ||
stackblitz | ||
strictsoftware | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.