@fayz-ai/sdk 0.9.0-next.0 → 0.9.0-next.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/dist/vite.js CHANGED
@@ -68,11 +68,11 @@ function fayzVite(opts = {}) {
68
68
  // (so they're hoisted to its root node_modules) — deduping a transitive
69
69
  // like @tanstack/react-table makes Vite resolve it from the app root,
70
70
  // which fails in local-source mode and 500s the aliased UI source.
71
- dedupe: userDedupe ?? ["react", "react-dom", "zustand", "lucide-react", "@supabase/supabase-js", "sonner"],
71
+ dedupe: userDedupe ?? ["react", "react-dom", "zustand", "lucide-react", "react-router-dom", "@supabase/supabase-js", "sonner"],
72
72
  conditions: useLocal ? ["source", "browser", "module", "jsnext:main", "jsnext"] : void 0
73
73
  },
74
74
  optimizeDeps: { exclude: useLocal ? Object.keys(localAliases) : [] },
75
- // The preview-container runtime contract: Vite 5.4 host-check 403s any
75
+ // The preview-container runtime contract: Vite's host-check 403s any
76
76
  // non-local Host (browser iframe via Caddy, health probe via
77
77
  // host.docker.internal) unless allowedHosts is set. host/cors/headers keep
78
78
  // the proxied iframe + cross-origin asset fetches working. Owned here
