@devup-ui/bun-plugin 1.0.0
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 +140 -0
- package/dist/index.cjs +0 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +0 -0
- package/dist/plugin.d.ts +2 -0
- package/dist/plugin.d.ts.map +1 -0
- package/package.json +53 -0
package/README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/dev-five-git/devup-ui/main/media/logo.svg" alt="Devup UI logo" width="300" />
|
|
3
|
+
</div>
|
|
4
|
+
|
|
5
|
+
<h3 align="center">
|
|
6
|
+
Zero Config, Zero FOUC, Zero Runtime, CSS in JS Preprocessor for Bun
|
|
7
|
+
</h3>
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<div>
|
|
12
|
+
<img src='https://img.shields.io/npm/v/@devup-ui/bun-plugin'>
|
|
13
|
+
<img alt="Apache-2.0 License" src="https://img.shields.io/github/license/dev-five-git/devup-ui"/>
|
|
14
|
+
<a href="https://www.npmjs.com/package/@devup-ui/bun-plugin">
|
|
15
|
+
<img alt="NPM Downloads" src="https://img.shields.io/npm/dm/@devup-ui/bun-plugin.svg?style=flat"/>
|
|
16
|
+
</a>
|
|
17
|
+
<a href="https://badgen.net/github/stars/dev-five-git/devup-ui">
|
|
18
|
+
<img alt="Github Stars" src="https://badgen.net/github/stars/dev-five-git/devup-ui" />
|
|
19
|
+
</a>
|
|
20
|
+
<a href="https://discord.gg/8zjcGc7cWh">
|
|
21
|
+
<img alt="Discord" src="https://img.shields.io/discord/1321362173619994644.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2" />
|
|
22
|
+
</a>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
bun add @devup-ui/react @devup-ui/bun-plugin
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
### With Bun.build()
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { DevupUI, getDevupDefine } from '@devup-ui/bun-plugin'
|
|
39
|
+
|
|
40
|
+
await Bun.build({
|
|
41
|
+
entrypoints: ['./src/index.tsx'],
|
|
42
|
+
outdir: './dist',
|
|
43
|
+
plugins: [DevupUI()],
|
|
44
|
+
define: getDevupDefine(),
|
|
45
|
+
})
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Configuration Options
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
import { DevupUI } from '@devup-ui/bun-plugin'
|
|
52
|
+
|
|
53
|
+
DevupUI({
|
|
54
|
+
// Package to import components from (default: '@devup-ui/react')
|
|
55
|
+
package: '@devup-ui/react',
|
|
56
|
+
|
|
57
|
+
// CSS directory path (default: 'df/devup-ui')
|
|
58
|
+
cssDir: 'df/devup-ui',
|
|
59
|
+
|
|
60
|
+
// Theme configuration file path (default: 'devup.json')
|
|
61
|
+
devupFile: 'devup.json',
|
|
62
|
+
|
|
63
|
+
// Distribution directory for generated files (default: 'df')
|
|
64
|
+
distDir: 'df',
|
|
65
|
+
|
|
66
|
+
// Enable CSS extraction and transformation (default: true)
|
|
67
|
+
extractCss: true,
|
|
68
|
+
|
|
69
|
+
// Enable debug logging (default: false)
|
|
70
|
+
debug: false,
|
|
71
|
+
|
|
72
|
+
// Additional packages to include in processing (default: [])
|
|
73
|
+
include: [],
|
|
74
|
+
|
|
75
|
+
// Merge all CSS into single file (default: false)
|
|
76
|
+
singleCss: false,
|
|
77
|
+
|
|
78
|
+
// CSS class name prefix (default: undefined)
|
|
79
|
+
prefix: 'my-prefix',
|
|
80
|
+
})
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Features
|
|
84
|
+
|
|
85
|
+
- Zero Config
|
|
86
|
+
- Zero FOUC (Flash of Unstyled Content)
|
|
87
|
+
- Zero Runtime
|
|
88
|
+
- Full Bun bundler integration
|
|
89
|
+
- TypeScript support with generated theme types
|
|
90
|
+
- CSS extraction at build time
|
|
91
|
+
|
|
92
|
+
## Theme Configuration
|
|
93
|
+
|
|
94
|
+
Create a `devup.json` file in your project root:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"theme": {
|
|
99
|
+
"colors": {
|
|
100
|
+
"default": {
|
|
101
|
+
"text": "#000",
|
|
102
|
+
"background": "#fff"
|
|
103
|
+
},
|
|
104
|
+
"dark": {
|
|
105
|
+
"text": "#fff",
|
|
106
|
+
"background": "#000"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The plugin will generate `df/theme.d.ts` with TypeScript types for your theme.
|
|
114
|
+
|
|
115
|
+
## How It Works
|
|
116
|
+
|
|
117
|
+
The plugin transforms your JSX/TSX code at build time:
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
// Before
|
|
121
|
+
<Box bg="red" color="$text" />
|
|
122
|
+
|
|
123
|
+
// After
|
|
124
|
+
<div className="d0 d1" />
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Generated CSS:
|
|
128
|
+
|
|
129
|
+
```css
|
|
130
|
+
.d0 {
|
|
131
|
+
background-color: red;
|
|
132
|
+
}
|
|
133
|
+
.d1 {
|
|
134
|
+
color: var(--text);
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
Apache-2.0
|
package/dist/index.cjs
ADDED
|
File without changes
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,CAAA"}
|
package/dist/index.mjs
ADDED
|
File without changes
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@devup-ui/bun-plugin",
|
|
3
|
+
"description": "Zero Config, Zero FOUC, Zero Runtime, CSS in JS Preprocessor for Bun",
|
|
4
|
+
"repository": "https://github.com/dev-five-git/devup-ui",
|
|
5
|
+
"author": "devfive",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"homepage": "https://devup-ui.com",
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "https://github.com/dev-five-git/devup-ui/issues",
|
|
10
|
+
"email": "contact@devfive.kr"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"css",
|
|
14
|
+
"css-in-js",
|
|
15
|
+
"css-in-js-preprocessor",
|
|
16
|
+
"css-in-js-framework",
|
|
17
|
+
"react",
|
|
18
|
+
"bun"
|
|
19
|
+
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"version": "1.0.0",
|
|
22
|
+
"scripts": {
|
|
23
|
+
"lint": "eslint",
|
|
24
|
+
"build": "tsc && bun build --target node src/index.ts --production --outfile dist/index.cjs --format cjs --packages external && bun build --target node src/index.ts --production --outfile dist/index.mjs --format esm --packages external"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"sideEffects": false,
|
|
30
|
+
"main": "./dist/index.cjs",
|
|
31
|
+
"module": "./dist/index.mjs",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.mjs",
|
|
37
|
+
"require": "./dist/index.cjs"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist"
|
|
42
|
+
],
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@devup-ui/wasm": "^1.0.55"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/bun": "latest",
|
|
48
|
+
"typescript": "^5.9.3"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@devup-ui/wasm": "*"
|
|
52
|
+
}
|
|
53
|
+
}
|