-
-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
108 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,44 +33,34 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
version: 6.15.1 | ||
|
||
- name: Set node version to ${{ matrix.node_version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node_version }} | ||
cache: "pnpm" | ||
|
||
- name: Get yarn cache directory | ||
id: yarn-cache | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- name: Set dependencies cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.yarn-cache.outputs.dir }} | ||
key: ${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('yarn.lock') }} | ||
${{ runner.os }}-${{ matrix.node_version }}- | ||
- name: Versions | ||
run: yarn versions | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Install deps | ||
run: pnpm install | ||
|
||
- name: Build vite | ||
run: yarn ci-build-vite | ||
run: pnpm run ci-build-vite | ||
|
||
- name: Build plugin-vue | ||
run: yarn build-plugin-vue | ||
run: pnpm run build-plugin-vue | ||
|
||
- name: Build plugin-react | ||
run: yarn build-plugin-react | ||
run: pnpm run build-plugin-react | ||
|
||
- name: Test serve | ||
run: yarn test-serve --runInBand | ||
run: pnpm run test-serve -- --runInBand | ||
|
||
- name: Test build | ||
run: yarn test-build --runInBand | ||
run: pnpm run test-build -- --runInBand | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
|
@@ -80,25 +70,24 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/[email protected] | ||
with: | ||
version: 6.15.1 | ||
|
||
- name: Set node version to 14 | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 14 | ||
cache: "pnpm" | ||
|
||
- name: Set dependencies cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/yarn | ||
key: lint-dependencies-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
lint-dependencies-${{ hashFiles('yarn.lock') }} | ||
lint-dependencies- | ||
- name: Install deps | ||
run: pnpm install | ||
|
||
- name: Prepare | ||
run: | | ||
yarn install --frozen-lockfile | ||
yarn ci-build-vite | ||
yarn build-plugin-vue | ||
pnpm run ci-build-vite | ||
pnpm run build-plugin-vue | ||
- name: Lint | ||
run: yarn lint | ||
run: pnpm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
packages: | ||
- 'packages/*' | ||
- 'packages/playground/**' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// pnpm treats file: protocols as link:, so it doesn't copy the actual files | ||
// into node_modules, causing Vite to still consider those deps linked. | ||
// This script is called from postinstall hooks in playground packages that | ||
// uses the file: protocol, and copies the file: deps into node_modules. | ||
|
||
const fs = require('fs-extra') | ||
const path = require('path') | ||
const root = process.cwd() | ||
const pkg = require(path.join(root, 'package.json')) | ||
|
||
let hasPatched | ||
for (const [key, val] of Object.entries(pkg.dependencies)) { | ||
if (val.startsWith('file:')) { | ||
hasPatched = true | ||
const src = path.resolve(root, val.slice('file:'.length)) | ||
const dest = path.resolve(root, 'node_modules', key) | ||
fs.removeSync(dest) | ||
fs.copySync(src, dest, { | ||
dereference: true | ||
}) | ||
console.log(`patched ${val}`) | ||
} | ||
} | ||
|
||
if (hasPatched) { | ||
// remove node_modules/.ignored as pnpm will think our patched files are | ||
// installed by another package manager and move them into this directory. | ||
// On further installs it will error out if this directory is not empty. | ||
fs.removeSync(path.resolve(root, 'node_modules', '.ignored')) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
if (!/pnpm/.test(process.env.npm_execpath || '')) { | ||
console.warn( | ||
`\u001b[33mThis repository requires using pnpm as the package manager ` + | ||
` for scripts to work properly.\u001b[39m\n` | ||
) | ||
process.exit(1) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters