Skip to content

Commit

Permalink
chore: migrate the monorepo to pnpm (quasarframework#16990)
Browse files Browse the repository at this point in the history
* chore: migrate to pnpm

* feat(app-vite&app-webpack): improve package manager references in banners

* chore: remove npm reference in dev app uploader page

* docs: upgrade contribution guide

* chore: correctly include extras in workspaces

* chore: include create-quasar in workspaces

* chore: centralize .editorconfig

* chore: remove yarn.lock

* chore: only allow pnpm

* chore: centralize linting packages and config

* chore: create shared eslint config package

* chore: remove redundant pnpm.peerDependencyRules.ignoreMissing
it needs to be specified in the root since we are using pnpm workspaces
but, it doesn't seem to be changing any behavior, so it's redundant

* chore: include cli in workspaces

* ci: ensure pnpm is installed and cache is set correctly

* chore: generate pnpm lock file after rebase

* chore: tidy up eslintignore

* chore: setup root lint script

* chore: include app-webpack in workspaces

* chore: update vscode config

* chore: update .github/CONTRIBUTING.md

* chore: regenerate lock file

* ci: fix create test project script
after migrating to pnpm workspaces, some behavior got changed
1. prompts package named imports are not working. This is probably due to switching to a different version during migration, rather than a pnpm specific issue.
2. When using pnpm to create the test project, it becomes part of the monorepo, which makes it fail to install properly.

* ci: fix weird test creation test issue with yarn

* Revert "ci: fix weird test creation test issue with yarn"

This reverts commit 5fcaa12.

* ci: fix weird test creation test issue with yarn
yarnpkg/yarn#9015

* ci: apply skip yarn corepack check to other scripts as well
but still keep it in create-test-project script to avoid the problem when executing the script in different environments

* ci: cache Cypress binary to fix tests on pr workflow

* ci: install Cypress binary when cache does not exit
and correctly cache it

* chore(ui): fix tests not being able to run
  • Loading branch information
yusufkandemir committed Mar 13, 2024
1 parent 146e910 commit 7f8e550
Show file tree
Hide file tree
Showing 111 changed files with 13,168 additions and 10,078 deletions.
1 change: 1 addition & 0 deletions ui/dev/.editorconfig → .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# http://editorconfig.org
root = true

[*]
Expand Down
7 changes: 1 addition & 6 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
/app-vite/templates
/app-webpack/templates
/icongenie/samples
/ui/types
/utils/render-ssr-error/src-ui/dist
/utils/render-ssr-error/src-ui/.quasar
node_modules
15 changes: 15 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require('@rushstack/eslint-patch/modern-module-resolution')

module.exports = {
root: true,

parserOptions: {
ecmaVersion: 'latest'
},

extends: [
'eslint:recommended',
'quasar/base',
'quasar/node'
]
}
3 changes: 2 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Quasar Contributing Guide

The guide can be found [here](../CONTRIBUTING.md).
Hi! We are really excited that you are interested in contributing to Quasar 👏.
Please visit our website to view the [Contribution Guide](https://quasar.dev/how-to-contribute/contribution-guide).
11 changes: 7 additions & 4 deletions .github/workflows/build-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,22 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3

- uses: actions/setup-node@v4
with:
node-version: 20
# No caching because we are not checking lock files in
cache: 'pnpm'

- name: Install dependencies
run: yarn
run: pnpm i

- name: Ensure types are formatted correctly
run: yarn format:types --write=false --check
run: pnpm format:types --write=false --check

- name: Build the types
run: yarn build js types
run: pnpm build js types

- if: ${{ github.event_name == 'pull_request' }}
run: |
Expand Down
29 changes: 16 additions & 13 deletions .github/workflows/project-creation-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,20 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
# create-quasar is not included in workspaces, and its yarn.lock is .gitignored, so we can't have caching
# cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies
run: yarn
run: pnpm i

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

test:
needs: lint
Expand All @@ -61,6 +63,10 @@ jobs:

runs-on: ubuntu-latest

env:
# See https://github.com/yarnpkg/yarn/issues/9015
SKIP_YARN_COREPACK_CHECK: 1

defaults:
run:
working-directory: create-quasar
Expand All @@ -79,22 +85,19 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
# create-quasar is not included in workspaces, and its yarn.lock is .gitignored, so we can't have caching
# cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies
run: yarn
run: pnpm i

# pnpm
- name: Install pnpm
if: ${{ matrix.package-manager == 'pnpm' }}
uses: pnpm/action-setup@v3
with:
version: 8
- name: Get pnpm store directory
if: ${{ matrix.package-manager == 'pnpm' }}
id: pnpm-cache
Expand Down Expand Up @@ -143,7 +146,7 @@ jobs:
npm-cache-
- name: Create the test project
run: yarn create-test-project ${{ matrix.script-type }} ${{ matrix.app-engine }} ${{ matrix.package-manager }}
run: pnpm create-test-project ${{ matrix.script-type }} ${{ matrix.app-engine }} ${{ matrix.package-manager }}

- name: Lint the project
working-directory: create-quasar/test-project
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ jobs:
with:
ref: dev

- name: Setup pnpm
uses: pnpm/action-setup@v3

- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache: 'pnpm'

- run: yarn install
working-directory: docs
- name: Install dependencies
run: pnpm i

- name: Generate Release Notes
uses: actions/github-script@v7
Expand Down
39 changes: 32 additions & 7 deletions .github/workflows/tests-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,21 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies
run: yarn
run: pnpm i

- name: Build the UI package
working-directory: ui
run: yarn build
run: pnpm build

- name: Upload UI build artifact
uses: actions/upload-artifact@v4
Expand All @@ -46,7 +49,7 @@ jobs:

- name: Build vite-plugin package
working-directory: vite-plugin
run: yarn build
run: pnpm build

- name: Upload vite-plugin build artifact
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -78,14 +81,36 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v3

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache: 'pnpm'

- name: Install dependencies
run: yarn
run: pnpm i

# We have to cache Cypress binary as well (https://on.cypress.io/not-installed-ci-error)
- name: Get Cypress version
id: cypress-version
working-directory: ui
run: |
echo "CYPRESS_VERSION=$(pnpm why cypress --depth 0 --json | jq -r '.[0].devDependencies.cypress.version')" > $GITHUB_OUTPUT
- name: Cache Cypress binary
id: cypress-cache
uses: actions/cache@v4
with:
# https://docs.cypress.io/guides/references/advanced-installation#Skipping-installation
path: ~/.cache/Cypress
key: cypress-cache-${{ steps.cypress-version.outputs.CYPRESS_VERSION }}
restore-keys: |
cypress-cache-
- name: Install Cypress
if: steps.cypress-cache.outputs.cache-hit != 'true'
run: pnpm cypress install

- name: Download UI build artifact
uses: actions/download-artifact@v4
Expand All @@ -105,7 +130,7 @@ jobs:
CYPRESS_JUNIT_RESULTS_FILENAME: test-results/${{ matrix.browser }}/[hash].xml
with:
install: false
command: yarn test:component:run --browser ${{ matrix.browser }}
command: pnpm test:component:run --browser ${{ matrix.browser }}
working-directory: ui

# Upload required artifacts to be used in tests-on-pr-report.yml
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
.Thumbs.db
*.sublime*
.idea/
**/yarn.lock
debug.log
package-lock.json

ui/.vscode/

node_modules/
yarn.lock
package-lock.json
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# pnpm-related options
shamefully-hoist=true
strict-peer-dependencies=false
5 changes: 3 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"vue.volar"
],
"vue.volar",
"editorconfig.editorconfig"
]
}
14 changes: 12 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
{
"eslint.format.enable": false,
"editor.formatOnSave": false,
"eslint.workingDirectories": ["./docs", "./ui"],
"eslint.workingDirectories": [
"./app-vite",
"./app-webpack",
"./cli",
"./create-quasar",
"./docs",
"./ui",
"./utils/render-ssr-error",
"./utils/ssl-certificate",
"./vite-plugin"
],
"editor.tabSize": 2,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"eslint.validate": ["javascript", "vue"],
"eslint.validate": ["javascript", "vue"]
}

0 comments on commit 7f8e550

Please sign in to comment.