Skip to content

Latest commit

 

History

History
145 lines (94 loc) · 4.85 KB

CONTRIBUTING.md

File metadata and controls

145 lines (94 loc) · 4.85 KB

CONTRIBUTING

If you are using VSCode, you can install the Remote Containers extension. Once installed you will be prompted to reopen the folder in a container. All required dependencies will be installed in the container for you. If you're not prompted, you can run the Remote-Containers: Open Folder in Container command from the VSCode Command Palette.

If you're not able to use the dev container, follow these instructions:

Prerequisite

To build platform binding and wasm, make sure you have installed Rust. Also follow directions for your platform to install wasm-pack.

On Windows, Rust requires C++ build tools. You can also select Desktop development with C++ while installing Visual Studio.

Alternatively, if Rust is not available you can run pnpm build.platform.copy to download bindings from CDN

To build Qwik for local development, first install the dev dependencies using pnpm:

Development

pnpm install

Fast build

It will build all JS and all packages, but Rust.

pnpm build

Full build

It will build absolutely everything, including Rust packages and WASM. First build might be very slow.

  • Builds each submodule
  • Generates bundled .d.ts files for each submodule with API Extractor
  • Checks the public API hasn't changed
  • Builds a minified core.min.mjs file
  • Generates the publishing package.json
pnpm build.full

The build output will be written to packages/qwik/dist, which will be the directory that is published to @builder.io/qwik.

Open E2E locally for debugging

pnpm serve

Unit Tests Only

Unit tests use uvu

pnpm test.unit

To keep uvu open with the watch mode, run:

pnpm test.watch

Note that the test.watch command isn't necessary if you're running the pnpm start command, since start will also concurrently run the uvu watch process.

E2E Tests Only

E2E tests use Playwright.

To run the Playwright tests headless, from start to finish, run:

pnpm test.e2e.chromium

Bonus: pnpm start

Next the start command will:

  • Build the source files
  • Begin the watch process so any changes will rebuild
  • Run the type checking watch process with tsc
  • Run the unit test watch process
pnpm start

Finally, you can use pnpm --filter command to run packages' commands, for example:

pnpm --filter qwik-docs start

More commands can be found in each package's package.json scripts section.

Starter CLI create-qwik

Pull Request

Committing using "Commitizen":

Instead of using git commit please use the following command:

pnpm commit

You'll be asked guiding questions which will eventually create a descriptive commit message and necessary to generate meaningful release notes / CHANGELOG automatically.

Pre-submit hooks

The project has pre-submit hooks, which ensure that your code is correctly formatted. You can run them manually like so:

pnpm lint

Some issues can be fixed automatically by using:

pnpm fmt

Releasing (core-team only)

  1. Run pnpm release.prepare, which will test, lint and build.
  2. Use the interactive UI to select the next version, which will update the package.json version property, add the git change, and start a commit message.
  3. Create a PR with the package.json change to merge to main.
  4. After the package.json with the updated version is in main, click the Run Workflow button from the "Qwik CI" GitHub Action workflow.
  5. Select the NPM dist-tag that should be used for this version, then click "Run Workflow".
  6. The GitHub Action will dispatch the workflow to build @builder.io/qwik and each of the submodules, build WASM and native bindings, combine them into one package, and validate the package before publishing to NPM.
  7. If the build is successful and all tests and validation passes, the workflow will automatically publish to NPM, commit a git tag to the repo, and create a GitHub release.
  8. 🚀