devflare 1.0.0-next.11 → 1.0.0-next.13

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.
Files changed (39) hide show
  1. package/LLM.md +67 -73
  2. package/README.md +11 -9
  3. package/dist/{build-ezksv2dd.js → build-e6kgjwr8.js} +39 -10
  4. package/dist/bundler/do-bundler.d.ts.map +1 -1
  5. package/dist/bundler/index.d.ts +1 -0
  6. package/dist/bundler/index.d.ts.map +1 -1
  7. package/dist/bundler/worker-bundler.d.ts +14 -0
  8. package/dist/bundler/worker-bundler.d.ts.map +1 -0
  9. package/dist/cli/commands/build.d.ts.map +1 -1
  10. package/dist/cli/commands/deploy.d.ts.map +1 -1
  11. package/dist/cli/commands/dev.d.ts.map +1 -1
  12. package/dist/config/compiler.d.ts.map +1 -1
  13. package/dist/config/index.d.ts +1 -0
  14. package/dist/config/index.d.ts.map +1 -1
  15. package/dist/config/resolve.d.ts +3 -0
  16. package/dist/config/resolve.d.ts.map +1 -0
  17. package/dist/{deploy-jdpy21t6.js → deploy-eeaqwxaa.js} +39 -10
  18. package/dist/{dev-9mq7zhww.js → dev-mqsffeeb.js} +64 -461
  19. package/dist/dev-server/server.d.ts.map +1 -1
  20. package/dist/{index-xqfbd9fx.js → index-8x16kn47.js} +4 -4
  21. package/dist/index-nb0bqtx7.js +625 -0
  22. package/dist/{index-51s1hkw4.js → index-rfhx0yd5.js} +10 -6
  23. package/dist/index-zbvmtcn2.js +795 -0
  24. package/dist/src/browser.js +1 -1
  25. package/dist/src/cli/index.js +1 -1
  26. package/dist/src/index.js +10 -11
  27. package/dist/src/sveltekit/index.js +2 -3
  28. package/dist/src/test/index.js +4 -5
  29. package/dist/src/vite/index.js +19 -399
  30. package/dist/{types-nq5acrwh.js → types-sffr9681.js} +5 -6
  31. package/dist/vite/config-file.d.ts +25 -0
  32. package/dist/vite/config-file.d.ts.map +1 -0
  33. package/dist/vite/index.d.ts +1 -0
  34. package/dist/vite/index.d.ts.map +1 -1
  35. package/dist/worker-entry/composed-worker.d.ts.map +1 -1
  36. package/package.json +1 -1
  37. package/dist/index-k7r18na8.js +0 -0
  38. package/dist/index-ws68xvq2.js +0 -311
  39. package/dist/{index-53xcakh8.js → index-0kzg8wed.js} +3 -3
package/LLM.md CHANGED
@@ -113,8 +113,8 @@ Devflare is not a replacement runtime. It is a higher-level developer system tha
113
113
 
114
114
  The shortest truthful mental model is:
115
115
 
116
- - **Vite** is the optional outer app/framework host. Devflare plugs into it only when the current package has a local `vite.config.*`.
117
- - **Rolldown** is the inner builder Devflare uses when Devflare itself needs to transform Worker source into runnable Worker modules. Today that shows up most clearly in the Durable Object bundler and its watch/rebuild loop.
116
+ - **Vite** is the optional outer app/framework host. Devflare runs it when the current package has a local `vite.config.*` or a non-empty `config.vite`, and Devflare merges that config into the actual Vite config it executes.
117
+ - **Rolldown** is the inner builder Devflare uses when Devflare itself needs to transform Worker source into runnable Worker modules. Today that covers worker-only main-worker bundles and Durable Object bundles.
118
118
 
119
119
  ### Authoring model
120
120
 
@@ -530,8 +530,8 @@ Secondary keys:
530
530
  | `assets` | static asset config |
531
531
  | `limits` | worker limits |
532
532
  | `wsRoutes` | local WebSocket proxy rules for dev |
533
- | `vite` | Devflare Vite metadata |
534
- | `rolldown` | Durable Object bundler options |
533
+ | `vite` | inline Vite config for Devflare-run Vite flows |
534
+ | `rolldown` | Devflare-owned Worker bundler options |
535
535
  | `wrangler.passthrough` | raw Wrangler overrides after compile |
536
536
 
537
537
  ### Complete config property reference
@@ -557,8 +557,8 @@ Treat this as the exhaustive property checklist for `defineConfig({...})`. The l
557
557
  | `limits` | `{ cpu_ms?: number }` | no | Worker execution limits compiled into Wrangler `limits`. |
558
558
  | `observability` | `{ enabled?: boolean; head_sampling_rate?: number }` | no | Workers observability and sampling config compiled into Wrangler `observability`. |
559
559
  | `migrations` | `Migration[]` | no | Durable Object migration history compiled into Wrangler `migrations`. |
560
- | `rolldown` | object | no | Rolldown builder configuration for Devflare's own code-transformation path, currently focused on Durable Object workers. This is not a replacement for `vite.config.*`. |
561
- | `vite` | object | no | Devflare-owned Vite metadata namespace. Raw Vite server/build/resolve config still belongs in local `vite.config.*`. |
560
+ | `rolldown` | object | no | Rolldown builder configuration for Devflare's own code-transformation path across worker-only main-worker bundles and Durable Object bundles. This is not a replacement for the main Vite app build. |
561
+ | `vite` | object | no | Inline Vite config merged into the actual Vite config Devflare runs. A local `vite.config.*` remains optional and is merged first when present. |
562
562
  | `env` | `Record<string, EnvOverride>` | no | Named environment overlays merged into the base config before compile/build/deploy. |
