.svelte-kit
, node_modules
(auto-generated)./src
, /static
directories.inform
.README.md
to get started.REFERENCE.md
is just to get an idea of multiple configs, hidden files, etc (OPTIONAL).origin/main
branch.Visual Studio Code installed
General Related VScode extensions installed
Node.js and npm installed
node -v
npm -v
Install dependencies (node_modules
folder) and start developing:
npm install
npm run dev
# or open in browser: npm run dev -- --open
src/lib
)You will likely be assigned a specific component or page to work on. Each component/page will have at least 3 files associated with it:
<component/page>.svelte
- This is the file containing the actual content of the component/page. <component/page>.svelte.test.ts
- This is the file containing the tests for your component. You shouldn't need to edit this file other than removing the .skip
(more details in the next section). <component/page>.stories.svelte
- This is the file containing the storybook preview of the component/page. You shouldn't need to edit this file.First, go into the <component/page>.svelte.test.ts
file associated with your component. Near the top, you'll see something like:
describe.skip('<component/page>.svelte', () => {
...
});
Remove the .skip
to enable testing for your component.
Then, run:
npm run test:unit
This will run the suite of tests for the website as a whole and your component. These tests will fail at first. Read them to see what the requirements are for your component, then implement all required features. Keep running npm run test:unit
until all tests pass.
Run:
npm run storybook
to open an interactive preview for the website's UI. Find your component within the tree and ensure everything looks and functions as expected.
scripts
)Prettier - Code formatting
npm run format
Storybook - Component docs (IMPORTANT
)
npm run storybook
ESLint - Code linting
npm run lint
Vitest - Unit testing
npm run test:unit
Playwright - E2E testing (end to end)
npm run test:e2e
Command | Description |
---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run preview |
Preview production build |
npm run check |
Type check |
npm run format |
Format code |
npm run lint |
Check formatting and linting |
npm run test:unit |
Run unit tests |
npm run test:e2e |
Run e2e tests |
npm run storybook |
Start Storybook |
npm run build
npm run preview
Deploy with an appropriate adapter for your environment.