Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/real-breads-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@stylelish/vite-plugin-declare-type': major
---

Renamed to `@stylelish/vite-plugin-declare-type`.
5 changes: 5 additions & 0 deletions .changeset/sad-bananas-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@stylelish/rollup-plugin-im-client-component': major
---

Renamed to `@stylelish/rollup-plugin-im-client-component`.
5 changes: 5 additions & 0 deletions .changeset/sweet-eels-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@stylelish/vite-plugin-react-svg': major
---

Renamed to `@stylelish/vite-plugin-react-svg`.
5 changes: 5 additions & 0 deletions .changeset/tricky-mirrors-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@stylelish/vite-plugin-crush-envy': major
---

Renamed to `@stylelish/vite-plugin-crush-envy`.
71 changes: 7 additions & 64 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,78 +2,21 @@

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Repository Overview

Plugin monorepo managed with pnpm workspaces, Turborepo, and changesets. Contains Vite/Rollup plugin packages published to npm.

## Commands

```bash
pnpm build # Build all packages (via Turbo)
pnpm lint # Lint all packages (via Turbo)
pnpm format # Format with Prettier (ts, md)
pnpm check-types # Type check all packages

# Single package (from root)
pnpm --filter <package-name> build
pnpm --filter <package-name> lint

# Per-package (run from package directory)
pnpm build # tsdown
pnpm dev # tsdown --watch
pnpm lint # eslint src

# Release
pnpm changeset # Create changeset
pnpm version # Apply changesets to versions
pnpm release # Build + publish to npm
```

## Architecture

```text
packages/
_eslint-config/ # Shared ESLint flat config (@plugin-baby/eslint-config)
_typescript-config/ # Shared tsconfig for tsdown (@plugin-baby/typescript-config)
rollup-plugin-im-client-component/ # Auto 'use client' directive injection
vite-plugin-crush-envy/ # Type-safe .env for Vite
vite-plugin-react-stylish-svg/ # SVG as React component
vite-plugin-sexy-declare-type/ # Auto .d.ts generation
_eslint-config/ # @plugin-baby/eslint-config — Shared ESLint flat config (internal)
_typescript-config/ # @plugin-baby/typescript-config — Shared tsconfig for tsdown (internal)
rollup-plugin-im-client-component/ # @stylelish/rollup-plugin-im-client-component — Auto 'use client' directive injection
vite-plugin-crush-envy/ # @stylelish/vite-plugin-crush-envy — Type-safe .env for Vite
vite-plugin-declare-type/ # @stylelish/vite-plugin-declare-type — Auto .d.ts generation
vite-plugin-react-svg/ # @stylelish/vite-plugin-react-svg — SVG as React component
```

Internal config packages are prefixed with `_` for visual grouping. All plugin packages follow the same structure:

- `src/` → source code (TypeScript)
- `dist/` → build output (tsdown)
- `eslint.config.js` → extends `@plugin-baby/eslint-config/base`
- `tsconfig.json` → extends `@plugin-baby/typescript-config/tsdown.json`

## Build System

- **tsdown** (powered by Rolldown) builds all plugin packages
- Turbo orchestrates builds with `^build` dependency graph
- Each package declares `external` in `tsdown.config.ts` for peer dependencies (e.g., `rollup`, `vite`)

## Shared Configs

- **ESLint**: Flat config using `eslint-config-stylish` + `eslint-config-stylish/typescript`, with turbo plugin and prettier integration
- **TypeScript**: `strict: true`, `verbatimModuleSyntax: true`, `module: preserve`, `moduleResolution: bundler`, target esnext
- **Prettier**: Single quotes, trailing commas, 80 print width

## Release Process

Changesets manages independent versioning per package. Each package has its own version and changelog. `access: public` in changeset config. Release workflow runs on push to `main` via GitHub Actions.

## Conventions

- Package names use creative/stylish naming (e.g., crush-envy, sexy-declare-type, im-client-component)
- All packages are pure ESM (`"type": "module"`)
- `workspace:*` for internal dependency references
- Commit messages follow conventional commits (`feat:`, `chore:`, `ci:`, `fix:`)
Public plugins publish under `@stylelish/*`; internal-only configs stay under `@plugin-baby/*` and don't publish. Directory names use the unscoped form; only `package.json` `name` carries the scope.

## Gotchas

- tsdown bundles all deps not listed in `external` of `tsdown.config.ts` — peer deps like `rollup` or `vite` must be explicitly external
- Vite may convert single quotes to double quotes in build output — idempotency checks in plugins should handle both quote styles
- Changesets support multiple packages with different bump types in a single changeset file (e.g., one package major, others patch)
- Internal config packages (`_eslint-config`, `_typescript-config`) use `_` prefix for directory sorting only — package names remain `@plugin-baby/*`
2 changes: 1 addition & 1 deletion packages/rollup-plugin-im-client-component/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# rollup-plugin-im-client-component
# @stylelish/rollup-plugin-im-client-component

