Skip to content

Commit

Permalink
Merge pull request #1114 from pikapkg/melissamcewen/contrib-docs
Browse files Browse the repository at this point in the history
Improving the contributing docs
  • Loading branch information
Melissa McEwen authored Sep 25, 2020
2 parents 3e9de92 + 82b6487 commit e0a2ecb
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,40 @@ yarn build
yarn build:watch
```

## Run tests
## Updating and adding packages

Since this is a monorepo with several packages, if you want to update/add packages in the subrepos like `create-snowpack-app/app-template-11ty` you'll want to run the commands in the target subdirectory like

```bash
cd create-snowpack-app/app-template-vue
yarn add vue@latest
```

## Tests

We recommend running all tests before you submit a PR.

### Running tests

From the repository's root folder, run

```bash
yarn build
yarn test
```

### Snapshot tests

The way our snapshot tests work is they test Snowpack by building the codebases in `test/build`. You'll almost always have a "failed" snapshot test when you make a contribution because your new change will make the final build different. You'll want to take a new snapshot. To do this run:

```bash
yarn test -u
```

You'll notice this changes the snapshot file. Commit this change and submit it along with your PR.

### Filtering tests

You can filter the tests that are being run using Jest's [`--testNamePattern`](https://jestjs.io/docs/en/cli#--testnamepatternregex) (alias: `-t`) CLI option. You can ignore the `123 snapshots obsolete` messages.

```bash
Expand All @@ -65,6 +92,20 @@ cd path/to/some-other-project
snowpack dev --verbose --reload
```

To test a local version of the CLI tool use

```bash
node /path/to/snowpack/create-snowpack-app/cli [my-new-dir] --template @snowpack/app-template-vue
```

To test a local version of the `create-snowpack-app` templates use

```bash
npx create-snowpack-app [my-new-dir] --template ./path/to/template
```

Note the path must start with must start with a `.` to be considered local

The `--verbose` flag enables additional logs which will help to identify the source of a problem. The `--reload` will clear the local cache which might have been created by a different `snowpack` version. Learn more about [Snowpack's CLI flags](https://www.snowpack.dev/#cli-flags).

## Discussion
Expand Down

1 comment on commit e0a2ecb

@vercel
Copy link

@vercel vercel bot commented on e0a2ecb Sep 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.