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 corepack pnpm instead of volta npm #109

Merged
merged 8 commits into from
Nov 1, 2023
Merged
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
33 changes: 21 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,51 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install node and npm
# Pulls version from packageManager key in package.json
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: npm
cache: 'pnpm'
- name: Install dependencies
run: npm ci
run: pnpm install
- name: Typecheck
run: npm run typecheck
run: pnpm typecheck
format:
name: Check prettier
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install node and npm
# Pulls version from packageManager key in package.json
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: npm
cache: 'pnpm'
- name: Install dependencies
run: npm ci
run: pnpm install
- name: Check formatting
run: npm run format:check
run: pnpm format:check
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install node and npm
# Pulls version from packageManager key in package.json
- name: Setup pnpm
uses: pnpm/action-setup@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: npm
cache: 'pnpm'
- name: Install dependencies
run: npm ci
run: pnpm install
- name: Test
run: npm run test
run: pnpm test
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.16.0
20.9.0
34 changes: 34 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# build output
build

# ignore docusaurus cache files
.docusaurus

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# dependencies
node_modules/
pnpm-lock.yaml

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
tsconfig.tsbuildinfo
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we need to add a prettierignore when moving from npm to pnpm?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

b/c it started formatting pnpm-lock.json

29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,28 @@ This is the documentation for the [nebula open source project](https://github.co

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :------------ | :------------------------------------------ |
| `npm install` | Installs dependencies |
| `npm start` | Starts local dev server at `localhost:3000` |
| Command | Action |
| :------------- | :------------------------------------------ |
| `pnpm install` | Installs dependencies |
| `pnpm start` | Starts local dev server at `localhost:3000` |

## Environment setup

#### Node.js and pnpm

To develop this code, you'll need node.js. The exact version you get doesn't matter much, as long as it meets the
requirements set in the `package.json` `engines` field, but you can reference the value in `.nvmrc` for the version that
is used in CI.

You can install node.js directly from https://nodejs.org/en/download/, or you can use a tool like
[fnm](https://github.com/Schniz/fnm) to handle automatically changing your node version when switching between projects
with different requirements.

To get `pnpm`, run `corepack enable` after installing `node`, and `corepack` should install the right `pnpm` version for
you.

#### Project dependencies

To install our javascript dependencies, run `pnpm install` (or `pnpm i` for short). You'll want to do this whenever you
IanVS marked this conversation as resolved.
Show resolved Hide resolved
change branches, if there's a possibility that dependencies have been changed or updated. If you're not able to start up
the client app, this is a good first troubleshooting step to take.
Loading