## 1.0.1

Expand Down
15 changes: 11 additions & 4 deletions packages/rollup-plugin-im-client-component/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# rollup-plugin-im-client-component

> ⚠️ **Renamed from `rollup-plugin-im-client-component`.** The unscoped package is deprecated and will no longer receive updates. Update your imports:
>
> ```diff
> - import clientDirective from 'rollup-plugin-im-client-component';
> + import clientDirective from '@stylelish/rollup-plugin-im-client-component';
> ```

Let your components say `'use client'` themselves

[![npm](https://img.shields.io/npm/v/rollup-plugin-im-client-component)](https://www.npmjs.com/package/rollup-plugin-im-client-component)
[![npm](https://img.shields.io/npm/v/@stylelish/rollup-plugin-im-client-component)](https://www.npmjs.com/package/@stylelish/rollup-plugin-im-client-component)

## Features

Expand All @@ -20,7 +27,7 @@ Let your components say `'use client'` themselves
### Installation

```bash
pnpm add -D rollup-plugin-im-client-component
pnpm add -D @stylelish/rollup-plugin-im-client-component
```

## Quick Start
Expand All @@ -32,7 +39,7 @@ pnpm add -D rollup-plugin-im-client-component
```typescript
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import clientDirective from 'rollup-plugin-im-client-component';
import clientDirective from '@stylelish/rollup-plugin-im-client-component';

export default defineConfig({
build: {
Expand All @@ -55,7 +62,7 @@ export default defineConfig({
`rollup.config.js`

```typescript
import clientDirective from 'rollup-plugin-im-client-component';
import clientDirective from '@stylelish/rollup-plugin-im-client-component';

export default {
input: 'src/index.ts',
Expand Down
2 changes: 1 addition & 1 deletion packages/rollup-plugin-im-client-component/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "rollup-plugin-im-client-component",
"name": "@stylelish/rollup-plugin-im-client-component",
"version": "1.0.1",
"description": "Let your components say 'use client' themselves",
"author": "StyleList94",
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin-crush-envy/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# vite-plugin-crush-envy
# @stylelish/vite-plugin-crush-envy

## 1.0.2

Expand Down
13 changes: 10 additions & 3 deletions packages/vite-plugin-crush-envy/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# Vite Plugin Crush Envy

> ⚠️ **Renamed from `vite-plugin-crush-envy`.** The unscoped package is deprecated and will no longer receive updates. Update your imports:
>
> ```diff
> - import crushEnvy from 'vite-plugin-crush-envy';
> + import crushEnvy from '@stylelish/vite-plugin-crush-envy';
> ```

Make `.env` type-safe, finally

[![npm](https://img.shields.io/npm/v/vite-plugin-crush-envy)](https://www.npmjs.com/package/vite-plugin-crush-envy)
[![npm](https://img.shields.io/npm/v/@stylelish/vite-plugin-crush-envy)](https://www.npmjs.com/package/@stylelish/vite-plugin-crush-envy)

## Features

Expand All @@ -20,7 +27,7 @@ Make `.env` type-safe, finally
### Install

```bash
pnpm add -D vite-plugin-crush-envy
pnpm add -D @stylelish/vite-plugin-crush-envy
```

## Quick Start
Expand All @@ -31,7 +38,7 @@ pnpm add -D vite-plugin-crush-envy

```typescript
import { defineConfig } from 'vite';
import crushEnvy from 'vite-plugin-crush-envy';
import crushEnvy from '@stylelish/vite-plugin-crush-envy';

export default defineConfig({
plugins: [crushEnvy()],
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin-crush-envy/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "vite-plugin-crush-envy",
"name": "@stylelish/vite-plugin-crush-envy",
"version": "1.0.2",
"description": "Make .env type-safe, finally",
"author": "StyleList94",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# vite-plugin-sexy-declare-type
# @stylelish/vite-plugin-declare-type

## 1.0.6

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# Vite Plugin Sexy Declare Type
# Vite Plugin Declare Type

> ⚠️ **Renamed from `vite-plugin-sexy-declare-type`.** The unscoped package is deprecated and will no longer receive updates. Update your imports:
>
> ```diff
> - import sexyDeclareType from 'vite-plugin-sexy-declare-type';
> + import declareType from '@stylelish/vite-plugin-declare-type';
> ```

Zero-config TypeScript declaration file generator for Vite library mode

[![npm](https://img.shields.io/npm/v/vite-plugin-sexy-declare-type)](https://www.npmjs.com/package/vite-plugin-sexy-declare-type)
[![npm](https://img.shields.io/npm/v/@stylelish/vite-plugin-declare-type)](https://www.npmjs.com/package/@stylelish/vite-plugin-declare-type)

## Features

Expand All @@ -20,7 +27,7 @@ Zero-config TypeScript declaration file generator for Vite library mode
### Install

```bash
pnpm add -D vite-plugin-sexy-declare-type
pnpm add -D @stylelish/vite-plugin-declare-type
```

## Quick Start
Expand All @@ -31,7 +38,7 @@ pnpm add -D vite-plugin-sexy-declare-type

```typescript
import { defineConfig } from 'vite';
import sexyDeclareType from 'vite-plugin-sexy-declare-type';
import declareType from '@stylelish/vite-plugin-declare-type';

export default defineConfig({
build: {
Expand All @@ -40,7 +47,7 @@ export default defineConfig({
formats: ['es'],
},
},
plugins: [sexyDeclareType()],
plugins: [declareType()],
});
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "vite-plugin-sexy-declare-type",
"name": "@stylelish/vite-plugin-declare-type",
"version": "1.0.6",
"description": "Zero-config TypeScript declaration file generator for Vite library mode",
"author": "StyleList94",
"license": "MIT",
"homepage": "https://github.com/StyleList94/plugin-baby/tree/main/packages/vite-plugin-sexy-declare-type#readme",
"homepage": "https://github.com/StyleList94/plugin-baby/tree/main/packages/vite-plugin-declare-type#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/StyleList94/plugin-baby.git",
"directory": "packages/vite-plugin-sexy-declare-type"
"directory": "packages/vite-plugin-declare-type"
},
"bugs": {
"url": "https://github.com/StyleList94/plugin-baby/issues"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# vite-plugin-react-stylish-svg
# @stylelish/vite-plugin-react-svg

## 1.0.6

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# Vite Plugin React Stylish SVG
# Vite Plugin React SVG

> ⚠️ **Renamed from `vite-plugin-react-stylish-svg`.** The unscoped package is deprecated and will no longer receive updates. Update your imports:
>
> ```diff
> - import reactStylishSvg from 'vite-plugin-react-stylish-svg';
> + import reactSvg from '@stylelish/vite-plugin-react-svg';
> ```

Stylishly handling SVG in Vite + React

[![npm](https://img.shields.io/npm/v/vite-plugin-react-stylish-svg)](https://www.npmjs.com/package/vite-plugin-react-stylish-svg)
[![npm](https://img.shields.io/npm/v/@stylelish/vite-plugin-react-svg)](https://www.npmjs.com/package/@stylelish/vite-plugin-react-svg)

## Features

Expand All @@ -23,7 +30,7 @@ Stylishly handling SVG in Vite + React
### install

```bash
pnpm add -D vite-plugin-react-stylish-svg
pnpm add -D @stylelish/vite-plugin-react-svg
```

## Quick Start
Expand All @@ -35,10 +42,10 @@ pnpm add -D vite-plugin-react-stylish-svg
```typescript
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import reactStylishSvg from 'vite-plugin-react-stylish-svg';
import reactSvg from '@stylelish/vite-plugin-react-svg';

export default defineConfig({
plugins: [react(), reactStylishSvg()],
plugins: [react(), reactSvg()],
});
```

Expand All @@ -50,15 +57,15 @@ You can add type declarations in two ways.

```diff
/// <reference types="vite/client" />
+ /// <reference types="vite-plugin-react-stylish-svg/types" />
+ /// <reference types="@stylelish/vite-plugin-react-svg/types" />
```

or `tsconfig.json`

```json
{
"compilerOptions": {
"types": ["vite-plugin-react-stylish-svg/types"]
"types": ["@stylelish/vite-plugin-react-svg/types"]
}
}
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "vite-plugin-react-stylish-svg",
"name": "@stylelish/vite-plugin-react-svg",
"version": "1.0.6",
"description": "Stylishly handling SVG in Vite + React",
"author": "StyleList94",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/StyleList94/plugin-baby.git",
"directory": "packages/vite-plugin-react-stylish-svg"
"directory": "packages/vite-plugin-react-svg"
},
"homepage": "https://github.com/StyleList94/plugin-baby/tree/main/packages/vite-plugin-react-stylish-svg#readme",
"homepage": "https://github.com/StyleList94/plugin-baby/tree/main/packages/vite-plugin-react-svg#readme",
"bugs": {
"url": "https://github.com/StyleList94/plugin-baby/issues"
},
Expand Down
Loading