563
563
  | `wrangler` | `{ passthrough?: Record<string, unknown> }` | no | Escape hatch for unsupported Wrangler keys, merged after native Devflare compile. |
564
564
  | `build` | object | legacy | Deprecated alias normalized into `rolldown`. Keep accepting it for compatibility; teach `rolldown` in new docs. |
@@ -674,36 +674,37 @@ Each migration object has this shape:
674
674
 
675
675
  #### `rolldown`
676
676
 
677
- `rolldown` config applies to Devflare's Durable Object bundler.
677
+ `rolldown` config applies to Devflare's own Worker bundling outputs.
678
678
 
679
679
  | Key | Shape | Current behavior |
680
680
  |---|---|---|
681
- | `target` | `string` | Bundle target for emitted DO bundles |
682
- | `minify` | `boolean` | Minify DO bundles |
683
- | `sourcemap` | `boolean` | Emit source maps for DO bundles |
681
+ | `target` | `string` | Bundle target for emitted Devflare-owned Worker bundles |
682
+ | `minify` | `boolean` | Minify Devflare-owned Worker bundles |
683
+ | `sourcemap` | `boolean` | Emit source maps for Devflare-owned Worker bundles |
684
684
  | `options` | `DevflareRolldownOptions` | Additional Rolldown input/output options and plugins, minus Devflare-owned fields |
685
685
 
686
686
  Current `rolldown.options` ownership rules:
687
687
 
688
688
  - Devflare owns `cwd`, `input`, `platform`, and `watch`
689
689
  - Devflare also owns output `codeSplitting`, `dir`, `file`, `format`, and `inlineDynamicImports`
690
- - output stays single-file ESM so the local DO bundling story remains worker-friendly
690
+ - output stays single-file ESM so Devflare's worker-owned bundles remain worker-friendly
691
691
  - `rolldown.options.plugins` is the intended extension point for custom transforms and Rollup-compatible plugins
692
692
 
693
693
  #### `vite`
694
694
 
695
- `vite` is the Devflare-side Vite metadata namespace, not the place for raw Vite app config.
695
+ `vite` is Devflare's inline Vite config namespace. When Devflare runs Vite, this object is merged into the actual Vite config that Vite receives.
696
696
 
697
697
  | Key | Shape | Current behavior |
698
698
  |---|---|---|
699
- | `plugins` | `unknown[]` | Accepted by the schema and normalized from the legacy top-level `plugins` alias |
700
- | any other key | `unknown` | Preserved by the schema as Devflare-level Vite metadata, but raw Vite server/build/resolve/plugin wiring still belongs in local `vite.config.*` |
699
+ | `plugins` | `unknown[]` | Accepted by the schema and normalized from the legacy top-level `plugins` alias, then merged into the actual Vite plugin chain when Devflare runs Vite |
700
+ | any other key | `unknown` | Passed through as actual Vite config when Devflare runs Vite |
701
701
 
702
702
  That distinction is intentional:
703
703
 
704
- - put real Vite config in `vite.config.ts`
705
- - use `devflare/vite` helpers when Devflare needs to participate in the Vite pipeline
706
- - treat `config.vite` as Devflare-owned metadata, not as a drop-in replacement for Vite's own config file
704
+ - use `config.vite` when you want Devflare config to be your Vite config source of truth
705
+ - keep `vite.config.ts` when you prefer a standalone Vite config file or need advanced programmatic control
706
+ - if both exist, Devflare merges `vite.config.*` first, then `config.vite`, and injects `devflarePlugin()` into the resulting config
707
+ - use `devflare/vite` helpers when Devflare needs to participate in the Vite pipeline programmatically
707
708
 
708
709
  #### `env`
709
710
 
@@ -1326,44 +1327,45 @@ They are both important, but they are not two names for the same job.
1326
1327
 
1327
1328
  | Tool | Role inside Devflare | When it matters most | What it is not |
1328
1329
  |---|---|---|---|
1329
- | `Vite` | the optional outer dev/build host for packages that are already Vite apps or frameworks; Devflare plugs generated Worker config, config watching, auxiliary DO workers, and bridge behavior into that pipeline | packages with a local `vite.config.*`, SvelteKit, frontend HMR | not Devflare's own Worker bundler |
1330
- | `Rolldown` | the inner code-transforming builder Devflare uses when Devflare itself bundles Worker code | Durable Object bundles, watch/rebuild, worker-side plugin transforms such as `.svelte` imported by a DO module | not the main app's Vite build |
1330
+ | `Vite` | the optional outer dev/build host for packages that are already Vite apps or frameworks; Devflare plugs generated Worker config, config watching, auxiliary DO workers, and bridge behavior into that pipeline | packages with a local `vite.config.*`, packages that only define inline `config.vite`, SvelteKit, frontend HMR | not Devflare's own Worker bundler |
1331
+ | `Rolldown` | the inner code-transforming builder Devflare uses when Devflare itself bundles Worker code | worker-only main worker bundles, Durable Object bundles, watch/rebuild, worker-side plugin transforms such as `.svelte` imported by a worker or DO module | not the main app's Vite build |
1331
1332
 
1332
1333
  Three practical consequences fall straight out of the implementation:
1333
1334
 
