Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .github/workflows/published-test.yml

This file was deleted.

63 changes: 63 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Exclude story files
**/*.stories.tsx
**/*.stories.ts
**/*.stories.mdx

# Exclude test files
**/*.test.tsx
**/*.test.ts

# Exclude test directories
**/__tests__/
**/test/

# Exclude dist artifacts
dist/
src/dist/

# Exclude development files
.storybook/
storybook-static/
integration/
tests/
*.log
build-storybook.log
.eslintcache
tsconfig.tsbuildinfo
*.tsbuildinfo

# Exclude source maps (not needed for pure TS)
**/*.map

# Exclude node_modules
node_modules/

# Exclude git files
.git/
.gitignore
.gitattributes

# Exclude CI/CD
.github/

# Exclude config files (not needed by consumers)
vite.config.mts
postcss.config.mjs
eslint.config.mjs
components.json
tsconfig.json
pnpm-lock.yaml
.prettierrc*
.prettierignore
.editorconfig
.releaserc.json
.vscode/

# Exclude old package tarballs
*.tgz

# Exclude docs (README and LICENSE are auto-included)
CLAUDE.md
*.md
!README.md

15 changes: 13 additions & 2 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
{
"branches": ["main", { "name": "alpha", "prerelease": true }],
"branches": [
"main",
{
"name": "alpha",
"prerelease": "alpha"
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm"
[
"@semantic-release/npm",
{
"npmPublish": true
}
]
]
}
10 changes: 10 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { StorybookConfig } from '@storybook/react-vite'
import path from 'path'

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
Expand All @@ -18,8 +19,17 @@ const config: StorybookConfig = {
},
async viteFinal(config) {
const { mergeConfig } = await import('vite')
const { resolve } = await import('path')
const { fileURLToPath } = await import('url')
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)

return mergeConfig(config, {
resolve: {
alias: {
'@': resolve(__dirname, '../src'),
},
},
optimizeDeps: {
// https://github.com/storybookjs/storybook/issues/28542#issuecomment-2268031095
exclude: [
Expand Down
36 changes: 26 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,16 @@ Add this to the top of your project's CSS file where you configure Tailwind:

**Note:** The `@reference` directive is required for Tailwind v4 to recognize Moonshine's custom utilities and make them available in your project.

### 3. Import Moonshine's Compiled CSS
### 3. Import Moonshine's CSS

In your main app file (or root layout):

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

**Note:** Moonshine distributes as pure TypeScript, and Vite will process the CSS from source automatically.

### 4. Set up the Provider

Wrap your application in the `MoonshineConfigProvider` component:
Expand All @@ -52,7 +54,7 @@ import { MoonshineConfigProvider } from '@speakeasy-api/moonshine'
</MoonshineConfigProvider>
```

### 5. Configure Custom Fonts (Optional)
### 6. Configure Custom Fonts (Optional)

Moonshine uses custom fonts (Diatype, Tobias). If you have licenses for these fonts, add them to your project:

Expand All @@ -79,7 +81,7 @@ Moonshine uses custom fonts (Diatype, Tobias). If you have licenses for these fo

If you don't have these fonts, the design system will fall back to system fonts.

### 6. Use Components and Utilities
### 7. Use Components and Utilities

```tsx
import { Grid } from '@speakeasy-api/moonshine'
Expand Down Expand Up @@ -112,7 +114,7 @@ The types are automatically generated during the build process and include:

💡 **Tip**: This prevents typos and helps you discover available utilities without leaving your editor!

The package is built with [vite](https://vitejs.dev/), and is distributed in both [ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) and [CommonJS](https://nodejs.org/api/modules.html#modules-commonjs) formats.
The package is built with [vite](https://vitejs.dev/) and distributed as **pure TypeScript**. Consumers using Vite will transpile the TypeScript on-the-fly, eliminating the need for a separate build step when linking the library locally.

### Using Tailwind Merge

Expand Down Expand Up @@ -206,8 +208,7 @@ import type { MoonshineClasses } from '@speakeasy-api/moonshine/types/utilities'

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
3. 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.

Expand Down Expand Up @@ -264,18 +265,33 @@ 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.
Since Moonshine distributes as pure TypeScript, linking is much simpler - no build step required!

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:
1. **Link the library** from within your consuming app:

```bash
pnpm link ../path/to/moonshine
```

The lockfile file within your app should referenced the linked copy:
For example, if `moonshine` is a sibling of your app directory:

```bash
pnpm link ../moonshine
```

2. **Start your dev server** - Vite will automatically transpile the TypeScript from the linked library.

The lockfile within your app should reference the linked copy:

```yaml
'@speakeasy-api/moonshine':
specifier: ^0.43.1
specifier: ^2.0.0-alpha.1
version: link:../../../../moonshine
```

**Benefits of pure TypeScript distribution:**

- ✅ No need to run `tsc` in watch mode
- ✅ No build conflicts between library and consumer
- ✅ Instant updates when you change source files
- ✅ Simpler development workflow
9 changes: 1 addition & 8 deletions components.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,5 @@
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
}
}
}
118 changes: 0 additions & 118 deletions integration/integration.test.tsx

This file was deleted.

22 changes: 0 additions & 22 deletions integration/package.json

This file was deleted.

Loading