Skip to content

Commit

Permalink
[docs] add a basic guide to the codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Aug 30, 2021
1 parent c086b18 commit bf3efd1
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ Please see [the documentation](https://kit.svelte.dev/docs) for information abou

The SvelteKit community also makes additional [SvelteKit adapters available for use](https://sveltesociety.dev/components#category-SvelteKit%20Adapters).

## Bug reporting

Please make sure the issue you're reporting involves SvelteKit. Many issues related to how a project builds originate from [Vite](https://vitejs.dev/), which SvelteKit uses to build a project. It's important to note that new Vite projects don't use SSR by default and so if you create a new Vite project from scratch many issues won't reproduce eventhough they're caused by Vite. You should thus start with a project that utilizes SSR such as:

- https://github.com/GrygrFlzr/vite-ssr-d3
- https://github.com/sveltejs/vite-plugin-svelte/tree/main/packages/e2e-tests/vite-ssr

If an issue is caused by Vite, please report in the [Vite issue tracker](https://github.com/vitejs/vite/issues).

## Developing

This monorepo uses [pnpm](https://pnpm.js.org/en/). Install it...
Expand Down Expand Up @@ -94,11 +103,13 @@ New packages will need to be published manually the first time if they are scope
npm publish --access=public
```

## Bug reporting
## Code structure

Please make sure the issue you're reporting involves SvelteKit. Many issues related to how a project builds originate from [Vite](https://vitejs.dev/), which SvelteKit uses to build a project. It's important to note that new Vite projects don't use SSR by default and so if you create a new Vite project from scratch many issues won't reproduce eventhough they're caused by Vite. You should thus start with a project that utilizes SSR such as:
Entry points to be aware of are:
- [`packages/create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte) - code that's run when you create a new project with `npm init svelte@next`
- [`packages/kit/src/packaging`](https://github.com/sveltejs/kit/tree/master/packages/kit/src/packaging) - for the `svelte-kit package` command
- [`packages/kit/src/core/dev/index.js`](https://github.com/sveltejs/kit/blob/master/packages/kit/src/core/dev/index.js) - for the dev-mode server
- [`packages/kit/src/core/build/index.js`](https://github.com/sveltejs/kit/blob/master/packages/kit/src/core/build/index.js) - for the production server
- [`packages/adapter-[platform]`](https://github.com/sveltejs/kit/tree/master/packages) - for the various SvelteKit-provided adapters

- https://github.com/GrygrFlzr/vite-ssr-d3
- https://github.com/sveltejs/vite-plugin-svelte/tree/main/packages/e2e-tests/vite-ssr

If an issue is caused by Vite, please report in the [Vite issue tracker](https://github.com/vitejs/vite/issues).
Most code that's called at build-time or from the CLI entry point lives in [packages/kit/src/core](https://github.com/sveltejs/kit/tree/master/packages/kit/src/core). Code that runs for rendering and routing lives in [packages/kit/src/runtime](https://github.com/sveltejs/kit/tree/master/packages/kit/src/runtime). Most changes to SvelteKit itself would involve code in these two directories.

0 comments on commit bf3efd1

Please sign in to comment.