@decocms/start 0.28.0 → 0.28.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/start",
3
- "version": "0.28.0",
3
+ "version": "0.28.1",
4
4
  "type": "module",
5
5
  "description": "Deco framework for TanStack Start - CMS bridge, admin protocol, hooks, schema generation",
6
6
  "main": "./src/index.ts",
@@ -43,7 +43,7 @@
43
43
  "./scripts/generate-blocks": "./scripts/generate-blocks.ts",
44
44
  "./scripts/generate-schema": "./scripts/generate-schema.ts",
45
45
  "./scripts/generate-invoke": "./scripts/generate-invoke.ts",
46
- "./vite": "./src/vite/plugin.ts"
46
+ "./vite": "./src/vite/plugin.js"
47
47
  },
48
48
  "scripts": {
49
49
  "build": "tsc",
@@ -12,10 +12,9 @@
12
12
  * ```
13
13
  */
14
14
 
15
- import type { Plugin, PluginOption } from "vite";
16
-
17
15
  // Bare-specifier stubs resolved by ID before Vite touches them.
18
- const CLIENT_STUBS: Record<string, string> = {
16
+ /** @type {Record<string, string>} */
17
+ const CLIENT_STUBS = {
19
18
  "react-dom/server": "\0stub:react-dom-server",
20
19
  "react-dom/server.browser": "\0stub:react-dom-server",
21
20
  "node:stream": "\0stub:node-stream",
@@ -25,7 +24,8 @@ const CLIENT_STUBS: Record<string, string> = {
25
24
  };
26
25
 
27
26
  // Minimal stub source for each virtual module.
28
- const STUB_SOURCE: Record<string, string> = {
27
+ /** @type {Record<string, string>} */
28
+ const STUB_SOURCE = {
29
29
  "\0stub:react-dom-server": [
30
30
  "const noop = () => '';",
31
31
  "export const renderToString = noop;",
@@ -55,8 +55,10 @@ const STUB_SOURCE: Record<string, string> = {
55
55
  "export const injectedHeadScripts = undefined;",
56
56
  };
57
57
 
58
- export function decoVitePlugin(): PluginOption {
59
- const plugin: Plugin = {
58
+ /** @returns {import("vite").PluginOption} */
59
+ export function decoVitePlugin() {
60
+ /** @type {import("vite").Plugin} */
61
+ const plugin = {
60
62
  name: "deco-server-only-stubs",
61
63
  enforce: "pre",
62
64
 
@@ -67,11 +69,8 @@ export function decoVitePlugin(): PluginOption {
67
69
  },
68
70
 
69
71
  load(id, options) {
70
- // ------------------------------------------------------------------
71
72
  // blocks.gen.ts — the CMS block registry (often 500KB+ compiled).
72
73
  // Only the server needs it; the client receives pre-resolved sections.
73
- // Match on resolved file path (relative imports resolve to absolute).
74
- // ------------------------------------------------------------------
75
74
  if (!options?.ssr && id.endsWith("blocks.gen.ts")) {
76
75
  return "export const blocks = {};";
77
76
  }
@@ -80,7 +79,7 @@ export function decoVitePlugin(): PluginOption {
80
79
  return STUB_SOURCE[id];
81
80
  },
82
81
 
83
- configEnvironment(name: string, env: any) {
82
+ configEnvironment(name, env) {
84
83
  if (name === "ssr" || name === "client") {
85
84
  env.optimizeDeps = env.optimizeDeps || {};
86
85
  env.optimizeDeps.esbuildOptions =