create-rolldown 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/create-rolldown)
|
|
4
4
|
[](https://github.com/rolldown/create-rolldown/blob/main/LICENSE)
|
|
5
|
+
[](https://github.com/sunny-117/create-rolldown)
|
|
6
|
+
[](https://github.com/sunny-117/create-rolldown)
|
|
5
7
|
|
|
6
8
|
Scaffolding tool for [Rolldown](https://rolldown.rs) library projects - a fast JavaScript bundler written in Rust.
|
|
7
9
|
|
|
@@ -79,27 +81,6 @@ Available templates:
|
|
|
79
81
|
svelte Svelte component library
|
|
80
82
|
```
|
|
81
83
|
|
|
82
|
-
## Examples
|
|
83
|
-
|
|
84
|
-
### Create a React library (components, hooks, utilities)
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
npm create rolldown@latest my-react-lib
|
|
88
|
-
# Select "react"
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Create a utility library and start immediately
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
npm create rolldown@latest my-utils -- --template vanilla --immediate
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### Create a Vue composables library in CI/CD
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
npm create rolldown@latest my-vue-composables -- --template vue --no-interactive
|
|
101
|
-
```
|
|
102
|
-
|
|
103
84
|
## Supported Templates
|
|
104
85
|
|
|
105
86
|
| Template | Description | Use Cases | Playground |
|
|
@@ -110,64 +91,18 @@ npm create rolldown@latest my-vue-composables -- --template vue --no-interactive
|
|
|
110
91
|
| `solid` | SolidJS library with TypeScript | Solid components, primitives | ✅ Vite |
|
|
111
92
|
| `svelte` | Svelte 5 library with TypeScript | Svelte components, actions | ✅ Vite |
|
|
112
93
|
|
|
113
|
-
### Template Architecture
|
|
114
|
-
|
|
115
|
-
**Vanilla Template** - For pure TypeScript/JavaScript libraries:
|
|
116
|
-
|
|
117
|
-
```
|
|
118
|
-
your-library/
|
|
119
|
-
├── src/
|
|
120
|
-
│ └── index.ts # Main entry point
|
|
121
|
-
├── dist/ # Build output (generated)
|
|
122
|
-
├── rolldown.config.ts
|
|
123
|
-
├── tsconfig.json
|
|
124
|
-
└── package.json
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
**Framework Templates** (React, Vue, Solid, Svelte) - For framework-specific libraries:
|
|
128
|
-
|
|
129
|
-
```
|
|
130
|
-
your-library/
|
|
131
|
-
├── src/ # Component library source code
|
|
132
|
-
│ ├── index.ts # Main entry point (exports)
|
|
133
|
-
│ └── MyButton.* # Example component
|
|
134
|
-
├── playground/ # Development playground (Vite)
|
|
135
|
-
│ ├── src/
|
|
136
|
-
│ │ ├── App.* # Playground app
|
|
137
|
-
│ │ ├── index.* # Playground entry
|
|
138
|
-
│ │ └── style.css # Playground styles
|
|
139
|
-
│ ├── index.html
|
|
140
|
-
│ └── public/
|
|
141
|
-
├── dist/ # Build output (generated)
|
|
142
|
-
├── rolldown.config.js # Rolldown configuration
|
|
143
|
-
├── vite.config.ts # Vite configuration (for playground)
|
|
144
|
-
├── tsconfig.json
|
|
145
|
-
├── package.json
|
|
146
|
-
└── README.md
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
**Key Features:**
|
|
150
|
-
|
|
151
|
-
- `src/` - Your library source code (built with Rolldown)
|
|
152
|
-
- `playground/` - Development environment (powered by Vite with HMR)
|
|
153
|
-
- `npm run build` - Build library with Rolldown
|
|
154
|
-
- `npm run dev` - Watch mode for library development
|
|
155
|
-
- `npm run play` - Start Vite playground for testing your library
|
|
156
|
-
- Ready for npm publishing with proper exports configuration
|
|
157
|
-
- Perfect for component libraries, utility libraries, hooks, composables, and more
|
|
158
|
-
|
|
159
94
|
## Development
|
|
160
95
|
|
|
161
96
|
### Prerequisites
|
|
162
97
|
|
|
163
98
|
- Node.js 20.19.0+ or 22.12.0+
|
|
164
|
-
- pnpm (recommended)
|
|
99
|
+
- pnpm (recommended)
|
|
165
100
|
|
|
166
101
|
### Setup
|
|
167
102
|
|
|
168
103
|
```bash
|
|
169
104
|
# Clone the repository
|
|
170
|
-
git clone https://github.com/
|
|
105
|
+
git clone https://github.com/Sunny-117/create-rolldown.git
|
|
171
106
|
cd create-rolldown
|
|
172
107
|
|
|
173
108
|
# Install dependencies
|
|
@@ -185,6 +120,9 @@ pnpm test
|
|
|
185
120
|
# Run tests in watch mode
|
|
186
121
|
pnpm test:watch
|
|
187
122
|
|
|
123
|
+
# Generate test coverage report
|
|
124
|
+
pnpm test:coverage
|
|
125
|
+
|
|
188
126
|
# Type checking
|
|
189
127
|
pnpm typecheck
|
|
190
128
|
|
|
@@ -198,51 +136,6 @@ pnpm format
|
|
|
198
136
|
pnpm format:check
|
|
199
137
|
```
|
|
200
138
|
|
|
201
|
-
### Project Structure
|
|
202
|
-
|
|
203
|
-
```
|
|
204
|
-
create-rolldown/
|
|
205
|
-
├── src/
|
|
206
|
-
│ ├── cli.ts # Main CLI entry point
|
|
207
|
-
│ └── utils/ # Utility modules
|
|
208
|
-
│ ├── args.ts # Argument parsing
|
|
209
|
-
│ ├── command.ts # Command execution
|
|
210
|
-
│ ├── constants.ts # Framework definitions
|
|
211
|
-
│ ├── file.ts # File operations
|
|
212
|
-
│ ├── package-manager.ts # Package manager detection
|
|
213
|
-
│ ├── prompts.ts # Interactive prompts
|
|
214
|
-
│ ├── types.ts # TypeScript types
|
|
215
|
-
│ └── validation.ts # Input validation
|
|
216
|
-
├── __tests__/
|
|
217
|
-
│ └── cli.spec.ts # Integration tests
|
|
218
|
-
├── template-vanilla/ # Vanilla TS template
|
|
219
|
-
├── template-react/ # React template
|
|
220
|
-
├── template-vue/ # Vue template
|
|
221
|
-
├── template-solid/ # Solid template
|
|
222
|
-
├── template-svelte/ # Svelte template
|
|
223
|
-
├── index.js # CLI entry point
|
|
224
|
-
├── package.json
|
|
225
|
-
└── tsconfig.json
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
### Testing
|
|
229
|
-
|
|
230
|
-
The project uses a comprehensive testing strategy:
|
|
231
|
-
|
|
232
|
-
- **Unit Tests**: Test specific functions and edge cases
|
|
233
|
-
- **Property-Based Tests**: Test universal properties across many inputs using [fast-check](https://github.com/dubzzz/fast-check)
|
|
234
|
-
- **Integration Tests**: Test complete CLI workflows
|
|
235
|
-
|
|
236
|
-
Run tests:
|
|
237
|
-
|
|
238
|
-
```bash
|
|
239
|
-
# Run all tests once
|
|
240
|
-
pnpm test
|
|
241
|
-
|
|
242
|
-
# Run tests in watch mode
|
|
243
|
-
pnpm test:watch
|
|
244
|
-
```
|
|
245
|
-
|
|
246
139
|
### Adding a New Template
|
|
247
140
|
|
|
248
141
|
1. Create a new directory: `template-{framework}` (e.g., `template-preact`)
|
|
@@ -269,10 +162,6 @@ pnpm test:watch
|
|
|
269
162
|
6. **Update files** (package.json name, metadata)
|
|
270
163
|
7. **Optionally install dependencies** and start playground
|
|
271
164
|
|
|
272
|
-
## Requirements
|
|
273
|
-
|
|
274
|
-
- Node.js ^20.19.0 || >=22.12.0
|
|
275
|
-
|
|
276
165
|
## Contributing
|
|
277
166
|
|
|
278
167
|
Contributions are welcome! Please feel free to submit a Pull Request.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-rolldown",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Scaffolding tool for Rolldown projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bundler",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"typecheck": "tsc --noEmit",
|
|
38
38
|
"test": "vitest --run",
|
|
39
39
|
"test:watch": "vitest",
|
|
40
|
+
"test:coverage": "vitest --run --coverage",
|
|
40
41
|
"lint": "oxlint",
|
|
41
42
|
"format": "oxfmt",
|
|
42
43
|
"format:check": "oxfmt --check",
|
|
@@ -55,6 +56,7 @@
|
|
|
55
56
|
"@types/cross-spawn": "^6.0.6",
|
|
56
57
|
"@types/mri": "^1.1.5",
|
|
57
58
|
"@types/node": "^20.11.0",
|
|
59
|
+
"@vitest/coverage-v8": "^1.6.1",
|
|
58
60
|
"changelogen": "^0.6.2",
|
|
59
61
|
"execa": "^9.0.0",
|
|
60
62
|
"fast-check": "^3.15.0",
|
|
@@ -5,14 +5,14 @@ export function App() {
|
|
|
5
5
|
<>
|
|
6
6
|
<div>
|
|
7
7
|
<a href="https://rolldown.rs" target="_blank" rel="noopener noreferrer">
|
|
8
|
-
<img src="/rolldown.svg"
|
|
8
|
+
<img src="/rolldown.svg" className="logo" alt="Rolldown logo" />
|
|
9
9
|
</a>
|
|
10
10
|
</div>
|
|
11
11
|
<h1>Rolldown + React</h1>
|
|
12
|
-
<div
|
|
12
|
+
<div className="card">
|
|
13
13
|
<MyButton />
|
|
14
14
|
</div>
|
|
15
|
-
<p
|
|
15
|
+
<p className="read-the-docs">Click on the Rolldown logo to learn more</p>
|
|
16
16
|
</>
|
|
17
17
|
);
|
|
18
18
|
}
|
|
@@ -5,14 +5,14 @@ export function App() {
|
|
|
5
5
|
<>
|
|
6
6
|
<div>
|
|
7
7
|
<a href="https://rolldown.rs" target="_blank" rel="noopener noreferrer">
|
|
8
|
-
<img src="/rolldown.svg"
|
|
8
|
+
<img src="/rolldown.svg" className="logo" alt="Rolldown logo" />
|
|
9
9
|
</a>
|
|
10
10
|
</div>
|
|
11
11
|
<h1>Rolldown + SolidJS</h1>
|
|
12
|
-
<div
|
|
12
|
+
<div className="card">
|
|
13
13
|
<MyButton />
|
|
14
14
|
</div>
|
|
15
|
-
<p
|
|
15
|
+
<p className="read-the-docs">Click on the Rolldown logo to learn more</p>
|
|
16
16
|
</>
|
|
17
17
|
);
|
|
18
18
|
}
|