veryfront 0.0.90 → 0.0.92

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 (38) hide show
  1. package/README.md +0 -9
  2. package/esm/_dnt.shims.d.ts +14 -14
  3. package/esm/_dnt.shims.d.ts.map +1 -1
  4. package/esm/deno.js +1 -1
  5. package/esm/src/cli/mcp/advanced-tools.d.ts +2 -2
  6. package/esm/src/cli/templates/manifest.d.ts +449 -449
  7. package/esm/src/cli/templates/manifest.js +480 -480
  8. package/esm/src/html/styles-builder/tailwind-compiler.d.ts.map +1 -1
  9. package/esm/src/html/styles-builder/tailwind-compiler.js +27 -4
  10. package/esm/src/modules/import-map/default-import-map.d.ts.map +1 -1
  11. package/esm/src/modules/import-map/default-import-map.js +9 -4
  12. package/esm/src/platform/compat/path-helper.d.ts +7 -7
  13. package/esm/src/platform/compat/path-helper.d.ts.map +1 -1
  14. package/esm/src/react/components/ai/agent-card.d.ts +1 -1
  15. package/esm/src/react/components/ai/agent-card.d.ts.map +1 -1
  16. package/esm/src/react/components/ai/chat/composition/api.d.ts +4 -5
  17. package/esm/src/react/components/ai/chat/composition/api.d.ts.map +1 -1
  18. package/esm/src/react/components/ai/chat/index.d.ts +2 -7
  19. package/esm/src/react/components/ai/chat/index.d.ts.map +1 -1
  20. package/esm/src/react/components/ai/message.d.ts +2 -2
  21. package/esm/src/react/components/ai/message.d.ts.map +1 -1
  22. package/esm/src/react/primitives/agent-primitives.d.ts +3 -3
  23. package/esm/src/react/primitives/agent-primitives.d.ts.map +1 -1
  24. package/esm/src/react/primitives/chat-container.d.ts +1 -1
  25. package/esm/src/react/primitives/chat-container.d.ts.map +1 -1
  26. package/esm/src/react/primitives/input-box.d.ts +3 -3
  27. package/esm/src/react/primitives/input-box.d.ts.map +1 -1
  28. package/esm/src/react/primitives/message-list.d.ts +4 -4
  29. package/esm/src/react/primitives/message-list.d.ts.map +1 -1
  30. package/esm/src/react/primitives/tool-primitives.d.ts +3 -3
  31. package/esm/src/react/primitives/tool-primitives.d.ts.map +1 -1
  32. package/esm/src/rendering/ssr-globals/context.d.ts +1 -6
  33. package/esm/src/rendering/ssr-globals/context.d.ts.map +1 -1
  34. package/package.json +2 -2
  35. package/src/deno.js +1 -1
  36. package/src/src/cli/templates/manifest.js +480 -480
  37. package/src/src/html/styles-builder/tailwind-compiler.ts +28 -5
  38. package/src/src/modules/import-map/default-import-map.ts +11 -4
@@ -582,12 +582,33 @@ async function loadPlugin(id: string): Promise<unknown> {
582
582
  return pluginCache.get(id);
583
583
  }
584
584
 
585
- const url = `https://esm.sh/${id}`;
585
+ // Use the proper isDeno check that distinguishes between real Deno and dnt shim
586
+ const { isDeno } = await import("../../platform/compat/runtime.js");
586
587
 
587
588
  try {
588
- logger.debug("[tailwind] Loading plugin", { id, url });
589
- const mod = await import(url);
590
- const plugin = mod.default ?? mod;
589
+ let mod: unknown;
590
+
591
+ if (isDeno) {
592
+ // Deno supports HTTP imports natively
593
+ const url = `https://esm.sh/${id}`;
594
+ logger.debug("[tailwind] Loading plugin via esm.sh", { id, url });
595
+ mod = await import(url);
596
+ } else {
597
+ // Node.js: Try to import from node_modules
598
+ // First try the bare specifier, then fall back to global node_modules
599
+ logger.debug("[tailwind] Loading plugin from node_modules", { id });
600
+ try {
601
+ mod = await import(id);
602
+ } catch {
603
+ // Plugin not installed - this is expected for most user projects
604
+ // Log at debug level since it's not an error, just a missing optional plugin
605
+ logger.debug("[tailwind] Plugin not installed", { id });
606
+ pluginCache.set(id, null);
607
+ return null;
608
+ }
609
+ }
610
+
611
+ const plugin = (mod as { default?: unknown }).default ?? mod;
591
612
  pluginCache.set(id, plugin);
592
613
  return plugin;
593
614
  } catch (error) {
@@ -645,8 +666,10 @@ async function getCompiler(stylesheet: string): Promise<Awaited<ReturnType<typeo
645
666
  },
646
667
  loadModule: async (id: string) => {
647
668
  const plugin = await loadPlugin(id);
669
+ // If plugin is null (not installed in Node.js), return empty module to prevent crash
670
+ // The stylesheet will compile but plugin-specific features won't work
648
671
  // deno-lint-ignore no-explicit-any
649
- return { module: plugin as any, base: "/", path: "/" };
672
+ return { module: (plugin ?? {}) as any, base: "/", path: "/" };
650
673
  },
651
674
  });
652
675
 
@@ -1,6 +1,7 @@
1
1
  import * as dntShim from "../../../_dnt.shims.js";
2
2
  import type { ImportMapConfig } from "./types.js";
3
3
  import { getReactImportMap } from "../../transforms/esm/package-registry.js";
4
+ import { isDeno as isRealDeno } from "../../platform/compat/runtime.js";
4
5
 
5
6
  function ensureTrailingSlash(path: string): string {
6
7
  return path.endsWith("/") ? path : `${path}/`;
@@ -24,10 +25,16 @@ function getFrameworkRoot(): string {
24
25
 
25
26
  function getVeryfrontSsrImportMap(): Record<string, string> {
26
27
  const srcPath = `file://${getFrameworkRoot()}src`;
27
- const head = `${srcPath}/react/components/Head.tsx`;
28
- const router = `${srcPath}/react/router/index.ts`;
29
- const context = `${srcPath}/react/context/index.ts`;
30
- const fonts = `${srcPath}/react/fonts/index.ts`;
28
+
29
+ // In Deno source, files have .tsx/.ts extensions
30
+ // In npm package (Node.js/Bun), dnt transforms to .js
31
+ const tsxExt = isRealDeno ? ".tsx" : ".js";
32
+ const tsExt = isRealDeno ? ".ts" : ".js";
33
+
34
+ const head = `${srcPath}/react/components/Head${tsxExt}`;
35
+ const router = `${srcPath}/react/router/index${tsExt}`;
36
+ const context = `${srcPath}/react/context/index${tsExt}`;
37
+ const fonts = `${srcPath}/react/fonts/index${tsExt}`;
31
38
 
32
39
  return {
33
40
  "veryfront/head": head,