package/dist/vite.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/vite.ts"],"names":[],"mappings":";;;;AAOA,IAAM,YAAA,GAAe;AAAA,EACnB,KAAA;AAAA,EAAO,MAAA;AAAA,EAAQ,MAAA;AAAA,EAAQ,IAAA;AAAA,EAAM,MAAA;AAAA,EAAQ,MAAA;AAAA,EAAQ,YAAA;AAAA,EAAc,QAAA;AAAA,EAAU,SAAA;AAAA,EAAW;AAClF,CAAA;AAEA,IAAM,WAAA,GAAc;AAAA,EAClB,QAAA;AAAA,EAAU,MAAA;AAAA,EAAQ,aAAA;AAAA,EAAe,MAAA;AAAA,EAAQ,eAAA;AAAA,EAAiB,SAAA;AAAA,EAAW,KAAA;AAAA,EAAO,WAAA;AAAA,EAC5E,WAAA;AAAA,EAAa,O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nimport { resolve } from 'node:path'\nimport type { UserConfig, PluginOption, AliasOptions } from 'vite'\n\n// All publishable @fayz-ai/* packages (root src). Subpaths (e.g.\n// @fayz-ai/saas/ui, @fayz-ai/storefront/catalog) resolve automatically via\n// Vite's prefix alias matching — the shim files mirror the subpath under src/.\nconst SDK_PACKAGES = [\n 'sdk', 'core', 'auth', 'ui', 'saas', 'shop', 'storefront', 'portal', 'courses', 'db',\n] as const\n\nconst SDK_PLUGINS = [\n 'agenda', 'auth', 'automations', 'blog', 'conversations', 'courses', 'crm', 'dashboard',\n 'financial', 'forms', 'inventory', 'marketing', 'menu', 'orders', 'payments', 'reports',\n 'reputation', 'shop', 'sites', 'tables', 'tasks',\n] as const\n\nexport interface FayzViteOptions {\n /** Dev server port. */\n port?: number\n /** Fail instead of incrementing if the port is taken. */\n strictPort?: boolean\n /** Extra app-specific aliases, merged after the SDK aliases. */\n aliases?: Record<string, string>\n /** Extra Vite plugins, appended after @vitejs/plugin-react. */\n plugins?: PluginOption[]\n /** SDK source location relative to the app root (default ../../fayz-sdk). */\n sdkDir?: string\n /** App root directory (default process.cwd()). */\n root?: string\n /**\n * Extra Vite `server` config, merged over the SDK server defaults. The\n * preview-container contract (host/cors/allowedHosts/headers) is applied\n * first, so an override can add e.g. `proxy` without dropping it.\n */\n server?: UserConfig['server']\n /**\n * Extra Vite `resolve` config, merged over the SDK resolve defaults. The SDK\n * alias map / dedupe / conditions win for `@fayz-ai/*` local-source\n * resolution; any other resolve keys (and extra aliases) are merged in.\n */\n resolve?: UserConfig['resolve']\n}\n\n/**\n * Shared Vite config for Fayz dogfood apps. Resolves `@fayz-ai/*` from the local\n * SDK source when it is checked out next to the app AND `FAYZ_SDK_SOURCE` is not\n * `published`; otherwise from node_modules (the Fayz editor sandbox / published\n * npm). Apps no longer hand-maintain alias maps or the local-vs-npm guard.\n *\n * import { defineConfig } from 'vite'\n * import react from '@vitejs/plugin-react'\n * import { fayzVite } from '@fayz-ai/sdk/vite'\n * export default defineConfig(fayzVite({ port: 5185, plugins: [react()] }))\n *\n * The app passes its own `@vitejs/plugin-react` so `@fayz-ai/sdk` carries no\n * build-tool peer deps (which otherwise choke npm's peer resolution, since sdk\n * sits in every dependency path).\n */\nexport function fayzVite(opts: FayzViteOptions = {}): UserConfig {\n const root = opts.root ?? process.cwd()\n const fayzSdk = resolve(root, opts.sdkDir ?? '../../fayz-sdk')\n const wantLocal = process.env.FAYZ_SDK_SOURCE !== 'published'\n const localPresent = existsSync(resolve(fayzSdk, 'packages/core/src/index.ts'))\n const useLocal = wantLocal && localPresent\n\n const localAliases: Record<string, string> = {}\n if (useLocal) {\n for (const p of SDK_PACKAGES) localAliases[`@fayz-ai/${p}`] = resolve(fayzSdk, `packages/${p}/src`)\n for (const p of SDK_PLUGINS) localAliases[`@fayz-ai/plugin-${p}`] = resolve(fayzSdk, `plugins/plugin-${p}/src`)\n }\n\n // Pull SDK-owned resolve keys out of any caller override so they can't clobber\n // local-source @fayz-ai/* resolution; the rest of `resolve` is merged in.\n const { alias: userAlias, dedupe: userDedupe, conditions: _ignore, ...restResolve } =\n (opts.resolve ?? {}) as Exclude<UserConfig['resolve'], undefined>\n\n return {\n plugins: [...(opts.plugins ?? [])],\n envPrefix: ['VITE_', 'PUBLIC_'],\n resolve: {\n ...restResolve,\n alias: {\n '@': resolve(root, 'src'),\n ...localAliases,\n ...(opts.aliases ?? {}),\n ...((userAlias as Record<string, string> | undefined) ?? {}),\n } as AliasOptions,\n // lucide-react is a direct dep of both the app and every @fayz-ai/*\n // package; without dedupe a version skew installs two copies and esbuild\n // pre-bundles each barrel separately (~1,500 icon modules each).\n // Collapsing to one copy is the single biggest cut to the editor-container\n // optimize RAM/CPU spike. Only dedupe deps the *app* directly depends on\n // (so they're hoisted to its root node_modules) — deduping a transitive\n // like @tanstack/react-table makes Vite resolve it from the app root,\n // which fails in local-source mode and 500s the aliased UI source.\n dedupe: userDedupe ?? ['react', 'react-dom', 'zustand', 'lucide-react', '@supabase/supabase-js', 'sonner'],\n conditions: useLocal ? ['source', 'browser', 'module', 'jsnext:main', 'jsnext'] : undefined,\n },\n optimizeDeps: { exclude: useLocal ? Object.keys(localAliases) : [] },\n // The preview-container runtime contract: Vite 5.4 host-check 403s any\n // non-local Host (browser iframe via Caddy, health probe via\n // host.docker.internal) unless allowedHosts is set. host/cors/headers keep\n // the proxied iframe + cross-origin asset fetches working. Owned here\n // because the app's vite.config has no literal `server: {` for the\n // container's text patchers to anchor on. Caller `server` merges last.\n server: {\n host: true,\n port: opts.port,\n strictPort: opts.strictPort,\n cors: true,\n allowedHosts: true,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Cross-Origin-Resource-Policy': 'cross-origin',\n },\n fs: { allow: [root, fayzSdk] },\n ...(opts.server ?? {}),\n },\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/vite.ts"],"names":[],"mappings":";;;;AAOA,IAAM,YAAA,GAAe;AAAA,EACnB,KAAA;AAAA,EAAO,MAAA;AAAA,EAAQ,MAAA;AAAA,EAAQ,IAAA;AAAA,EAAM,MAAA;AAAA,EAAQ,MAAA;AAAA,EAAQ,YAAA;AAAA,EAAc,QAAA;AAAA,EAAU,SAAA;AAAA,EAAW;AAClF,CAAA;AAEA,IAAM,WAAA,GAAc;AAAA,EAClB,QAAA;AAAA,EAAU,MAAA;AAAA,EAAQ,aAAA;AAAA,EAAe,MAAA;AAAA,EAAQ,eAAA;AAAA,EAAiB,SAAA;AAAA,EAAW,KAAA;AAAA,EAAO,WAAA;AAAA,EAC5E,WAAA;AAAA,EAAa,OAAA;AAAA,EAAS,WAAA;AAAA,EAAa,WAAA;AAAA,EAAa,MAAA;AAAA,EAAQ,QAAA;AAAA,EAAU,UAAA;AAAA,EAAY,SAAA;AAAA,EAC9E,YAAA;AAAA,EAAc,MAAA;AAAA,EAAQ,OAAA;AAAA,EAAS,QAAA;AAAA,EAAU;AAC3C,CAAA;AA4CO,SAAS,QAAA,CAAS,IAAA,GAAwB,EAAC,EAAe;AAC/D,EA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AAAA,QACxB,GAAG,YAAA;AAAA,QACH,GAAI,IAAA,CAAK,OAAA,IAAW,EAAC;AAAA,QACrB,GAAK,aAAoD;AAAC,OAC5D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MASA,MAAA,EAAQ,cAAc,CAAC,OAAA,EAAS,aAAa,SAAA,EAAW,cAAA,EAAgB,kBAAA,EAAoB,uBAAA,EAAyB,QAAQ,CAAA;AAAA,MAC7H,UAAA,EAAY,WAAW,CAAC,QAAA,EAAU,WAAW,QAAA,EAAU,aAAA,EAAe,QAAQ,CAAA,GAAI;AAAA,KACpF;AAAA,IACA,YAAA,EAAc,EAAE,OAAA,EAAS,QAAA,GAAW,OAAO,IAAA,CAAK,YAAY,CAAA,GAAI,EAAC,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOnE,MAAA,EAAQ;AAAA,MACN,IAAA,EAAM,IAAA;AAAA,MACN,MAAM,IAAA,CAAK,IAAA;AAAA,MACX,YAAY,IAAA,CAAK,UAAA;AAAA,MACjB,IAAA,EAAM,IAAA;AAAA,MACN,YAAA,EAAc,IAAA;AAAA,MACd,OAAA,EAAS;AAAA,QACP,6BAAA,EAA+B,GAAA;AAAA,QAC/B,8BAAA,EAAgC;AAAA,OAClC;AAAA,MACA,IAAI,EAAE,KAAA,EAAO,CAAC,IAAA,EAAM,OAAO,CAAA,EAAE;AAAA,MAC7B,GAAI,IAAA,CAAK,MAAA,IAAU;AAAC;AACtB,GACF;AACF","file":"vite.js","sourcesContent":["import { existsSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport type { UserConfig, PluginOption, AliasOptions } from 'vite'\n\n// All publishable @fayz-ai/* packages (root src). Subpaths (e.g.\n// @fayz-ai/saas/ui, @fayz-ai/storefront/catalog) resolve automatically via\n// Vite's prefix alias matching — the shim files mirror the subpath under src/.\nconst SDK_PACKAGES = [\n 'sdk', 'core', 'auth', 'ui', 'saas', 'shop', 'storefront', 'portal', 'courses', 'db',\n] as const\n\nconst SDK_PLUGINS = [\n 'agenda', 'auth', 'automations', 'blog', 'conversations', 'courses', 'crm', 'dashboard',\n 'financial', 'forms', 'inventory', 'marketing', 'menu', 'orders', 'payments', 'reports',\n 'reputation', 'shop', 'sites', 'tables', 'tasks',\n] as const\n\nexport interface FayzViteOptions {\n /** Dev server port. */\n port?: number\n /** Fail instead of incrementing if the port is taken. */\n strictPort?: boolean\n /** Extra app-specific aliases, merged after the SDK aliases. */\n aliases?: Record<string, string>\n /** Extra Vite plugins, appended after @vitejs/plugin-react. */\n plugins?: PluginOption[]\n /** SDK source location relative to the app root (default ../../fayz-sdk). */\n sdkDir?: string\n /** App root directory (default process.cwd()). */\n root?: string\n /**\n * Extra Vite `server` config, merged over the SDK server defaults. The\n * preview-container contract (host/cors/allowedHosts/headers) is applied\n * first, so an override can add e.g. `proxy` without dropping it.\n */\n server?: UserConfig['server']\n /**\n * Extra Vite `resolve` config, merged over the SDK resolve defaults. The SDK\n * alias map / dedupe / conditions win for `@fayz-ai/*` local-source\n * resolution; any other resolve keys (and extra aliases) are merged in.\n */\n resolve?: UserConfig['resolve']\n}\n\n/**\n * Shared Vite config for Fayz dogfood apps. Resolves `@fayz-ai/*` from the local\n * SDK source when it is checked out next to the app AND `FAYZ_SDK_SOURCE` is not\n * `published`; otherwise from node_modules (the Fayz editor sandbox / published\n * npm). Apps no longer hand-maintain alias maps or the local-vs-npm guard.\n *\n * import { defineConfig } from 'vite'\n * import react from '@vitejs/plugin-react'\n * import { fayzVite } from '@fayz-ai/sdk/vite'\n * export default defineConfig(fayzVite({ port: 5185, plugins: [react()] }))\n *\n * The app passes its own `@vitejs/plugin-react` so `@fayz-ai/sdk` carries no\n * build-tool peer deps (which otherwise choke npm's peer resolution, since sdk\n * sits in every dependency path).\n */\nexport function fayzVite(opts: FayzViteOptions = {}): UserConfig {\n const root = opts.root ?? process.cwd()\n const fayzSdk = resolve(root, opts.sdkDir ?? '../../fayz-sdk')\n const wantLocal = process.env.FAYZ_SDK_SOURCE !== 'published'\n const localPresent = existsSync(resolve(fayzSdk, 'packages/core/src/index.ts'))\n const useLocal = wantLocal && localPresent\n\n const localAliases: Record<string, string> = {}\n if (useLocal) {\n for (const p of SDK_PACKAGES) localAliases[`@fayz-ai/${p}`] = resolve(fayzSdk, `packages/${p}/src`)\n for (const p of SDK_PLUGINS) localAliases[`@fayz-ai/plugin-${p}`] = resolve(fayzSdk, `plugins/plugin-${p}/src`)\n }\n\n // Pull SDK-owned resolve keys out of any caller override so they can't clobber\n // local-source @fayz-ai/* resolution; the rest of `resolve` is merged in.\n const { alias: userAlias, dedupe: userDedupe, conditions: _ignore, ...restResolve } =\n (opts.resolve ?? {}) as Exclude<UserConfig['resolve'], undefined>\n\n return {\n plugins: [...(opts.plugins ?? [])],\n envPrefix: ['VITE_', 'PUBLIC_'],\n resolve: {\n ...restResolve,\n alias: {\n '@': resolve(root, 'src'),\n ...localAliases,\n ...(opts.aliases ?? {}),\n ...((userAlias as Record<string, string> | undefined) ?? {}),\n } as AliasOptions,\n // lucide-react is a direct dep of both the app and every @fayz-ai/*\n // package; without dedupe a version skew installs two copies and esbuild\n // pre-bundles each barrel separately (~1,500 icon modules each).\n // Collapsing to one copy is the single biggest cut to the editor-container\n // optimize RAM/CPU spike. Only dedupe deps the *app* directly depends on\n // (so they're hoisted to its root node_modules) — deduping a transitive\n // like @tanstack/react-table makes Vite resolve it from the app root,\n // which fails in local-source mode and 500s the aliased UI source.\n dedupe: userDedupe ?? ['react', 'react-dom', 'zustand', 'lucide-react', 'react-router-dom', '@supabase/supabase-js', 'sonner'],\n conditions: useLocal ? ['source', 'browser', 'module', 'jsnext:main', 'jsnext'] : undefined,\n },\n optimizeDeps: { exclude: useLocal ? Object.keys(localAliases) : [] },\n // The preview-container runtime contract: Vite's host-check 403s any\n // non-local Host (browser iframe via Caddy, health probe via\n // host.docker.internal) unless allowedHosts is set. host/cors/headers keep\n // the proxied iframe + cross-origin asset fetches working. Owned here\n // because the app's vite.config has no literal `server: {` for the\n // container's text patchers to anchor on. Caller `server` merges last.\n server: {\n host: true,\n port: opts.port,\n strictPort: opts.strictPort,\n cors: true,\n allowedHosts: true,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Cross-Origin-Resource-Policy': 'cross-origin',\n },\n fs: { allow: [root, fayzSdk] },\n ...(opts.server ?? {}),\n },\n }\n}\n"]}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "fayz": {
4
4
  "status": "beta"
