@cloudwerk/vite-plugin 0.1.2 → 0.1.3
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 +66 -0
- package/package.json +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# @cloudwerk/vite-plugin
|
|
2
|
+
|
|
3
|
+
Vite plugin for Cloudwerk file-based routing with virtual entry generation.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @cloudwerk/vite-plugin vite
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Setup
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
// vite.config.ts
|
|
15
|
+
import { defineConfig } from 'vite'
|
|
16
|
+
import cloudwerk from '@cloudwerk/vite-plugin'
|
|
17
|
+
|
|
18
|
+
export default defineConfig({
|
|
19
|
+
plugins: [
|
|
20
|
+
cloudwerk({
|
|
21
|
+
// Options (all optional)
|
|
22
|
+
appDir: 'app', // Directory containing app files
|
|
23
|
+
routesDir: 'routes', // Subdirectory for routes
|
|
24
|
+
renderer: 'hono-jsx', // 'hono-jsx' or 'react'
|
|
25
|
+
verbose: false, // Enable debug logging
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
})
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Virtual Modules
|
|
32
|
+
|
|
33
|
+
The plugin generates virtual modules for your application:
|
|
34
|
+
|
|
35
|
+
| Module | Description |
|
|
36
|
+
|--------|-------------|
|
|
37
|
+
| `virtual:cloudwerk/server-entry` | Server entry with route registration |
|
|
38
|
+
| `virtual:cloudwerk/client-entry` | Client entry for hydration |
|
|
39
|
+
| `virtual:cloudwerk/manifest` | Compiled route manifest |
|
|
40
|
+
|
|
41
|
+
Import in your code:
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
import app from 'virtual:cloudwerk/server-entry'
|
|
45
|
+
import manifest from 'virtual:cloudwerk/manifest'
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Options
|
|
49
|
+
|
|
50
|
+
| Option | Type | Default | Description |
|
|
51
|
+
|--------|------|---------|-------------|
|
|
52
|
+
| `appDir` | `string` | `'app'` | Directory containing route files |
|
|
53
|
+
| `routesDir` | `string` | `'routes'` | Subdirectory within appDir for routes |
|
|
54
|
+
| `config` | `object` | - | Override Cloudwerk configuration |
|
|
55
|
+
| `serverEntry` | `string` | - | Custom server entry file path |
|
|
56
|
+
| `clientEntry` | `string` | - | Custom client entry file path |
|
|
57
|
+
| `renderer` | `string` | `'hono-jsx'` | UI renderer (`'hono-jsx'` or `'react'`) |
|
|
58
|
+
| `verbose` | `boolean` | `false` | Enable verbose logging |
|
|
59
|
+
|
|
60
|
+
## Documentation
|
|
61
|
+
|
|
62
|
+
For full documentation, visit: https://github.com/squirrelsoft-dev/cloudwerk
|
|
63
|
+
|
|
64
|
+
## Part of Cloudwerk
|
|
65
|
+
|
|
66
|
+
This package is part of the [Cloudwerk](https://github.com/squirrelsoft-dev/cloudwerk) monorepo.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudwerk/vite-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Vite plugin for Cloudwerk file-based routing with virtual entry generation",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@swc/core": "^1.3.100",
|
|
22
|
-
"@cloudwerk/core": "^0.7.
|
|
23
|
-
"@cloudwerk/ui": "^0.7.
|
|
22
|
+
"@cloudwerk/core": "^0.7.2",
|
|
23
|
+
"@cloudwerk/ui": "^0.7.2"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"vite": "^5.0.0 || ^6.0.0",
|