1334
- - remove `vite.config.*`, and Devflare drops back to worker-only mode instead of starting Vite
1335
- - import `.svelte` from a Durable Object, and the compilation belongs to `rolldown.options.plugins`, not to the main Vite plugin chain
1335
+ - remove both `vite.config.*` and inline `config.vite`, and Devflare drops back to worker-only mode instead of starting Vite
1336
+ - import `.svelte` from a worker-only surface or Durable Object, and the compilation belongs to `rolldown.options.plugins`, not to the main Vite plugin chain
1336
1337
  - generated `.devflare/worker-entrypoints/main.ts` is separate glue code produced by Devflare when it needs to compose fetch, queue, scheduled, email, or route-tree surfaces into one Worker entry
1337
1338
 
1338
1339
  ### Operational decision rules
1339
1340
 
1340
1341
  Use these rules in order:
1341
1342
 
1342
- 1. a local `vite.config.*` in the current package decides whether `dev`, `build`, and `deploy` run in Vite-backed mode or worker-only mode
1343
+ 1. a local `vite.config.*` or a non-empty `config.vite` in the current package decides whether `dev`, `build`, and `deploy` run in Vite-backed mode or worker-only mode
1343
1344
  2. `devflare/vite` is an explicit helper layer, not a separate CLI mode
1344
- 3. worker-only mode is a supported first-class path; no local `vite.config.*` means Devflare does not start Vite
1345
- 4. raw Vite config belongs in `vite.config.*`; `config.vite` is Devflare metadata, not full Vite config
1345
+ 3. worker-only mode is a supported first-class path; no local `vite.config.*` and no inline `config.vite` means Devflare does not start Vite
1346
+ 4. `config.vite` is real Vite config when Devflare runs Vite; a local `vite.config.*` remains optional and is merged first when present
1346
1347
  5. treat `.devflare/*`, `env.d.ts`, and generated Wrangler config as outputs, not authoring inputs
1347
1348
  6. remote mode is mainly for remote-oriented services such as AI and Vectorize, not a blanket “make everything remote” switch
1348
1349
 
1349
1350
  ### Vite-backed workflows
1350
1351
 
1351
- A package enters Vite-backed mode when it has a local `vite.config.*`. In that mode, Vite is the outer application pipeline: it owns the package's dev server and app build, while Devflare injects Worker-aware config, generated Wrangler output, auxiliary DO worker config, and bridge behavior into that Vite stack.
1352
+ A package enters Vite-backed mode when it has a local `vite.config.*` or a non-empty `config.vite`. In that mode, Vite is the outer application pipeline: it owns the package's dev server and app build, while Devflare injects Worker-aware config, generated Wrangler output, auxiliary DO worker config, and bridge behavior into that Vite stack.
1352
1353
 
1353
1354
  Current Vite-backed flow:
1354
1355
 
1355
1356
  1. Devflare loads and validates `devflare.config.*`
1356
- 2. `devflarePlugin()` compiles that config into a generated `.devflare/wrangler.jsonc`
1357
- 3. Devflare may generate `.devflare/worker-entrypoints/main.ts` when multiple surfaces must be composed into one Worker entry
1358
- 4. if Durable Object files are discovered, Devflare builds an auxiliary DO worker config for Vite / Cloudflare interop
1359
- 5. in serve mode, Devflare watches the resolved Devflare config file and triggers a full reload when it changes
1360
- 6. if `wsRoutes` are configured, Devflare can proxy matching WebSocket upgrade paths to the Miniflare bridge
1361
- 7. on build, Devflare runs `bunx vite build` only after it has prepared the Worker config for that package
1357
+ 2. if a local `vite.config.*` exists, Devflare loads it and merges `config.vite` on top; otherwise Devflare synthesizes `.devflare/vite.config.mjs` from `config.vite`
1358
+ 3. `devflarePlugin()` compiles that config into a generated `.devflare/wrangler.jsonc`
1359
+ 4. Devflare may generate `.devflare/worker-entrypoints/main.ts` when multiple surfaces must be composed into one Worker entry
1360
+ 5. if Durable Object files are discovered, Devflare builds an auxiliary DO worker config for Vite / Cloudflare interop
1361
+ 6. in serve mode, Devflare watches the resolved Devflare config file and triggers a full reload when it changes
1362
+ 7. if `wsRoutes` are configured, Devflare can proxy matching WebSocket upgrade paths to the Miniflare bridge
1363
+ 8. on build, Devflare runs `bunx vite build --config .devflare/vite.config.mjs` when it needs a generated config wrapper
1362
1364
 
1363
1365
  Two ownership rules matter here:
1364
1366
 
1365
1367
  - setting `wrangler.passthrough.main` tells Devflare to preserve your explicit Worker `main` instead of generating a composed one
1366
- - no local `vite.config.*` means none of this Vite-specific behavior runs; the package stays in worker-only mode
1368
+ - no local `vite.config.*` and no inline `config.vite` means none of this Vite-specific behavior runs; the package stays in worker-only mode
1367
1369
 
1368
1370
  #### `devflare/vite` helpers
1369
1371
 
@@ -1372,6 +1374,8 @@ Two ownership rules matter here:
1372
1374
  | `devflarePlugin(options)` | generated `.devflare/wrangler.jsonc`, config watching, DO discovery, DO transforms, and WebSocket proxy wiring | include it in `vite.config.*` plugins |
1373
1375
  | `getCloudflareConfig(options)` | compiled programmatic config for `cloudflare({ config })` | call during Vite config creation |