5
5
  },
6
- "version": "0.9.0-next.0",
6
+ "version": "0.9.0-next.1",
7
7
  "description": "Fayz SDK — API client, app params, runtime broker helpers, and shared types for generated Fayz projects",
8
8
  "type": "module",
9
9
  "sideEffects": false,
@@ -77,8 +77,8 @@
77
77
  "devDependencies": {
78
78
  "tsup": "^8.2.0",
79
79
  "typescript": "^5.5.0",
80
- "vite": "^5.4.0",
81
- "vitest": "^2.1.9"
80
+ "vite": "^8.1.5",
81
+ "vitest": "^4.1.5"
82
82
  },
83
83
  "license": "MIT",
84
84
  "homepage": "https://github.com/FayaLabs/fayz-sdk#readme",
package/src/vite.ts CHANGED
@@ -94,11 +94,11 @@ export function fayzVite(opts: FayzViteOptions = {}): UserConfig {
94
94
  // (so they're hoisted to its root node_modules) — deduping a transitive
95
95
  // like @tanstack/react-table makes Vite resolve it from the app root,
96
96
  // which fails in local-source mode and 500s the aliased UI source.
97
- dedupe: userDedupe ?? ['react', 'react-dom', 'zustand', 'lucide-react', '@supabase/supabase-js', 'sonner'],
97
+ dedupe: userDedupe ?? ['react', 'react-dom', 'zustand', 'lucide-react', 'react-router-dom', '@supabase/supabase-js', 'sonner'],
98
98
  conditions: useLocal ? ['source', 'browser', 'module', 'jsnext:main', 'jsnext'] : undefined,
99
99
  },
100
100
  optimizeDeps: { exclude: useLocal ? Object.keys(localAliases) : [] },
101
- // The preview-container runtime contract: Vite 5.4 host-check 403s any
101
+ // The preview-container runtime contract: Vite's host-check 403s any
102
102
  // non-local Host (browser iframe via Caddy, health probe via
103
103
  // host.docker.internal) unless allowedHosts is set. host/cors/headers keep
104
104
  // the proxied iframe + cross-origin asset fetches working. Owned here