diff --git a/ui/dev/.editorconfig b/.editorconfig similarity index 84% rename from ui/dev/.editorconfig rename to .editorconfig index 9d08a1a828a..0b01722f133 100644 --- a/ui/dev/.editorconfig +++ b/.editorconfig @@ -1,3 +1,4 @@ +# http://editorconfig.org root = true [*] diff --git a/.eslintignore b/.eslintignore index 2bca731ab9b..3c3629e647f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -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 diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 00000000000..fe8107db18a --- /dev/null +++ b/.eslintrc.cjs @@ -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' + ] +} diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d53451c236d..42402af7318 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -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). diff --git a/.github/workflows/build-types.yml b/.github/workflows/build-types.yml index e443903d0f4..8d1c07774a0 100644 --- a/.github/workflows/build-types.yml +++ b/.github/workflows/build-types.yml @@ -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: | diff --git a/.github/workflows/project-creation-tests.yml b/.github/workflows/project-creation-tests.yml index c57d0c5bb89..8fd1db65ec9 100644 --- a/.github/workflows/project-creation-tests.yml +++ b/.github/workflows/project-creation-tests.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml index 719564a9066..e90b12e3e28 100644 --- a/.github/workflows/release-notes.yml +++ b/.github/workflows/release-notes.yml @@ -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 diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index d268292e7c4..ea1d6b5952f 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.gitignore b/.gitignore index a0985fb2efc..572056230bb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,10 @@ .Thumbs.db *.sublime* .idea/ -**/yarn.lock debug.log -package-lock.json ui/.vscode/ node_modules/ +yarn.lock +package-lock.json diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000000..32bd84d2a27 --- /dev/null +++ b/.npmrc @@ -0,0 +1,3 @@ +# pnpm-related options +shamefully-hoist=true +strict-peer-dependencies=false diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 47552f0bc23..044abe88e80 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,7 @@ { "recommendations": [ "dbaeumer.vscode-eslint", - "vue.volar" - ], + "vue.volar", + "editorconfig.editorconfig" + ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 25bcd95d313..1081fd8d1ff 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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"] } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5a0d887bf91..42402af7318 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,121 +1,4 @@ # Quasar Contributing Guide -Hi! We are really excited that you are interested in contributing to Quasar 👏. Before submitting your contribution though, please make sure to take a moment and read through the following guidelines. - -- [Code of Conduct](./.github/CODE_OF_CONDUCT.md) -- [Issue Reporting Guidelines](#issue-reporting-guidelines) -- [Pull Request Guidelines](#pull-request-guidelines) -- [Development Setup](#development-setup) -- [Project Structure](#project-structure-ui) -- [Financial Contribution](#financial-contribution) - -## Issue Reporting Guidelines - -- The issue list of this repo is **exclusively** for bug reports and docs reports. Non-conforming issues will be closed immediately. - - - For simple beginner questions, you can get quick answers from the [Quasar Discord chat](https://chat.quasar.dev). - - - For more complicated questions, you can use [the Discussions section](https://forum.quasar.dev/). Make sure to provide enough information when asking your questions - this makes it easier for others to help you! - - - For feature requests, you can [start a new feature discussion](https://github.com/quasarframework/quasar/discussions/new?category=ideas-proposals). - -- Try to search for your issue, it may have already been answered or even fixed in the development branch (`dev`). - -- Check if the issue is reproducible with the latest stable version of Quasar. If you are using a pre-release, please indicate the specific version you are using. - -- It is **required** that you clearly describe the steps necessary to reproduce the issue you are running into. Although we would love to help our users as much as possible, diagnosing issues without clear reproduction steps is extremely time-consuming and simply not sustainable. - -- Use only the minimum amount of code necessary to reproduce the unexpected behavior. A good bug report should isolate specific methods that exhibit unexpected behavior and precisely define how expectations were violated. What did you expect the method or methods to do, and how did the observed behavior differ? The more precisely you isolate the issue, the faster we can investigate. - -- Issues with no clear reproduction steps will not be triaged. If an issue labeled "bug/0-needs-info" receives no further input from the issue author for more than 5 days, it will be closed. - -- If your issue is resolved but still open, don’t hesitate to close it. In case you found a solution by yourself, it could be helpful to explain how you fixed it. - -- Most importantly, we beg your patience: the team must balance your request against many other responsibilities — fixing other bugs, answering other questions, new features, new documentation, etc. The issue list is not paid support and we cannot make guarantees about how fast your issue can be resolved. - -## Pull Request Guidelines - -- The `master` branch is basically just a snapshot of the latest stable release. All development should be done in dedicated branches. **DO NOT submit PRs against the `master` branch.** - -- Checkout a topic branch from the relevant branch, e.g. `dev`, and merge back against that branch. - -- **DO NOT** checkin `dist` in the commits. - -- It's OK to have multiple small commits as you work on the PR - we will let GitHub automatically squash it before merging. - -- If adding new feature: - - Provide convincing reason to add this feature. Ideally you should [start a new feature discussion](https://github.com/quasarframework/quasar/discussions/new?category=ideas-proposals) first and have it greenlighted before working on it. - -- If fixing a bug: - - If you are resolving a special issue, add `(fix: #xxxx[,#xxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `fix: update entities encoding/decoding (fix #3899)`. - - Provide detailed description of the bug in the PR. A live demo is preferred. - -- Cypress e2e tests will run every time there is a code change in any file of the `ui` folder. - -## Development Setup - -You will need [Node.js](http://nodejs.org) **v16+** along [Yarn](https://yarnpkg.com/) or [NPM](https://docs.npmjs.com/getting-started/installing-node). Read `package.json` and take notice of the scripts you can use. - -After cloning the repo, in each subfolder run: - -``` bash -$ yarn # or: npm install -``` - -### Commonly used NPM scripts - -``` bash -# Start dev server with a demo app. This app has Quasar source code linked directly so any change will trigger HMR (Hot Module Reload) on the dev server. -# There's a section for each feature where tests are made. -$ yarn dev [theme] # or: npm run dev [theme] - -# build all dist files, including npm packages -$ yarn build # or: npm run build -# build only js dist files -$ yarn build js # or: npm run build js -# build only type related files -$ yarn build js types # or: npm run build js types -# build only css dist files -$ yarn build css # or: npm run build css - -# lint sources -$ yarn lint # or: npm run lint -``` - -## Project Structure (/ui) - -- **`build`**: contains build-related configuration files. In most cases you don't need to touch them. - -- **`src`**: contains the source code, obviously. The codebase is written in ES2015. - - - **`components`**: JS and Stylus files (one for each theme) for Quasar Vue components - - - **`directives`**: Vue directives supplied by Quasar - - - **`features`**: code for global features outside of the components - - - **`css`**: Stylus definitions and core code for Quasar themes - - - **`utils`**: utilities used by the framework and exported to the public API - - - **`index.js`**: starting point for Quasar - -- **`lang`**: Quasar language packs - -- **`icon-set`**: Quasar icon sets - -- **`dist`**: contains built files for distribution (only after a build). Note this directory is only updated when a release happens; they do not reflect the latest changes in development branches. - -- **`types`**: contains Typescript related files. Used by `build/script.types.js` along with JSON API files to produce final Typescript type declarations. - -- **`dev`**: app with Quasar sources linked directly used for testing purposes. Each feature/component has its own `*.vue` file. Adding a new file automatically creates a route for it and adds it to the "homepage" list (based on the file name). - -## Dev Server for Quasar (/ui) - -Running `yarn dev` (or `npm run dev`) starts up a dev server which uses HMR (Hot Module Reload) for Quasar source code. You can easily test your changes by making necessary changes to `/dev` `*.vue` files. - -## Financial Contribution - -Quasar Framework is an MIT-licensed open source project. Its ongoing development is made possible thanks to the support by these awesome [backers](../backers.md). - -**Please read our manifest on [Why donations are important](https://quasar.dev/why-donate)**. If you'd like to become a donator, check out [Quasar Framework's Donator campaign](https://donate.quasar.dev). +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). diff --git a/app-vite/.editorconfig b/app-vite/.editorconfig deleted file mode 100644 index e717f5eb638..00000000000 --- a/app-vite/.editorconfig +++ /dev/null @@ -1,13 +0,0 @@ -# http://editorconfig.org -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/app-vite/.eslintrc.cjs b/app-vite/.eslintrc.cjs index e7ded366d86..6f4b6dc2b0f 100644 --- a/app-vite/.eslintrc.cjs +++ b/app-vite/.eslintrc.cjs @@ -1,9 +1,12 @@ +// eslint-disable-next-line n/no-extraneous-require +require('@rushstack/eslint-patch/modern-module-resolution') module.exports = { root: true, parserOptions: { - ecmaVersion: 'latest' + ecmaVersion: 'latest', + sourceType: 'module' }, env: { @@ -12,47 +15,12 @@ module.exports = { extends: [ 'eslint:recommended', - 'plugin:n/recommended', - 'standard' + 'quasar/base', + 'quasar/node' ], rules: { - 'brace-style': [ 2, 'stroustrup', { allowSingleLine: true } ], - 'prefer-const': 2, - 'prefer-promise-reject-errors': 'off', - 'multiline-ternary': 'off', - 'no-prototype-builtins': 'off', - 'no-case-declarations': 'off', - 'generator-star-spacing': 'off', - 'arrow-parens': 'off', - 'object-property-newline': 'off', - 'one-var': 'off', - 'no-void': 'off', - 'no-lone-blocks': 'error', - 'no-unused-expressions': [ 'error', { allowShortCircuit: true } ], - 'no-useless-concat': 'error', - 'no-useless-return': 'error', - 'no-unneeded-ternary': 'error', - 'no-confusing-arrow': [ 'error', { allowParens: true } ], - 'operator-linebreak': [ 'error', 'before' ], - - 'array-bracket-spacing': [ 'error', 'always' ], - 'object-curly-spacing': [ 'error', 'always' ], - 'computed-property-spacing': [ 'error', 'always' ], - 'template-curly-spacing': [ 'error', 'always' ], - - 'import/first': 0, - 'import/named': 2, - 'import/namespace': 2, - 'import/default': 2, - 'import/export': 2, - 'import/extensions': 0, - 'import/no-unresolved': 0, - 'import/no-extraneous-dependencies': 'off', - 'no-useless-escape': 'off', - 'no-unused-vars': [ 'error', { ignoreRestSiblings: true, argsIgnorePattern: '^_' } ], - - 'n/no-process-exit': 'off' + 'no-unused-vars': [ 'error', { ignoreRestSiblings: true, argsIgnorePattern: '^_' } ] } } diff --git a/app-vite/lib/app-extension/AppExtensionInstance.js b/app-vite/lib/app-extension/AppExtensionInstance.js index 2bc2df8ffe4..e88ceb94223 100644 --- a/app-vite/lib/app-extension/AppExtensionInstance.js +++ b/app-vite/lib/app-extension/AppExtensionInstance.js @@ -210,7 +210,6 @@ export class AppExtensionInstance { } } - // yarn/npm/pnpm install if (skipPkgInstall !== true) { await this.#installPackage() } @@ -253,7 +252,6 @@ export class AppExtensionInstance { this.#appExtJson.remove(this.extId) - // yarn/npm/pnpm uninstall if (skipPkgUninstall !== true) { await this.#uninstallPackage() } diff --git a/app-vite/lib/app-extension/api-classes/BaseAPI.js b/app-vite/lib/app-extension/api-classes/BaseAPI.js index d025197fcf9..916631e7e79 100644 --- a/app-vite/lib/app-extension/api-classes/BaseAPI.js +++ b/app-vite/lib/app-extension/api-classes/BaseAPI.js @@ -57,7 +57,7 @@ export class BaseAPI { /** * What is the host project's node packager? * - * @return {Promise} 'npm' | 'yarn' | 'pnpm' + * @return {Promise<'npm' | 'yarn' | 'pnpm' | 'bun'>} */ async getNodePackagerName () { const nodePackager = await this.ctx.cacheProxy.getModule('nodePackager') diff --git a/app-vite/lib/cmd/build.js b/app-vite/lib/cmd/build.js index a15c4f66d33..4e0a5aa3212 100755 --- a/app-vite/lib/cmd/build.js +++ b/app-vite/lib/cmd/build.js @@ -113,7 +113,7 @@ const ctx = getCtx({ }) const { displayBanner } = await import('../utils/banner.js') -displayBanner({ argv, ctx, cmd: 'build' }) +await displayBanner({ argv, ctx, cmd: 'build' }) const { log } = await import('../utils/logger.js') @@ -161,7 +161,7 @@ appBuilder.build().then(async () => { ? path.join(outputFolder, '..') : outputFolder - displayBanner({ + await displayBanner({ argv, ctx, cmd: 'build', diff --git a/app-vite/lib/cmd/dev.js b/app-vite/lib/cmd/dev.js index c64da9eac27..1306c16de4d 100755 --- a/app-vite/lib/cmd/dev.js +++ b/app-vite/lib/cmd/dev.js @@ -119,7 +119,7 @@ async function startVueDevtools (ctx, devtoolsPort) { nodePackager.installPackage('@vue/devtools', { isDevDependency: true }) // a small delay is a must, otherwise require.resolve - // after a yarn/npm install will fail + // after a installing the dependencies will fail return new Promise(resolve => { vueDevtoolsBin = getPackagePath('.bin/vue-devtools', appDir) run().then(resolve) diff --git a/app-vite/lib/cmd/info.js b/app-vite/lib/cmd/info.js index 01065caa06f..0b81a2c6465 100755 --- a/app-vite/lib/cmd/info.js +++ b/app-vite/lib/cmd/info.js @@ -68,6 +68,8 @@ print({ key: 'NodeJs', value: green(process.version.slice(1)) }) print({ key: 'Global packages', section: true }) print({ key: ' NPM', value: getSpawnOutput('npm') }) print({ key: ' yarn', value: getSpawnOutput('yarn') }) +print({ key: ' pnpm', value: getSpawnOutput('pnpm') }) +print({ key: ' bun', value: getSpawnOutput('bun') }) print({ key: ' @quasar/cli', value: green(process.env.QUASAR_CLI_VERSION) }) print({ key: ' @quasar/icongenie', value: getSpawnOutput('icongenie') }) print({ key: ' cordova', value: getSpawnOutput('cordova') }) diff --git a/app-vite/lib/cmd/inspect.js b/app-vite/lib/cmd/inspect.js index ecc158865db..3836e027840 100755 --- a/app-vite/lib/cmd/inspect.js +++ b/app-vite/lib/cmd/inspect.js @@ -60,7 +60,7 @@ const ctx = getCtx({ }) import { displayBanner } from '../utils/banner.js' -displayBanner({ argv, ctx, cmd: argv.cmd }) +await displayBanner({ argv, ctx, cmd: argv.cmd }) import { log, fatal } from '../utils/logger.js' diff --git a/app-vite/lib/utils/banner.js b/app-vite/lib/utils/banner.js index f1fdd3e7a80..63bfd1cd5a5 100644 --- a/app-vite/lib/utils/banner.js +++ b/app-vite/lib/utils/banner.js @@ -26,7 +26,7 @@ function getCompilationTarget (target) { ) } -export function displayBanner ({ argv, ctx, cmd, details }) { +export async function displayBanner ({ argv, ctx, cmd, details }) { let banner = '' if (details?.buildOutputFolder) { @@ -69,14 +69,17 @@ export function displayBanner ({ argv, ctx, cmd, details }) { } if (argv.mode === 'ssr') { + const packager = await ctx.cacheProxy.getModule('nodePackager') banner += ` - Tip: The output folder must be yarn/npm installed before using it, - except when it is run inside your already yarn/npm installed project folder. + Tip: The dependencies must be installed before running the app. You can do + this by running "$ ${ packager.name } install" inside the output folder. + If you are running the app from your project folder where dependencies + are already installed, then you can skip this step. Tip: Notice the package.json generated, where there's a script defined: "start": "node index.js" - Running "$ yarn start" or "$ npm run start" from the output folder will + Running "$ ${ packager.name === 'npm' ? 'npm run' : packager.name } start" from the output folder will start the webserver. Alternatively you can call "$ node index.js" yourself.` } @@ -92,6 +95,7 @@ export function displayBanner ({ argv, ctx, cmd, details }) { in "src-cordova", except for "www" folder which must be built by Quasar CLI.` } else if (argv.mode === 'capacitor') { + const packager = await ctx.cacheProxy.getModule('nodePackager') banner += ` Tip: "src-capacitor" is a Capacitor project folder, so everything you know @@ -99,9 +103,9 @@ export function displayBanner ({ argv, ctx, cmd, details }) { for "src-capacitor/www" folder and then either opens the IDE or calls the platform's build commands to generate the final packaged file. - Tip: Feel free to use Capacitor CLI ("yarn capacitor " or - "npx capacitor ") or change any files in "src-capacitor", except - for the "www" folder which must be built by Quasar CLI.` + Tip: Feel free to use Capacitor CLI ("${ packager.name === 'npm' ? 'npx' : packager.name } capacitor ") or change + any files in "src-capacitor", except for the "www" folder which must + be built by Quasar CLI.` } else if ([ 'spa', 'pwa' ].includes(argv.mode)) { banner += ` diff --git a/app-vite/package.json b/app-vite/package.json index 1a681d945af..5b22438cf4d 100644 --- a/app-vite/package.json +++ b/app-vite/package.json @@ -89,10 +89,7 @@ "electron-builder": "^24.12.0", "electron-packager": "^17.1.1", "eslint": "^8.57.0", - "eslint-config-standard": "^17.0.0", - "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^16.6.2", - "eslint-plugin-promise": "^6.1.1", + "eslint-config-quasar": "workspace:*", "pinia": "^2.1.3", "quasar": "^2.14.0", "ts-essentials": "^9.1.2", @@ -137,13 +134,6 @@ "npm": ">= 6.14.12", "yarn": ">= 1.17.3" }, - "pnpm": { - "peerDependencyRules": { - "ignoreMissing": [ - "rollup" - ] - } - }, "volta": { "node": "lts" }, diff --git a/app-vite/types/app-extension.d.ts b/app-vite/types/app-extension.d.ts index 532198b255d..6a2cfd75efc 100644 --- a/app-vite/types/app-extension.d.ts +++ b/app-vite/types/app-extension.d.ts @@ -36,7 +36,7 @@ interface BaseAPI { hasTypescript: () => Promise; hasLint: () => Promise; getStorePackageName: () => 'pinia' | 'vuex' | undefined; - getNodePackagerName: () => Promise<'npm' | 'yarn' | 'pnpm'>; + getNodePackagerName: () => Promise<'npm' | 'yarn' | 'pnpm' | 'bun'>; } interface SharedIndexInstallAPI { diff --git a/app-vite/types/configuration/electron-conf.d.ts b/app-vite/types/configuration/electron-conf.d.ts index 38f820431a8..1fcb2245921 100644 --- a/app-vite/types/configuration/electron-conf.d.ts +++ b/app-vite/types/configuration/electron-conf.d.ts @@ -52,7 +52,7 @@ interface QuasarBaseElectronConfiguration { bundler: QuasarElectronBundlersInternal; /** - * Specify additional parameters when yarn/npm installing + * Specify additional parameters when installing dependencies in * the UnPackaged folder, right before bundling with either * electron packager or electron builder; * Example: [ 'install', '--production', '--ignore-optional', '--some-other-param' ] diff --git a/app-webpack/.editorconfig b/app-webpack/.editorconfig deleted file mode 100644 index e717f5eb638..00000000000 --- a/app-webpack/.editorconfig +++ /dev/null @@ -1,13 +0,0 @@ -# http://editorconfig.org -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/app-webpack/.eslintrc.cjs b/app-webpack/.eslintrc.cjs index e7ded366d86..7db78789ce2 100644 --- a/app-webpack/.eslintrc.cjs +++ b/app-webpack/.eslintrc.cjs @@ -1,3 +1,5 @@ +// eslint-disable-next-line n/no-extraneous-require +require('@rushstack/eslint-patch/modern-module-resolution') module.exports = { root: true, @@ -6,53 +8,14 @@ module.exports = { ecmaVersion: 'latest' }, - env: { - node: true - }, - extends: [ 'eslint:recommended', - 'plugin:n/recommended', - 'standard' + 'quasar/base', + 'quasar/node' ], rules: { - 'brace-style': [ 2, 'stroustrup', { allowSingleLine: true } ], - 'prefer-const': 2, - 'prefer-promise-reject-errors': 'off', - 'multiline-ternary': 'off', - 'no-prototype-builtins': 'off', - 'no-case-declarations': 'off', - 'generator-star-spacing': 'off', - 'arrow-parens': 'off', - 'object-property-newline': 'off', - 'one-var': 'off', - 'no-void': 'off', - 'no-lone-blocks': 'error', - 'no-unused-expressions': [ 'error', { allowShortCircuit: true } ], - 'no-useless-concat': 'error', - 'no-useless-return': 'error', - 'no-unneeded-ternary': 'error', - 'no-confusing-arrow': [ 'error', { allowParens: true } ], - 'operator-linebreak': [ 'error', 'before' ], - - 'array-bracket-spacing': [ 'error', 'always' ], - 'object-curly-spacing': [ 'error', 'always' ], - 'computed-property-spacing': [ 'error', 'always' ], - 'template-curly-spacing': [ 'error', 'always' ], - - 'import/first': 0, - 'import/named': 2, - 'import/namespace': 2, - 'import/default': 2, - 'import/export': 2, - 'import/extensions': 0, - 'import/no-unresolved': 0, - 'import/no-extraneous-dependencies': 'off', - 'no-useless-escape': 'off', - 'no-unused-vars': [ 'error', { ignoreRestSiblings: true, argsIgnorePattern: '^_' } ], - - 'n/no-process-exit': 'off' + 'no-unused-vars': [ 'error', { ignoreRestSiblings: true, argsIgnorePattern: '^_' } ] } } diff --git a/app-webpack/lib/app-extension/AppExtensionInstance.js b/app-webpack/lib/app-extension/AppExtensionInstance.js index 9a35b6f9b27..f8fc7e12652 100644 --- a/app-webpack/lib/app-extension/AppExtensionInstance.js +++ b/app-webpack/lib/app-extension/AppExtensionInstance.js @@ -211,7 +211,6 @@ module.exports.AppExtensionInstance = class AppExtensionInstance { } } - // yarn/npm/pnpm install if (skipPkgInstall !== true) { await this.#installPackage() } @@ -254,7 +253,6 @@ module.exports.AppExtensionInstance = class AppExtensionInstance { this.#appExtJson.remove(this.extId) - // yarn/npm/pnpm uninstall if (skipPkgUninstall !== true) { await this.#uninstallPackage() } diff --git a/app-webpack/lib/app-extension/api-classes/BaseAPI.js b/app-webpack/lib/app-extension/api-classes/BaseAPI.js index 6f2faccdc2d..76cf85fcb53 100644 --- a/app-webpack/lib/app-extension/api-classes/BaseAPI.js +++ b/app-webpack/lib/app-extension/api-classes/BaseAPI.js @@ -56,7 +56,7 @@ module.exports.BaseAPI = class BaseAPI { /** * What is the host project's node packager? * - * @return {string} 'npm' | 'yarn' | 'pnpm' + * @return {Promise<'npm' | 'yarn' | 'pnpm' | 'bun'>} */ async getNodePackagerName () { const nodePackager = this.ctx.cacheProxy.getModule('nodePackager') diff --git a/app-webpack/lib/cmd/build.js b/app-webpack/lib/cmd/build.js index ef88a869e12..a0b65c8aea7 100755 --- a/app-webpack/lib/cmd/build.js +++ b/app-webpack/lib/cmd/build.js @@ -113,11 +113,7 @@ const ctx = getCtx({ publish: argv.publish }) -const { displayBanner } = require('../utils/banner.js') -displayBanner({ argv, ctx, cmd: 'build' }) - const { log } = require('../utils/logger.js') - async function runBuild () { // install mode if it's missing const { addMode } = require(`../modes/${ argv.mode }/${ argv.mode }-installation.js`) @@ -163,7 +159,7 @@ async function runBuild () { ? path.join(outputFolder, '..') : outputFolder - displayBanner({ + await displayBanner({ argv, ctx, cmd: 'build', @@ -204,4 +200,5 @@ async function runBuild () { }) } -runBuild() +const { displayBanner } = require('../utils/banner.js') +displayBanner({ argv, ctx, cmd: 'build' }).then(runBuild) diff --git a/app-webpack/lib/cmd/dev.js b/app-webpack/lib/cmd/dev.js index 5c64b446d07..a1dd1bf3181 100755 --- a/app-webpack/lib/cmd/dev.js +++ b/app-webpack/lib/cmd/dev.js @@ -119,7 +119,7 @@ function startVueDevtools (ctx, devtoolsPort) { nodePackager.installPackage('@vue/devtools', { isDevDependency: true }) // a small delay is a must, otherwise require.resolve - // after a yarn/npm install will fail + // after a installing the dependencies will fail return new Promise(resolve => { vueDevtoolsBin = getPackagePath('.bin/vue-devtools', appDir) run().then(resolve) diff --git a/app-webpack/lib/cmd/info.js b/app-webpack/lib/cmd/info.js index 3509344ac4b..1535ba0aec9 100755 --- a/app-webpack/lib/cmd/info.js +++ b/app-webpack/lib/cmd/info.js @@ -68,6 +68,8 @@ print({ key: 'NodeJs', value: green(process.version.slice(1)) }) print({ key: 'Global packages', section: true }) print({ key: ' NPM', value: getSpawnOutput('npm') }) print({ key: ' yarn', value: getSpawnOutput('yarn') }) +print({ key: ' pnpm', value: getSpawnOutput('pnpm') }) +print({ key: ' bun', value: getSpawnOutput('bun') }) print({ key: ' @quasar/cli', value: green(process.env.QUASAR_CLI_VERSION) }) print({ key: ' @quasar/icongenie', value: getSpawnOutput('icongenie') }) print({ key: ' cordova', value: getSpawnOutput('cordova') }) diff --git a/app-webpack/lib/cmd/inspect.js b/app-webpack/lib/cmd/inspect.js index 1de2d9f75f0..c30fa983a24 100755 --- a/app-webpack/lib/cmd/inspect.js +++ b/app-webpack/lib/cmd/inspect.js @@ -60,26 +60,23 @@ const ctx = getCtx({ }) const { displayBanner } = require('../utils/banner.js') -displayBanner({ argv, ctx, cmd: argv.cmd }) +displayBanner({ argv, ctx, cmd: argv.cmd }).then(async () => { + const { log, fatal } = require('../utils/logger.js') -const { log, fatal } = require('../utils/logger.js') - -const { isModeInstalled } = require(`../modes/${ argv.mode }/${ argv.mode }-installation.js`) - -if (isModeInstalled(ctx.appPaths) !== true) { - fatal('Requested mode for inspection is NOT installed.') -} + const { isModeInstalled } = require(`../modes/${ argv.mode }/${ argv.mode }-installation.js`) + if (isModeInstalled(ctx.appPaths) !== true) { + fatal('Requested mode for inspection is NOT installed.') + } -const depth = parseInt(argv.depth, 10) || Infinity + const depth = parseInt(argv.depth, 10) || Infinity -const { QuasarConfigFile } = require('../quasar-config-file.js') -const quasarConfFile = new QuasarConfigFile({ - ctx, - port: argv.port, - host: argv.hostname -}) + const { QuasarConfigFile } = require('../quasar-config-file.js') + const quasarConfFile = new QuasarConfigFile({ + ctx, + port: argv.port, + host: argv.hostname + }) -async function run () { await quasarConfFile.init() const quasarConf = await quasarConfFile.read() @@ -132,6 +129,4 @@ async function run () { }) console.log(`\n Depth used: ${ depth }. You can change it with "-d" / "--depth" parameter.\n`) -} - -run() +}) diff --git a/app-webpack/lib/utils/banner.js b/app-webpack/lib/utils/banner.js index 4d1f6bf053b..b831af00f3a 100644 --- a/app-webpack/lib/utils/banner.js +++ b/app-webpack/lib/utils/banner.js @@ -26,7 +26,7 @@ function getCompilationTarget (target) { ) } -module.exports.displayBanner = function displayBanner ({ argv, ctx, cmd, details }) { +module.exports.displayBanner = async function displayBanner ({ argv, ctx, cmd, details }) { let banner = '' if (details?.buildOutputFolder) { @@ -76,14 +76,17 @@ module.exports.displayBanner = function displayBanner ({ argv, ctx, cmd, details } if (argv.mode === 'ssr') { + const packager = await ctx.cacheProxy.getModule('nodePackager') banner += ` - Tip: The output folder must be yarn/npm installed before using it, - except when it is run inside your already yarn/npm installed project folder. + Tip: The dependencies must be installed before running the app. You can do + this by running "$ ${ packager.name } install" inside the output folder. + If you are running the app from your project folder where dependencies + are already installed, then you can skip this step. Tip: Notice the package.json generated, where there's a script defined: "start": "node index.js" - Running "$ yarn start" or "$ npm run start" from the output folder will + Running "$ ${ packager.name === 'npm' ? 'npm run' : packager.name } start" from the output folder will start the webserver. Alternatively you can call "$ node index.js" yourself.` } @@ -99,6 +102,7 @@ module.exports.displayBanner = function displayBanner ({ argv, ctx, cmd, details in "src-cordova", except for "www" folder which must be built by Quasar CLI.` } else if (argv.mode === 'capacitor') { + const packager = await ctx.cacheProxy.getModule('nodePackager') banner += ` Tip: "src-capacitor" is a Capacitor project folder, so everything you know @@ -106,9 +110,9 @@ module.exports.displayBanner = function displayBanner ({ argv, ctx, cmd, details for "src-capacitor/www" folder and then either opens the IDE or calls the platform's build commands to generate the final packaged file. - Tip: Feel free to use Capacitor CLI ("yarn capacitor " or - "npx capacitor ") or change any files in "src-capacitor", except - for the "www" folder which must be built by Quasar CLI.` + Tip: Feel free to use Capacitor CLI ("${ packager.name === 'npm' ? 'npx' : packager.name } capacitor ") or change + any files in "src-capacitor", except for the "www" folder which must + be built by Quasar CLI.` } else if ([ 'spa', 'pwa' ].includes(argv.mode)) { banner += ` diff --git a/app-webpack/package.json b/app-webpack/package.json index 626225cd807..679472b436e 100644 --- a/app-webpack/package.json +++ b/app-webpack/package.json @@ -119,10 +119,7 @@ "electron-builder": "^24.12.0", "electron-packager": "^17.1.1", "eslint": "^8.57.0", - "eslint-config-standard": "^17.0.0", - "eslint-plugin-import": "^2.27.5", - "eslint-plugin-n": "^16.0.0", - "eslint-plugin-promise": "^6.1.1", + "eslint-config-quasar": "workspace:*", "pinia": "^2.1.3", "quasar": "^2.14.5", "ts-essentials": "^9.1.2", @@ -171,13 +168,6 @@ "npm": ">= 6.14.12", "yarn": ">= 1.17.3" }, - "pnpm": { - "peerDependencyRules": { - "ignoreMissing": [ - "rollup" - ] - } - }, "volta": { "node": "lts" }, diff --git a/app-webpack/types/app-extension.d.ts b/app-webpack/types/app-extension.d.ts index 413da434815..c38bc122a46 100644 --- a/app-webpack/types/app-extension.d.ts +++ b/app-webpack/types/app-extension.d.ts @@ -44,7 +44,7 @@ interface BaseAPI { hasTypescript: () => Promise; hasLint: () => Promise; getStorePackageName: () => 'pinia' | 'vuex' | undefined; - getNodePackagerName: () => 'npm' | 'yarn' | 'pnpm'; + getNodePackagerName: () => Promise<'npm' | 'yarn' | 'pnpm' | 'bun'>; } interface SharedIndexInstallAPI { diff --git a/app-webpack/types/configuration/electron-conf.d.ts b/app-webpack/types/configuration/electron-conf.d.ts index 38f820431a8..1fcb2245921 100644 --- a/app-webpack/types/configuration/electron-conf.d.ts +++ b/app-webpack/types/configuration/electron-conf.d.ts @@ -52,7 +52,7 @@ interface QuasarBaseElectronConfiguration { bundler: QuasarElectronBundlersInternal; /** - * Specify additional parameters when yarn/npm installing + * Specify additional parameters when installing dependencies in * the UnPackaged folder, right before bundling with either * electron packager or electron builder; * Example: [ 'install', '--production', '--ignore-optional', '--some-other-param' ] diff --git a/cli/.editorconfig b/cli/.editorconfig deleted file mode 100644 index e717f5eb638..00000000000 --- a/cli/.editorconfig +++ /dev/null @@ -1,13 +0,0 @@ -# http://editorconfig.org -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/cli/.eslintrc.cjs b/cli/.eslintrc.cjs index 8863777fb15..6f4b6dc2b0f 100644 --- a/cli/.eslintrc.cjs +++ b/cli/.eslintrc.cjs @@ -1,3 +1,5 @@ +// eslint-disable-next-line n/no-extraneous-require +require('@rushstack/eslint-patch/modern-module-resolution') module.exports = { root: true, @@ -13,47 +15,12 @@ module.exports = { extends: [ 'eslint:recommended', - 'plugin:n/recommended', - 'standard' + 'quasar/base', + 'quasar/node' ], rules: { - 'brace-style': [ 2, 'stroustrup', { allowSingleLine: true } ], - 'prefer-const': 2, - 'prefer-promise-reject-errors': 'off', - 'multiline-ternary': 'off', - 'no-prototype-builtins': 'off', - 'no-case-declarations': 'off', - 'generator-star-spacing': 'off', - 'arrow-parens': 'off', - 'object-property-newline': 'off', - 'one-var': 'off', - 'no-void': 'off', - 'no-lone-blocks': 'error', - 'no-unused-expressions': [ 'error', { allowShortCircuit: true } ], - 'no-useless-concat': 'error', - 'no-useless-return': 'error', - 'no-unneeded-ternary': 'error', - 'no-confusing-arrow': [ 'error', { allowParens: true } ], - 'operator-linebreak': [ 'error', 'before' ], - - 'array-bracket-spacing': [ 'error', 'always' ], - 'object-curly-spacing': [ 'error', 'always' ], - 'computed-property-spacing': [ 'error', 'always' ], - 'template-curly-spacing': [ 'error', 'always' ], - - 'import/first': 0, - 'import/named': 2, - 'import/namespace': 2, - 'import/default': 2, - 'import/export': 2, - 'import/extensions': 0, - 'import/no-unresolved': 0, - 'import/no-extraneous-dependencies': 'off', - 'no-useless-escape': 'off', - 'no-unused-vars': [ 'error', { ignoreRestSiblings: true, argsIgnorePattern: '^_' } ], - - 'n/no-process-exit': 'off' + 'no-unused-vars': [ 'error', { ignoreRestSiblings: true, argsIgnorePattern: '^_' } ] } } diff --git a/cli/lib/cmd/create.js b/cli/lib/cmd/create.js index 36a35795836..1fd54184f6d 100755 --- a/cli/lib/cmd/create.js +++ b/cli/lib/cmd/create.js @@ -1,15 +1,23 @@ console.log(` · For scaffolding an official Quasar project please use this instead: + npm init quasar + (or) yarn create quasar (or) - npm init quasar + pnpm create quasar + (or) + bun create quasar · For scaffolding a custom starter kit please use this instead: + npm install -g @quasar/legacy-create + (or) yarn global add @quasar/legacy-create (or) - npm install -g @quasar/legacy-create + pnpm add -g @quasar/legacy-create + (or) + bun install -g @quasar/legacy-create ...and then: quasar-legacy-create [--branch ] diff --git a/cli/lib/cmd/help.js b/cli/lib/cmd/help.js index 132dd1e3907..32e1bcb9444 100755 --- a/cli/lib/cmd/help.js +++ b/cli/lib/cmd/help.js @@ -33,6 +33,6 @@ console.log(` -------------- => IMPORTANT ! - => ${ italic('Trigger this inside of a Quasar project (and npm/yarn install) for more commands.') } + => ${ italic('Trigger this inside of a Quasar project (and npm/yarn/pnpm/bun install) for more commands.') } -------------- `) diff --git a/cli/lib/cmd/info.js b/cli/lib/cmd/info.js index 3b40bed4e19..bd8410faa2e 100755 --- a/cli/lib/cmd/info.js +++ b/cli/lib/cmd/info.js @@ -44,6 +44,8 @@ const output = [ { key: 'Global packages', section: true }, { key: ' NPM', value: getSpawnOutput('npm') }, { key: ' yarn', value: getSpawnOutput('yarn') }, + { key: ' pnpm', value: getSpawnOutput('pnpm') }, + { key: ' bun', value: getSpawnOutput('bun') }, { key: ' @quasar/cli', value: green(cliPkg.version) }, { key: ' @quasar/icongenie', value: getSpawnOutput('icongenie') }, { key: ' cordova', value: getSpawnOutput('cordova') } diff --git a/cli/lib/cmd/upgrade.js b/cli/lib/cmd/upgrade.js index eccb7d5b8f5..5e1e7a646c1 100755 --- a/cli/lib/cmd/upgrade.js +++ b/cli/lib/cmd/upgrade.js @@ -61,7 +61,7 @@ if (appPaths.appDir === void 0) { } if (!fs.existsSync(appPaths.resolve.app('node_modules'))) { - fatal('Please run "yarn" / "npm install" / "pnpm install" first\n', 'Error') + fatal('Please run npm/yarn/pnpm/bun install first\n', 'Error') } import { appPkg } from '../app-pkg.js' diff --git a/cli/package.json b/cli/package.json index 4fcd3912f9f..95284e8fb60 100644 --- a/cli/package.json +++ b/cli/package.json @@ -63,11 +63,7 @@ "update-notifier": "^6.0.2" }, "devDependencies": { - "eslint": "^8.57.0", - "eslint-config-standard": "^17.0.0", - "eslint-plugin-import": "^2.29.1", - "eslint-plugin-n": "^16.6.2", - "eslint-plugin-promise": "^6.1.1" + "eslint-config-quasar": "workspace:*" }, "publishConfig": { "access": "public" diff --git a/create-quasar/.eslintrc.cjs b/create-quasar/.eslintrc.cjs index f008a9fc421..a93e356665c 100644 --- a/create-quasar/.eslintrc.cjs +++ b/create-quasar/.eslintrc.cjs @@ -1,4 +1,5 @@ module.exports = { + // TODO: improve rules, use the ones from the root config by removing `root: true` root: true, parserOptions: { diff --git a/create-quasar/README.md b/create-quasar/README.md index 339ec93e707..6878c88180f 100644 --- a/create-quasar/README.md +++ b/create-quasar/README.md @@ -13,12 +13,17 @@ This app is used to scaffold Quasar CLI project folders. ```bash +npm init quasar +# or: yarn create quasar # or: -npm init quasar +pnpm create quasar +# or: +bun create quasar ``` ## Supporting Quasar + Quasar Framework is an MIT-licensed open source project. Its ongoing development is made possible thanks to the support by these awesome [backers](https://github.com/rstoenescu/quasar-framework/blob/dev/backers.md). **Please read our manifest on [Why donations are important](https://quasar.dev/why-donate)**. If you'd like to become a donator, check out [Quasar Framework's Donator campaign](https://donate.quasar.dev). @@ -44,6 +49,7 @@ Ask questions at the official community forum: [https://forum.quasar.dev](https: I'm excited if you want to contribute to Quasar under any form (report bugs, write a plugin, fix an issue, write a new feature). Please read the [Contributing Guide](../CONTRIBUTING.md). ## Semver + Quasar is following [Semantic Versioning 2.0](https://semver.org/). ## License diff --git a/create-quasar/package.json b/create-quasar/package.json index 1273b815db7..7d51cacd9cb 100644 --- a/create-quasar/package.json +++ b/create-quasar/package.json @@ -42,7 +42,6 @@ "@types/prompts": "^2.4.7", "@typescript-eslint/eslint-plugin": "^7.1.0", "@typescript-eslint/parser": "^7.1.0", - "eslint": "^8.57.0", "eslint-plugin-lodash-template": "^1.0.0", "tsx": "^4.7.0", "typescript": "^5.2.2" diff --git a/create-quasar/scripts/create-test-project.ts b/create-quasar/scripts/create-test-project.ts index 9d8fc680a90..1a74c35469b 100644 --- a/create-quasar/scripts/create-test-project.ts +++ b/create-quasar/scripts/create-test-project.ts @@ -1,4 +1,4 @@ -import { override } from 'prompts'; +import prompts from 'prompts'; type ScriptType = 'js' | 'ts'; type AppEngine = 'vite' | 'webpack'; @@ -13,8 +13,12 @@ type CreateProjectOptions = { export async function createProject({ scriptType, appEngine, packageManager }: CreateProjectOptions) { // To bypass Corepack enforcing what's specified in the closest package.json file that has the 'packageManager' field process.env.COREPACK_ENABLE_STRICT = '0'; + // See https://github.com/yarnpkg/yarn/issues/9015 + process.env.SKIP_YARN_COREPACK_CHECK = '1'; + // To alter the behavior to run correctly within this script + process.env.CREATE_TEST_PROJECT_OVERRIDE = 'true'; - override({ + prompts.override({ projectType: 'app', projectFolder: 'test-project', overwrite: true, diff --git a/create-quasar/utils/index.js b/create-quasar/utils/index.js index 6fd6a57c9a7..5b62ec65d50 100644 --- a/create-quasar/utils/index.js +++ b/create-quasar/utils/index.js @@ -187,9 +187,16 @@ function runCommand (cmd, args, options) { } function installDeps (scope) { + const args = [ 'install' ] + // Related to scripts/create-test-project.ts + if (process.env.CREATE_TEST_PROJECT_OVERRIDE === 'true') { + // If we don't use this flag, then the test project will become part of the monorepo and fail to install properly + args.push('--ignore-workspace') + } + return runCommand( scope.packageManager, - [ 'install' ], + args, { cwd: scope.projectFolder } ) } diff --git a/docs/.editorconfig b/docs/.editorconfig deleted file mode 100644 index 9d08a1a828a..00000000000 --- a/docs/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*] -charset = utf-8 -indent_style = space -indent_size = 2 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true diff --git a/docs/.eslintrc.cjs b/docs/.eslintrc.cjs index 3dbaf27f053..d9a69a12b92 100644 --- a/docs/.eslintrc.cjs +++ b/docs/.eslintrc.cjs @@ -1,3 +1,5 @@ +require('@rushstack/eslint-patch/modern-module-resolution') + module.exports = { root: true, @@ -11,10 +13,8 @@ module.exports = { }, extends: [ - // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention - // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules. - 'plugin:vue/vue3-essential', - 'standard' + 'quasar/base', + 'quasar/vue' ], // required to lint *.vue files @@ -24,9 +24,6 @@ module.exports = { ], globals: { - ga: true, // Google Analytics - cordova: true, - __statics: true, __QUASAR_SSR__: true, __QUASAR_SSR_SERVER__: true, __QUASAR_SSR_CLIENT__: true, @@ -34,33 +31,14 @@ module.exports = { Prism: true }, - // add your custom rules here rules: { - 'brace-style': [ 2, 'stroustrup', { allowSingleLine: true } ], - 'prefer-const': 2, - 'prefer-promise-reject-errors': 'off', - 'multiline-ternary': 'off', + // TODO: Unify rules with the root config 'array-bracket-spacing': [ 'error', 'always', { singleValue: false } ], - 'computed-property-spacing': [ 'error', 'always' ], - 'no-prototype-builtins': 'off', - 'no-case-declarations': 'off', - 'generator-star-spacing': 'off', - 'arrow-parens': 'off', - 'one-var': 'off', - 'no-void': 'off', - 'no-console': 'error', - 'no-debugger': 'error', 'template-curly-spacing': 'off', - 'no-multiple-empty-lines': 'off', - - 'import/export': 'off', - 'import/first': 'off', - 'import/no-absolute-path': 'off', - 'import/no-duplicates': 'off', - 'import/no-named-default': 'off', - 'import/no-webpack-loader-syntax': 'off', - 'import/extensions': 'off', - 'import/no-extraneous-dependencies': 'off', + 'no-useless-concat': 'off', + 'operator-linebreak': 'off', + 'no-console': 'error', + 'no-confusing-arrow': 'off', 'quasar/check-valid-props': 'warn', diff --git a/docs/build/chunks.js b/docs/build/chunks.js index 984f370bde6..1de8acfb6e0 100644 --- a/docs/build/chunks.js +++ b/docs/build/chunks.js @@ -1,4 +1,3 @@ - const vendorRE = /node_modules[\\/](vue|@vue|quasar|vue-router)[\\/](.*)\.(m?js|css|sass)$/ const exampleRE = /examples:([a-zA-Z0-9]+)$|src[\\/]examples[\\/]([a-zA-Z0-9-]+)/ diff --git a/docs/build/fix-ssr-manifest.js b/docs/build/fix-ssr-manifest.js index be05ce3327f..67d512af21c 100644 --- a/docs/build/fix-ssr-manifest.js +++ b/docs/build/fix-ssr-manifest.js @@ -1,4 +1,3 @@ - /** * Vite 3+ injects vendor.css into the manifest, which doubles up the html link tag for it. * This differs significantly from Vite 2, which didn't do this when manually generating a vendor chunk diff --git a/docs/build/md/index.js b/docs/build/md/index.js index 245db267b30..39f067c967a 100644 --- a/docs/build/md/index.js +++ b/docs/build/md/index.js @@ -1,4 +1,3 @@ - import mdParse from './md-parse.js' const mdRE = /.md$/ diff --git a/docs/build/release-notes/index.js b/docs/build/release-notes/index.js index 107ce1fc132..336766807cc 100644 --- a/docs/build/release-notes/index.js +++ b/docs/build/release-notes/index.js @@ -1,4 +1,3 @@ - import { join } from 'node:path' import { fileURLToPath } from 'node:url' import fse from 'fs-extra' diff --git a/docs/package.json b/docs/package.json index 416f18c9438..6f1a591bff6 100644 --- a/docs/package.json +++ b/docs/package.json @@ -8,11 +8,11 @@ "type": "module", "scripts": { "prepare-docs": "node build/copy-quasar-api.js", - "dev": "yarn prepare-docs && quasar dev", - "dev:ssr": "yarn prepare-docs && quasar dev -m ssr", - "build": "yarn prepare-docs && node build/search.js && quasar build -m ssr && node build/fix-ssr-manifest.js && mkdir -p dist/quasar.dev/client/examples/ && cp -R src/examples/* dist/quasar.dev/client/examples/ && node build/ssg.js", + "dev": "pnpm prepare-docs && quasar dev", + "dev:ssr": "pnpm prepare-docs && quasar dev -m ssr", + "build": "pnpm prepare-docs && node build/search.js && quasar build -m ssr && node build/fix-ssr-manifest.js && mkdir -p dist/quasar.dev/client/examples/ && cp -R src/examples/* dist/quasar.dev/client/examples/ && node build/ssg.js", "relnotes": "node build/release-notes/index.js", - "lint": "eslint --ext .js,.vue ./ --fix", + "lint": "eslint --ext .js,.vue ./ --report-unused-disable-directives --fix", "test": "echo \"No test specified\" && exit 0" }, "dependencies": { diff --git a/docs/src/assets/links.components.js b/docs/src/assets/links.components.js index 1313996ecaf..495e81f96ae 100644 --- a/docs/src/assets/links.components.js +++ b/docs/src/assets/links.components.js @@ -1,4 +1,3 @@ - const components = [ { name: 'Ajax-bar', short: 'ajaxbar', description: 'A loading bar for ajax calls in progress', tag: 'loading' }, { name: 'Avatar', description: 'A space for your portrait, icon or text', tag: 'media' }, diff --git a/docs/src/components/DocExample.vue b/docs/src/components/DocExample.vue index 320055710a8..20edacee9f1 100644 --- a/docs/src/components/DocExample.vue +++ b/docs/src/components/DocExample.vue @@ -55,9 +55,8 @@