Requirements
Please ensure you have read and understand all requirements below. Failure to adhere to the following guidelines may result in your pull requests being denied. We reserve the right to ban repeat offenders.
Pull Requests
- Find an open issue or identify a roadmap task you wish to contribute to.
- If an issue exists on GitHub, leave a comment and let us know you're interested. We'll assign you to it.
- To propose a new feature or update, create a GitHub issue or reach out on Discord in the
#contributors
channel. - Please communicate with maintainers to define all requirements before you write your first line of code.
- Follow our recommended branch naming convention defined in our style guide.
- Submit your pull request as a DRAFT as early as possible. Peer review is critical to this process.
- Run automated tests with
pnpm test
to verify that no regressions were introduced. - Be sure to follow our recommended documentation guidelines before requesting a review.
- When ready, set your pull request to the "ready to review" state. Then be patient. We'll review asap.
- If your PR meets all requirements it will be merged, otherwise feedback and guidance will be provided.
Branches
Branch | Description | Pull Requests |
---|---|---|
master | Represents the production branch. All pull requests submitted to this branch will be rejected. | 🚫 NEVER |
dev | The active development branch containing bleeding edge changes. Target this branch for PRs | ✅ Yes |
Monorepo
Skeleton uses a monorepo to group related projects into a single repository. This allows us to easily maintain multiple projects and packages in parallel. This includes the Skeleton core library, this documentation site, and more.
In order to contribute to Skeleton, you will be required to install and use pnpm, as it fully supports monorepo project structures. Don't worry, it's very similar to npm
and will handle most of the heavy lifting.
We've provide a quick reference below for where each project is located.
Path | Description |
---|---|
/packages/skeleton | The core library project, containing all components, elements, utilities, and more. |
/sites/skeleton.dev | The SvelteKit project containing this documentation website. |
Getting Started
If you're not familiar with using a monorepo, please follow the steps below:
- Install pnpm globally using
npm install -g pnpm
. Confirm viapnpm --version
in your terminal. - Go to our repo and press the Fork button in the top right.
- Click the Code button in Github to clone down a copy of your fork to your local machine
- Run
cd skeleton
to move into the cloned monorepo project. - Delete your
node_modules
directory, then runpnpm i
to install dependencies for all projects. - Run
cd sites/skeleton.dev
to move into the Skeleton documentation project. - Run
code .
to open the current project directory in VS Code. - Run
pnpm dev
to start a local dev server. You may see a warning the first time. - Open the dev server address provided by the terminal in your browser.
- Modify the documentation or library components as desired. This fully supports HMR.
Adding New Projects
If you wish to add a new project, first run pnpm getall
from the root of the monorepo. This will clone
create-skeleton-app
into your project under packages/create-skeleton-app
. Next run
pnpm csa yoursitename
. This will generate a brand new Skeleton project in the
/sites
directory.
Importing Skeleton
To import Skeleton features (ex: components) within each monorepo project, use the following structure:
import { Avatar } from '@skeletonlabs/skeleton';
Changesets
Once you have a PR that is ready, it'll be time to add a Changeset. We use changesets to help automate our versioning, changelogs, and releases.
We will be creating changesets using the Changeset CLI. The CLI will walk us through the process by having us select the packages and
their respective version bumps. Version bumps are how we increment the versions for our packages and they come in 3 flavors:
major
,
minor
, and patch
.
Generally, new features are minor
bumps while bugfixes and chores are patch
bumps.
When writing the summary for the changeset, be sure to prefix the message with either
feat:
,
bugfix:
, or chore:
.
Prefix | When to use | Version Bump |
---|---|---|
feat: | For when a new feature is added | minor |
bugfix: | For bug fixes | patch |
chore: | For dependency and general project management | patch |
Adding a Changeset
- Navigate to the root directory of the monorepo.
- Run
pnpm changeset
to run the Changeset CLI. - Press Space to select the package(s) you would like to add a changeset for. Once selected, press Enter.
- Now it's time to select a version bump. If it's the version bump you desire, press Space to select the package(s) that it will apply to, and press Enter to submit. Otherwise, press Enter to move on to the next version bump option.
- You will now be prompted to write a summary. Prefix your summary with either
feat:
,bugfix:
, orchore:
. Then briefly describe the change you implemented. - Confirm the changes and commit the newly generated markdown file.
Tooling
Skeleton utilizes a number of additional tools for project maintenance.
Code Linting & Formatting
To check for linting issues via Prettier, run:
pnpm lint
To automatically apply suggested linting changes, run:
pnpm format
Automated Tests
Tests are handled via Vitest, which is similar to Jest. Make sure to run all tests before submitting new pull requests.
pnpm test
Spell Checking
Skeleton uses Cspell to check for spelling errors. We
recommend installing the
Code Spell Checker
extension for VS Code. You can add words to the dictionary using this extension, or by editing cspell.json
at
the root of the repository.
pnpm cspell "**" --no-progress
Dependencies
Introducing new dependencies to projects is strictly prohibited. Please sync with a core maintainer if this is required. Pull requests that introduce new dependencies without approval will be rejected.