1374
1376
  | `getDevflareConfigs(options)` | compiled config plus `auxiliaryWorkers` array for DO workers | call during Vite config creation |
1377
+ | `resolveViteUserConfig(configEnv, options)` | merge local `vite.config.*`, inline `config.vite`, and `devflarePlugin()` into the actual Vite config object | advanced / generated-config use |
1378
+ | `writeGeneratedViteConfig(options)` | write `.devflare/vite.config.mjs` for CLI-driven Vite runs | advanced / generated-config use |
1375
1379
  | `getPluginContext()` | read resolved plugin state such as `wranglerConfig`, `cloudflareConfig`, discovered DOs, and `projectRoot` | advanced use only, after Vite has resolved config |
1376
1380
 
1377
1381
  `devflarePlugin(options)` currently supports these options:
@@ -1388,6 +1392,7 @@ Two ownership rules matter here:
1388
1392
  Timing rule of thumb:
1389
1393
 
1390
1394
  - if you need config while building the Vite config object, use `getCloudflareConfig()` or `getDevflareConfigs()`
1395
+ - if you want Devflare to treat `config.vite` as the actual Vite config source of truth, rely on the CLI-generated config path or `resolveViteUserConfig()`
1391
1396
  - if another Vite plugin needs to inspect the already-resolved Devflare state, `getPluginContext()` is the advanced hook
1392
1397
 
1393
1398
  #### Minimal Vite wiring
@@ -1469,18 +1474,19 @@ Use `createHandle({...})` from `devflare/sveltekit` when you need custom binding
1469
1474
 
1470
1475
  ### Rolldown bundling and plugin workflows
1471
1476
 
1472
- `rolldown` is not just a namespace of knobs. Rolldown is the builder Devflare uses for the code Devflare actively bundles itself. Today that means the Durable Object path: Devflare discovers DO source files, applies its own transforms, lets user plugins transform imports, and emits runnable single-file ESM Worker modules that Miniflare can execute.
1477
+ `rolldown` is not just a namespace of knobs. Rolldown is the builder Devflare uses for the code Devflare actively bundles itself. Today that means two Devflare-owned output paths: the worker-only composed main worker bundle and the Durable Object bundle path. Devflare composes worker surfaces when needed, applies its own transforms, lets user plugins transform imports, and emits runnable single-file ESM Worker modules that Miniflare and Wrangler can execute.
1473
1478
 
1474
1479
  That is why `rolldown` is important but different from Vite:
1475
1480
 
1476
1481
  - Vite may host the outer app or framework pipeline
1477
- - Rolldown is the inner code-transform step that turns DO source into actual runnable worker code
1478
- - if a Durable Object imports `.svelte`, that compilation belongs to the Rolldown plugin pipeline, not to the main Vite app plugin chain
1482
+ - Rolldown is the inner code-transform step that turns Devflare-owned Worker source into actual runnable worker code
1483
+ - if a worker-only surface or Durable Object imports `.svelte`, that compilation belongs to the Rolldown plugin pipeline, not to the main Vite app plugin chain
1479
1484
 
1480
- It is still not Vite config, not a replacement for your app's `vite.config.*`, and not the place to configure the main fetch build.
1485
+ It is still not Vite config, not a replacement for your app's `vite.config.*`, and not the place to configure the main Vite app build.
1481
1486
 
1482
- Current DO bundler behavior:
1487
+ Current worker bundler behavior:
1483
1488
 
1489
+ - in worker-only `dev`, `build`, and `deploy`, Devflare composes the main worker entry to `.devflare/worker-entrypoints/main.ts` and then bundles it to `.devflare/worker-entrypoints/main.js`
1484
1490
  - Devflare discovers DO files from `files.durableObjects`
1485
1491
  - discovered DO entries are bundled to worker-compatible ESM
1486
1492
  - code splitting is disabled so Devflare can emit a worker-friendly single-file bundle
@@ -1512,14 +1518,9 @@ const inlineSvelteFixturePlugin: RolldownPlugin = {
1512
1518
  }
1513
1519
 
