@lattice-php/lattice 0.41.0 → 0.42.0

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.d.ts CHANGED
@@ -30,22 +30,27 @@ export type LatticeComponentPackage = {
30
30
  dir: string;
31
31
  /** Absolute path to the package's JS plugin entry. */
32
32
  plugin: string;
33
+ /** Absolute path to the package's stylesheet, when it declares one. */
34
+ css?: string;
35
+ /** Absolute path to the package's icon directory, when it declares one. */
36
+ icons?: string;
37
+ };
38
+ type LatticeManifest = {
39
+ plugin?: string;
40
+ css?: string;
41
+ icons?: string;
33
42
  };
34
43
  type InstalledPackage = {
35
44
  name: string;
36
45
  "install-path"?: string;
37
46
  extra?: {
38
- lattice?: {
39
- plugin?: string;
40
- };
47
+ lattice?: LatticeManifest;
41
48
  };
42
49
  };
43
50
  type RootPackageJson = {
44
51
  name?: string;
45
52
  extra?: {
46
- lattice?: {
47
- plugin?: string;
48
- };
53
+ lattice?: LatticeManifest;
49
54
  };
50
55
  };
51
56
  /**
@@ -77,5 +82,5 @@ export declare function discoverComponentPackages(appRoot: string): LatticeCompo
77
82
  */
78
83
  export declare function componentPackagesPlugin(packages: LatticeComponentPackage[]): Plugin;
79
84
  export declare function latticeConfig(options?: LatticeViteOptions): ConfigWithTest;
80
- export declare function resolveIconOptions(options: LatticeViteOptions): SvgSpriteOptions | null;
85
+ export declare function resolveIconOptions(options: LatticeViteOptions, packages?: LatticeComponentPackage[]): SvgSpriteOptions | null;
81
86
  export {};
package/dist/vite.js CHANGED
@@ -6,16 +6,23 @@ import { searchForWorkspaceRoot } from "vite";
6
6
  //#region resources/js/vite.ts
7
7
  function lattice(options = {}) {
8
8
  const { appRoot } = resolveRoots(options);
9
+ const packages = discoverComponentPackages(appRoot);
9
10
  const plugins = [
10
11
  corePlugin(options),
11
12
  optionalPeersPlugin(),
12
- componentPackagesPlugin(discoverComponentPackages(appRoot)),
13
+ componentPackagesPlugin(packages),
13
14
  typescriptPlugin(options)
14
15
  ];
15
- const iconOptions = resolveIconOptions(options);
16
+ const iconOptions = resolveIconOptions(options, packages);
16
17
  if (iconOptions) plugins.push(svgSprite(iconOptions));
17
18
  return plugins;
18
19
  }
20
+ function resolveManifestPaths(manifest, dir) {
21
+ return {
22
+ ...typeof manifest.css === "string" ? { css: path.resolve(dir, manifest.css) } : {},
23
+ ...typeof manifest.icons === "string" ? { icons: path.resolve(dir, manifest.icons) } : {}
24
+ };
25
+ }
19
26
  /**
20
27
  * Resolve every Composer package that declares `extra.lattice.plugin` into an
21
28
  * absolute plugin-entry path. `installPathsRelativeTo` is `vendor/composer` (the
@@ -23,13 +30,15 @@ function lattice(options = {}) {
23
30
  */
24
31
  function collectComponentPackages(installed, installPathsRelativeTo) {
25
32
  return (Array.isArray(installed) ? installed : installed.packages ?? []).flatMap((pkg) => {
26
- const entry = pkg.extra?.lattice?.plugin;
33
+ const manifest = pkg.extra?.lattice ?? {};
34
+ const entry = manifest.plugin;
27
35
  if (typeof entry !== "string") return [];
28
36
  const dir = path.resolve(installPathsRelativeTo, pkg["install-path"] ?? `../${pkg.name}`);
29
37
  return [{
30
38
  name: pkg.name,
31
39
  dir,
32
- plugin: path.resolve(dir, entry)
40
+ plugin: path.resolve(dir, entry),
41
+ ...resolveManifestPaths(manifest, dir)
33
42
  }];
34
43
  });
35
44
  }
@@ -41,12 +50,13 @@ function collectComponentPackages(installed, installPathsRelativeTo) {
41
50
  * the package itself is the app root).
42
51
  */
