|
| 1 | +# Quasar Contributing Guide |
| 2 | + |
| 3 | +Hi! I’m 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. |
| 4 | + |
| 5 | +- [Code of Conduct](https://github.com/quasarframework/quasar/blob/dev/.github/CODE_OF_CONDUCT.md) |
| 6 | +- [Issue Reporting Guidelines](#issue-reporting-guidelines) |
| 7 | +- [Pull Request Guidelines](#pull-request-guidelines) |
| 8 | +- [Development Setup](#development-setup) |
| 9 | +- [Project Structure](#project-structure) |
| 10 | + |
| 11 | +## Issue Reporting Guidelines |
| 12 | + |
| 13 | +- The issue list of this repo is **exclusively** for bug reports and feature requests. Non-conforming issues will be closed immediately. |
| 14 | + |
| 15 | + - For simple beginner questions, you can get quick answers from [The Gitter chat room](https://gitter.im/quasarframework/Lobby). |
| 16 | + |
| 17 | + - For more complicated questions, you can use [the official forum](http://forum.quasar-framework.org/). Make sure to provide enough information when asking your questions - this makes it easier for others to help you! |
| 18 | + |
| 19 | +- Try to search for your issue, it may have already been answered or even fixed in the development branch (`dev`). |
| 20 | + |
| 21 | +- 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. |
| 22 | + |
| 23 | +- 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. |
| 24 | + |
| 25 | +- 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. |
| 26 | + |
| 27 | +- Issues with no clear repro steps will not be triaged. If an issue labeled "need repro" receives no further input from the issue author for more than 5 days, it will be closed. |
| 28 | + |
| 29 | +- 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. |
| 30 | + |
| 31 | +- 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. |
| 32 | + |
| 33 | +## Pull Request Guidelines |
| 34 | + |
| 35 | +- 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.** |
| 36 | + |
| 37 | +- Checkout a topic branch from the relevant branch, e.g. `dev`, and merge back against that branch. |
| 38 | + |
| 39 | +- Work in the `src` folder and **DO NOT** checkin `dist` in the commits. |
| 40 | + |
| 41 | +- It's OK to have multiple small commits as you work on the PR - we will let GitHub automatically squash it before merging. |
| 42 | + |
| 43 | +- If adding new feature: |
| 44 | + - Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it greenlighted before working on it. |
| 45 | + |
| 46 | +- If fixing a bug: |
| 47 | + - 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)`. |
| 48 | + - Provide detailed description of the bug in the PR. Live demo preferred. |
| 49 | + |
| 50 | +## Development Setup |
| 51 | + |
| 52 | +You will need [Node.js](http://nodejs.org) **version 4+** along [NPM](https://docs.npmjs.com/getting-started/installing-node). Read `package.json` and take notice of the scripts you can use. |
| 53 | + |
| 54 | +After cloning the repo, run: |
| 55 | + |
| 56 | +``` bash |
| 57 | +$ npm install |
| 58 | +``` |
| 59 | + |
| 60 | +### Commonly used NPM scripts |
| 61 | + |
| 62 | +``` bash |
| 63 | +# 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. |
| 64 | +# There's a section for each feature where tests are made. |
| 65 | +$ npm run dev [theme] |
| 66 | + |
| 67 | +# build all dist files, including npm packages |
| 68 | +$ npm run build |
| 69 | +# build minimum dist files required |
| 70 | +$ npm run build simple |
| 71 | +# build only minimum js dist files |
| 72 | +$ npm run build js simple |
| 73 | +# build only minimum stylus dist files |
| 74 | +$ npm run build css simple |
| 75 | + |
| 76 | +# lint sources |
| 77 | +$ npm run lint |
| 78 | +``` |
| 79 | + |
| 80 | +## Project Structure |
| 81 | + |
| 82 | +- **`build`**: contains build-related configuration files. In most cases you don't need to touch them. |
| 83 | + |
| 84 | +- **`src`**: contains the source code, obviously. The codebase is written in ES2015. |
| 85 | + |
| 86 | + - **`components`**: contains global features (Dialog, Toast, ...) |
| 87 | + |
| 88 | + - **`css-components`**: Stylus code that accompanies HTML markup for non-components |
| 89 | + |
| 90 | + - **`features`**: code for global features outside of the components |
| 91 | + |
| 92 | + - **`themes`**: Stylus definitions and code for Quasar themes |
| 93 | + |
| 94 | + - **`utils`**: utilities used by the framework and exported to the public API |
| 95 | + |
| 96 | + - **`vue-components`**: JS and Stylus files (one for each theme) for Quasar components |
| 97 | + |
| 98 | + - **`vue-directives`**: Vue directives supplied by Quasar |
| 99 | + |
| 100 | + - **`vue-transitions`**: JS transitions through `q-transition` component |
| 101 | + |
| 102 | + - **`index.js`/`index.es6.js`**: starting point for Quasar |
| 103 | + |
| 104 | + - **`vue-install.js`**: where all components get injected into Vue |
| 105 | + |
| 106 | +- **`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. |
| 107 | + - **`quasar.common.js`**: Common JS formatted Quasar JS distributable. **This is set as the `main` field in `package.json` so it is the default export when you import Vue as an NPM package.** |
| 108 | + |
| 109 | + - **`quasar.es6.js`**: ES6 formatted Quasar JS distributable. |
| 110 | + |
| 111 | + - **`quasar.standalone.js`**: Standalone version of Quasar (_not yet ready_) |
| 112 | + |
| 113 | + - **`quasar.*.css`**: Compiled CSS from Stylus Quasar source code. It's imported into apps when NOT using a custom theme build. |
| 114 | + |
| 115 | + - **`quasar.*.styl`**: One big file containing Quasar's Stylus code to be imported in apps when using custom theme builds. |
| 116 | + |
| 117 | +- **`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). |
| 118 | + |
| 119 | +## Dev Server for Quasar |
| 120 | +Running `npm run dev [theme]` 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. |
0 commit comments