|
| 1 | +# Contributing |
| 2 | + |
| 3 | +## Prerequisites |
| 4 | + |
| 5 | +- [NodeJS](https://nodejs.org/) |
| 6 | +- [PNPM](https://pnpm.io/) |
| 7 | + |
| 8 | +## Project Structure |
| 9 | + |
| 10 | +This project utilizes [PNPM Workspaces](https://pnpm.io/workspaces) with the following structure: |
| 11 | +``` |
| 12 | +├── packages/ |
| 13 | +│ └── floating-ui-svelte/ # Package |
| 14 | +└── sites/ |
| 15 | + └── floating-ui-svelte.vercel.app/ # Documentation |
| 16 | +``` |
| 17 | + |
| 18 | +## Development |
| 19 | + |
| 20 | +1. Fork and clone the repository |
| 21 | +2. Install dependencies: `pnpm i` |
| 22 | +3. Start development: `pnpm build:watch` |
| 23 | + |
| 24 | +## Branch |
| 25 | + |
| 26 | +All pull requests should be created against the `main` branch. |
| 27 | + |
| 28 | +### Branch Conventions |
| 29 | + |
| 30 | +Please use the following naming convention when creating your pull request. |
| 31 | + |
| 32 | +| Branch | Role | |
| 33 | +| --- | --- | |
| 34 | +| `docs/*` | Updates for the documentation site. | |
| 35 | +| `feature/*` | When implementing a new feature. | |
| 36 | +| `chore/*` | When implementing small changes. | |
| 37 | +| `bugfix/*` | When implementing feature bugfixes. | |
| 38 | + |
| 39 | +Keep branch names short and semantic, using dashes to separate words. |
| 40 | + |
| 41 | +``` |
| 42 | +docs/getting-started-typo-fix |
| 43 | +bugfix/fixed-use-floating-bug |
| 44 | +``` |
| 45 | + |
| 46 | +## Changesets |
| 47 | + |
| 48 | +[Changesets](https://github.com/changesets/changesets) are used to automatically generate the changelog for each release. Any contributions made to projects that live within the `/lib` directory must contain a Changeset. Use the following instructions to generate a changeset. |
| 49 | + |
| 50 | +1. Make sure you're within local pull request feature branch. |
| 51 | +2. Navigate to the root of the project. |
| 52 | +3. Run `pnpm changeset` to trigger the Changeset CLI. |
| 53 | +4. Follow the instructions when prompted. |
| 54 | +5. Changeset are added to the `/.changeset` directory. |
| 55 | +6. Commit and push the new changeset file. |
| 56 | + |
| 57 | +Changesets use semantic version. We recommend the following convention. |
| 58 | + |
| 59 | +| Version | Role | |
| 60 | +| --- | --- | |
| 61 | +| `major` | Do not use. Reserved for maintainers. | |
| 62 | +| `minor` | For notable changes, such as a new features. | |
| 63 | +| `patch` | For small changes, such as a chore or typo. | |
| 64 | + |
| 65 | +Changeset descriptions will appear verbatim on the [Changelog](https://github.com/skeletonlabs/skeleton/blob/dev/packages/skeleton/CHANGELOG.md). Keep it short, semantic, and prefix this like branch names. |
| 66 | + |
| 67 | +```md |
| 68 | +--- |
| 69 | +'@skeletonlabs/floating-ui-svelte': minor |
| 70 | +--- |
| 71 | + |
| 72 | +feat: Added a new useFoo hook. |
| 73 | +``` |
| 74 | + |
| 75 | +> [!CAUTION] |
| 76 | +> Only add a changeset when the change affects the library, documentation changes for example will not require a changeset. |
| 77 | +
|
| 78 | +## Tooling |
| 79 | + |
| 80 | +### Formatting |
| 81 | + |
| 82 | +This project makes use of [Biome](https://biomejs.dev/), to run the formatter: |
| 83 | + |
| 84 | +```bash |
| 85 | +pnpm format |
| 86 | +``` |
| 87 | + |
| 88 | +### Testing |
| 89 | + |
| 90 | +This project makes use of [Vitest](https://vitest.dev/), to run the tests: |
| 91 | + |
| 92 | +```bash |
| 93 | +pnpm test |
| 94 | +``` |
| 95 | + |
| 96 | +To test and watch: |
| 97 | + |
| 98 | +```bash |
| 99 | +pnpm test:watch |
| 100 | +``` |
| 101 | + |
| 102 | +### Building |
| 103 | + |
| 104 | +This project makes use of [Svelte Package](https://svelte.dev/docs/kit/packaging), to run the build: |
| 105 | + |
| 106 | +```bash |
| 107 | +pnpm build |
| 108 | +``` |
| 109 | + |
| 110 | +To build and watch: |
| 111 | + |
| 112 | +```bash |
| 113 | +pnpm build:watch |
| 114 | +``` |
0 commit comments