1.8.2 • Published 1 month ago

@speakeasy-api/moonshine v1.8.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 month ago

🥃 Moonshine 🥃

NPM

Speakeasy's design system.

Installing the NPM package

pnpm add @speakeasy-api/moonshine

Reference the CSS file in your project:

import '@speakeasy-api/moonshine/moonshine.css'

Wrap your application in the MoonshineConfigProvider component, passing in the HTML element where the tailwind dark/light class is applied:

import { MoonshineConfigProvider } from '@speakeasy-api/moonshine'

<MoonshineConfigProvider themeElement={document.documentElement}>
  <App />
</MoonshineConfigProvider>

Then you can import components from the package:

import { Grid } from '@speakeasy-api/moonshine'

The package is built with vite, and is distributed in both ESM and CommonJS formats.

Contributing

Setup

  1. Clone the repository
  2. Run pnpm install to install the dependencies
  3. Run pnpm build to build the package
  4. Run pnpm storybook to start the storybook server

If you'd like to develop Moonshine in tandem with another app, you can follow the steps outlined below in the Linking the library locally section.

Guidelines

  • We're using Storybook to develop the components.
  • Components should be added to the src/components directory.
  • Each component should have its own directory. e.g src/components/Box, src/components/Button etc.
  • Each component should have a corresponding Storybook story file located at src/components/{Your Component}/index.stories.tsx, with several stories for different use cases.
  • Shadcn components should not be exported directly from src/index.ts.

Workflow

We use Semantic Release to handle versioning and changelog generation.

The release workflow is as follows:

  1. Create a new branch for your changes
  2. Make your changes
  3. Add a commit with the conventional changelog message format (e.g feat(component-name): what the commit does)
  4. Push your changes to GitHub
  5. Merge the PR into the main branch
  6. A new version is released to NPM

Conventional changelog reference

Only certain commit types will trigger a release (noted below in bold).

  • feat: A new feature (triggers a minor release)
  • fix: A bug fix (triggers a patch release)
  • perf: A code change that improves performance (triggers a patch release)
  • refactor: A code change that neither fixes a bug nor adds a feature (no release)
  • docs: Documentation only changes (no release)
  • style: Changes that do not affect the meaning of the code (no release)
  • test: Adding missing tests (no release)
  • ci: Changes to CI configuration files and scripts (no release)
  • build: Changes that affect the build system or external dependencies (no release)
  • chore: Other changes that don't modify src or test files (no release)
Breaking changes

If a PR is a breaking change for consumers, then the commit message should use a bang (!) to signify a breaking change, which will trigger a major release:

feat(component-name)!: breaking change description
fix(component-name)!: breaking change description

Testing

We're using Vitest and @testing-library/react for testing components when necessary.

Run pnpm test to run the tests.

Linking the library locally

Run pnpm build:watch within Moonshine to build the library and watch for changes.

Then run pnpm link ../path/to/moonshine within the app that will use the library. For the registry webapp directory (assuming a standard cloning setup where moonshine is a sibling of the registry repo), it would be:

pnpm link ../path/to/moonshine

The lockfile file within your app should referenced the linked copy:

'@speakeasy-api/moonshine':
  specifier: ^0.43.1
  version: link:../../../../moonshine
1.8.2

1 month ago

1.9.0

1 month ago

1.8.1

1 month ago

1.8.0

2 months ago

1.7.0

2 months ago

1.6.1

2 months ago

1.6.0

2 months ago

1.5.0

2 months ago

1.4.0

2 months ago

1.3.5

2 months ago

1.3.4

2 months ago

1.3.3

2 months ago

1.3.2

2 months ago

1.3.1

2 months ago

1.3.0

3 months ago

1.2.0

3 months ago

1.1.2

3 months ago

1.1.1

3 months ago

1.1.0

3 months ago

1.0.1

3 months ago

1.0.0

3 months ago

0.90.0

3 months ago

0.89.1

3 months ago

0.89.0

3 months ago

0.88.3

4 months ago

0.88.2

4 months ago

0.88.1

4 months ago

0.88.0

4 months ago

0.87.0

4 months ago

0.86.0

4 months ago

0.85.0

4 months ago

0.84.1

4 months ago

0.84.0

4 months ago

0.83.0

4 months ago

0.82.0

4 months ago

0.81.4

4 months ago

0.81.3

4 months ago

0.81.2

4 months ago

0.81.1

4 months ago

0.81.0

4 months ago

0.80.10

4 months ago

0.80.9

4 months ago

0.80.8

4 months ago

0.80.7

4 months ago

0.80.6

4 months ago

0.80.5

4 months ago

0.80.4

4 months ago

0.80.3

5 months ago

0.80.2

5 months ago

0.80.1

5 months ago

0.80.0

5 months ago

0.79.1

5 months ago

0.79.0

5 months ago

0.78.0

5 months ago

0.77.3

5 months ago

0.77.2

5 months ago

0.77.1

5 months ago

0.77.0

5 months ago

0.76.2

5 months ago

0.76.1

5 months ago

0.76.0

5 months ago

0.75.0

5 months ago

0.74.4

5 months ago

0.74.3

5 months ago

0.74.2

5 months ago

0.74.1

5 months ago

0.74.0

5 months ago

0.73.0

5 months ago

0.72.2

5 months ago

0.72.1

5 months ago

0.72.0

5 months ago

0.71.0

5 months ago

0.70.0

5 months ago

0.69.3

5 months ago

0.69.2

5 months ago

0.69.1

5 months ago

0.69.0

5 months ago

0.68.0

5 months ago

0.67.2

5 months ago

0.67.1

5 months ago

0.67.0

5 months ago

0.66.0

5 months ago

0.65.0

5 months ago

0.64.1

5 months ago

0.64.0

6 months ago

0.63.0

6 months ago

0.62.0

6 months ago

0.61.1

6 months ago

0.61.0

6 months ago

0.60.3

6 months ago

0.60.2

6 months ago

0.60.1

6 months ago

0.60.0

6 months ago

0.59.2

6 months ago

0.59.1

6 months ago

0.59.0

6 months ago

0.58.2

6 months ago

0.58.1

6 months ago

0.58.0

6 months ago

0.57.0

6 months ago

0.56.0

6 months ago

0.55.1

6 months ago

0.55.0

6 months ago

0.54.0

6 months ago

0.53.0

6 months ago

0.52.3

6 months ago

0.52.2

7 months ago

0.52.1

7 months ago

0.52.0

7 months ago

0.51.0

7 months ago

0.50.0

7 months ago

0.49.0

7 months ago

0.48.0

7 months ago

0.47.0

7 months ago