@openworkers/adapter-sveltekit 0.5.2 → 0.5.4

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
@@ -17,8 +17,8 @@ import adapter from '@openworkers/adapter-sveltekit';
17
17
  export default {
18
18
  kit: {
19
19
  adapter: adapter({
20
- out: 'dist', // Output directory (default: 'dist')
21
- functions: false // Generate mini-workers for API routes (default: false)
20
+ outDir: 'build', // Output directory (default: 'build')
21
+ functions: true // Generate mini-workers for API routes (default: false)
22
22
  })
23
23
  }
24
24
  };
@@ -26,15 +26,16 @@ export default {
26
26
 
27
27
  ## Options
28
28
 
29
- | Option | Type | Default | Description |
30
- | ----------- | --------- | -------- | ------------------------------------------------- |
31
- | `out` | `string` | `'dist'` | Output directory for the build |
32
- | `functions` | `boolean` | `false` | Generate separate mini-workers for each API route |
29
+ | Option | Type | Default | Description |
30
+ | ------------ | --------- | --------- | ------------------------------------------------- |
31
+ | `outDir` | `string` | `'build'` | Output directory for the build |
32
+ | `functions` | `boolean` | `false` | Generate separate mini-workers for each API route |
33
+ | `nodeCompat` | `boolean` | `false` | Include shims for Node.js built-in modules |
33
34
 
34
35
  ## Output
35
36
 
36
37
  ```
37
- dist/
38
+ build/
38
39
  ├── _worker.js # Main SSR worker
39
40
  ├── _routes.json # Route manifest for edge routing
40
41
  ├── assets/ # Static assets and prerendered pages
@@ -99,7 +100,7 @@ Build your SvelteKit app, then deploy it with the [OpenWorkers CLI](https://gith
99
100
  bun run build
100
101
 
101
102
  # Deploy
102
- ow workers upload my-app ./dist
103
+ ow workers upload my-app ./build
103
104
  ```
104
105
 
105
106
  For a first deployment, you'll need to set up the worker and its assets binding:
@@ -119,7 +120,7 @@ ow env bind my-app-env ASSETS my-storage --type assets
119
120
  ow workers link my-app my-app-env
120
121
  # Build and upload
121
122
  bun run build
122
- ow workers upload my-app ./dist
123
+ ow workers upload my-app ./build
123
124
  ```
124
125
 
125
126
  ## Examples
package/dist/index.d.ts CHANGED
@@ -3,16 +3,33 @@ import { Adapter } from '@sveltejs/kit';
3
3
  export interface AdapterOptions {
4
4
  /**
5
5
  * Output directory for the build
6
- * @default 'dist'
6
+ * @default 'build'
7
7
  */
8
- out?: string;
8
+ outDir?: string;
9
9
 
10
10
  /**
11
11
  * Generate separate mini-workers for each API route.
12
- * Outputs to `dist/functions/` with routing info in `routes.js`.
12
+ * Outputs to `build/functions/` with routing info in `routes.js`.
13
13
  * @default false
14
14
  */
15
15
  functions?: boolean;
16
+
17
+ /**
18
+ * Include shims for Node.js built-in modules (e.g. `path`, `fs`, `url`) to improve compatibility with existing npm packages.
19
+ * Note: This may increase bundle size and is not necessary for all packages.
20
+ * @default false
21
+ */
22
+ nodeCompat?: boolean;
23
+
24
+ /**
25
+ * Debug options for generated worker files.
26
+ */
27
+ debug?: {
28
+ /** Emit source maps alongside worker files */
29
+ sourcemap?: boolean;
30
+ /** Format output with Prettier for readability */
31
+ prettier?: boolean;
32
+ };
16
33
  }
17
34
 
18
35
  export default function plugin(options?: AdapterOptions): Adapter;