You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+44-54Lines changed: 44 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,18 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
6
6
7
7
Microbundle is a zero-configuration bundler for tiny JavaScript libraries, powered by Rollup. It takes source code and produces multiple output formats (modern ES modules, CommonJS, UMD) with minimal setup.
8
8
9
+
## Quick Reference
10
+
11
+
```bash
12
+
npm run build # Full build (Babel + self-build)
13
+
npm test# Lint + build + tests
14
+
npm run jest # Tests only
15
+
npm run lint # ESLint
16
+
npm run format # Prettier
17
+
npm run changeset # Create changelog entry
18
+
npm run release # Publish (prepare + test + changeset publish)
19
+
```
20
+
9
21
## Development Commands
10
22
11
23
### Building
@@ -28,42 +40,12 @@ Microbundle is a zero-configuration bundler for tiny JavaScript libraries, power
28
40
29
41
### Changesets and Versioning
30
42
31
-
This project uses [@changesets/cli](https://github.com/changesets/changesets) to track notable changes and generate changelogs.
32
-
33
-
#### Creating a Changeset
34
-
35
-
When making a change that should be documented in the changelog:
36
-
37
-
```bash
38
-
npm run changeset
39
-
```
40
-
41
-
This will:
42
-
43
-
1. Prompt you to select the type of change (major, minor, or patch)
44
-
2. Ask you to describe the change
45
-
3. Create a markdown file in `.changeset/` with a randomly generated name
46
-
47
-
#### Changeset Configuration
48
-
49
-
-**Changelog Format**: Uses `@changesets/changelog-github` to generate GitHub-flavored changelogs
50
-
-**Base Branch**: `master` (configured in .changeset/config.json:10)
51
-
-**Access**: Public (for npm publishing)
52
-
-**Commit Mode**: Changesets are not automatically committed (commit: false)
43
+
This project uses [@changesets/cli](https://github.com/changesets/changesets) for changelog management.
53
44
54
-
#### Changeset File Format
55
-
56
-
Changeset files in `.changeset/` follow this format:
57
-
58
-
```markdown
59
-
---
60
-
"microbundle": patch
61
-
---
62
-
63
-
Description of the change
64
-
```
65
-
66
-
The version bump type can be: `major`, `minor`, or `patch`
45
+
-`npm run changeset` - Create a new changeset (prompts for type: major/minor/patch)
46
+
-`npm run release` - Full release: prepare + test + changeset publish
47
+
- Base branch: `master`
48
+
- Changesets are not auto-committed
67
49
68
50
### Running Tests
69
51
@@ -74,6 +56,16 @@ npm run jest -- --testNamePattern="build shebang"
74
56
npm run jest -- test/index.test.js
75
57
```
76
58
59
+
## Code Style
60
+
61
+
This project uses Prettier with:
62
+
-**Tabs** for indentation (not spaces)
63
+
-**Single quotes** for strings
64
+
-**Trailing commas** in multi-line structures
65
+
-**No parens** around single arrow function parameters
66
+
67
+
ESLint extends `eslint-config-developit` with Prettier integration.
68
+
77
69
## Architecture
78
70
79
71
### Entry Points
@@ -84,24 +76,24 @@ npm run jest -- test/index.test.js
84
76
85
77
### Core Build Flow
86
78
87
-
1.**Input Resolution** (`getInput()` in src/index.js:205)
79
+
1.**Input Resolution** (`getInput()` in src/index.js)
88
80
89
81
- Resolves entry files from CLI args, `source` field in package.json, or defaults (src/index.js, index.js)
90
82
- Supports glob patterns for multiple entries
91
83
- Handles TypeScript (.ts/.tsx) and JavaScript files
92
84
93
-
2.**Output Resolution** (`getOutput()` in src/index.js:227)
85
+
2.**Output Resolution** (`getOutput()` in src/index.js)
94
86
95
87
- Determines output location from CLI args or package.json `main` field
96
88
- Defaults to dist/ directory
97
89
98
-
3.**Format Generation** (`getMain()` in src/index.js:278)
90
+
3.**Format Generation** (`getMain()` in src/index.js)
99
91
100
92
- Maps each format (modern, es, cjs, umd) to appropriate output filenames
101
93
- Reads from package.json fields: `module`, `main`, `exports`, `unpkg`, etc.
102
94
- Respects `{"type":"module"}` for ES Module packages
103
95
104
-
4.**Configuration Creation** (`createConfig()` in src/index.js:327)
96
+
4.**Configuration Creation** (`createConfig()` in src/index.js)
105
97
106
98
- Creates Rollup configuration for each entry/format combination
107
99
- Configures plugins: Babel, TypeScript, PostCSS, Terser, etc.
@@ -130,37 +122,35 @@ npm run jest -- test/index.test.js
0 commit comments