chore: yarn => pnpm
This commit is contained in:
parent
1a34fab1e4
commit
95e5d13bba
18 changed files with 10810 additions and 10257 deletions
64
.github/workflows/ci.yml
vendored
64
.github/workflows/ci.yml
vendored
|
@ -21,7 +21,7 @@ defaults:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Lint can run in parallel with Build.
|
# Lint can run in parallel with Build.
|
||||||
# We also run `yarn install` with the `--prefer-offline` flag to speed things up.
|
# We also run `pnpm install` with the `--prefer-offline` flag to speed things up.
|
||||||
lint:
|
lint:
|
||||||
name: Lint
|
name: Lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -29,14 +29,18 @@ jobs:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v2.0.1
|
||||||
|
with:
|
||||||
|
version: 6.23.x
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
cache: 'yarn'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Install NPM Dependencies
|
- name: Install NPM Dependencies
|
||||||
run: yarn install --prefer-offline --frozen-lockfile --ignore-engines --registry https://registry.npmjs.org --network-timeout 300000
|
run: pnpm install --prefer-offline --frozen-lockfile --ignore-engines --registry https://registry.npmjs.org --network-timeout 300000
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
|
|
||||||
|
@ -46,7 +50,7 @@ jobs:
|
||||||
# Lint autofix cannot run on forks, so just skip those! See https://github.com/wearerequired/lint-action/issues/13
|
# Lint autofix cannot run on forks, so just skip those! See https://github.com/wearerequired/lint-action/issues/13
|
||||||
- name: Lint (External)
|
- name: Lint (External)
|
||||||
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != github.repository_owner }}
|
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != github.repository_owner }}
|
||||||
run: yarn lint
|
run: pnpm run lint
|
||||||
|
|
||||||
# Otherwise, run lint autofixer
|
# Otherwise, run lint autofixer
|
||||||
- name: Lint
|
- name: Lint
|
||||||
|
@ -80,25 +84,25 @@ jobs:
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
cache: 'yarn'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Cache Node Modules
|
- name: Cache Node Modules
|
||||||
id: cache-node
|
id: cache-node
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: "**/node_modules"
|
path: "**/node_modules"
|
||||||
key: cache-node_modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ github.run_id }}
|
key: cache-node_modules-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.run_id }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
cache-node_modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ github.run_id }}
|
cache-node_modules-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.run_id }}
|
||||||
cache-node_modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-
|
cache-node_modules-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-
|
||||||
|
|
||||||
- name: Install NPM Dependencies
|
- name: Install NPM Dependencies
|
||||||
run: yarn install --prefer-offline --frozen-lockfile --ignore-engines --registry https://registry.npmjs.org --network-timeout 300000
|
run: pnpm install --prefer-offline --frozen-lockfile --ignore-engines --registry https://registry.npmjs.org --network-timeout 300000
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
|
|
||||||
- name: Build Packages
|
- name: Build Packages
|
||||||
run: yarn build --force
|
run: pnpm run build --force
|
||||||
|
|
||||||
- name: Upload Package Artifacts
|
- name: Upload Package Artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
|
@ -108,7 +112,7 @@ jobs:
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
# Test depends on Build's output, which allows us to skip any build process!
|
# Test depends on Build's output, which allows us to skip any build process!
|
||||||
# We also run `yarn install` with the `--prefer-offline` flag to speed things up.
|
# We also run `pnpm install` with the `--prefer-offline` flag to speed things up.
|
||||||
test:
|
test:
|
||||||
name: 'Test: ${{ matrix.os }} (node@${{ matrix.node_version }})'
|
name: 'Test: ${{ matrix.os }} (node@${{ matrix.node_version }})'
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
@ -132,7 +136,7 @@ jobs:
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node_version }}
|
node-version: ${{ matrix.node_version }}
|
||||||
cache: 'yarn'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Download Build Artifacts
|
- name: Download Build Artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
|
@ -145,24 +149,24 @@ jobs:
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: "**/node_modules"
|
path: "**/node_modules"
|
||||||
key: cache-node_modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ github.run_id }}
|
key: cache-node_modules-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.run_id }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
cache-node_modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ github.run_id }}
|
cache-node_modules-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.run_id }}
|
||||||
cache-node_modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-
|
cache-node_modules-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-
|
||||||
|
|
||||||
- name: Install NPM Dependencies
|
- name: Install NPM Dependencies
|
||||||
run: yarn install --prefer-offline --frozen-lockfile --ignore-engines --registry https://registry.npmjs.org --network-timeout 300000
|
run: pnpm install --prefer-offline --frozen-lockfile --ignore-engines --registry https://registry.npmjs.org --network-timeout 300000
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
if: ${{ matrix.os != 'windows-latest' }}
|
if: ${{ matrix.os != 'windows-latest' }}
|
||||||
run: yarn test
|
run: pnpm run test
|
||||||
|
|
||||||
# Turbo seems to make the tests hang on Windows, just run them directly
|
# Turbo seems to make the tests hang on Windows, just run them directly
|
||||||
- name: Test (Windows)
|
- name: Test (Windows)
|
||||||
if: ${{ matrix.os == 'windows-latest' }}
|
if: ${{ matrix.os == 'windows-latest' }}
|
||||||
run: yarn workspace astro run test
|
run: pnpm run test --filter=astro
|
||||||
|
|
||||||
smoke:
|
smoke:
|
||||||
name: 'Test (Smoke) ${{ matrix.os }}'
|
name: 'Test (Smoke) ${{ matrix.os }}'
|
||||||
|
@ -180,7 +184,7 @@ jobs:
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: 14
|
node-version: 14
|
||||||
cache: 'yarn'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Download Build Artifacts
|
- name: Download Build Artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
|
@ -193,19 +197,19 @@ jobs:
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: "**/node_modules"
|
path: "**/node_modules"
|
||||||
key: cache-node_modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ github.run_id }}
|
key: cache-node_modules-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.run_id }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
cache-node_modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ github.run_id }}
|
cache-node_modules-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.run_id }}
|
||||||
cache-node_modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-
|
cache-node_modules-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-
|
||||||
|
|
||||||
- name: Install NPM Dependencies
|
- name: Install NPM Dependencies
|
||||||
run: yarn install --prefer-offline --frozen-lockfile --ignore-engines --registry https://registry.npmjs.org --network-timeout 300000
|
run: pnpm install --prefer-offline --frozen-lockfile --ignore-engines --registry https://registry.npmjs.org --network-timeout 300000
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
if: ${{ matrix.os != 'windows-latest' }}
|
if: ${{ matrix.os != 'windows-latest' }}
|
||||||
run: yarn run build:examples --concurrency=1
|
run: pnpm run build:examples --concurrency=1
|
||||||
|
|
||||||
# Turbo seems to fail on Windows, so run a custom script directly.
|
# Turbo seems to fail on Windows, so run a custom script directly.
|
||||||
- name: Test (Windows)
|
- name: Test (Windows)
|
||||||
|
@ -229,7 +233,7 @@ jobs:
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
cache: 'yarn'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Download Build Artifacts
|
- name: Download Build Artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v2
|
||||||
|
@ -242,13 +246,13 @@ jobs:
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: "**/node_modules"
|
path: "**/node_modules"
|
||||||
key: cache-node_modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ github.run_id }}
|
key: cache-node_modules-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.run_id }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
cache-node_modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ github.run_id }}
|
cache-node_modules-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ github.run_id }}
|
||||||
cache-node_modules-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-
|
cache-node_modules-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-
|
||||||
|
|
||||||
- name: Install NPM Dependencies
|
- name: Install NPM Dependencies
|
||||||
run: yarn install --prefer-offline --frozen-lockfile --ignore-engines --registry https://registry.npmjs.org --network-timeout 300000
|
run: pnpm install --prefer-offline --frozen-lockfile --ignore-engines --registry https://registry.npmjs.org --network-timeout 300000
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
|
|
||||||
|
@ -256,7 +260,7 @@ jobs:
|
||||||
id: changesets
|
id: changesets
|
||||||
uses: changesets/action@v1
|
uses: changesets/action@v1
|
||||||
with:
|
with:
|
||||||
publish: yarn changeset publish
|
publish: pnpm exec changeset publish
|
||||||
commit: '[ci] release'
|
commit: '[ci] release'
|
||||||
title: '[ci] release'
|
title: '[ci] release'
|
||||||
env:
|
env:
|
||||||
|
|
11
.github/workflows/format.yml
vendored
11
.github/workflows/format.yml
vendored
|
@ -13,19 +13,22 @@ jobs:
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.head_ref }}
|
ref: ${{ github.head_ref }}
|
||||||
|
- uses: pnpm/action-setup@v2.0.1
|
||||||
|
with:
|
||||||
|
version: 6.23.x
|
||||||
- name: Set Node version to 16
|
- name: Set Node version to 16
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
cache: 'yarn'
|
cache: 'pnpm'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn --frozen-lockfile --ignore-engines
|
run: pnpm install --frozen-lockfile --ignore-engines
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
- name: Format code
|
- name: Format code
|
||||||
run: yarn format
|
run: pnpm run format
|
||||||
- name: Commit changes
|
- name: Commit changes
|
||||||
uses: stefanzweifel/git-auto-commit-action@v4
|
uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
with:
|
with:
|
||||||
commit_message: '[ci] yarn format'
|
commit_message: '[ci] format'
|
||||||
branch: ${{ github.head_ref }}
|
branch: ${{ github.head_ref }}
|
||||||
|
|
10
.github/workflows/main.yml
vendored
10
.github/workflows/main.yml
vendored
|
@ -39,20 +39,24 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v2.0.1
|
||||||
|
with:
|
||||||
|
version: 6.23.x
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
cache: 'yarn'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Install NPM Dependencies
|
- name: Install NPM Dependencies
|
||||||
if: steps.cache-npm.outputs.cache-hit != 'true'
|
if: steps.cache-npm.outputs.cache-hit != 'true'
|
||||||
run: yarn install --prefer-offline --frozen-lockfile --ignore-engines --registry https://registry.npmjs.org --network-timeout 300000
|
run: pnpm install --prefer-offline --frozen-lockfile --ignore-engines --registry https://registry.npmjs.org --network-timeout 300000
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
|
|
||||||
- name: Check Modified
|
- name: Check Modified
|
||||||
run: yarn changeset status --output ./status.json
|
run: pnpm changeset status --output ./status.json
|
||||||
|
|
||||||
- name: Check Output
|
- name: Check Output
|
||||||
id: check_files
|
id: check_files
|
||||||
|
|
17
.github/workflows/nightly.yml
vendored
17
.github/workflows/nightly.yml
vendored
|
@ -13,13 +13,16 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code using Git
|
- name: Check out code using Git
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- uses: pnpm/action-setup@v2.0.1
|
||||||
|
with:
|
||||||
|
version: 6.23.x
|
||||||
- name: Set Node version to 16
|
- name: Set Node version to 16
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
cache: 'yarn'
|
cache: 'pnpm'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn install --frozen-lockfile --ignore-engines --ignore-scripts
|
run: pnpm install --frozen-lockfile --ignore-engines --ignore-scripts
|
||||||
- name: Collect stats
|
- name: Collect stats
|
||||||
run: node scripts/stats/index.js
|
run: node scripts/stats/index.js
|
||||||
env:
|
env:
|
||||||
|
@ -37,18 +40,22 @@ jobs:
|
||||||
|
|
||||||
- name: Check out code using Git
|
- name: Check out code using Git
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v2.0.1
|
||||||
|
with:
|
||||||
|
version: 6.23.x
|
||||||
|
|
||||||
- name: Set Node version to 16
|
- name: Set Node version to 16
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
cache: 'yarn'
|
cache: 'pnpm'
|
||||||
|
|
||||||
- name: Clear lockfile
|
- name: Clear lockfile
|
||||||
run: rm -rf yarn.lock node_modules
|
run: rm -rf pnpm-lock.yaml node_modules
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn install --ignore-engines --ignore-scripts
|
run: pnpm install --ignore-engines --ignore-scripts
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
id: createpr
|
id: createpr
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
---
|
---
|
||||||
# Commands to start on workspace startup
|
# Commands to start on workspace startup
|
||||||
tasks:
|
tasks:
|
||||||
- init: yarn install
|
- init: pnpm install
|
||||||
command: yarn build
|
command: pnpm build
|
||||||
vscode:
|
vscode:
|
||||||
extensions:
|
extensions:
|
||||||
# TODO Once astro is on [vsx](https://open-vsx.org/), we should be able to specify it as an extension as well!
|
# TODO Once astro is on [vsx](https://open-vsx.org/), we should be able to specify it as an extension as well!
|
||||||
|
|
|
@ -11,18 +11,18 @@ We welcome contributions of any size and skill level. As an open source project,
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
node: "^14.15.0 || >=16.0.0"
|
node: "^14.15.0 || >=16.0.0"
|
||||||
yarn: "^1.22.10"
|
pnpm: "^6.23.6"
|
||||||
# otherwise, your build will fail
|
# otherwise, your build will fail
|
||||||
```
|
```
|
||||||
|
|
||||||
### Setting up your local repo
|
### Setting up your local repo
|
||||||
|
|
||||||
Astro uses yarn workspaces, so you should **always run `yarn install` from the top-level project directory.** running `yarn install` in the top-level project root will install dependencies for `astro`, `docs`, and every package in the repo.
|
Astro uses pnpm workspaces, so you should **always run `pnpm install` from the top-level project directory.** running `pnpm install` in the top-level project root will install dependencies for `astro`, `docs`, and every package in the repo.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git clone && cd ...
|
git clone && cd ...
|
||||||
yarn install
|
pnpm install
|
||||||
yarn build
|
pnpm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
In [#2254](https://github.com/withastro/astro/pull/2254) a `.git-blame-ignore-revs` file was added to ignore repo-wide formatting changes. To improve your experience, you should run the following command locally.
|
In [#2254](https://github.com/withastro/astro/pull/2254) a `.git-blame-ignore-revs` file was added to ignore repo-wide formatting changes. To improve your experience, you should run the following command locally.
|
||||||
|
@ -35,9 +35,9 @@ git config --local blame.ignoreRevsFile .git-blame-ignore-revs
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# starts a file-watching, live-reloading dev script for active development
|
# starts a file-watching, live-reloading dev script for active development
|
||||||
yarn dev
|
pnpm run dev
|
||||||
# build the entire project, one time.
|
# build the entire project, one time.
|
||||||
yarn build
|
pnpm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Debugging Vite
|
#### Debugging Vite
|
||||||
|
@ -53,10 +53,10 @@ DEBUG=vite:[name] astro dev # debug specific process, e.g. "vite:deps" or "vit
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# run this in the top-level project root to run all tests
|
# run this in the top-level project root to run all tests
|
||||||
yarn test
|
pnpm run test
|
||||||
# run only a few tests, great for working on a single feature
|
# run only a few tests, great for working on a single feature
|
||||||
# (example - `yarn test -g "RSS"` runs `astro-rss.test.js`)
|
# (example - `pnpm run test -g "RSS"` runs `astro-rss.test.js`)
|
||||||
yarn test -g "$STRING_MATCH"
|
pnpm test -g "$STRING_MATCH"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Other useful commands
|
### Other useful commands
|
||||||
|
@ -64,13 +64,13 @@ yarn test -g "$STRING_MATCH"
|
||||||
```shell
|
```shell
|
||||||
# auto-format the entire project
|
# auto-format the entire project
|
||||||
# (optional - a GitHub Action formats every commit after a PR is merged)
|
# (optional - a GitHub Action formats every commit after a PR is merged)
|
||||||
yarn format
|
pnpm run format
|
||||||
```
|
```
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# lint the project
|
# lint the project
|
||||||
# (optional - our linter creates helpful warnings, but not errors.)
|
# (optional - our linter creates helpful warnings, but not errors.)
|
||||||
yarn lint
|
pnpm run lint
|
||||||
```
|
```
|
||||||
|
|
||||||
### Making a Pull Request
|
### Making a Pull Request
|
||||||
|
@ -78,7 +78,7 @@ yarn lint
|
||||||
When making a pull request, be sure to add a changeset when something has changed with Astro. Non-packages (`examples/*`, `docs/*`) do not need changesets.
|
When making a pull request, be sure to add a changeset when something has changed with Astro. Non-packages (`examples/*`, `docs/*`) do not need changesets.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn changeset
|
pnpm exec changeset
|
||||||
```
|
```
|
||||||
|
|
||||||
### Running benchmarks
|
### Running benchmarks
|
||||||
|
@ -86,7 +86,7 @@ yarn changeset
|
||||||
We have benchmarks to keep performance under control. You can run these by running (from the project root):
|
We have benchmarks to keep performance under control. You can run these by running (from the project root):
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
yarn workspace astro run benchmark
|
pnpm run benchmark --filter=astro
|
||||||
```
|
```
|
||||||
|
|
||||||
Which will fail if the performance has regressed by **10%** or more.
|
Which will fail if the performance has regressed by **10%** or more.
|
||||||
|
@ -142,11 +142,11 @@ To release a snapshot, run the following locally:
|
||||||
# Note: XXX should be a keyword to identify this release. Ex: `--snapshot routing` & `--tag next--routing`
|
# Note: XXX should be a keyword to identify this release. Ex: `--snapshot routing` & `--tag next--routing`
|
||||||
|
|
||||||
# 1:
|
# 1:
|
||||||
yarn changeset version --snapshot XXX
|
pnpm exec changeset version --snapshot XXX
|
||||||
# 2: (Manual) review the diff, and make sure that you're not releasing more than you need to.
|
# 2: (Manual) review the diff, and make sure that you're not releasing more than you need to.
|
||||||
git checkout -- examples/ docs/
|
git checkout -- examples/ docs/
|
||||||
# 3:
|
# 3:
|
||||||
yarn release --tag next--XXX
|
pnpm run release --tag next--XXX
|
||||||
# 4: (Manual) review the publish, and if you're happy then you can throw out all local changes
|
# 4: (Manual) review the publish, and if you're happy then you can throw out all local changes
|
||||||
git reset --hard
|
git reset --hard
|
||||||
```
|
```
|
||||||
|
@ -165,7 +165,7 @@ Full documentation: https://github.com/atlassian/changesets/blob/main/docs/prere
|
||||||
|
|
||||||
If you have gotten permission from the core contributors, you can enter into prerelease mode by following the following steps:
|
If you have gotten permission from the core contributors, you can enter into prerelease mode by following the following steps:
|
||||||
|
|
||||||
- Run: `yarn changeset pre enter next` in the project root
|
- Run: `pnpm exec changeset pre enter next` in the project root
|
||||||
- Create a new PR from the changes created by this command
|
- Create a new PR from the changes created by this command
|
||||||
- Review, approve, and more the PR to enter prerelease mode.
|
- Review, approve, and more the PR to enter prerelease mode.
|
||||||
- If successful, The "Version Packages" PR (if one exists) will now say "Version Packages (next)".
|
- If successful, The "Version Packages" PR (if one exists) will now say "Version Packages (next)".
|
||||||
|
@ -174,7 +174,7 @@ If you have gotten permission from the core contributors, you can enter into pre
|
||||||
|
|
||||||
Exiting prerelease mode should happen once an experimental release is ready to go from `npm install astro@next` to `npm install astro`. Only a core contributor run these steps. These steps should be run before
|
Exiting prerelease mode should happen once an experimental release is ready to go from `npm install astro@next` to `npm install astro`. Only a core contributor run these steps. These steps should be run before
|
||||||
|
|
||||||
- Run: `yarn changeset pre exit` in the project root
|
- Run: `pnpm exec changeset pre exit` in the project root
|
||||||
- Create a new PR from the changes created by this command.
|
- Create a new PR from the changes created by this command.
|
||||||
- Review, approve, and more the PR to enter prerelease mode.
|
- Review, approve, and more the PR to enter prerelease mode.
|
||||||
- If successful, The "Version Packages (next)" PR (if one exists) will now say "Version Packages".
|
- If successful, The "Version Packages (next)" PR (if one exists) will now say "Version Packages".
|
||||||
|
@ -187,9 +187,9 @@ When in prerelease mode, the automatic PR release process will no longer release
|
||||||
1. Create a new `release/0.X` branch, if none exists.
|
1. Create a new `release/0.X` branch, if none exists.
|
||||||
1. Point `release/0.X` to the latest commit for the `v0.X` version.
|
1. Point `release/0.X` to the latest commit for the `v0.X` version.
|
||||||
1. `git cherry-pick` commits from `main`, as needed.
|
1. `git cherry-pick` commits from `main`, as needed.
|
||||||
1. Make sure that all changesets for the new release are included. You can create some manually (via `yarn changeset`) if needed.
|
1. Make sure that all changesets for the new release are included. You can create some manually (via `pnpm exec changeset`) if needed.
|
||||||
1. Run `yarn changeset version` to create your new release.
|
1. Run `pnpm exec changeset version` to create your new release.
|
||||||
1. Run `yarn release` to publish your new release.
|
1. Run `pnpm run release` to publish your new release.
|
||||||
1. Run `git push && git push --tags` to push your new release to GitHub.
|
1. Run `git push && git push --tags` to push your new release to GitHub.
|
||||||
1. Run `git push release/0.X:latest` to push your release branch to `latest`. This will trigger an update to the docs site, etc.
|
1. Run `git push release/0.X:latest` to push your release branch to `latest`. This will trigger an update to the docs site, etc.
|
||||||
1. Go to https://github.com/withastro/astro/releases/new and create a new release. Copy the new changelog entry from https://github.com/withastro/astro/blob/latest/packages/astro/CHANGELOG.md.
|
1. Go to https://github.com/withastro/astro/releases/new and create a new release. Copy the new changelog entry from https://github.com/withastro/astro/blob/latest/packages/astro/CHANGELOG.md.
|
||||||
|
|
|
@ -10,9 +10,9 @@ For the RFC writing guide, check out the [RFC issue template](https://github.com
|
||||||
|
|
||||||
### Linting (Style Rules)
|
### Linting (Style Rules)
|
||||||
|
|
||||||
We use tools like ESLint and TypeScript to automatically enforce some parts of our style guide. Run the `yarn lint` command to lint the codebase. We also use tools like Prettier to automatically enforce code formatting. Run the `yarn format` command to format the entire codebase.
|
We use tools like ESLint and TypeScript to automatically enforce some parts of our style guide. Run the `pnpm run lint` command to lint the codebase. We also use tools like Prettier to automatically enforce code formatting. Run the `pnpm run format` command to format the entire codebase.
|
||||||
|
|
||||||
Anything enforced by linting and formatting is considered a **style rule.** It is strictly required that you follow all style rules while working in the codebase. Run the `yarn lint` and `yarn format` commands to check your code at any time.
|
Anything enforced by linting and formatting is considered a **style rule.** It is strictly required that you follow all style rules while working in the codebase. Run the `pnpm run lint` and `pnpm run format` commands to check your code at any time.
|
||||||
|
|
||||||
These style rules are maintained in configuration files, and therefore not documented in this document. Read any of the following configuration files to learn more about the style rules that we strictly enforced across the codebase:
|
These style rules are maintained in configuration files, and therefore not documented in this document. Read any of the following configuration files to learn more about the style rules that we strictly enforced across the codebase:
|
||||||
|
|
||||||
|
|
|
@ -11,10 +11,10 @@ Every pull request needs to be reviewed by another contributor to the documentat
|
||||||
- Clone the Project
|
- Clone the Project
|
||||||
|
|
||||||
`git clone git@github.com:withastro/astro.git`
|
`git clone git@github.com:withastro/astro.git`
|
||||||
- Run `yarn install` to install latest dependencies.
|
- Run `pnpm install` to install latest dependencies.
|
||||||
> This project uses yarn to manage dependencies. [Make sure that you have yarn v1 installed.](https://classic.yarnpkg.com/)
|
> This project uses pnpm to manage dependencies.
|
||||||
- Run `yarn workspace docs dev` to start the dev server.
|
- Run `pnpm run dev --filter docs` to start the dev server.
|
||||||
- Run `yarn workspace docs build` to build the final site for production.
|
- Run `pnpm run build --filter docs` to build the final site for production.
|
||||||
> The environment variable `SNOWPACK_PUBLIC_GITHUB_TOKEN` must be set to a personal access token with `public_repo` permissions to prevent rate-limiting.
|
> The environment variable `SNOWPACK_PUBLIC_GITHUB_TOKEN` must be set to a personal access token with `public_repo` permissions to prevent rate-limiting.
|
||||||
|
|
||||||
## Deploying
|
## Deploying
|
||||||
|
|
|
@ -8,10 +8,10 @@
|
||||||
"build": "astro build",
|
"build": "astro build",
|
||||||
"preview": "astro preview",
|
"preview": "astro preview",
|
||||||
"lint": "run-p --aggregate-output lint:linkcheck",
|
"lint": "run-p --aggregate-output lint:linkcheck",
|
||||||
"lint:a11y": "start-test 'yarn build && yarn preview' 3000 'yarn lint:a11y:local'",
|
"lint:a11y": "start-test 'pnpm run build && pnpm run preview' 3000 'pnpm run lint:a11y:local'",
|
||||||
"lint:a11y:local": "pa11y-ci --sitemap 'http://localhost:3000/sitemap.xml' --sitemap-find 'https://docs.astro.build' --sitemap-replace 'http://localhost:3000'",
|
"lint:a11y:local": "pa11y-ci --sitemap 'http://localhost:3000/sitemap.xml' --sitemap-find 'https://docs.astro.build' --sitemap-replace 'http://localhost:3000'",
|
||||||
"lint:a11y:remote": "pa11y-ci --sitemap 'https://docs.astro.build/sitemap.xml'",
|
"lint:a11y:remote": "pa11y-ci --sitemap 'https://docs.astro.build/sitemap.xml'",
|
||||||
"lint:linkcheck": "start-test 'yarn dev --silent' 3000 'yarn lint:linkcheck:local'",
|
"lint:linkcheck": "start-test 'pnpm run dev --silent' 3000 'pnpm run lint:linkcheck:local'",
|
||||||
"lint:linkcheck:local": "blc -roe --user-agent 'broken-link-checker/0.7.8' 'http://localhost:3000/en/getting-started'",
|
"lint:linkcheck:local": "blc -roe --user-agent 'broken-link-checker/0.7.8' 'http://localhost:3000/en/getting-started'",
|
||||||
"lint:linkcheck:remote": "blc -ro --user-agent 'broken-link-checker/0.7.8' 'https://docs.astro.build/'"
|
"lint:linkcheck:remote": "blc -ro --user-agent 'broken-link-checker/0.7.8' 'https://docs.astro.build/'"
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
"url": "https://github.com/withastro/astro.git"
|
"url": "https://github.com/withastro/astro.git"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"release": "yarn build && changeset publish",
|
"release": "pnpm run build && changeset publish",
|
||||||
"build": "turbo run build --no-deps --scope=astro --scope=create-astro --scope=\"@astrojs/*\"",
|
"build": "turbo run build --no-deps --scope=astro --scope=create-astro --scope=\"@astrojs/*\"",
|
||||||
"build:examples": "turbo run build --scope=docs --scope=\"@example/*\"",
|
"build:examples": "turbo run build --scope=docs --scope=\"@example/*\"",
|
||||||
"dev": "turbo run dev --no-deps --no-cache --parallel --scope=astro --scope=create-astro --scope=\"@astrojs/*\"",
|
"dev": "turbo run dev --no-deps --no-cache --parallel --scope=astro --scope=create-astro --scope=\"@astrojs/*\"",
|
||||||
|
@ -65,8 +65,7 @@
|
||||||
],
|
],
|
||||||
"volta": {
|
"volta": {
|
||||||
"node": "14.17.0",
|
"node": "14.17.0",
|
||||||
"npm": "7.11.2",
|
"npm": "7.11.2"
|
||||||
"yarn": "1.22.10"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@changesets/changelog-github": "^0.4.2",
|
"@changesets/changelog-github": "^0.4.2",
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
"dist"
|
"dist"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepublish": "yarn build",
|
"prepublish": "pnpm run build",
|
||||||
"build": "astro-scripts build \"src/**/*.ts\" && tsc -p tsconfig.json",
|
"build": "astro-scripts build \"src/**/*.ts\" && tsc -p tsconfig.json",
|
||||||
"dev": "astro-scripts dev \"src/**/*.ts\""
|
"dev": "astro-scripts dev \"src/**/*.ts\""
|
||||||
},
|
},
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
|
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
|
||||||
"dev": "astro-scripts dev \"src/**/*.ts\"",
|
"dev": "astro-scripts dev \"src/**/*.ts\"",
|
||||||
"prepare": "yarn build",
|
"prepare": "pnpm run build",
|
||||||
"test": "rm -rf test/fixtures && mkdir test/fixtures && node --unhandled-rejections=strict test/create-astro.test.js"
|
"test": "rm -rf test/fixtures && mkdir test/fixtures && node --unhandled-rejections=strict test/create-astro.test.js"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
|
@ -38,7 +38,8 @@
|
||||||
"yargs-parser": "^21.0.0"
|
"yargs-parser": "^21.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"uvu": "^0.5.1"
|
"uvu": "^0.5.1",
|
||||||
|
"astro-scripts": "0.0.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^14.15.0 || >=16.0.0"
|
"node": "^14.15.0 || >=16.0.0"
|
||||||
|
|
|
@ -111,7 +111,7 @@ async function testAll() {
|
||||||
await execa('../../create-astro.mjs', [template, '--template', template, '--commit', GITHUB_SHA, '--force-overwrite'], {
|
await execa('../../create-astro.mjs', [template, '--template', template, '--commit', GITHUB_SHA, '--force-overwrite'], {
|
||||||
cwd: FIXTURES_DIR,
|
cwd: FIXTURES_DIR,
|
||||||
});
|
});
|
||||||
// setup: `npm install` (note: running multiple `yarn`s in parallel in CI will conflict)
|
// setup: `npm install` (note: running multiple `pnpm`s in parallel in CI will conflict)
|
||||||
await execa('npm', ['install', '--no-package-lock', '--silent'], { cwd: path.join(FIXTURES_DIR, template) });
|
await execa('npm', ['install', '--no-package-lock', '--silent'], { cwd: path.join(FIXTURES_DIR, template) });
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
".": "./dist/index.js"
|
".": "./dist/index.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepublish": "yarn build",
|
"prepublish": "pnpm run build",
|
||||||
"build": "astro-scripts build \"src/**/*.ts\" && tsc -p tsconfig.json",
|
"build": "astro-scripts build \"src/**/*.ts\" && tsc -p tsconfig.json",
|
||||||
"postbuild": "astro-scripts copy \"src/**/*.js\"",
|
"postbuild": "astro-scripts copy \"src/**/*.js\"",
|
||||||
"dev": "astro-scripts dev \"src/**/*.ts\""
|
"dev": "astro-scripts dev \"src/**/*.ts\""
|
||||||
|
@ -44,6 +44,7 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/github-slugger": "^1.3.0",
|
"@types/github-slugger": "^1.3.0",
|
||||||
"@types/prismjs": "^1.16.6"
|
"@types/prismjs": "^1.16.6",
|
||||||
|
"astro-scripts": "0.0.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
10696
pnpm-lock.yaml
Normal file
10696
pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load diff
13
pnpm-workspace.yaml
Normal file
13
pnpm-workspace.yaml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
packages:
|
||||||
|
- "compiled/*"
|
||||||
|
- "packages/markdown/*"
|
||||||
|
- "packages/renderers/*"
|
||||||
|
- "packages/*"
|
||||||
|
- "examples/*"
|
||||||
|
- "examples/component/demo"
|
||||||
|
- "examples/component/packages/*"
|
||||||
|
- "scripts"
|
||||||
|
- "docs"
|
||||||
|
- "packages/astro/test/fixtures/builtins/packages/*"
|
||||||
|
- "packages/astro/test/fixtures/builtins-polyfillnode"
|
||||||
|
- "packages/astro/test/fixtures/custom-elements/my-component-lib"
|
|
@ -19,7 +19,7 @@ export default async function run() {
|
||||||
const filePath = fileURLToPath(projectToTest);
|
const filePath = fileURLToPath(projectToTest);
|
||||||
console.log(' 🤖 Testing', filePath, '\n');
|
console.log(' 🤖 Testing', filePath, '\n');
|
||||||
try {
|
try {
|
||||||
await execa('yarn', ['build'], { cwd: fileURLToPath(projectToTest), stdout: 'inherit', stderr: 'inherit' });
|
await execa('pnpm', ['run', 'build'], { cwd: fileURLToPath(projectToTest), stdout: 'inherit', stderr: 'inherit' });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|
Loading…
Reference in a new issue