Skip to content

Commit

Permalink
chore: use pnpm for framework monorepo (nuxt#7895)
Browse files Browse the repository at this point in the history
Co-authored-by: Pooya Parsa <pooya@pi0.io>
  • Loading branch information
danielroe and pi0 authored Oct 17, 2022
1 parent 9388e65 commit 74a90c5
Show file tree
Hide file tree
Showing 32 changed files with 9,413 additions and 16,368 deletions.
109 changes: 79 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name: CI
on:
push:
paths-ignore:
- 'docs/**'
- "docs/**"
branches:
- main
pull_request:
paths-ignore:
- 'docs/**'
- "docs/**"
branches:
- main

Expand All @@ -25,16 +25,17 @@ jobs:

steps:
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
cache: "pnpm"

- name: Install dependencies
run: yarn --immutable
run: pnpm install

- name: Build
run: yarn build
run: pnpm build

- name: Cache dist
uses: actions/cache@v3
Expand All @@ -54,16 +55,17 @@ jobs:

steps:
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
cache: "pnpm"

- name: Install dependencies
run: yarn --immutable
run: pnpm install

- name: Lint
run: yarn lint
run: pnpm lint

typecheck:
runs-on: ${{ matrix.os }}
Expand All @@ -77,19 +79,20 @@ jobs:

steps:
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
cache: "pnpm"

- name: Install dependencies
run: yarn --immutable
run: pnpm install

- name: Stub
run: yarn stub
- name: Build (stub)
run: pnpm build:stub

- name: Typecheck
run: yarn typecheck
run: pnpm typecheck

test-fixtures:
runs-on: ${{ matrix.os }}
Expand All @@ -103,25 +106,47 @@ jobs:

steps:
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
cache: "pnpm"

- name: Install dependencies
run: yarn --immutable
run: pnpm install

# https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L62
# Install playwright's binary under custom directory to cache
- name: Set Playwright path
if: runner.os != 'Windows'
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
- name: Set Playwright path (windows)
if: runner.os == 'Windows'
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV

- name: Cache Playwright's binary
uses: actions/cache@v3
with:
# Playwright removes unused browsers automatically
# So does not need to add playwright version to key
key: ${{ runner.os }}-playwright-bin-v1
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}

- name: Install Playwright
# does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
run: pnpm playwright install chromium

- name: Stub
run: yarn stub
- name: Build (stub)
run: pnpm build:stub

- name: Test (unit)
run: yarn test:unit
run: pnpm test:unit

- name: Test (fixtures)
run: yarn test:fixtures
run: pnpm test:fixtures

- name: Test (fixtures with dev)
run: yarn test:fixtures:dev
run: pnpm test:fixtures:dev
env:
NODE_OPTIONS: --max-old-space-size=8192

Expand All @@ -137,19 +162,41 @@ jobs:

steps:
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
cache: "pnpm"

- name: Install dependencies
run: yarn --immutable
run: pnpm install

# https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml#L62
# Install playwright's binary under custom directory to cache
- name: Set Playwright path (non-windows)
if: runner.os != 'Windows'
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
- name: Set Playwright path (windows)
if: runner.os == 'Windows'
run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV

- name: Cache Playwright's binary
uses: actions/cache@v3
with:
# Playwright removes unused browsers automatically
# So does not need to add playwright version to key
key: ${{ runner.os }}-playwright-bin-v1
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}

- name: Install Playwright
# does not need to explicitly set chromium after https://github.com/microsoft/playwright/issues/14862 is solved
run: pnpm playwright install chromium

- name: Stub
run: yarn stub
- name: Build (stub)
run: pnpm build:stub

- name: Test (fixtures)
run: yarn test:fixtures:webpack
run: pnpm test:fixtures:webpack

test-types:
needs:
Expand All @@ -165,13 +212,14 @@ jobs:

steps:
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
cache: "pnpm"

- name: Install dependencies
run: yarn --immutable
run: pnpm install

- name: Restore dist cache
uses: actions/cache@v3
Expand All @@ -180,7 +228,7 @@ jobs:
key: ${{ matrix.os }}-node-v${{ matrix.node }}-${{ github.sha }}

- name: Test (types)
run: yarn test:types
run: pnpm test:types

build-release:
if: |
Expand All @@ -205,13 +253,14 @@ jobs:

steps:
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
cache: "pnpm"

- name: Install dependencies
run: yarn --immutable
run: pnpm install

- name: Restore dist cache
uses: actions/cache@v3
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/docs-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ jobs:

steps:
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: "yarn"
cache: "pnpm"

- name: Install dependencies
run: yarn --immutable
run: pnpm install

- run: node ./scripts/crawl.mjs
env:
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ name: Docs
on:
push:
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
- "docs/**"
- ".github/workflows/docs.yml"
branches:
- main
pull_request:
paths:
- 'docs/**'
- '.github/workflows/docs.yml'
- "docs/**"
- ".github/workflows/docs.yml"
branches:
- main

Expand All @@ -25,13 +25,14 @@ jobs:

steps:
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
cache: "pnpm"

- name: Install dependencies
run: yarn --immutable
run: pnpm install

- name: Lint (docs)
run: yarn lint:docs
run: pnpm lint:docs
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ node_modules
jspm_packages

package-lock.json
# */**/yarn.lock
*/**/yarn.lock
/.yarn

# Logs
*.log
Expand All @@ -13,10 +14,6 @@ package-lock.json
.tmp
.cache

# Yarn
**/.yarn/cache
**/.yarn/*state*

# Generated dirs
dist
.nuxt
Expand Down
6 changes: 3 additions & 3 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
tasks:
- init: |
npx yarn install
npx yarn stub
command: npx yarn play
npx pnpm install
npx pnpm build:stub
command: npx pnpm play
ports:
- port: 3000
Expand Down
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
shamefully-hoist=true
strict-peer-dependencies=false
shell-emulator=true
363 changes: 0 additions & 363 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

9 changes: 0 additions & 9 deletions .yarn/plugins/@yarnpkg/plugin-typescript.cjs

This file was deleted.

801 changes: 0 additions & 801 deletions .yarn/releases/yarn-3.2.4.cjs

This file was deleted.

11 changes: 0 additions & 11 deletions .yarnrc.yml

This file was deleted.

23 changes: 2 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,9 @@ Nuxt's goal is to make web development intuitive and performant with a great dev
</tbody>
</table>

## 💻 Development
## Local Development

- Clone repository
- Ensure you have the latest LTS version of Node.js installed
- Install dependencies with `npx yarn install`
- Run `npx yarn stub` to activate passive development
- Open playground with `npx yarn dev`

Learn more about in our documentation on [how to contribute to Nuxt](https://v3.nuxtjs.org/community/contribution).

## 📖 Documentation

We are using [Docus](https://nuxtlabs.com/docus) for documentation (*It is planned to be open sourced in the following weeks*).

We recommend to install the [Docus extension](https://marketplace.visualstudio.com/items?itemName=NuxtLabs.docus) for VS Code.

- Run `npx yarn stub` once in the root directory
- Go into the docs directory: `cd docs`
- Install docs dependencies with `npx yarn install`
- Run `npx yarn dev` to start Docus in development mode

The pages are generated from [docs/content/](./docs/content), you can start editing them to start helping us on documenting Nuxt 3 💚
Follow the docs to [Set Up Your Local Development Environment](https://v3.nuxtjs.org/community/framework-contribution#set-up-your-local-development-environment) to contribute to the framework and documentation.

## License

Expand Down
4 changes: 4 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ schema
**/*.configuration/nuxt.config.md
**/*.configuration/nuxt-config.md
static/sw.js

.yarn/*
!.yarn/releases
!yarn.lock
2 changes: 2 additions & 0 deletions docs/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
nmMode: hardlinks-local
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-3.2.4.cjs
Loading

0 comments on commit 74a90c5

Please sign in to comment.