43
52
  function collectRootComponentPackage(composerJson, appRoot) {
44
- const entry = composerJson.extra?.lattice?.plugin;
45
- if (typeof entry !== "string" || typeof composerJson.name !== "string") return [];
53
+ const manifest = composerJson.extra?.lattice ?? {};
54
+ if (typeof manifest.plugin !== "string" || typeof composerJson.name !== "string") return [];
46
55
  return [{
47
56
  name: composerJson.name,
48
57
  dir: appRoot,
49
- plugin: path.resolve(appRoot, entry)
58
+ plugin: path.resolve(appRoot, manifest.plugin),
59
+ ...resolveManifestPaths(manifest, appRoot)
50
60
  }];
51
61
  }
52
62
  /**
@@ -84,7 +94,12 @@ function componentPackagesPlugin(packages) {
84
94
  name: "lattice:component-packages",
85
95
  config(config) {
86
96
  if (packages.length === 0) return {};
87
- return { server: { fs: { allow: [searchForWorkspaceRoot(config.root ?? process.cwd()), ...packages.map((pkg) => pkg.dir)] } } };
97
+ const workspaceRoot = searchForWorkspaceRoot(config.root ?? process.cwd());
98
+ const alias = Object.fromEntries(packages.flatMap((pkg) => pkg.css ? [[`@${pkg.name}/css`, pkg.css]] : []));
99
+ return {
100
+ ...Object.keys(alias).length > 0 ? { resolve: { alias } } : {},
101
+ server: { fs: { allow: [workspaceRoot, ...packages.map((pkg) => pkg.dir)] } }
102
+ };
88
103
  },
89
104
  resolveId(id) {
90
105
  return id === VIRTUAL_PLUGINS_ID ? RESOLVED_VIRTUAL_PLUGINS_ID : null;
@@ -194,7 +209,7 @@ function typescriptPlugin(options) {
194
209
  }
195
210
  };
196
211
  }
197
- function resolveIconOptions(options) {
212
+ function resolveIconOptions(options, packages = []) {
198
213
  const icons = options.icons ?? true;
199
214
  if (icons === false) return null;
200
215
  const { root } = resolveRoots(options);
@@ -206,7 +221,11 @@ function resolveIconOptions(options) {
206
221
  };
207
222
  return {
208
223
  ...spriteOptions,
209
- iconDirs: [path.resolve(root, "../ui/resources/icons"), ...dirs],
224
+ iconDirs: [
225
+ path.resolve(root, "../ui/resources/icons"),
226
+ ...packages.flatMap((pkg) => pkg.icons ? [pkg.icons] : []),
227
+ ...dirs
228
+ ],
210
229
  ...dts === false ? {} : { dts: {
211
230
  ...defaultTypes,
212
231
  ...dts
package/dist/vite.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"vite.js","names":[],"sources":["../resources/js/vite.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { svgSprite } from \"@lattice-php/vite-svg-sprite\";\nimport type { IconTypesOptions, SvgSpriteOptions } from \"@lattice-php/vite-svg-sprite\";\nimport { searchForWorkspaceRoot } from \"vite\";\nimport type { Plugin, PluginOption, UserConfig } from \"vite\";\nimport { refreshTypeScriptTypes } from \"./vite-typescript-refresh.ts\";\n\ntype InlineDependency = string | RegExp;\n\ntype ConfigWithTest = UserConfig & {\n test?: {\n server?: {\n deps?: {\n inline?: InlineDependency[];\n };\n };\n };\n};\n\nexport type LatticeViteIconsOptions = Omit<SvgSpriteOptions, \"dts\" | \"iconDirs\"> & {\n dirs?: string[];\n dts?: Partial<IconTypesOptions> | false;\n};\n\nexport type LatticeViteOptions = {\n appRoot?: string;\n icons?: boolean | LatticeViteIconsOptions;\n root?: string;\n source?: boolean;\n /** Refresh generated TypeScript types via the dev server. Defaults to `true`. */\n typescript?: boolean;\n};\n\ntype Roots = {\n appRoot: string;\n root: string;\n};\n\nexport function lattice(options: LatticeViteOptions = {}): PluginOption[] {\n const { appRoot } = resolveRoots(options);\n const plugins: PluginOption[] = [\n corePlugin(options),\n optionalPeersPlugin(),\n componentPackagesPlugin(discoverComponentPackages(appRoot)),\n typescriptPlugin(options),\n ];\n const iconOptions = resolveIconOptions(options);\n\n if (iconOptions) {\n plugins.push(svgSprite(iconOptions));\n }\n\n return plugins;\n}\n\n/** A Composer package that contributes a Lattice component plugin. */\nexport type LatticeComponentPackage = {\n name: string;\n /** Absolute path to the package's installed directory. */\n dir: string;\n /** Absolute path to the package's JS plugin entry. */\n plugin: string;\n};\n\ntype InstalledPackage = {\n name: string;\n \"install-path\"?: string;\n extra?: { lattice?: { plugin?: string } };\n};\n\ntype RootPackageJson = {\n name?: string;\n extra?: { lattice?: { plugin?: string } };\n};\n\n/**\n * Resolve every Composer package that declares `extra.lattice.plugin` into an\n * absolute plugin-entry path. `installPathsRelativeTo` is `vendor/composer` (the\n * dir `installed.json` records its `install-path`s against).\n */\nexport function collectComponentPackages(\n installed: { packages?: InstalledPackage[] } | InstalledPackage[],\n installPathsRelativeTo: string,\n): LatticeComponentPackage[] {\n const packages = Array.isArray(installed) ? installed : (installed.packages ?? []);\n\n return packages.flatMap((pkg) => {\n const entry = pkg.extra?.lattice?.plugin;\n\n if (typeof entry !== \"string\") {\n return [];\n }\n\n const dir = path.resolve(installPathsRelativeTo, pkg[\"install-path\"] ?? `../${pkg.name}`);\n\n return [{ name: pkg.name, dir, plugin: path.resolve(dir, entry) }];\n });\n}\n\n/**\n * Resolve the composer ROOT project's own `extra.lattice.plugin` — Composer\n * never lists the root package in `installed.json`, so a component package\n * declaring the plugin entry in its own composer.json would otherwise be\n * invisible to its own dev server (e.g. inside a testbench workbench, where\n * the package itself is the app root).\n */\nexport function collectRootComponentPackage(\n composerJson: RootPackageJson,\n appRoot: string,\n): LatticeComponentPackage[] {\n const entry = composerJson.extra?.lattice?.plugin;\n\n if (typeof entry !== \"string\" || typeof composerJson.name !== \"string\") {\n return [];\n }\n\n return [{ name: composerJson.name, dir: appRoot, plugin: path.resolve(appRoot, entry) }];\n}\n\n/**\n * Read `<appRoot>/vendor/composer/installed.json` and `<appRoot>/composer.json`\n * and collect every component package they contribute.\n */\nexport function discoverComponentPackages(appRoot: string): LatticeComponentPackage[] {\n const composerDir = path.resolve(appRoot, \"vendor/composer\");\n\n let installed: LatticeComponentPackage[] = [];\n\n try {\n const raw = readFileSync(path.join(composerDir, \"installed.json\"), \"utf8\");\n installed = collectComponentPackages(JSON.parse(raw), composerDir);\n } catch {\n installed = [];\n }\n\n let root: LatticeComponentPackage[] = [];\n\n try {\n const raw = readFileSync(path.join(appRoot, \"composer.json\"), \"utf8\");\n root = collectRootComponentPackage(JSON.parse(raw), appRoot);\n } catch {\n root = [];\n }\n\n return [...installed, ...root];\n}\n\nconst VIRTUAL_PLUGINS_ID = \"virtual:lattice/plugins\";\nconst RESOLVED_VIRTUAL_PLUGINS_ID = `\\0${VIRTUAL_PLUGINS_ID}`;\n\n/**\n * Exposes the discovered component packages as `virtual:lattice/plugins` — a\n * module whose default export is the array of their plugin objects,\n * ready for `extendRegistry(registry, ...plugins)`. Also grants Vite filesystem\n * access to each package dir so its source compiles from `vendor/` (or a symlink).\n */\nexport function componentPackagesPlugin(packages: LatticeComponentPackage[]): Plugin {\n return {\n name: \"lattice:component-packages\",\n config(config) {\n if (packages.length === 0) {\n return {};\n }\n\n const workspaceRoot = searchForWorkspaceRoot(config.root ?? process.cwd());\n\n return { server: { fs: { allow: [workspaceRoot, ...packages.map((pkg) => pkg.dir)] } } };\n },\n resolveId(id) {\n return id === VIRTUAL_PLUGINS_ID ? RESOLVED_VIRTUAL_PLUGINS_ID : null;\n },\n load(id) {\n if (id !== RESOLVED_VIRTUAL_PLUGINS_ID) {\n return null;\n }\n\n const imports = packages\n .map((pkg, index) => `import p${index} from ${JSON.stringify(pkg.plugin)};`)\n .join(\"\\n\");\n const list = packages.map((_, index) => `p${index}`).join(\", \");\n\n return `${imports}\\nexport default [${list}];\\n`;\n },\n };\n}\n\nexport function latticeConfig(options: LatticeViteOptions = {}): ConfigWithTest {\n const { appRoot, root } = resolveRoots(options);\n\n return {\n resolve: {\n // A react alias would break SSR: Vite only externalizes bare specifiers,\n // so an absolute path inlines react's CJS into the SSR module runner.\n // `dedupe` alone keeps the app on a single React copy, symlinks included.\n ...(options.source\n ? {\n alias: {\n \"@lattice-php/lattice/css\": path.resolve(root, \"../ui/resources/css/lattice.css\"),\n \"@lattice-php/lattice\": path.resolve(root, \"resources/js\"),\n \"@lattice-php/action\": path.resolve(root, \"../action/resources/js\"),\n \"@lattice-php/core\": path.resolve(root, \"../core/resources/js\"),\n \"@lattice-php/form\": path.resolve(root, \"../form/resources/js\"),\n \"@lattice-php/table\": path.resolve(root, \"../table/resources/js\"),\n \"@lattice-php/ui/css\": path.resolve(root, \"../ui/resources/css/lattice.css\"),\n \"@lattice-php/ui\": path.resolve(root, \"../ui/resources/js\"),\n },\n }\n : {}),\n dedupe: [\"@inertiajs/react\", \"react\", \"react-dom\"],\n },\n server: options.source\n ? {\n fs: {\n allow: [searchForWorkspaceRoot(appRoot), root],\n },\n }\n : undefined,\n test: {\n server: {\n deps: {\n inline: [\n \"@lattice-php/lattice\",\n \"@lattice-php/action\",\n \"@lattice-php/core\",\n \"@lattice-php/form\",\n \"@lattice-php/table\",\n \"@lattice-php/ui\",\n /[/\\\\]lattice[/\\\\]dist[/\\\\]/,\n /[/\\\\]lattice[/\\\\]node_modules[/\\\\]@radix-ui[/\\\\]/,\n /[/\\\\]lattice[/\\\\]node_modules[/\\\\]@tiptap[/\\\\]/,\n /[/\\\\]lattice[/\\\\]node_modules[/\\\\]react-i18next[/\\\\]/,\n ],\n },\n },\n },\n };\n}\n\nfunction corePlugin(options: LatticeViteOptions): Plugin {\n return {\n name: \"lattice\",\n config() {\n return latticeConfig(options);\n },\n };\n}\n\nconst OPTIONAL_PEER_STUB_PREFIX = \"\\0lattice-optional-peer/\";\n\n/**\n * Real-time listeners statically import their optional Echo peers. A consumer\n * that never uses real-time should still build, so stub a missing peer with\n * hooks that throw — the `RealtimeListeners` error boundary then degrades\n * gracefully and warns to install the peer, exactly as when it is absent.\n */\nconst OPTIONAL_PEER_STUBS: Record<string, string> = {\n \"@laravel/echo-react\": [\n \"const missing = () => {\",\n \" throw new Error(\",\n ' \"[lattice] Real-time listeners require @laravel/echo-react. Install it and call configureEcho().\",',\n \" );\",\n \"};\",\n \"export const useEcho = missing;\",\n \"export const useEchoPublic = missing;\",\n \"export const useEchoPresence = missing;\",\n \"export const useEchoNotification = missing;\",\n ].join(\"\\n\"),\n};\n\nfunction optionalPeersPlugin(): Plugin {\n return {\n name: \"lattice:optional-peers\",\n enforce: \"pre\",\n async resolveId(id) {\n if (!Object.prototype.hasOwnProperty.call(OPTIONAL_PEER_STUBS, id)) {\n return null;\n }\n\n const installed = await this.resolve(id, undefined, { skipSelf: true });\n\n return installed ? null : `${OPTIONAL_PEER_STUB_PREFIX}${id}`;\n },\n load(id) {\n if (!id.startsWith(OPTIONAL_PEER_STUB_PREFIX)) {\n return null;\n }\n\n return OPTIONAL_PEER_STUBS[id.slice(OPTIONAL_PEER_STUB_PREFIX.length)] ?? null;\n },\n };\n}\n\n/**\n * Refreshes `node.props` typings from the app's own `php artisan\n * lattice:typescript` whenever the dev server starts — installing or updating\n * a component package would otherwise leave its generated types stale until\n * someone remembers to run the command by hand. Dev-server only: a production\n * build machine may not have PHP installed, and the generated file is a dev\n * ergonomics artifact, not a build input.\n *\n * Module-private like its siblings `optionalPeersPlugin`/`corePlugin` — the\n * `refreshTypeScriptTypes` DI seam it defers to lives in\n * `./vite-typescript-refresh`, which isn't part of the published `vite`\n * subpath either (see that module for why).\n */\nfunction typescriptPlugin(options: LatticeViteOptions): Plugin {\n return {\n name: \"lattice:typescript\",\n apply: \"serve\",\n configureServer(server) {\n const typescript = options.typescript ?? true;\n\n if (typescript === false) {\n return;\n }\n\n const { appRoot } = resolveRoots(options);\n\n refreshTypeScriptTypes(appRoot, server.config.logger);\n },\n };\n}\n\nexport function resolveIconOptions(options: LatticeViteOptions): SvgSpriteOptions | null {\n const icons = options.icons ?? true;\n\n if (icons === false) {\n return null;\n }\n\n const { root } = resolveRoots(options);\n const iconOptions = icons === true ? {} : icons;\n const { dirs = [], dts, ...spriteOptions } = iconOptions;\n const defaultTypes = {\n file: \"resources/js/types/sprite-icons.ts\",\n augmentModule: \"@lattice-php/ui\",\n augmentInterface: \"KnownIcons\",\n };\n\n return {\n ...spriteOptions,\n iconDirs: [path.resolve(root, \"../ui/resources/icons\"), ...dirs],\n ...(dts === false ? {} : { dts: { ...defaultTypes, ...dts } }),\n };\n}\n\nfunction resolveRoots(options: LatticeViteOptions): Roots {\n const appRoot = options.appRoot ?? process.cwd();\n const root = options.root ?? path.resolve(appRoot, \"vendor/lattice-php/lattice\");\n\n return { appRoot, root };\n}\n"],"mappings":";;;;;;AAuCA,SAAgB,QAAQ,UAA8B,CAAC,GAAmB;CACxE,MAAM,EAAE,YAAY,aAAa,OAAO;CACxC,MAAM,UAA0B;EAC9B,WAAW,OAAO;EAClB,oBAAoB;EACpB,wBAAwB,0BAA0B,OAAO,CAAC;EAC1D,iBAA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AAO,CAAC,GAAG,KAAK,GAAG,kBADP,UAAU,OAAO,CAAC,IAAI;CAE1C,MAAM,eAAe;EACnB,MAAM;EACN,eAAe;EACf,kBAAkB;CACpB;CAEA,OAAO;EACL,GAAG;EACH,UAAU,CAAC,KAAK,QAAQ,MAAM,uBAAuB,GAAG,GAAG,IAAI;EAC/D,GAAI,QAAQ,QAAQ,CAAC,IAAI,EAAE,KAAK;GAAE,GAAG;GAAc,GAAG;EAAI,EAAE;CAC9D;AACF;AAEA,SAAS,aAAa,SAAoC;CACxD,MAAM,UAAU,QAAQ,WAAW,QAAQ,IAAI;CAG/C,OAAO;EAAE;EAAS,MAFL,QAAQ,QAAQ,KAAK,QAAQ,SAAS,4BAA4B;CAExD;AACzB"}
1
+ {"version":3,"file":"vite.js","names":[],"sources":["../resources/js/vite.ts"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { svgSprite } from \"@lattice-php/vite-svg-sprite\";\nimport type { IconTypesOptions, SvgSpriteOptions } from \"@lattice-php/vite-svg-sprite\";\nimport { searchForWorkspaceRoot } from \"vite\";\nimport type { Plugin, PluginOption, UserConfig } from \"vite\";\nimport { refreshTypeScriptTypes } from \"./vite-typescript-refresh.ts\";\n\ntype InlineDependency = string | RegExp;\n\ntype ConfigWithTest = UserConfig & {\n test?: {\n server?: {\n deps?: {\n inline?: InlineDependency[];\n };\n };\n };\n};\n\nexport type LatticeViteIconsOptions = Omit<SvgSpriteOptions, \"dts\" | \"iconDirs\"> & {\n dirs?: string[];\n dts?: Partial<IconTypesOptions> | false;\n};\n\nexport type LatticeViteOptions = {\n appRoot?: string;\n icons?: boolean | LatticeViteIconsOptions;\n root?: string;\n source?: boolean;\n /** Refresh generated TypeScript types via the dev server. Defaults to `true`. */\n typescript?: boolean;\n};\n\ntype Roots = {\n appRoot: string;\n root: string;\n};\n\nexport function lattice(options: LatticeViteOptions = {}): PluginOption[] {\n const { appRoot } = resolveRoots(options);\n const packages = discoverComponentPackages(appRoot);\n const plugins: PluginOption[] = [\n corePlugin(options),\n optionalPeersPlugin(),\n componentPackagesPlugin(packages),\n typescriptPlugin(options),\n ];\n const iconOptions = resolveIconOptions(options, packages);\n\n if (iconOptions) {\n plugins.push(svgSprite(iconOptions));\n }\n\n return plugins;\n}\n\n/** A Composer package that contributes a Lattice component plugin. */\nexport type LatticeComponentPackage = {\n name: string;\n /** Absolute path to the package's installed directory. */\n dir: string;\n /** Absolute path to the package's JS plugin entry. */\n plugin: string;\n /** Absolute path to the package's stylesheet, when it declares one. */\n css?: string;\n /** Absolute path to the package's icon directory, when it declares one. */\n icons?: string;\n};\n\ntype LatticeManifest = { plugin?: string; css?: string; icons?: string };\n\ntype InstalledPackage = {\n name: string;\n \"install-path\"?: string;\n extra?: { lattice?: LatticeManifest };\n};\n\ntype RootPackageJson = {\n name?: string;\n extra?: { lattice?: LatticeManifest };\n};\n\nfunction resolveManifestPaths(\n manifest: LatticeManifest,\n dir: string,\n): Pick<LatticeComponentPackage, \"css\" | \"icons\"> {\n return {\n ...(typeof manifest.css === \"string\" ? { css: path.resolve(dir, manifest.css) } : {}),\n ...(typeof manifest.icons === \"string\" ? { icons: path.resolve(dir, manifest.icons) } : {}),\n };\n}\n\n/**\n * Resolve every Composer package that declares `extra.lattice.plugin` into an\n * absolute plugin-entry path. `installPathsRelativeTo` is `vendor/composer` (the\n * dir `installed.json` records its `install-path`s against).\n */\nexport function collectComponentPackages(\n installed: { packages?: InstalledPackage[] } | InstalledPackage[],\n installPathsRelativeTo: string,\n): LatticeComponentPackage[] {\n const packages = Array.isArray(installed) ? installed : (installed.packages ?? []);\n\n return packages.flatMap((pkg) => {\n const manifest = pkg.extra?.lattice ?? {};\n const entry = manifest.plugin;\n\n if (typeof entry !== \"string\") {\n return [];\n }\n\n const dir = path.resolve(installPathsRelativeTo, pkg[\"install-path\"] ?? `../${pkg.name}`);\n\n return [\n {\n name: pkg.name,\n dir,\n plugin: path.resolve(dir, entry),\n ...resolveManifestPaths(manifest, dir),\n },\n ];\n });\n}\n\n/**\n * Resolve the composer ROOT project's own `extra.lattice.plugin` — Composer\n * never lists the root package in `installed.json`, so a component package\n * declaring the plugin entry in its own composer.json would otherwise be\n * invisible to its own dev server (e.g. inside a testbench workbench, where\n * the package itself is the app root).\n */\nexport function collectRootComponentPackage(\n composerJson: RootPackageJson,\n appRoot: string,\n): LatticeComponentPackage[] {\n const manifest = composerJson.extra?.lattice ?? {};\n\n if (typeof manifest.plugin !== \"string\" || typeof composerJson.name !== \"string\") {\n return [];\n }\n\n return [\n {\n name: composerJson.name,\n dir: appRoot,\n plugin: path.resolve(appRoot, manifest.plugin),\n ...resolveManifestPaths(manifest, appRoot),\n },\n ];\n}\n\n/**\n * Read `<appRoot>/vendor/composer/installed.json` and `<appRoot>/composer.json`\n * and collect every component package they contribute.\n */\nexport function discoverComponentPackages(appRoot: string): LatticeComponentPackage[] {\n const composerDir = path.resolve(appRoot, \"vendor/composer\");\n\n let installed: LatticeComponentPackage[] = [];\n\n try {\n const raw = readFileSync(path.join(composerDir, \"installed.json\"), \"utf8\");\n installed = collectComponentPackages(JSON.parse(raw), composerDir);\n } catch {\n installed = [];\n }\n\n let root: LatticeComponentPackage[] = [];\n\n try {\n const raw = readFileSync(path.join(appRoot, \"composer.json\"), \"utf8\");\n root = collectRootComponentPackage(JSON.parse(raw), appRoot);\n } catch {\n root = [];\n }\n\n return [...installed, ...root];\n}\n\nconst VIRTUAL_PLUGINS_ID = \"virtual:lattice/plugins\";\nconst RESOLVED_VIRTUAL_PLUGINS_ID = `\\0${VIRTUAL_PLUGINS_ID}`;\n\n/**\n * Exposes the discovered component packages as `virtual:lattice/plugins` — a\n * module whose default export is the array of their plugin objects,\n * ready for `extendRegistry(registry, ...plugins)`. Also grants Vite filesystem\n * access to each package dir so its source compiles from `vendor/` (or a symlink).\n */\nexport function componentPackagesPlugin(packages: LatticeComponentPackage[]): Plugin {\n return {\n name: \"lattice:component-packages\",\n config(config) {\n if (packages.length === 0) {\n return {};\n }\n\n const workspaceRoot = searchForWorkspaceRoot(config.root ?? process.cwd());\n // Vite's mergeAlias puts plugin-config aliases in front of the user config's,\n // so this specific `/css` alias wins over a user's broader package-dir alias.\n const alias = Object.fromEntries(\n packages.flatMap((pkg) => (pkg.css ? [[`@${pkg.name}/css`, pkg.css]] : [])),\n );\n\n return {\n ...(Object.keys(alias).length > 0 ? { resolve: { alias } } : {}),\n server: { fs: { allow: [workspaceRoot, ...packages.map((pkg) => pkg.dir)] } },\n };\n },\n resolveId(id) {\n return id === VIRTUAL_PLUGINS_ID ? RESOLVED_VIRTUAL_PLUGINS_ID : null;\n },\n load(id) {\n if (id !== RESOLVED_VIRTUAL_PLUGINS_ID) {\n return null;\n }\n\n const imports = packages\n .map((pkg, index) => `import p${index} from ${JSON.stringify(pkg.plugin)};`)\n .join(\"\\n\");\n const list = packages.map((_, index) => `p${index}`).join(\", \");\n\n return `${imports}\\nexport default [${list}];\\n`;\n },\n };\n}\n\nexport function latticeConfig(options: LatticeViteOptions = {}): ConfigWithTest {\n const { appRoot, root } = resolveRoots(options);\n\n return {\n resolve: {\n // A react alias would break SSR: Vite only externalizes bare specifiers,\n // so an absolute path inlines react's CJS into the SSR module runner.\n // `dedupe` alone keeps the app on a single React copy, symlinks included.\n ...(options.source\n ? {\n alias: {\n \"@lattice-php/lattice/css\": path.resolve(root, \"../ui/resources/css/lattice.css\"),\n \"@lattice-php/lattice\": path.resolve(root, \"resources/js\"),\n \"@lattice-php/action\": path.resolve(root, \"../action/resources/js\"),\n \"@lattice-php/core\": path.resolve(root, \"../core/resources/js\"),\n \"@lattice-php/form\": path.resolve(root, \"../form/resources/js\"),\n \"@lattice-php/table\": path.resolve(root, \"../table/resources/js\"),\n \"@lattice-php/ui/css\": path.resolve(root, \"../ui/resources/css/lattice.css\"),\n \"@lattice-php/ui\": path.resolve(root, \"../ui/resources/js\"),\n },\n }\n : {}),\n dedupe: [\"@inertiajs/react\", \"react\", \"react-dom\"],\n },\n server: options.source\n ? {\n fs: {\n allow: [searchForWorkspaceRoot(appRoot), root],\n },\n }\n : undefined,\n test: {\n server: {\n deps: {\n inline: [\n \"@lattice-php/lattice\",\n \"@lattice-php/action\",\n \"@lattice-php/core\",\n \"@lattice-php/form\",\n \"@lattice-php/table\",\n \"@lattice-php/ui\",\n /[/\\\\]lattice[/\\\\]dist[/\\\\]/,\n /[/\\\\]lattice[/\\\\]node_modules[/\\\\]@radix-ui[/\\\\]/,\n /[/\\\\]lattice[/\\\\]node_modules[/\\\\]@tiptap[/\\\\]/,\n /[/\\\\]lattice[/\\\\]node_modules[/\\\\]react-i18next[/\\\\]/,\n ],\n },\n },\n },\n };\n}\n\nfunction corePlugin(options: LatticeViteOptions): Plugin {\n return {\n name: \"lattice\",\n config() {\n return latticeConfig(options);\n },\n };\n}\n\nconst OPTIONAL_PEER_STUB_PREFIX = \"\\0lattice-optional-peer/\";\n\n/**\n * Real-time listeners statically import their optional Echo peers. A consumer\n * that never uses real-time should still build, so stub a missing peer with\n * hooks that throw — the `RealtimeListeners` error boundary then degrades\n * gracefully and warns to install the peer, exactly as when it is absent.\n */\nconst OPTIONAL_PEER_STUBS: Record<string, string> = {\n \"@laravel/echo-react\": [\n \"const missing = () => {\",\n \" throw new Error(\",\n ' \"[lattice] Real-time listeners require @laravel/echo-react. Install it and call configureEcho().\",',\n \" );\",\n \"};\",\n \"export const useEcho = missing;\",\n \"export const useEchoPublic = missing;\",\n \"export const useEchoPresence = missing;\",\n \"export const useEchoNotification = missing;\",\n ].join(\"\\n\"),\n};\n\nfunction optionalPeersPlugin(): Plugin {\n return {\n name: \"lattice:optional-peers\",\n enforce: \"pre\",\n async resolveId(id) {\n if (!Object.prototype.hasOwnProperty.call(OPTIONAL_PEER_STUBS, id)) {\n return null;\n }\n\n const installed = await this.resolve(id, undefined, { skipSelf: true });\n\n return installed ? null : `${OPTIONAL_PEER_STUB_PREFIX}${id}`;\n },\n load(id) {\n if (!id.startsWith(OPTIONAL_PEER_STUB_PREFIX)) {\n return null;\n }\n\n return OPTIONAL_PEER_STUBS[id.slice(OPTIONAL_PEER_STUB_PREFIX.length)] ?? null;\n },\n };\n}\n\n/**\n * Refreshes `node.props` typings from the app's own `php artisan\n * lattice:typescript` whenever the dev server starts — installing or updating\n * a component package would otherwise leave its generated types stale until\n * someone remembers to run the command by hand. Dev-server only: a production\n * build machine may not have PHP installed, and the generated file is a dev\n * ergonomics artifact, not a build input.\n *\n * Module-private like its siblings `optionalPeersPlugin`/`corePlugin` — the\n * `refreshTypeScriptTypes` DI seam it defers to lives in\n * `./vite-typescript-refresh`, which isn't part of the published `vite`\n * subpath either (see that module for why).\n */\nfunction typescriptPlugin(options: LatticeViteOptions): Plugin {\n return {\n name: \"lattice:typescript\",\n apply: \"serve\",\n configureServer(server) {\n const typescript = options.typescript ?? true;\n\n if (typescript === false) {\n return;\n }\n\n const { appRoot } = resolveRoots(options);\n\n refreshTypeScriptTypes(appRoot, server.config.logger);\n },\n };\n}\n\nexport function resolveIconOptions(\n options: LatticeViteOptions,\n packages: LatticeComponentPackage[] = [],\n): SvgSpriteOptions | null {\n const icons = options.icons ?? true;\n\n if (icons === false) {\n return null;\n }\n\n const { root } = resolveRoots(options);\n const iconOptions = icons === true ? {} : icons;\n const { dirs = [], dts, ...spriteOptions } = iconOptions;\n const defaultTypes = {\n file: \"resources/js/types/sprite-icons.ts\",\n augmentModule: \"@lattice-php/ui\",\n augmentInterface: \"KnownIcons\",\n };\n\n return {\n ...spriteOptions,\n iconDirs: [\n path.resolve(root, \"../ui/resources/icons\"),\n ...packages.flatMap((pkg) => (pkg.icons ? [pkg.icons] : [])),\n ...dirs,\n ],\n ...(dts === false ? {} : { dts: { ...defaultTypes, ...dts } }),\n };\n}\n\nfunction resolveRoots(options: LatticeViteOptions): Roots {\n const appRoot = options.appRoot ?? process.cwd();\n const root = options.root ?? path.resolve(appRoot, \"vendor/lattice-php/lattice\");\n\n return { appRoot, root };\n}\n"],"mappings":";;;;;;AAuCA,SAAgB,QAAQ,UA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WAAW,QAAQ,IAAI;CAG/C,OAAO;EAAE;EAAS,MAFL,QAAQ,QAAQ,KAAK,QAAQ,SAAS,4BAA4B;CAExD;AACzB"}
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "0.41.0"
2
+ "version": "0.42.0"
3
3
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lattice-php/lattice",
3
- "version": "0.41.0",
3
+ "version": "0.42.0",
4
4
  "description": "Server-driven React components for Laravel and Inertia.",
5
5
  "license": "MIT",
6
6
  "author": "Manuel Christlieb <manuel@christlieb.eu>",
@@ -116,11 +116,11 @@
116
116
  "typecheck": "tsc --noEmit"
117
117
  },
118
118
  "dependencies": {
119
- "@lattice-php/action": "0.41.0",
120
- "@lattice-php/core": "0.41.0",
121
- "@lattice-php/form": "0.41.0",
122
- "@lattice-php/table": "0.41.0",
123
- "@lattice-php/ui": "0.41.0",
119
+ "@lattice-php/action": "0.42.0",
120
+ "@lattice-php/core": "0.42.0",
121
+ "@lattice-php/form": "0.42.0",
122
+ "@lattice-php/table": "0.42.0",
123
+ "@lattice-php/ui": "0.42.0",
124
124
  "@lattice-php/vite-svg-sprite": "^0.3.0",
125
125
  "@atlaskit/pragmatic-drag-and-drop": "^2.0.1",
126
126
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.0.0",