bunki 0.1.1 → 0.1.2
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 +19 -12
- package/package.json +11 -3
package/README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/kahwee/bunki/blob/main/LICENSE)
|
|
4
4
|
[](https://github.com/kahwee/bunki/issues)
|
|
5
|
+
[](https://coveralls.io/github/kahwee/bunki?branch=main)
|
|
5
6
|
|
|
6
7
|
Bunki is an opinionated static site generator built with Bun. It's designed for creating blogs and simple websites with sensible defaults and minimal configuration.
|
|
7
8
|
|
|
@@ -22,6 +23,7 @@ Bunki is an opinionated static site generator built with Bun. It's designed for
|
|
|
22
23
|
> **IMPORTANT**: Bunki requires Bun v1.2.11 or later as its runtime. It is not compatible with Node.js and will not work with npm, yarn, or pnpm.
|
|
23
24
|
|
|
24
25
|
### Prerequisites
|
|
26
|
+
|
|
25
27
|
```bash
|
|
26
28
|
# Install Bun if you don't have it
|
|
27
29
|
curl -fsSL https://bun.sh/install | bash
|
|
@@ -31,6 +33,7 @@ bun --version
|
|
|
31
33
|
```
|
|
32
34
|
|
|
33
35
|
### From npm (Coming soon)
|
|
36
|
+
|
|
34
37
|
```bash
|
|
35
38
|
# Install globally
|
|
36
39
|
bun install -g bunki
|
|
@@ -40,6 +43,7 @@ bun install bunki
|
|
|
40
43
|
```
|
|
41
44
|
|
|
42
45
|
### From GitHub
|
|
46
|
+
|
|
43
47
|
```bash
|
|
44
48
|
# Clone the repository
|
|
45
49
|
git clone git@github.com:kahwee/bunki.git
|
|
@@ -65,6 +69,7 @@ bunki init
|
|
|
65
69
|
```
|
|
66
70
|
|
|
67
71
|
This will:
|
|
72
|
+
|
|
68
73
|
- Create a default configuration file (`bunki.config.json`)
|
|
69
74
|
- Set up the required directory structure
|
|
70
75
|
- Create default templates
|
|
@@ -77,7 +82,7 @@ Create markdown files in the `content` directory with frontmatter:
|
|
|
77
82
|
```markdown
|
|
78
83
|
---
|
|
79
84
|
title: Your Post Title
|
|
80
|
-
date:
|
|
85
|
+
date: 2025-01-01T12:00:00Z
|
|
81
86
|
tags: [tag1, tag2]
|
|
82
87
|
---
|
|
83
88
|
|
|
@@ -228,25 +233,25 @@ Options:
|
|
|
228
233
|
You can also use Bunki programmatically in your own Bun scripts:
|
|
229
234
|
|
|
230
235
|
```javascript
|
|
231
|
-
import { SiteGenerator, loadConfig } from
|
|
232
|
-
import path from
|
|
236
|
+
import { SiteGenerator, loadConfig } from "bunki";
|
|
237
|
+
import path from "path";
|
|
233
238
|
|
|
234
239
|
// Load configuration
|
|
235
|
-
const config = loadConfig(
|
|
240
|
+
const config = loadConfig("bunki.config.json");
|
|
236
241
|
|
|
237
242
|
// Create a generator
|
|
238
243
|
const generator = new SiteGenerator({
|
|
239
|
-
contentDir: path.join(process.cwd(),
|
|
240
|
-
outputDir: path.join(process.cwd(),
|
|
241
|
-
templatesDir: path.join(process.cwd(),
|
|
242
|
-
config
|
|
244
|
+
contentDir: path.join(process.cwd(), "content"),
|
|
245
|
+
outputDir: path.join(process.cwd(), "dist"),
|
|
246
|
+
templatesDir: path.join(process.cwd(), "templates"),
|
|
247
|
+
config,
|
|
243
248
|
});
|
|
244
249
|
|
|
245
250
|
// Generate site
|
|
246
251
|
async function generate() {
|
|
247
252
|
await generator.initialize();
|
|
248
253
|
await generator.generate();
|
|
249
|
-
console.log(
|
|
254
|
+
console.log("Site generation complete!");
|
|
250
255
|
}
|
|
251
256
|
|
|
252
257
|
generate().catch(console.error);
|
|
@@ -272,9 +277,11 @@ bun test utils/markdown
|
|
|
272
277
|
bun test --watch
|
|
273
278
|
|
|
274
279
|
# Run tests with coverage
|
|
275
|
-
bun test
|
|
280
|
+
bun test:coverage
|
|
276
281
|
```
|
|
277
282
|
|
|
283
|
+
Code coverage reports are automatically generated and displayed on GitHub through a badge at the top of this README. You can also view detailed coverage reports on [Coveralls](https://coveralls.io/github/kahwee/bunki).
|
|
284
|
+
|
|
278
285
|
Tests are written using Bun's native test runner and verify all core functionality of Bunki, including:
|
|
279
286
|
|
|
280
287
|
- Site generation process
|
|
@@ -293,7 +300,7 @@ The fixture directory includes:
|
|
|
293
300
|
fixtures/
|
|
294
301
|
├── bunki.config.json # Test configuration file
|
|
295
302
|
├── content/ # Sample markdown content
|
|
296
|
-
│ └──
|
|
303
|
+
│ └── 2025/
|
|
297
304
|
│ ├── test-post-1.md
|
|
298
305
|
│ ├── performance-optimization.md
|
|
299
306
|
│ └── migrating-from-gatsby.md
|
|
@@ -311,4 +318,4 @@ You can use these fixtures as examples for your own Bunki projects.
|
|
|
311
318
|
|
|
312
319
|
## License
|
|
313
320
|
|
|
314
|
-
MIT
|
|
321
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bunki",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "An opinionated static site generator built with Bun",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
"build": "bun build.js",
|
|
11
11
|
"dev": "bun run --watch src/index.ts",
|
|
12
12
|
"test": "bun test",
|
|
13
|
-
"
|
|
13
|
+
"test:coverage": "bun test --coverage --coverage-reporter=lcov",
|
|
14
|
+
"format": "prettier --write .",
|
|
15
|
+
"prepare": "husky",
|
|
16
|
+
"lint-staged": "lint-staged"
|
|
14
17
|
},
|
|
15
18
|
"bin": {
|
|
16
19
|
"bunki": "./dist/cli.js"
|
|
@@ -49,6 +52,8 @@
|
|
|
49
52
|
"@types/nunjucks": "^3.2.5",
|
|
50
53
|
"@types/sanitize-html": "^2.9.5",
|
|
51
54
|
"bun-types": "^1.2.11",
|
|
55
|
+
"husky": "^9.1.7",
|
|
56
|
+
"lint-staged": "^15.5.1",
|
|
52
57
|
"prettier": "^3.1.0",
|
|
53
58
|
"typescript": "^5.2.2"
|
|
54
59
|
},
|
|
@@ -60,5 +65,8 @@
|
|
|
60
65
|
"engines": {
|
|
61
66
|
"bun": ">=1.2.11"
|
|
62
67
|
},
|
|
63
|
-
"engineStrict": true
|
|
68
|
+
"engineStrict": true,
|
|
69
|
+
"lint-staged": {
|
|
70
|
+
"**/*": "prettier --write --ignore-unknown"
|
|
71
|
+
}
|
|
64
72
|
}
|