Skip to content

Commit dd4061b

Browse files
authored
rename dev script, update contributor guide and readme (#9673)
* rename dev script, update contributor guide and readme * turns out we can do this! * increase accuracy * justify FILTER --------- Co-authored-by: Rich Harris <[email protected]>
1 parent f9ba528 commit dd4061b

File tree

3 files changed

+25
-54
lines changed

3 files changed

+25
-54
lines changed

CONTRIBUTING.md

+23-12
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The maintainers meet on the final Saturday of each month. While these meetings a
4343

4444
### Prioritization
4545

46-
We do our best to review PRs and RFCs as they are sent, but it is difficult to keep up. We welcome help in reviewing PRs, RFC, and issues. If an item aligns with the current priority on our [roadmap](https://svelte.dev/roadmap), it is more likely to be reviewed quickly. PRs to the most important and active ones repositories get reviewed more quickly while PRs to smaller inactive repos may sit for a bit before we periodically come by and review the pending PRs in a batch.
46+
We do our best to review PRs and RFCs as they are sent, but it is difficult to keep up. We welcome help in reviewing PRs, RFCs, and issues. If an item aligns with the current priority on our [roadmap](https://svelte.dev/roadmap), it is more likely to be reviewed quickly. PRs to the most important and active ones repositories get reviewed more quickly while PRs to smaller inactive repos may sit for a bit before we periodically come by and review the pending PRs in a batch.
4747

4848
## Bugs
4949

@@ -74,10 +74,11 @@ Small pull requests are much easier to review and more likely to get merged.
7474

7575
### Installation
7676

77-
1. Ensure you have [pnpm](https://pnpm.io/installation) installed
78-
1. After cloning the repository, run `pnpm install`. You can do this in the root directory or in the `svelte` project
79-
1. Move into the `svelte` directory with `cd packages/svelte`
80-
1. To compile in watch mode, run `pnpm dev`
77+
Ensure you have [pnpm](https://pnpm.io/installation) installed. After cloning the repository, run `pnpm install`.
78+
79+
### Developing
80+
81+
To build the UMD version of `svelte/compiler` (this is only necessary for CommonJS consumers, or in-browser use), run `pnpm build` inside `packages/svelte`. To rebuild whenever source files change, run `pnpm dev`.
8182

8283
### Creating a branch
8384

@@ -100,18 +101,28 @@ Test samples are kept in `/test/xxx/samples` folder.
100101
> PREREQUISITE: Install chromium via playwright by running `pnpm playwright install chromium`
101102
102103
1. To run test, run `pnpm test`.
103-
1. To run test for a specific feature, you can use the `-g` (aka `--grep`) option. For example, to only run test involving transitions, run `pnpm test -- -g transition`.
104+
1. To run a particular test suite, use `pnpm test <suite-name>`, for example:
105+
106+
```bash
107+
pnpm test validator
108+
```
104109

105-
##### Running solo test
110+
1. To filter tests _within_ a test suite, use `pnpm test <suite-name> -- -t <test-name>`, for example:
106111

107-
1. To run only one test, rename the test sample folder to end with `.solo`. For example, to run the `test/js/samples/action` only, rename it to `test/js/samples/action.solo`.
108-
1. To run only one test suite, rename the test suite folder to end with `.solo`. For example, to run the `test/js` test suite only, rename it to `test/js.solo`.
109-
1. Remember to rename the test folder back. The CI will fail if there's a solo test.
112+
```bash
113+
pnpm test validator -- -t a11y-alt-text
114+
```
115+
116+
(You can also do `FILTER=<test-name> pnpm test <suite-name>` which removes other tests rather than simply skipping them — this will result in faster and more compact test results, but it's non-idiomatic. Choose your fighter.)
110117

111118
##### Updating `.expected` files
112119

113-
1. Tests suites like `css`, `js`, `server-side-rendering` asserts that the generated output has to match the content in the `.expected` file. For example, in the `js` test suites, the generated js code is compared against the content in `expected.js`.
114-
1. To update the content of the `.expected` file, run the test with `--update` flag. (`pnpm test --update`)
120+
1. Tests suites like `snapshot` and `parser` assert that the generated output matches the existing snapshot.
121+
1. To update these snapshots, run `UPDATE_SNAPSHOTS=true pnpm test`.
122+
123+
### Typechecking
124+
125+
To typecheck the codebase, run `pnpm check` inside `packages/svelte`. To typecheck in watch mode, run `pnpm check:watch`.
115126

116127
### Style guide
117128

README.md

+1-41
Original file line numberDiff line numberDiff line change
@@ -22,47 +22,7 @@ You may view [our roadmap](https://svelte.dev/roadmap) if you'd like to see what
2222

2323
## Contributing
2424

25-
Please see the [Contributing Guide](CONTRIBUTING.md) and [svelte package](packages/svelte) for contributing to Svelte.
26-
27-
### Development
28-
29-
Pull requests are encouraged and always welcome. [Pick an issue](https://github.com/sveltejs/svelte/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) and help us out!
30-
31-
To install and work on Svelte locally:
32-
33-
```bash
34-
git clone https://github.com/sveltejs/svelte.git
35-
cd svelte
36-
pnpm install
37-
```
38-
39-
> Do not use Yarn to install the dependencies, as the specific package versions in `pnpm-lock.json` are used to build and test Svelte.
40-
41-
To build the compiler and all the other modules included in the package:
42-
43-
```bash
44-
pnpm build
45-
```
46-
47-
To watch for changes and continually rebuild the package (this is useful if you're using [`pnpm link`](https://pnpm.io/cli/link) to test out changes in a project locally):
48-
49-
```bash
50-
pnpm dev
51-
```
52-
53-
The compiler is written in JavaScript and uses [JSDoc](https://jsdoc.app/index.html) comments for type-checking.
54-
55-
### Running Tests
56-
57-
```bash
58-
pnpm test
59-
```
60-
61-
To filter tests, use `-g` (aka `--grep`). For example, to only run tests involving transitions:
62-
63-
```bash
64-
pnpm test -- -g transition
65-
```
25+
Please see the [Contributing Guide](CONTRIBUTING.md) and the [`svelte`](packages/svelte) package for information on contributing to Svelte.
6626

6727
### svelte.dev
6828

packages/svelte/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
],
9292
"scripts": {
9393
"build": "rollup -c && node scripts/build.js && node scripts/check-treeshakeability.js",
94-
"watch": "rollup -cw",
94+
"dev": "rollup -cw",
9595
"check": "tsc && cd ./tests/types && tsc",
9696
"check:watch": "tsc --watch",
9797
"generate:version": "node ./scripts/generate-version.js",

0 commit comments

Comments
 (0)