Skip to content

Commit

Permalink
fix: devcontainer (QwikDev#2198)
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat authored Nov 20, 2022
1 parent 49d841b commit e616fe1
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ RUN rustup --version; \
rustup target add wasm32-unknown-unknown; \
cargo install cargo-insta; \
rustup component add clippy; \
corepack enable
corepack enable --install-directory ~/bin
11 changes: 5 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,20 @@
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"esbenp.prettier-vscode",
"rust-lang.rust",
"rust-lang.rust-analyzer",
"hdevalke.rust-test-lens",
"bradlc.vscode-tailwindcss",
"ms-playwright.playwright",
"manucorporat.vermoji",
"ms-azuretools.vscode-docker",
"mitsuhiko.insta",
"silvenon.mdx",
"csstools.postcss"
],
"features": {
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/rust:1": {}
"build": {
"dockerfile": "Dockerfile"
},
"waitFor": "onCreateCommand",
"updateContentCommand": "pnpm install",
"updateContentCommand": "corepack prepare & pnpm install",
"forwardPorts": [3300, 9229],
"customizations": {
"codespaces": {
Expand Down
102 changes: 53 additions & 49 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,37 @@ To build Qwik for local development, first install the dev dependencies using [p
pnpm install
```

Next the `start` command will:
### Fast build

- Build the source files
- Begin the watch process so any changes will rebuild
- Run the type checking watch process with [tsc](https://www.typescriptlang.org/docs/handbook/compiler-options.html)
- Run the unit test watch process
It will build all JS and all packages, but Rust.

```shell
pnpm start
pnpm build
```

Finally, you can use pnpm workspace command to run packages' commands, for example:
### Full build

```shell
pnpm workspace qwik-docs dev.ssr
pnpm workspace @builder.io/qwik-city dev.ssr
```
It will build absolutely everything, including Rust packages and WASM.
First build might be very slow.

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

## Starter CLI `create-qwik`
- Builds each submodule
- Generates bundled `.d.ts` files for each submodule with [API Extractor](https://api-extractor.com/)
- Checks the public API hasn't changed
- Builds a minified `core.min.mjs` file
- Generates the publishing `package.json`

- [Starter CLI](https://github.com/BuilderIO/qwik/blob/main/starters/README.md)
```shell
pnpm build.full
```

## Running All Tests
The build output will be written to `packages/qwik/dist`, which will be the directory that is published to [@builder.io/qwik](https://www.npmjs.com/package/@builder.io/qwik).

To run all Unit tests ([uvu](https://github.com/lukeed/uvu)) and E2E tests ([Playwright](https://playwright.dev/)), run:
### Open E2E locally for debugging

```shell
pnpm test
pnpm serve
```

The `test` command will also ensure a build was completed.

### Unit Tests Only

Unit tests use [uvu](https://github.com/lukeed/uvu)
Expand All @@ -78,34 +75,41 @@ E2E tests use [Playwright](https://playwright.dev/).
To run the Playwright tests headless, from start to finish, run:

```shell
pnpm test.e2e
pnpm test.e2e.chromium
```

## Pull Request

- [Open Qwik in Stackblitz Codeflow](https://pr.new/github.com/BuilderIO/qwik/)
- Review PR in Stackblitz
![image](https://user-images.githubusercontent.com/4918140/195581745-8dfca1f9-2dcd-4f6a-b7aa-705f3627f8fa.png)
### Bonus: pnpm start

## Production Build
Next the `start` command will:

The `pnpm start` command will run development builds, type check, watch unit tests, and watch the files for changes.
- Build the source files
- Begin the watch process so any changes will rebuild
- Run the type checking watch process with [tsc](https://www.typescriptlang.org/docs/handbook/compiler-options.html)
- Run the unit test watch process

A full production build will:
```shell
pnpm start
```

- Builds each submodule
- Generates bundled `.d.ts` files for each submodule with [API Extractor](https://api-extractor.com/)
- Checks the public API hasn't changed
- Builds a minified `core.min.mjs` file
- Generates the publishing `package.json`
Finally, you can use pnpm workspace command to run packages' commands, for example:

```shell
pnpm build
pnpm workspace qwik-docs start
```

The build output will be written to `packages/qwik/dist`, which will be the directory that is published to [@builder.io/qwik](https://www.npmjs.com/package/@builder.io/qwik).
More commands can be found in each package's package.json scripts section.

## Committing using "Commitizen":
## Starter CLI `create-qwik`

- [Starter CLI](https://github.com/BuilderIO/qwik/blob/main/starters/README.md)

## Pull Request

- [Open Qwik in Stackblitz Codeflow](https://pr.new/github.com/BuilderIO/qwik/)
- Review PR in Stackblitz
![image](https://user-images.githubusercontent.com/4918140/195581745-8dfca1f9-2dcd-4f6a-b7aa-705f3627f8fa.png)

### Committing using "Commitizen":

Instead of using `git commit` please use the following command:

Expand All @@ -115,18 +119,7 @@ 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.

## Releasing

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](https://github.com/BuilderIO/qwik/actions/workflows/ci.yml) 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. 🚀

## Pre-submit hooks
### Pre-submit hooks

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

Expand All @@ -139,3 +132,14 @@ Some issues can be fixed automatically by using:
```shell
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](https://github.com/BuilderIO/qwik/actions/workflows/ci.yml) 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. 🚀

0 comments on commit e616fe1

Please sign in to comment.