Skip to content

Commit ae746f2

Browse files
BeeMargaridaKamell PerrykamellperryJasonXu314mrbrianevans
authored
[update]: next minor (#250)
* [docs]: added missing installation check boxes and fixed typo * [core]: fixed typos * [core]: Yarn and Storybook migration (#160) * [migration]: all packages on kit-next.377 and use storybook template * [@svelteui/core]: configuring story book (viewport modifications and set up) * [@svelteui/core]: moved lib contents to src * [@svelteui/core]: fixed stories for button * [core]: fixed all eslintrcs * [core]: started theme setup for core package * [core]: storybook working with dark and light theme * [core]: revert some changes and remove logs * [core]: remove unused logic * [core] yarn migration (#157) * [core]: migrate to yarn * [docs]: update contribution guide to include yarn * [core]: modify github pipelines to use yarn * [core]: format and lint code * [core]: update yarn.lock (#161) Co-authored-by: BeeMargarida <[email protected]> * [@svelteui/core]: support number as size in Button (#165) * [@svelteui/core]: fix missing prop type in NumberInput * [@svelteui/core]: use new prop approach in all components * [@svelteui/core]: remove onMouseEnter and onMouseLeave prop and use dispatch events instead * [@svelteui/core]: simplify prop approach in Button * [@svelteui/core]: format code - yarn format result * [@svelteui/core]: revert yarn format * [@svelteui/core]: remove BrowserRender, ServerRender and Fragment component (#167) * [core]: normalize scripts with : and udpdate readmes (#169) * [core]: sorted package jsons * [core]: updated docs and core dev scripts * [@svelteui/core]: Export all components prop types (#173) * [@svelteui/core]: export all component types instead of the whole styles * [core]: yarn lock * [core]: linting + format all package.json * [@svelteui/core]: fix select autocomplete logic that showed previous option on reload (#177) * [@svelteui/core]: fix Tabs bug where events inside tab content were not propagated due to node handling (#180) * [@svelteui/prism]: fix indentation problem on the first line (#181) * [@svelteui/prism]: fix indentation problem on the first line * [core]: remove package.json from prettier * [docs]: fix docs dev command, add docs node_modules to clean:all command and update tsconfig of core * [@svelteui/demos]: remove unecessary code from demos code examples (#182) * [@svelteui/core]: updated tsconfig * [@svelteuidev/core] Menu custom control (#184) * [@svelteui/core]: support for custom control in Menu * [@svelteui/core]: expose menu functions for opening/closing/toggling the menu state outside the component * [@svelteui/demos]: demo for Menu custom control * [docs]: add custom menu control examples to docs * [docs]: add missing period * [core]: remove flacky test * [@svelteui/core]: add role and aria info to custom menu control * [@svelteui/core]: added menu story * [core]: syncpack was failing script * [docs]: added modal clarification and removed banner * [core]: changed publish scripts due to unknown npm bug * [@svelteui/core]: menu story * [core]: fixed peerdeps versioning issues * [release]: 0.7.2 * [core]: fixed dev:core script * [@svelteui/composables]: migrated directory structure from the use of lib * [@svelteui/composables]: removed storybook config * [core]: fixed package json * [core]: changed yarn install to yarn in workflow * [core]: Storybook for core, composables and dates packages (#190) * [core]: removed unused stories from packages * [core]: moved storybook configuration to configuration folder and updated paths * [core]: working storybook that shows core stories * [core]: simple use-click-outside story for testing purposes * [core]: delete old storybook folders * [core]: stabilize storybook config * [@svelteui/composables]: change to * [@svelteui/dates]: change to * [core]: stories for dates, core and composables and simple example stories * [core]: format and lint fixes * [@svelteui/prism]: ignore line for prettier in prism * [@svelteui/composables]: small fix in alias * [@svelteui/composables]: small fixes to alias * [core]: bump vitest, cleanup dependencies, remove unecessary test setup and fix tests * [core]: update scripts + contributing scripts * [@svelteui/core]: Fixes #189 - fix Switch disabled style and add dark styles (#192) * [@svelteui/core]: fix switch disabled style and add dark mode style * [@svelteui/core]: fix switch disabled style and add dark mode style * [core]: migrate to new svelte-package approach since svelte-kit package is deprecated (#194) * [docs]: improve Modal target warning and demo (#197) * [@svelteui/core]: fix type inconsistency in actions API (#198) * [core]: move all packages outside lib folder (#196) * [@svelteui/preprocessors]: moved code from src/lib into src * [@svelteui/prism]: moved code from src/lib into src * [@svelteui/tests]: moved code from src/lib into src/ * [@svelteui/demos]: moved code from src/lib into src * [core]: removed static files from packages * [@svelteui/dates]: moved src/lib into src/ * [core]: fix packaging with new aliases: bump svelte-package with fix * [docs]: fix paths for components * [@svelteui/core]: fix test setup * [core]: fixed pub script and changed storybook to dev * [core]: made modal error more clear * [core]: [release] 0.7.3 * [core]: updated readme for rebase * [@svelteui/core]: fix Tab dark mode color and simple story for testing purposes (#201) * [@svelteui/core]: fix element retrieval in Modal (#203) * [@svelteui/core]: fix switch disable behaviour * [core]: bump svelte version * [core]: update yarn lock * [core]: do not change package.json on prettier since it changes the peerDependencies semver (#213) * [@svelteui/core]: add Chip and ChipGroup components (#209) * [@svelteui/core]: add Chip and ChipGroup components Stubbed first draft of components. Not ready yet. Mostly copied from other components like Checkbox and also Mantine. Not tested. Signed-off-by: Brian Evans <[email protected]> * [@svelteui/core]: change Chip styles after code review Edited the styles for Chip based on PR feedback. Used color functions where possible, instead of hard coding. Also changed the way variants are selected. Added a checkmark when a chip is selected. Signed-off-by: Brian Evans <[email protected]> * [@svelteui/core]: added Storybook story for Chip Signed-off-by: Brian Evans <[email protected]> * [@sveltui/core]: make Chip label dynamic Co-authored-by: Ana Margarida Silva <[email protected]> * [@svelteui/core]: Chip styling and Story changes Based on PR feedback: - added more stories to storybook for sizing, and the different states - fixed dark mode selectors to use old method [`${theme.dark} &`] - made the label dynamic from label prop if no children provided to component Signed-off-by: Brian Evans <[email protected]> * [@svelteui/core]: hide input element in Chip Wrap the input element in a div which hides it. Signed-off-by: Brian Evans <[email protected]> * [@svelteui/core]: ChipGroup storybook Stories Added Stories for testing the ChipGroup. Removed some defaults from the ChipGroup component since these are set in Chip. Removed the input type prop, as it's not necessary. Signed-off-by: Brian Evans <[email protected]> * [@svelteui/core]: Chip disabled checked styling Signed-off-by: Brian Evans <[email protected]> Signed-off-by: Brian Evans <[email protected]> Co-authored-by: Kamell <[email protected]> Co-authored-by: Ana Margarida Silva <[email protected]> * [docs]: fix docs paths (#214) * [docs]: fix docs paths for svelteui-core and edit page * [docs]: fix doc paths for composables * [docs]: fix doc paths for dates * [docs]: fix doc path for preprocessors * [@svelteui/core]: Fix menu placement bug (#216) The menu placement was not working when a custom control was used. I fixed the bug by making the custom control the reference, unless it doesn't exist, then use the default control element. The Story demonstrates the fix. Signed-off-by: Brian Evans <[email protected]> Signed-off-by: Brian Evans <[email protected]> * [core]: fix storybook global undefined error * [@svelteui/core]: fix type, TS errors and format * [docs] README documentation for NPM package (#218) * [docs]: Documentation for Chip and ChipGroup (#220) * [@svelteui/core]: fix Chip export * [@svelteui/core]: improvements to Chip and ChipGroup - support multiple or not * [@svelteui/demos]: chip demos * [@svelteui/core]: format fixes * [docs]: chip docs * [@svelteui/core]: use same path for linting command as in format * [core]: Fix npm dependency errors on install (#222) * [docs]: rename prepare script to not be called by husky * [core]: fix vite npm dependency error * [core]: add deno to contributing guide * [core]: small fix * [@svelteuidev/demos] Fixes #225: Gradient problem in docs (#228) * [@svelteui/core]: badge simple story and fix in prism styles * [docs]: add rollup to fix error on dev * [@svelteui/demos]: fix CompositeRender event dispatch * [@svelteui/core]: add IconRenderer (#223) * [core]: fixes #233 - update dev docs setup documentation * [@svelteui/core]: refactor import * [core]: update tsconfigs * [@svelteui/core]: make Code props optional (#238) * [@svelteuidev/core] Fix modal target problem (#239) * [@svelteui/core]: fix modal target check and affix props * [@svelteui/demos]: fix modal demos * [@svelteui/demos]: revert target=body in modal demos * [docs]: Changed the line-height and added animations on scroll in the homepage (#240) * [docs]: Changed lineHight of text in homepage to match Features.svelte * [docs]: Added transitions on scroll for Features.svelte * [docs]: Changed variable name to improve clarity * [docs]: Ran tests and linted code * [docs]: Changed height of wrapper div * [docs]: fix height in docs * [core]: update README * [docs]: Improvements in sentences and changed styling of NextSteps component (#244) * [docs]: Changed lineHight of text in homepage to match Features.svelte * [docs]: Added transitions on scroll for Features.svelte * [docs]: Changed variable name to improve clarity * [docs]: Ran tests and linted code * [docs]: Changed height of wrapper div * [docs]: Improvements in sentences and styling * [docs]: Hopefully resolved conflict * review changes * [@svelteui/demos] Fixed incorrect value being shown (#247) * [core]: exclude peer deps in syncpack set-semver-ranges script (#246) * [@svelteui/core]: fix Grid spacing prop reactivity and style (#248) * [@svelteui/core]: exclude open/close events from event forwarding in Meny (#245) * [@svelteuidev/composables] Fixes #241: focus trap action and usage on modal (#243) * [@svelteui/composables]: use-focus-trap action * [@svelteui/core]: use focus-trap action in modal * [@svelteui/composables]: story for action focus-trap * [docs]: focus-trap docs * [@svelteuidev/composables] use-move action (#242) * [@svelteui/composables]: use-move action to move an element with the mouse movement * [@svelteui/composables]: set custom events for native DOM elements typings * [@svelteui/composables]: use-move finished with working story * [@svelteui/composables]: export use-move * [@svelteui/composables]: fix namespace and story style * [@svelteui/demos]: use-move demo * [docs]: use-move docs * [docs]: fix in description * Modal story added Signed-off-by: Brian Evans <[email protected]> Co-authored-by: Kamell Perry <[email protected]> Co-authored-by: Kamell <[email protected]> Co-authored-by: Brisklemonade <[email protected]> Co-authored-by: Jason Xu <[email protected]> Co-authored-by: Brian Evans <[email protected]> Co-authored-by: Kyle Shepherd <[email protected]> Co-authored-by: Caladan <[email protected]>
1 parent 6cb962a commit ae746f2

File tree

75 files changed

+718
-228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+718
-228
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ There are different categories on the roadmap. Items for versions `0.8–1.0` an
170170
| :red_circle: | ! | Create `ARIA` component |
171171
| :red_circle: | ! | Create `Slider` component |
172172
| :red_circle: | ! | Create `SegmentedControl` component |
173-
| :red_circle: | ! | Create `Chip` component |
173+
| :green_circle: | ! | Create `Chip` component |
174174
| :yellow_circle: | !!! | Find an effective solution to SSR in SSR mode (#172) |
175175
| :red_circle: | !!! | Find an effective solution to SSR in SSG mode (#107) |
176176

apps/docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
"deploy": "yarn prepare:docs & yarn build && deno run -A --unstable ../../scripts/docs/build.ts",
2626
"deploy:nobuild": "node ../../node_modules/@svelte-docs/publisher"
2727
}
28-
}
28+
}
Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,50 @@
11
<script>
22
import { features } from '../../data';
33
import { Title, Text, SimpleGrid, ThemeIcon, Center, Stack, Paper } from '@svelteuidev/core';
4+
import { fly } from "svelte/transition"
5+
import { onMount } from "svelte"
6+
let featuresVisible = false
7+
8+
onMount(() => {
9+
const wrapper = document.querySelector("#wrapper")
10+
const observer = new IntersectionObserver((entries) => {
11+
entries.forEach((entry) => {
12+
if (entry.isIntersecting) {
13+
featuresVisible = true
14+
}
15+
})
16+
}, {
17+
threshold: 0.5
18+
})
19+
observer.observe(wrapper)
20+
})
21+
422
</script>
523

6-
<SimpleGrid
7-
breakpoints={[
8-
{ minWidth: 1024, cols: 3, spacing: 'md' },
9-
{ minWidth: 768, cols: 2, spacing: 'sm' },
10-
{ minWidth: 640, cols: 1, spacing: 'sm' }
11-
]}
12-
>
13-
{#each features as { description, icon, title }}
14-
<Paper shadow="xl">
15-
<Stack>
16-
<Center override={{ jc: 'start', gap: '$10' }} inline>
17-
<ThemeIcon variant="gradient" size="xl">
18-
<svelte:component this={icon} size={25} />
19-
</ThemeIcon>
20-
<Title order={3} weight="extrabold">{title}</Title>
21-
</Center>
22-
<Text size="lg" override={{ lineHeight: '$md' }}>{description}</Text>
23-
</Stack>
24-
</Paper>
25-
{/each}
26-
</SimpleGrid>
24+
<div id="wrapper">
25+
{#if featuresVisible}
26+
<SimpleGrid
27+
breakpoints={[
28+
{ minWidth: 1024, cols: 3, spacing: 'md' },
29+
{ minWidth: 768, cols: 2, spacing: 'sm' },
30+
{ minWidth: 640, cols: 1, spacing: 'sm' }
31+
]}
32+
>
33+
{#each features as { description, icon, title }, i}
34+
<div in:fly="{{ y: 200, duration: (i + 1) * 500 }}">
35+
<Paper shadow="xl" style="height: 100%">
36+
<Stack>
37+
<Center override={{ jc: 'start', gap: '$10' }} inline>
38+
<ThemeIcon variant="gradient" size="xl">
39+
<svelte:component this={icon} size={25} />
40+
</ThemeIcon>
41+
<Title order={3} weight="extrabold">{title}</Title>
42+
</Center>
43+
<Text size="lg" override={{ lineHeight: '$md' }}>{description}</Text>
44+
</Stack>
45+
</Paper>
46+
</div>
47+
{/each}
48+
</SimpleGrid>
49+
{/if}
50+
</div>

apps/docs/src/includes/sidebar.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,13 @@
121121
- [use-css-variable](composables/use-css-variable)
122122
- [use-download](composables/use-download)
123123
- [use-focus](composables/use-focus)
124+
- [use-focus-trap](composables/use-focus-trap)
124125
- [use-hot-key](composables/use-hot-key)
125126
- [use-io](composables/use-io)
126127
- [use-lazy](composables/use-lazy)
127128
- [use-lock-scroll](composables/use-lock-scroll)
128129
- [use-long-press](composables/use-long-press)
130+
- [use-move](composables/use-move)
129131
- [use-persistent-tab](composables/use-persistent-tab)
130132
- [use-portal](composables/use-portal)
131133
- [use-page-leave](composables/use-page-leave)

apps/docs/src/pages/basics.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ title: Learn the basics
1313

1414
<MinorHeading />
1515

16-
This guide will help you get familiar with core SvelteUI concepts. Please read this guide and the **theming** section before starting development to learn about all available theming features and component behaviors.
16+
This guide will help you get familiar with core SvelteUI concepts. Please read this guide and the [theming](theming/svelteui-provider) section before starting development to learn about all available theming features and component behaviors.
1717

1818
## SvelteUI packages
1919

@@ -40,15 +40,15 @@ To learn how to dynamically change the theme by reading the [dark theme guide](t
4040

4141
## Server side rendering
4242

43-
SvelteUI components work in SvelteKit environments without any configuration needed. However, they aren't SSR compatible by default. To setup SSR, follow the server side rendering guide below, It's really easy to set up!
43+
SvelteUI components work in SvelteKit environments without any configuration needed. However, they aren't SSR compatible by default. To setup SSR, follow the server side rendering guide below. It's really easy to set up!
4444

4545
- [Server side rendering with SvelteKit](theming/ssr)
4646

4747
## TypeScript
4848

4949
### Exported types
5050

51-
@svelteuidev/core package export all types to help you build components and styles with TypeScript, some notable ones are:
51+
`@svelteuidev/core` package export all types to help you build components and styles with TypeScript. Some notable ones are:
5252

5353
- `ColorScheme` – union of `'light' | 'dark'`.
5454
- `SvelteUIColor` – union of all default colors.
@@ -113,7 +113,7 @@ Under normal circumstances you wouldn't be able to use actions on components bec
113113

114114
## Bindings
115115

116-
All components support binding their top-level element via the element prop instead of `this`. This allows you to get a reference to a DOM node (as a supplement to `bind:this`):
116+
All components support binding their top-level element via the `element` prop instead of `this`. This allows you to get a reference to a DOM node (as a supplement to `bind:this`):
117117

118118
```svelte
119119
<script lang="ts">
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: 'use-focus-trap'
3+
group: 'svelteuidev-composables'
4+
packageGroup: '@svelteuidev/composables'
5+
slug: /composables/use-focus-trap/
6+
description: 'Traps the focus inside the given DOM node'
7+
import: "import { focustrap } from '@svelteuidev/composables';"
8+
docs: 'composables/use-focus-trap.md'
9+
source: 'svelteui-composables/src/actions/use-focus/use-focus-trap.ts'
10+
---
11+
12+
<script lang='ts'>
13+
import { Demo, ComposableDemos } from '@svelteuidev/demos';
14+
import { Heading } from 'components';
15+
</script>
16+
17+
<Heading />
18+
19+
## Usage
20+
21+
The `use-focus-trap` action traps the focus inside a given DOM node. The node must include at least one focusable element, and it will give priority to a node with the `autofocus` property.
22+
23+
```svelte
24+
<script>
25+
import { focustrap } from './use-focus-trap';
26+
</script>
27+
28+
<div use:focustrap>
29+
<h1>Title</h1>
30+
<input /> <!-- This will be focused -->
31+
</div>
32+
```
33+
34+
## Definition
35+
36+
```ts
37+
export function focustrap(node: HTMLElement): ReturnType<Action>;
38+
```

apps/docs/src/pages/composables/use-io.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ source: 'svelteui-composables/src/actions/use-io/use-io.ts'
1818

1919
## Usage
2020

21-
With the Intersection Observer API, use-intersection gets information about the intersection of a given element with its scroll container or body element:
21+
With the Intersection Observer API, `use-intersection` gets information about the intersection of a given element with its scroll container or body element:
2222

2323
<Demo demo={ComposableDemos.useIoDemo.usage} />
2424

@@ -33,7 +33,7 @@ With the Intersection Observer API, use-intersection gets information about the
3333

3434
## Events
3535

36-
The use-clipboard action dispatches custom events. Each custom event takes a callback function just like other events.
36+
The `use-clipboard` action dispatches custom events. Each custom event takes a callback function just like other events.
3737

3838
```ts
3939
on:useclipboard?: (callback: (any) => unknown) => void;

apps/docs/src/pages/composables/use-long-press.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ With the `use-long-press` action, a `long press` event is created when `mousedow
3030

3131
## Events
3232

33-
The use-longpress action dispatches one custom event. The custom event takes a callback function just like other events.
33+
The `use-longpress` action dispatches one custom event. The custom event takes a callback function just like other events.
3434

3535
```ts
3636
on:uselongpress?: (callback: (any) => unknown) => void;
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: 'use-move'
3+
group: 'svelteuidev-composables'
4+
packageGroup: '@svelteuidev/composables'
5+
slug: /composables/use-move/
6+
description: 'Handles the movement of an element based on mouse and touch events'
7+
import: "import { move } from '@svelteuidev/composables';"
8+
docs: 'composables/use-move.md'
9+
source: 'svelteui-composables/src/actions/use-move/use-move.ts'
10+
---
11+
12+
<script>
13+
import { Demo, ComposableDemos } from '@svelteuidev/demos';
14+
import { Heading } from 'components';
15+
</script>
16+
17+
<Heading />
18+
19+
## Usage
20+
21+
With the `use-move` action, it is possible to move an element in the screen with mouse or touch events.
22+
23+
<Demo demo={ComposableDemos.useMoveDemo.usage} />
24+
25+
## Events
26+
27+
The use-move action dispatches three custom event. The custom event takes a callback function just like other events.
28+
29+
```ts
30+
on:move?: (callback: (event: CustomEvent<{ x: number; y: number }> & { target: EventTarget & T }) => unknown) => void;
31+
on:move:start?: (callback: (event: CustomEvent<{ x: number; y: number }> & { target: EventTarget & T }) => unknown) => void;
32+
on:move:stop?: (callback: (event: CustomEvent<{ x: number; y: number }> & { target: EventTarget & T }) => unknown) => void;
33+
```
34+
35+
## Definition
36+
37+
```ts
38+
export function move(
39+
node: HTMLElement
40+
): ReturnType<Action>;
41+
```

apps/docs/src/pages/contributing.md

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,31 @@ title: 'Contributing'
1919

2020
## Ways to contribute
2121

22-
- **Improve documentation:** fix incomplete or missing docs, bad wording, examples or explanations
23-
- **Give feedback:** we are constantly working on making SvelteUI better, please share how you use SvelteUI, what features are missing and what is done good via GitHub Discussions
24-
- **Share SvelteUI:** share link to SvelteUI docs with everyone who can be interested, share SvelteUI on Twitter
25-
- **Contribute to codebase:** propose new feature via GitHub Issues or find an [existing one](https://github.com/svelteuidev/svelteui/labels/help%20wanted) that you are interested in and work on it
26-
- **Give us a code review:** help us identify problems with [source code](https://github.com/svelteuidev/svelteui) or make SvelteUI more performant
22+
- **Improve documentation:** Fix incomplete or missing docs, bad wording, examples or explanations.
23+
- **Give feedback:** We are constantly working on making SvelteUI better, please share how you use SvelteUI, what features are missing and what is done good via GitHub Discussions.
24+
- **Share SvelteUI:** Share the link to SvelteUI docs with everyone who can be interested, share SvelteUI on Twitter.
25+
- **Contribute to codebase:** Propose new features via GitHub Issues or find an [existing one](https://github.com/svelteuidev/svelteui/labels/help%20wanted) that you are interested in and work on it.
26+
- **Give us a code review:** Help us identify problems with the [source code](https://github.com/svelteuidev/svelteui) or make SvelteUI more performant.
2727

2828
## Contributing workflow
2929

30-
- Decide what you want to contribute
31-
- If you want to implement a new feature, discuss it with a maintainer ([Discord](https://discord.gg/2J2xmzCS79) or [Discussions](https://github.com/svelteuidev/svelteui/discussions/categories/feature-requests)) before jumping into code
32-
- After finalizing the issue details and the code, please follow commit convention
33-
- Submit a PR if everything is fine
34-
- Get a code review and fix all issues noticed by a maintainer
35-
- PR is merged, and we're done!
30+
- Decide what you want to contribute.
31+
- If you want to implement a new feature, discuss it with a maintainer ([Discord](https://discord.gg/2J2xmzCS79) or [Discussions](https://github.com/svelteuidev/svelteui/discussions/categories/feature-requests)) before jumping into code.
32+
- After finalizing the issue details and the code, please follow commit convention.
33+
- Submit a PR if everything is fine.
34+
- Get a code review and fix all issues noticed by a maintainer.
35+
- The PR is merged, and we're done!
3636

3737
## Commit convention
3838

3939
SvelteUI is a monorepo and it is important to write clear commit messages to keep the git history clean.
40-
All commits made in this repository are divided in 3 groups:
40+
All commits made in this repository are divided into 3 groups:
4141

42-
- **package commits** related to particular package
42+
- **package commits** related to a particular package
4343
- **docs commits** related to documentation
4444
- **core commits** only related to repository tooling and not associated with any package
4545

46-
This repo uses commitizen to make commits easier. In order to commit changes made, you should run the `yarn cm` command. Once you have done that, the commitizen cli messages will guide you through the commit process. Commit message consists of 2 parts:
46+
This repo uses commitizen to make commits easier. In order to commit the changes made, you should run the `yarn cm` command. Once you have done that, the commitizen CLI messages will guide you through the commit process. Commit message consists of 2 parts:
4747

4848
```bash
4949
[type]: Message
@@ -58,7 +58,7 @@ Examples:
5858

5959
## Git branches
6060

61-
- **main** - When the project hits 1.0, this will be for the current version, and patches for current minor version (1.0.x)
61+
- **main** - When the project hits 1.0, this will have the current version, as well as patches for the current minor version (1.0.x)
6262
- **next-minor** - Contains next minor version (1.x.0), most likely you would want to create a PR to this branch
6363
- **experimental** - Up to date with next minor version (1.x.0), implementing some experimental features that may or may not be added
6464

@@ -67,7 +67,7 @@ Examples:
6767
- Install [editorconfig](https://editorconfig.org/) extension for your editor
6868
- **vscode users only** - install recommended extensions
6969
- Fork [repository](https://github.com/svelteuidev/svelteui), clone or download your fork
70-
- Install dependencies at the root of the monorepo with npm **(make sure to install with npm only)**
70+
- Install dependencies at the root of the monorepo with Yarn **(make sure to install with yarn only)**
7171
- After your node modules have installed:
7272

7373
**To start developing**
@@ -76,37 +76,44 @@ Examples:
7676
It is very important to make sure you start from the root of the monorepo before following these steps
7777
</Alert>
7878

79-
**`@svelteuidev/` scoped packages:**
79+
**If developing in [svelteui-prism, svelteui-dates, or svelteui-demos]**
8080

8181
1. run `yarn package`
8282
- If you want to watch for changes in one of the packages that they depend on, run `yarn watch` in their directory.
8383
- You will need two terminal sessions open at the very least. If this doesn't apply to your situation move on to step 2
8484
2. cd into the package you want to develop on
8585
3. run `yarn dev`
8686

87-
**`docs`:**
87+
**If developing in [svelteui-core, svelteui-actions, svelteui-utilities, or svelteui-motion]**
8888

89-
1. run `yarn package`
90-
2. cd into the docs
91-
3. run `yarn dev`
89+
1. cd into the package you want to develop on
90+
2. run `yarn dev`
91+
92+
**If developing in docs:**
93+
94+
1. Install [deno](https://deno.land/[email protected]/introduction)
95+
2. Run `yarn package`
96+
3. Run `yarn dev:docs`
9297

9398
**Project Structure**
9499

95100
You won't need to pay attention to every file within the project. All of the packages follow a similar pattern, so you should always start your journey within the `src/lib` of whatever package you choose to work on.
96101

97102
<Demo demo={MiscDemos.contributing.tree} />
98103

99-
## NPM scripts
104+
## Yarn scripts
100105

101-
All packages' npm scripts are located at [main package.json](https://github.com/svelteuidev/svelteui/blob/main/package.json),
102-
individual packages have scripts, but they should not be interacted with directly. This is due to the nature of [TurboRepo](https://turborepo.org/). All scripts should be running from the root of the monorepo.
106+
All packages' Yarn scripts are located at [main package.json](https://github.com/svelteuidev/svelteui/blob/main/package.json),
107+
individual packages have scripts, but they should not be interacted with directly. This is due to the nature of [TurboRepo](https://turborepo.org/). All scripts should be run from the root of the monorepo.
103108

109+
- `dev:docs` - runs the development environment for the docs
110+
- `dev` - runs Storybook for all the packages that contain stories
104111
- `clean` - removes all unnecessary files and folders from packages (i.e. node_modules)
105112
- `format` - runs prettier on packages folder
106-
- `lint` - runs ESLint on packages folder (run format before running lint)
113+
- `lint` - runs eslint on packages folder (run format before running lint)
107114
- `test` - runs tests with [vitest](https://vitest.dev/)
108115
- `package` - generates built versions of packages (needed for cross package development)
109-
- `repo:prepush` - runs sort, format, lint and test (run this before pushing your code)
116+
- `prepush:repo` - runs sort, format, lint and test (run this before pushing your code)
110117
- `cm` - runs git commands to add and commit through commitizen (this is the recommended way to commit as it follows the convention automatically)
111118

112119
<BottomNav

0 commit comments

Comments
 (0)