@molecule/app-bonds-default 0.0.0-stage → 0.0.1-stage

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 (42) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +456 -2
  3. package/dist/auth.d.ts +156 -0
  4. package/dist/auth.d.ts.map +1 -0
  5. package/dist/auth.js +258 -0
  6. package/dist/index.d.ts +113 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +112 -0
  9. package/dist/optional/charts-chartjs.d.ts +15 -0
  10. package/dist/optional/charts-chartjs.d.ts.map +1 -0
  11. package/dist/optional/charts-chartjs.js +20 -0
  12. package/dist/optional/client-search-minisearch.d.ts +12 -0
  13. package/dist/optional/client-search-minisearch.d.ts.map +1 -0
  14. package/dist/optional/client-search-minisearch.js +17 -0
  15. package/dist/optional/code-editor-monaco.d.ts +12 -0
  16. package/dist/optional/code-editor-monaco.d.ts.map +1 -0
  17. package/dist/optional/code-editor-monaco.js +17 -0
  18. package/dist/optional/command-palette-cmdk.d.ts +12 -0
  19. package/dist/optional/command-palette-cmdk.d.ts.map +1 -0
  20. package/dist/optional/command-palette-cmdk.js +17 -0
  21. package/dist/optional/drag-drop-dndkit.d.ts +12 -0
  22. package/dist/optional/drag-drop-dndkit.d.ts.map +1 -0
  23. package/dist/optional/drag-drop-dndkit.js +17 -0
  24. package/dist/optional/keyboard-shortcuts-hotkeys.d.ts +12 -0
  25. package/dist/optional/keyboard-shortcuts-hotkeys.d.ts.map +1 -0
  26. package/dist/optional/keyboard-shortcuts-hotkeys.js +17 -0
  27. package/dist/optional/maps-leaflet.d.ts +19 -0
  28. package/dist/optional/maps-leaflet.d.ts.map +1 -0
  29. package/dist/optional/maps-leaflet.js +24 -0
  30. package/dist/optional/realtime-socketio.d.ts +24 -0
  31. package/dist/optional/realtime-socketio.d.ts.map +1 -0
  32. package/dist/optional/realtime-socketio.js +29 -0
  33. package/dist/optional/video-hls.d.ts +12 -0
  34. package/dist/optional/video-hls.d.ts.map +1 -0
  35. package/dist/optional/video-hls.js +17 -0
  36. package/dist/optional/virtual-scroll-tanstack.d.ts +12 -0
  37. package/dist/optional/virtual-scroll-tanstack.d.ts.map +1 -0
  38. package/dist/optional/virtual-scroll-tanstack.js +17 -0
  39. package/dist/setup.d.ts +53 -0
  40. package/dist/setup.d.ts.map +1 -0
  41. package/dist/setup.js +97 -0
  42. package/package.json +174 -4
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-charts` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /**
11
+ * Wires `@molecule/app-charts-chartjs` (Chart.js) to `@molecule/app-charts` — real
12
+ * line/bar/pie/etc. charts instead of the core's placeholder panel.
13
+ */
14
+ export declare function setupAppChartsChartjs(): Promise<void>;
15
+ //# sourceMappingURL=charts-chartjs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"charts-chartjs.d.ts","sourceRoot":"","sources":["../../src/optional/charts-chartjs.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAM3D"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-charts` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /**
11
+ * Wires `@molecule/app-charts-chartjs` (Chart.js) to `@molecule/app-charts` — real
12
+ * line/bar/pie/etc. charts instead of the core's placeholder panel.
13
+ */
14
+ export async function setupAppChartsChartjs() {
15
+ const [{ setProvider: setCharts }, { provider }] = await Promise.all([
16
+ import('@molecule/app-charts'),
17
+ import('@molecule/app-charts-chartjs'),
18
+ ]);
19
+ setCharts(provider);
20
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-client-search` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-client-search-minisearch` to `@molecule/app-client-search`. */
11
+ export declare function setupAppClientSearchMinisearch(): Promise<void>;
12
+ //# sourceMappingURL=client-search-minisearch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-search-minisearch.d.ts","sourceRoot":"","sources":["../../src/optional/client-search-minisearch.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,uFAAuF;AACvF,wBAAsB,8BAA8B,IAAI,OAAO,CAAC,IAAI,CAAC,CAMpE"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-client-search` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-client-search-minisearch` to `@molecule/app-client-search`. */
11
+ export async function setupAppClientSearchMinisearch() {
12
+ const [{ setProvider: setSearch }, { provider }] = await Promise.all([
13
+ import('@molecule/app-client-search'),
14
+ import('@molecule/app-client-search-minisearch'),
15
+ ]);
16
+ setSearch(provider);
17
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-code-editor` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-code-editor-monaco` to `@molecule/app-code-editor`. */
11
+ export declare function setupAppCodeEditorMonaco(): Promise<void>;
12
+ //# sourceMappingURL=code-editor-monaco.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-editor-monaco.d.ts","sourceRoot":"","sources":["../../src/optional/code-editor-monaco.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,+EAA+E;AAC/E,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC,CAM9D"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-code-editor` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-code-editor-monaco` to `@molecule/app-code-editor`. */
11
+ export async function setupAppCodeEditorMonaco() {
12
+ const [{ setProvider: setEditor }, { provider }] = await Promise.all([
13
+ import('@molecule/app-code-editor'),
14
+ import('@molecule/app-code-editor-monaco'),
15
+ ]);
16
+ setEditor(provider);
17
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-command-palette` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-command-palette-cmdk` to `@molecule/app-command-palette`. */
11
+ export declare function setupAppCommandPaletteCmdk(): Promise<void>;
12
+ //# sourceMappingURL=command-palette-cmdk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-palette-cmdk.d.ts","sourceRoot":"","sources":["../../src/optional/command-palette-cmdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,qFAAqF;AACrF,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC,CAMhE"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-command-palette` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-command-palette-cmdk` to `@molecule/app-command-palette`. */
11
+ export async function setupAppCommandPaletteCmdk() {
12
+ const [{ setProvider: setPalette }, { provider }] = await Promise.all([
13
+ import('@molecule/app-command-palette'),
14
+ import('@molecule/app-command-palette-cmdk'),
15
+ ]);
16
+ setPalette(provider);
17
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-drag-drop` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-drag-drop-dndkit` to `@molecule/app-drag-drop`. */
11
+ export declare function setupAppDragDropDndkit(): Promise<void>;
12
+ //# sourceMappingURL=drag-drop-dndkit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drag-drop-dndkit.d.ts","sourceRoot":"","sources":["../../src/optional/drag-drop-dndkit.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,2EAA2E;AAC3E,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAM5D"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-drag-drop` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-drag-drop-dndkit` to `@molecule/app-drag-drop`. */
11
+ export async function setupAppDragDropDndkit() {
12
+ const [{ setProvider: setDnd }, { provider }] = await Promise.all([
13
+ import('@molecule/app-drag-drop'),
14
+ import('@molecule/app-drag-drop-dndkit'),
15
+ ]);
16
+ setDnd(provider);
17
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-keyboard-shortcuts` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-keyboard-shortcuts-hotkeys` to `@molecule/app-keyboard-shortcuts`. */
11
+ export declare function setupAppKeyboardShortcutsHotkeys(): Promise<void>;
12
+ //# sourceMappingURL=keyboard-shortcuts-hotkeys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyboard-shortcuts-hotkeys.d.ts","sourceRoot":"","sources":["../../src/optional/keyboard-shortcuts-hotkeys.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,8FAA8F;AAC9F,wBAAsB,gCAAgC,IAAI,OAAO,CAAC,IAAI,CAAC,CAMtE"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-keyboard-shortcuts` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-keyboard-shortcuts-hotkeys` to `@molecule/app-keyboard-shortcuts`. */
11
+ export async function setupAppKeyboardShortcutsHotkeys() {
12
+ const [{ setProvider: setKbd }, { provider }] = await Promise.all([
13
+ import('@molecule/app-keyboard-shortcuts'),
14
+ import('@molecule/app-keyboard-shortcuts-hotkeys'),
15
+ ]);
16
+ setKbd(provider);
17
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-maps` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale. `@molecule/app-maps` is the import that first exposed the problem:
7
+ * it is the alphabetically-first unresolvable provider, so it is the one Rolldown
8
+ * named while the other 14 were equally broken.
9
+ *
10
+ * @module
11
+ */
12
+ /**
13
+ * Wires `@molecule/app-maps-leaflet` (Leaflet + OpenStreetMap, no API key) to
14
+ * `@molecule/app-maps` — a real slippy map instead of the core's grey placeholder.
15
+ * REQUIRES `import 'leaflet/dist/leaflet.css'` once in the app entry (the scaffolded
16
+ * `bonds/app-maps-leaflet.ts` does this); without it tiles + markers mis-position.
17
+ */
18
+ export declare function setupAppMapsLeaflet(): Promise<void>;
19
+ //# sourceMappingURL=maps-leaflet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maps-leaflet.d.ts","sourceRoot":"","sources":["../../src/optional/maps-leaflet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;GAKG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAMzD"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-maps` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale. `@molecule/app-maps` is the import that first exposed the problem:
7
+ * it is the alphabetically-first unresolvable provider, so it is the one Rolldown
8
+ * named while the other 14 were equally broken.
9
+ *
10
+ * @module
11
+ */
12
+ /**
13
+ * Wires `@molecule/app-maps-leaflet` (Leaflet + OpenStreetMap, no API key) to
14
+ * `@molecule/app-maps` — a real slippy map instead of the core's grey placeholder.
15
+ * REQUIRES `import 'leaflet/dist/leaflet.css'` once in the app entry (the scaffolded
16
+ * `bonds/app-maps-leaflet.ts` does this); without it tiles + markers mis-position.
17
+ */
18
+ export async function setupAppMapsLeaflet() {
19
+ const [{ setProvider: setMaps }, { provider }] = await Promise.all([
20
+ import('@molecule/app-maps'),
21
+ import('@molecule/app-maps-leaflet'),
22
+ ]);
23
+ setMaps(provider);
24
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-realtime` bond.
3
+ *
4
+ * Lives in its own module, reachable only via the
5
+ * `@molecule/app-bonds-default/optional/realtime-socketio.js` subpath, because
6
+ * a bundler must RESOLVE every `import()` in a module it pulls into the graph —
7
+ * before tree-shaking can drop anything. While these wirings sat in `setup.ts`
8
+ * (re-exported from the barrel), importing `bootstrapApp` dragged all 18 optional
9
+ * providers into the graph, and any app that had not installed all of them failed
10
+ * to build:
11
+ *
12
+ * ```
13
+ * [vite]: Rolldown failed to resolve import "@molecule/app-maps"
14
+ * from ".../app-bonds-default/dist/setup.js"
15
+ * ```
16
+ *
17
+ * One module per provider pair means an app pays for exactly the providers it
18
+ * imports — which is what made them optional in the first place.
19
+ *
20
+ * @module
21
+ */
22
+ /** Wires `@molecule/app-realtime-socketio` to `@molecule/app-realtime`. */
23
+ export declare function setupAppRealtimeSocketio(): Promise<void>;
24
+ //# sourceMappingURL=realtime-socketio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realtime-socketio.d.ts","sourceRoot":"","sources":["../../src/optional/realtime-socketio.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,2EAA2E;AAC3E,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC,CAM9D"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-realtime` bond.
3
+ *
4
+ * Lives in its own module, reachable only via the
5
+ * `@molecule/app-bonds-default/optional/realtime-socketio.js` subpath, because
6
+ * a bundler must RESOLVE every `import()` in a module it pulls into the graph —
7
+ * before tree-shaking can drop anything. While these wirings sat in `setup.ts`
8
+ * (re-exported from the barrel), importing `bootstrapApp` dragged all 18 optional
9
+ * providers into the graph, and any app that had not installed all of them failed
10
+ * to build:
11
+ *
12
+ * ```
13
+ * [vite]: Rolldown failed to resolve import "@molecule/app-maps"
14
+ * from ".../app-bonds-default/dist/setup.js"
15
+ * ```
16
+ *
17
+ * One module per provider pair means an app pays for exactly the providers it
18
+ * imports — which is what made them optional in the first place.
19
+ *
20
+ * @module
21
+ */
22
+ /** Wires `@molecule/app-realtime-socketio` to `@molecule/app-realtime`. */
23
+ export async function setupAppRealtimeSocketio() {
24
+ const [{ setProvider: setRealtime }, { provider }] = await Promise.all([
25
+ import('@molecule/app-realtime'),
26
+ import('@molecule/app-realtime-socketio'),
27
+ ]);
28
+ setRealtime(provider);
29
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-video` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-video-hls` (hls.js — HLS streaming everywhere) to `@molecule/app-video`. */
11
+ export declare function setupAppVideoHls(): Promise<void>;
12
+ //# sourceMappingURL=video-hls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"video-hls.d.ts","sourceRoot":"","sources":["../../src/optional/video-hls.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,oGAAoG;AACpG,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAMtD"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-video` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-video-hls` (hls.js — HLS streaming everywhere) to `@molecule/app-video`. */
11
+ export async function setupAppVideoHls() {
12
+ const [{ setProvider: setVideo }, { provider }] = await Promise.all([
13
+ import('@molecule/app-video'),
14
+ import('@molecule/app-video-hls'),
15
+ ]);
16
+ setVideo(provider);
17
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-virtual-scroll` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-virtual-scroll-tanstack` to `@molecule/app-virtual-scroll`. */
11
+ export declare function setupAppVirtualScrollTanstack(): Promise<void>;
12
+ //# sourceMappingURL=virtual-scroll-tanstack.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"virtual-scroll-tanstack.d.ts","sourceRoot":"","sources":["../../src/optional/virtual-scroll-tanstack.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,uFAAuF;AACvF,wBAAsB,6BAA6B,IAAI,OAAO,CAAC,IAAI,CAAC,CAMnE"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Wiring for the optional `@molecule/app-virtual-scroll` bond.
3
+ *
4
+ * Its own module + subpath export so a bundler only resolves these providers when
5
+ * an app actually imports them — see `./realtime-socketio.js` for the full
6
+ * rationale.
7
+ *
8
+ * @module
9
+ */
10
+ /** Wires `@molecule/app-virtual-scroll-tanstack` to `@molecule/app-virtual-scroll`. */
11
+ export async function setupAppVirtualScrollTanstack() {
12
+ const [{ setProvider: setScroll }, { provider }] = await Promise.all([
13
+ import('@molecule/app-virtual-scroll'),
14
+ import('@molecule/app-virtual-scroll-tanstack'),
15
+ ]);
16
+ setScroll(provider);
17
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Framework-neutral default app-side bond wirings (state + Tailwind ClassMap +
3
+ * localStorage + Arimo font + Molecule icons + CSS-variables theme).
4
+ *
5
+ * Centralizes the byte-identical `app/src/bonds/<name>.ts` setup functions that
6
+ * every flagship app shipped. Per-app bond files become 1-line re-exports —
7
+ * `bonds/index.ts` import sites unchanged.
8
+ *
9
+ * Each framework package (`@molecule/app-bonds-default-react`, `-vue`,
10
+ * `-solid`, `-svelte`, `-angular`) re-exports every setup here and adds its own
11
+ * `setupAppRouting<Router>()` plus a `setupAllDefaultBonds()` that wires these
12
+ * in one call. Only routing is framework-specific; everything in this module
13
+ * runs under any renderer.
14
+ *
15
+ * `setupAppStylingTailwind` registers `tailwind-merge` as the class merger
16
+ * for `cn()`; Tailwind itself is configured via env vars and the Vite plugin.
17
+ * Apps wire it in `setupProviders()` alongside the others.
18
+ *
19
+ * @module
20
+ */
21
+ import { createCSSVariablesThemeProvider } from '@molecule/app-theme-css-variables';
22
+ /** Returns (and lazily constructs) the shared default CSS-variables theme provider. */
23
+ export declare function getDefaultThemeProvider(): ReturnType<typeof createCSSVariablesThemeProvider>;
24
+ /** Wires `@molecule/app-fonts-arimo` to `@molecule/app-fonts`. */
25
+ export declare function setupAppFontsArimo(): void;
26
+ /** Wires `@molecule/app-icons-molecule` to `@molecule/app-icons`. */
27
+ export declare function setupAppIconsMolecule(): void;
28
+ /**
29
+ * Wires the framework-agnostic `simpleProvider` from `@molecule/app-state` as
30
+ * the active state provider.
31
+ *
32
+ * WITHOUT this, `createStore()` throws
33
+ * `@molecule/app-state: No provider set. Call setProvider() first` — nothing
34
+ * else in a scaffolded app wires the `state` bond, so the documented
35
+ * `createStore()` + `useStore()` pattern failed at the first render and every
36
+ * page came up blank while `tsc` passed.
37
+ */
38
+ export declare function setupAppStateSimple(): void;
39
+ /** Wires `@molecule/app-storage-localstorage` to `@molecule/app-storage`. */
40
+ export declare function setupAppStorageLocalstorage(): void;
41
+ /**
42
+ * Wires `@molecule/app-styling-tailwind`: registers `tailwind-merge` as the
43
+ * class merger for `@molecule/app-styling`'s `cn()`, so conflicting Tailwind
44
+ * utilities resolve (last wins). Tailwind itself is configured via env vars +
45
+ * the Vite plugin; this is the one runtime hook the framework-agnostic styling
46
+ * core needs so it carries no Tailwind dependency of its own.
47
+ */
48
+ export declare function setupAppStylingTailwind(): void;
49
+ /** Wires the default light + dark CSS-variables theme provider to `@molecule/app-theme`. */
50
+ export declare function setupAppThemeCssVariables(): void;
51
+ /** Wires `@molecule/app-ui-tailwind` `classMap` to `@molecule/app-ui`. */
52
+ export declare function setupAppUiTailwind(): void;
53
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAcH,OAAO,EACL,+BAA+B,EAGhC,MAAM,mCAAmC,CAAA;AAe1C,uFAAuF;AACvF,wBAAgB,uBAAuB,IAAI,UAAU,CAAC,OAAO,+BAA+B,CAAC,CAS5F;AAED,kEAAkE;AAClE,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED,qEAAqE;AACrE,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED,6EAA6E;AAC7E,wBAAgB,2BAA2B,IAAI,IAAI,CAElD;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C;AAED,4FAA4F;AAC5F,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD;AAED,0EAA0E;AAC1E,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
package/dist/setup.js ADDED
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Framework-neutral default app-side bond wirings (state + Tailwind ClassMap +
3
+ * localStorage + Arimo font + Molecule icons + CSS-variables theme).
4
+ *
5
+ * Centralizes the byte-identical `app/src/bonds/<name>.ts` setup functions that
6
+ * every flagship app shipped. Per-app bond files become 1-line re-exports —
7
+ * `bonds/index.ts` import sites unchanged.
8
+ *
9
+ * Each framework package (`@molecule/app-bonds-default-react`, `-vue`,
10
+ * `-solid`, `-svelte`, `-angular`) re-exports every setup here and adds its own
11
+ * `setupAppRouting<Router>()` plus a `setupAllDefaultBonds()` that wires these
12
+ * in one call. Only routing is framework-specific; everything in this module
13
+ * runs under any renderer.
14
+ *
15
+ * `setupAppStylingTailwind` registers `tailwind-merge` as the class merger
16
+ * for `cn()`; Tailwind itself is configured via env vars and the Vite plugin.
17
+ * Apps wire it in `setupProviders()` alongside the others.
18
+ *
19
+ * @module
20
+ */
21
+ import { setFont } from '@molecule/app-fonts';
22
+ import { font as arimoFont } from '@molecule/app-fonts-arimo';
23
+ import { setIconSet } from '@molecule/app-icons';
24
+ import { iconSet as moleculeIconSet } from '@molecule/app-icons-molecule';
25
+ import { setProvider as setState, simpleProvider as defaultStateProvider, } from '@molecule/app-state';
26
+ import { setProvider as setStorage } from '@molecule/app-storage';
27
+ import { provider as localStorageProvider } from '@molecule/app-storage-localstorage';
28
+ import { registerTailwindClassMerger } from '@molecule/app-styling-tailwind';
29
+ import { setProvider as setTheme } from '@molecule/app-theme';
30
+ import { createCSSVariablesThemeProvider, darkTheme, lightTheme, } from '@molecule/app-theme-css-variables';
31
+ import { setClassMap } from '@molecule/app-ui';
32
+ import { classMap } from '@molecule/app-ui-tailwind';
33
+ /**
34
+ * Pre-wired default CSS-variables theme provider with light + dark
35
+ * themes from `@molecule/app-theme-css-variables`. Apps that need
36
+ * custom themes should build their own provider and skip this.
37
+ *
38
+ * Lazily constructed on first access — `createCSSVariablesThemeProvider`
39
+ * touches `globalThis.localStorage.getItem` during construction, which
40
+ * throws in non-DOM environments (SSR, unit-test runners with
41
+ * incomplete localStorage shims).
42
+ */
43
+ let _defaultThemeProvider = null;
44
+ /** Returns (and lazily constructs) the shared default CSS-variables theme provider. */
45
+ export function getDefaultThemeProvider() {
46
+ if (!_defaultThemeProvider) {
47
+ _defaultThemeProvider = createCSSVariablesThemeProvider({
48
+ themes: [lightTheme, darkTheme],
49
+ defaultTheme: 'light',
50
+ persistKey: 'molecule-theme',
51
+ });
52
+ }
53
+ return _defaultThemeProvider;
54
+ }
55
+ /** Wires `@molecule/app-fonts-arimo` to `@molecule/app-fonts`. */
56
+ export function setupAppFontsArimo() {
57
+ setFont(arimoFont);
58
+ }
59
+ /** Wires `@molecule/app-icons-molecule` to `@molecule/app-icons`. */
60
+ export function setupAppIconsMolecule() {
61
+ setIconSet(moleculeIconSet);
62
+ }
63
+ /**
64
+ * Wires the framework-agnostic `simpleProvider` from `@molecule/app-state` as
65
+ * the active state provider.
66
+ *
67
+ * WITHOUT this, `createStore()` throws
68
+ * `@molecule/app-state: No provider set. Call setProvider() first` — nothing
69
+ * else in a scaffolded app wires the `state` bond, so the documented
70
+ * `createStore()` + `useStore()` pattern failed at the first render and every
71
+ * page came up blank while `tsc` passed.
72
+ */
73
+ export function setupAppStateSimple() {
74
+ setState(defaultStateProvider);
75
+ }
76
+ /** Wires `@molecule/app-storage-localstorage` to `@molecule/app-storage`. */
77
+ export function setupAppStorageLocalstorage() {
78
+ setStorage(localStorageProvider);
79
+ }
80
+ /**
81
+ * Wires `@molecule/app-styling-tailwind`: registers `tailwind-merge` as the
82
+ * class merger for `@molecule/app-styling`'s `cn()`, so conflicting Tailwind
83
+ * utilities resolve (last wins). Tailwind itself is configured via env vars +
84
+ * the Vite plugin; this is the one runtime hook the framework-agnostic styling
85
+ * core needs so it carries no Tailwind dependency of its own.
86
+ */
87
+ export function setupAppStylingTailwind() {
88
+ registerTailwindClassMerger();
89
+ }
90
+ /** Wires the default light + dark CSS-variables theme provider to `@molecule/app-theme`. */
91
+ export function setupAppThemeCssVariables() {
92
+ setTheme(getDefaultThemeProvider());
93
+ }
94
+ /** Wires `@molecule/app-ui-tailwind` `classMap` to `@molecule/app-ui`. */
95
+ export function setupAppUiTailwind() {
96
+ setClassMap(classMap);
97
+ }