1514
1520
  export default defineConfig({
1515
- name: 'do-worker',
1521
+ name: 'worker-app',
1516
1522
  files: {
1517
- durableObjects: 'src/do/**/*.ts'
1518
- },
1519
- bindings: {
1520
- durableObjects: {
1521
- GREETER: 'Greeter'
1522
- }
1523
+ fetch: 'src/fetch.ts'
1523
1524
  },
1524
1525
  rolldown: {
1525
1526
  options: {
@@ -1529,13 +1530,13 @@ export default defineConfig({
1529
1530
  })
1530
1531
  ```
1531
1532
 
1532
- That mirrors the kind of `.svelte` transform path the repo's own DO bundler tests exercise.
1533
+ That mirrors the kind of `.svelte` transform path the repo now exercises for the composed main worker bundle.
1533
1534
 
1534
1535
  #### Svelte plugin example for Rolldown
1535
1536
 
1536
- This example is intentionally about a `.svelte` import inside a Durable Object module. In that situation, Rolldown — not the main Vite app build — is the plugin pipeline doing the compilation.
1537
+ This example is intentionally about a `.svelte` import inside a worker-only fetch surface. In that situation, Rolldown — not the main Vite app build — is the plugin pipeline doing the compilation.
1537
1538
 
1538
- For this pattern you typically install `svelte`, `rollup-plugin-svelte`, and `@rollup/plugin-node-resolve` in the package that owns the Durable Object code.
1539
+ For this pattern you typically install `svelte`, `rollup-plugin-svelte`, and `@rollup/plugin-node-resolve` in the package that owns the worker code.
1539
1540
 
1540
1541
  ```ts
1541
1542
  import { defineConfig } from 'devflare'
@@ -1546,12 +1547,7 @@ import svelte from 'rollup-plugin-svelte'
1546
1547
  export default defineConfig({
1547
1548
  name: 'chat-worker',
1548
1549
  files: {
1549
- durableObjects: 'src/do/**/*.ts'
1550
- },
1551
- bindings: {
1552
- durableObjects: {
1553
- CHAT_ROOM: 'ChatRoom'
1554
- }
1550
+ fetch: 'src/fetch.ts'
1555
1551
  },
1556
1552
  rolldown: {
1557
1553
  target: 'es2022',
@@ -1576,7 +1572,7 @@ export default defineConfig({
1576
1572
  ```
1577
1573
 
1578
1574
  ```svelte
1579
- <!-- src/do/Greeting.svelte -->
1575
+ <!-- src/Greeting.svelte -->
1580
1576
  <script lang='ts'>
1581
1577
  export let name: string
1582
1578
  </script>
@@ -1585,42 +1581,39 @@ export default defineConfig({
1585
1581
  ```
1586
1582
 
1587
1583
  ```ts
1588
- // src/do/chat-room.ts
1589
- import { DurableObject } from 'cloudflare:workers'
1584
+ // src/fetch.ts
1590
1585
  import Greeting from './Greeting.svelte'
1591
1586
 
1592
- export class ChatRoom extends DurableObject {
1593
- async fetch(): Promise<Response> {
1594
- return new Response(Greeting.render({ name: 'Devflare' }).html, {
1595
- headers: {
1596
- 'content-type': 'text/html; charset=utf-8'
1597
- }
1598
- })
1599
- }
1587
+ export async function fetch(): Promise<Response> {
1588
+ return new Response(Greeting.render({ name: 'Devflare' }).html, {
1589
+ headers: {
1590
+ 'content-type': 'text/html; charset=utf-8'
1591
+ }
1592
+ })
1600
1593
  }
1601
1594
  ```
1602
1595
 
1603
1596
  What happens in this flow:
1604
1597
 
1605
- 1. Devflare discovers `src/do/**/*.ts` from `files.durableObjects`
1606
- 2. the DO module imports `Greeting.svelte`
1598
+ 1. Devflare discovers or composes the worker-only main entry from `files.fetch` and related surfaces
1599
+ 2. the worker module imports `Greeting.svelte`
1607
1600
  3. Rolldown runs the configured plugin pipeline, including `rollup-plugin-svelte`
1608
- 4. the Svelte component becomes JavaScript before the DO bundle is written
1609
- 5. Devflare writes a runnable single-file Worker bundle for that DO
1601
+ 4. the Svelte component becomes JavaScript before the Worker bundle is written
1602
+ 5. Devflare writes a runnable single-file Worker bundle for that worker entry
1610
1603
 
1611
1604
  Why this example is shaped that way:
1612
1605
 
1613
- - `emitCss: false` keeps the DO bundle single-file instead of emitting a separate CSS asset pipeline
1606
+ - `emitCss: false` keeps the Worker bundle single-file instead of emitting a separate CSS asset pipeline
1614
1607
  - `generate: 'ssr'` fits the Worker-side rendering story better than a browser DOM target
1615
1608
  - `@rollup/plugin-node-resolve` helps `.svelte` files and `exports.svelte` packages resolve cleanly
1616
1609
  - some Rollup plugins need a type cast to satisfy Rolldown's TypeScript types even when the runtime hooks work fine
1617
- - this example is specifically about worker-side component compilation inside a DO; if your Svelte code lives in the main app or SvelteKit shell, that outer build is still Vite's job
1610
+ - this example is specifically about worker-side component compilation inside a worker-only surface; the same plugin path also applies to DO bundles, while Svelte code in the main app or SvelteKit shell is still Vite's job
1618
1611
 
1619
1612
  If a plugin relies on Rollup-only hooks that Rolldown does not support yet, keep that plugin in your main Vite build instead of the DO bundler.
1620
1613
 
1621
1614
  ### Daily development loop
1622
1615
 
1623
- Use the same CLI loop for both worker-only and Vite-backed packages. The presence of a local `vite.config.*` changes the mode automatically.
1616
+ Use the same CLI loop for both worker-only and Vite-backed packages. The presence of a local `vite.config.*` or inline `config.vite` changes the mode automatically.
1624
1617
 
1625
1618
  ```bash
1626
1619
  bunx --bun devflare dev
@@ -1637,7 +1630,7 @@ Use `--env <name>` on build and deploy when you want Devflare to resolve a named
1637
1630
  | Command | What it does | Important note |
1638
1631
  |---|---|---|
1639
1632
  | `devflare init` | scaffold a project | current templates generate `src/fetch.ts` and explicit `files.fetch` |
1640
- | `devflare dev` | start local development | worker-only by default, Vite-backed only when the current package has a local `vite.config.*` |
1633
+ | `devflare dev` | start local development | worker-only by default, Vite-backed when the current package has a local `vite.config.*` or inline `config.vite` |
1641
1634
  | `devflare build` | build from resolved config | skips Vite for worker-only packages |
1642
1635
  | `devflare deploy` | build and deploy | supports `--env` and `--dry-run` |
1643
1636
  | `devflare types` | generate `env.d.ts` | supports `--output` |
@@ -1777,7 +1770,8 @@ Keep these caveats explicit:
1777
1770
  - `sendEmail` is a supported outbound binding, while inbound email is a separate worker surface
1778
1771
  - email and tail helpers have real, useful test paths, but they should not be described as identical to full Cloudflare ingress or tail replay
1779
1772
  - Vite and Rolldown are different systems and should not be blurred together
1780
- - `rolldown` config affects Durable Object bundling, not the main Vite app build
1773
+ - `config.vite` is real Vite config only when Devflare is actually running Vite; it does not replace the worker-only Rolldown bundle path
1774
+ - `rolldown` config affects Devflare-owned worker bundling outputs (worker-only main bundles and DO bundles), not the main Vite app build
1781
1775
  - `wrangler.passthrough.main` suppresses Devflare's composed main-entry generation in higher-level build and Vite-backed flows
1782
1776
  - `getCloudflareConfig()` and `getDevflareConfigs()` are the safe config-time Vite helpers; `getPluginContext()` is advanced post-resolution state
1783
1777
  - Rollup-compatible plugins often work in `rolldown.options.plugins`, but compatibility is high-not-total and plugin-specific validation still matters
package/README.md CHANGED
@@ -417,30 +417,32 @@ Devflare is worker-only first.
417
417
 
418
418
  ### Mode selection
419
419
 
420
- - a local `vite.config.*` opts the current package into **Vite-backed** flows
421
- - Vite-related dependencies without a local config do **not** switch the package into Vite mode
422
- - without a local `vite.config.*`, `dev`, `build`, and `deploy` stay in **worker-only** mode
420
+ - a local `vite.config.*` or a non-empty `config.vite` opts the current package into **Vite-backed** flows
421
+ - Vite-related dependencies without either a local config or inline `config.vite` do **not** switch the package into Vite mode
422
+ - without a local `vite.config.*` and without inline `config.vite`, `dev`, `build`, and `deploy` stay in **worker-only** mode
423
423
 
424
424
  ### Mental model
425
425
 
426
426
  Vite and Rolldown both matter here, but they do different jobs:
427
427
 
428
- - **Vite** is the optional outer app/framework host. Devflare only enters Vite-backed mode when the current package has a local `vite.config.*`, and then Devflare plugs Worker-aware config, auxiliary DO workers, and Cloudflare/Vite interop into that pipeline.
429
- - **Rolldown** is the inner builder Devflare uses when Devflare itself needs to transform Worker code into runnable bundles. Today that matters most in the Durable Object path and its watch/rebuild loop.
428
+ - **Vite** is the optional outer app/framework host. Devflare enters Vite-backed mode when the current package has a local `vite.config.*` or a non-empty `config.vite`, and then Devflare merges that config into the actual Vite config it runs.
429
+ - **Rolldown** is the inner builder Devflare uses when Devflare itself needs to transform Worker code into runnable bundles. Today that covers worker-only main-worker bundles and Durable Object bundles.
430
430
 
431
431
  Short version:
432
432
 
433
- - no local `vite.config.*` → no Vite process; Devflare stays worker-only
434
- - `.svelte` imported by a Durable Object → that compilation belongs to the Rolldown plugin pipeline, not to the main Vite app build
433
+ - no local `vite.config.*` and no inline `config.vite` → no Vite process; Devflare stays worker-only
434
+ - `.svelte` imported by a worker-only fetch/route/queue/scheduled/email surface or by a Durable Object → that compilation belongs to the Rolldown plugin pipeline, not to the main Vite app build
435
435
  - generated `.devflare/worker-entrypoints/main.ts` is separate Devflare glue that composes worker surfaces when needed
436
436
 
437
437
  ### Current behavior that matters
438
438
 
439
439
  - worker-only `dev` is a real first-class path
440
- - `build` and `deploy` skip Vite when the current package has no local `vite.config.*`
440
+ - `build` and `deploy` skip Vite only when the current package has no effective Vite config (`vite.config.*` or inline `config.vite`)
441
+ - when Devflare runs Vite, `config.vite` is merged into the actual Vite config, and Devflare writes a generated `.devflare/vite.config.mjs` when it needs one
441
442
  - higher-level `build`, `deploy`, and `devflare/vite` flows currently synthesize `.devflare/worker-entrypoints/main.ts` whenever a fetch, route tree, queue, scheduled, or email surface is discovered
442
443
  - `wrangler.passthrough.main` disables that composed-entry generation path
443
- - Rolldown currently matters most in the Durable Object bundler path, including unified dev flows where Vite hosts the app but Rolldown still rebuilds DO worker code
444
+ - in worker-only mode, Devflare now bundles the composed main worker to `.devflare/worker-entrypoints/main.js` via Rolldown before handing it to Miniflare or Wrangler
445
+ - Rolldown still rebuilds Durable Object worker code in unified Vite dev flows where Vite hosts the outer app
444
446
 
445
447
  For the full contract-level explanation and a concrete Rolldown + Svelte example, see [`LLM.md`](./LLM.md).
446
448
 
@@ -1,3 +1,6 @@
1
+ import {
2
+ bundleWorkerEntry
3
+ } from "./index-nb0bqtx7.js";
1
4
  import {
2
5
  detectViteProject
3
6
  } from "./index-y1d8za14.js";
@@ -5,20 +8,25 @@ import {
5
8
  getDependencies
6
9
  } from "./index-1xpj0m4r.js";
7
10
  import {
8
- prepareComposedWorkerEntrypoint
9
- } from "./index-ws68xvq2.js";
11
+ prepareComposedWorkerEntrypoint,
12
+ resolveEffectiveViteProject,
13
+ writeGeneratedViteConfig
14
+ } from "./index-zbvmtcn2.js";
10
15
  import"./index-1p814k7s.js";
11
16
  import"./index-rbht7m9r.js";
17
+ import"./index-9wt9x09k.js";
12
18
  import {
13
19
  compileConfig,
14
20
  writeWranglerConfig
15
- } from "./index-51s1hkw4.js";
21
+ } from "./index-rfhx0yd5.js";
16
22
  import {
17
23
  loadConfig
18
24
  } from "./index-wyf3s77s.js";
25
+ import"./index-v8vvsn9x.js";
19
26
  import"./index-37x76zdn.js";
20
27
 
21
28
  // src/cli/commands/build.ts
29
+ import { relative, resolve } from "pathe";
22
30
  async function runBuildCommand(parsed, logger, options) {
23
31
  const cwd = options.cwd || process.cwd();
24
32
  const configPath = parsed.options.config;
@@ -28,22 +36,43 @@ async function runBuildCommand(parsed, logger, options) {
28
36
  const config = await loadConfig({ cwd, configFile: configPath });
29
37
  logger.info(`Building: ${config.name}`);
30
38
  const composedMainEntry = await prepareComposedWorkerEntrypoint(cwd, config, environment);
39
+ const deps = await getDependencies();
40
+ const viteProject = resolveEffectiveViteProject(await detectViteProject(cwd, deps.fs), config, environment);
31
41
  const wranglerConfig = compileConfig(config, environment);
32
- if (composedMainEntry) {
33
- wranglerConfig.main = composedMainEntry;
34
- logger.info(`Generated composed worker entry: ${composedMainEntry}`);
42
+ if (viteProject.shouldStartVite) {
43
+ if (composedMainEntry) {
44
+ wranglerConfig.main = composedMainEntry;
45
+ logger.info(`Generated composed worker entry: ${composedMainEntry}`);
46
+ }
47
+ } else if (composedMainEntry) {
48
+ const bundledMainEntryPath = await bundleWorkerEntry({
49
+ cwd,
50
+ inputFile: resolve(cwd, composedMainEntry),
51
+ outFile: resolve(cwd, ".devflare", "worker-entrypoints", "main.js"),
52
+ rolldownOptions: config.rolldown?.options,
53
+ sourcemap: config.rolldown?.sourcemap,
54
+ minify: config.rolldown?.minify,
55
+ target: config.rolldown?.target,
56
+ logger
57
+ });
58
+ wranglerConfig.main = relative(cwd, bundledMainEntryPath).replace(/\\/g, "/");
59
+ logger.info(`Generated bundled worker entry: ${wranglerConfig.main}`);
35
60
  }
36
61
  await writeWranglerConfig(cwd, wranglerConfig);
37
62
  logger.success("Generated wrangler.jsonc");
38
- const deps = await getDependencies();
39
- const viteProject = await detectViteProject(cwd, deps.fs);
40
63
  if (!viteProject.shouldStartVite) {
41
- logger.info("Skipping Vite build (no local vite.config.* found for this package)");
64
+ logger.info("Skipping Vite build (no effective Vite config found for this package)");
42
65
  logger.success("Build complete!");
43
66
  return { exitCode: 0 };
44
67
  }
68
+ const generatedViteConfigPath = await writeGeneratedViteConfig({
69
+ cwd,
70
+ configPath,
71
+ environment,
72
+ localConfigPath: viteProject.viteConfigPath
73
+ });
45
74
  logger.info("Running vite build...");
46
- const proc = await deps.exec.exec("bunx", ["vite", "build"], {
75
+ const proc = await deps.exec.exec("bunx", ["vite", "build", "--config", generatedViteConfigPath], {
47
76
  cwd,
48
77
  stdio: "inherit",
49
78
  env: {
@@ -1 +1 @@
1
- {"version":3,"file":"do-bundler.d.ts","sourceRoot":"","sources":["../../src/bundler/do-bundler.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAS9C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAS/D,MAAM,WAAW,gBAAgB;IAChC,6BAA6B;IAC7B,GAAG,EAAE,MAAM,CAAA;IACX,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAA;IACf,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAA;IACd,8DAA8D;IAC9D,eAAe,CAAC,EAAE,uBAAuB,CAAA;IACzC,qDAAqD;IACrD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,uDAAuD;IACvD,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,sBAAsB;IACtB,MAAM,CAAC,EAAE,eAAe,CAAA;IACxB,oCAAoC;IACpC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5D;AAED,MAAM,WAAW,cAAc;IAC9B,gDAA8C;IAC9C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C,EAAE,OAAO,CAAA;IAChB,sBAAsB;IACtB,MAAM,CAAC,EAAE,eAAe,CAAA;IACxB,oCAAoC;IACpC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAC5D;AAED,MAAM,WAAW,cAAc;IAC9B,gDAA8C;IAC9C,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,yCAAuC;IACvC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,+CAA6C;IAC7C,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAClC,6BAA6B;IAC7B,MAAM,EAAE,KAAK,EAAE,CAAA;CACf;AAED,MAAM,WAAW,SAAS;IACzB,+BAA+B;IAC/B,KAAK,IAAI,OAAO,CAAC,cAAc,CAAC,CAAA;IAChC,iCAAiC;IACjC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACtB,oBAAoB;IACpB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACtB,mCAAmC;IACnC,SAAS,IAAI,cAAc,CAAA;CAC3B;AAibD;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,CAgOpE;AAMD;;GAEG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,WAAW,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAIrG"}
@@ -1,2 +1,3 @@
1
1
  export { type DOBundlerOptions, type DOBundleResult, type DOBundler, createDOBundler, bundleDOs } from './do-bundler';
2
+ export { type WorkerBundlerOptions, bundleWorkerEntry } from './worker-bundler';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACN,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,eAAe,EACf,SAAS,EACT,MAAM,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACN,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,eAAe,EACf,SAAS,EACT,MAAM,cAAc,CAAA;AACrB,OAAO,EACN,KAAK,oBAAoB,EACzB,iBAAiB,EACjB,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,14 @@
1
+ import type { ConsolaInstance } from 'consola';
2
+ import type { DevflareRolldownOptions } from '../config/schema';
3
+ export interface WorkerBundlerOptions {
4
+ cwd: string;
5
+ inputFile: string;
6
+ outFile: string;
7
+ rolldownOptions?: DevflareRolldownOptions;
8
+ sourcemap?: boolean;
9
+ minify?: boolean;
10
+ target?: string;
11
+ logger?: ConsolaInstance;
12
+ }
13
+ export declare function bundleWorkerEntry(options: WorkerBundlerOptions): Promise<string>;
14
+ //# sourceMappingURL=worker-bundler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worker-bundler.d.ts","sourceRoot":"","sources":["../../src/bundler/worker-bundler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAQ9C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAE/D,MAAM,WAAW,oBAAoB;IACpC,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,CAAC,EAAE,uBAAuB,CAAA;IACzC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,eAAe,CAAA;CACxB;AAwOD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAgCtF"}
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/build.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAOjE,wBAAsB,eAAe,CACpC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,UAAU,GACjB,OAAO,CAAC,SAAS,CAAC,CA2DpB"}
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/build.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AASjE,wBAAsB,eAAe,CACpC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,UAAU,GACjB,OAAO,CAAC,SAAS,CAAC,CAqFpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/deploy.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAOjE,wBAAsB,gBAAgB,CACrC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,UAAU,GACjB,OAAO,CAAC,SAAS,CAAC,CAgFpB"}
1
+ {"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/deploy.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AASjE,wBAAsB,gBAAgB,CACrC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,UAAU,GACjB,OAAO,CAAC,SAAS,CAAC,CA2GpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/dev.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAE7D,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAkEjE,wBAAsB,aAAa,CAClC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,UAAU,GACjB,OAAO,CAAC,SAAS,CAAC,CA6JpB"}
1
+ {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/dev.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAiB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAE7D,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAoEjE,wBAAsB,aAAa,CAClC,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,UAAU,GACjB,OAAO,CAAC,SAAS,CAAC,CAiKpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"compiler.d.ts","sourceRoot":"","sources":["../../src/config/compiler.ts"],"names":[],"mappings":"AAKA,OAAO,EAAsB,KAAK,cAAc,EAA6B,MAAM,UAAU,CAAA;AAE7F;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,CAA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pC,MAAM,EAAE,cAAc,EACtB,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAChD,cAAc,GAAG,IAAI,CAoFvB"}
@@ -2,5 +2,6 @@ export { defineConfig } from './define';
2
2
  export { configSchema, normalizeDOBinding, type DevflareConfig, type DevflareConfigInput, type DevflareEnvConfig, type DurableObjectBinding, type NormalizedDOBinding, type QueueConsumer, type QueuesConfig, type ServiceBinding, type RouteConfig, type WsRouteConfig, type AssetsConfig, type ViteConfig, type RolldownConfig, type BuildConfig, type MigrationConfig } from './schema';
3
3
  export { compileConfig, stringifyConfig, writeWranglerConfig, type WranglerConfig } from './compiler';
4
4
  export { loadConfig, resolveConfigPath, ConfigNotFoundError, ConfigValidationError, type LoadConfigOptions } from './loader';
5
+ export { resolveConfigForEnvironment } from './resolve';
5
6
  export { ref, resolveRef, serviceBinding, type RefResult, type WorkerBinding, type WorkerBindingAccessor, type DOBindingRef } from './ref';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EACN,YAAY,EACZ,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,mBAAmB,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAA;AACrG,OAAO,EACN,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,iBAAiB,EACtB,MAAM,UAAU,CAAA;AAGjB,OAAO,EACN,GAAG,EACH,UAAU,EACV,cAAc,EACd,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,MAAM,OAAO,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EACN,YAAY,EACZ,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,mBAAmB,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAA;AACrG,OAAO,EACN,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,iBAAiB,EACtB,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAA;AAGvD,OAAO,EACN,GAAG,EACH,UAAU,EACV,cAAc,EACd,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,MAAM,OAAO,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { DevflareConfig } from './schema';
2
+ export declare function resolveConfigForEnvironment(config: DevflareConfig, environment?: string): DevflareConfig;
3
+ //# sourceMappingURL=resolve.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,wBAAgB,2BAA2B,CAC1C,MAAM,EAAE,cAAc,EACtB,WAAW,CAAC,EAAE,MAAM,GAClB,cAAc,CAMhB"}