@volter/twin-segment 0.1.0 → 0.1.2

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.
@@ -21,11 +21,11 @@
21
21
  // PURE FRONTEND (R3): this module imports no handler and no twin internals. It MOUNTS the pack's
22
22
  // own fetch adapter as the API backend and the client reads every byte of state back over the wire.
23
23
  import { readFile } from 'node:fs/promises';
24
- import { bundleClient, fileResponse } from '@volter/world-core';
24
+ import { bundleClient, fileResponse, filePathOf } from '@volter/world-core';
25
25
  import { serveHttp } from '@volter/world-core';
26
26
  import { createSegmentTwinFetch } from "./segment-server.js";
27
- const CLIENT_ENTRY = () => new URL('../client/segment-mirror.tsx', import.meta.url).pathname; // lazy: workerd rejects a top-level relative import.meta.url
28
- const CLIENT_CSS = () => new URL('../client/segment-mirror.css', import.meta.url).pathname; // lazy: same
27
+ const CLIENT_ENTRY = () => filePathOf(new URL('../client/segment-mirror.tsx', import.meta.url)); // lazy: workerd rejects a top-level relative import.meta.url
28
+ const CLIENT_CSS = () => filePathOf(new URL('../client/segment-mirror.css', import.meta.url)); // lazy: same
29
29
  /** STATIC literal class names — a template-literal class (`pill-${tone}`) is erased by the
30
30
  * bundler, so the mirror emits these and the verifies assert them (ADDING_A_TWIN §6). */
31
31
  export const PILL_CLASS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/twin-segment",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Local Segment twin - the HTTP Tracking API (POST /v1/batch and the direct /v1/{track,identify,page,screen,group,alias} routes) modeled over kernel state, so an unmodified @segment/analytics-node client round-trips offline. Built on @volter/world-core.",
5
5
  "author": "Volter (https://github.com/volter-ai)",
6
6
  "license": "Apache-2.0",
@@ -41,7 +41,7 @@
41
41
  "react-dom": "^19.2.7"
42
42
  },
43
43
  "peerDependencies": {
44
- "@volter/world-core": "2.0.0"
44
+ "@volter/world-core": "2.0.2"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@segment/analytics-node": "^2.3.0",
@@ -49,7 +49,7 @@
49
49
  "@types/node": "^24.0.0",
50
50
  "@types/react": "^19.2.17",
51
51
  "@types/react-dom": "^19.2.3",
52
- "@volter/world-core": "2.0.0",
52
+ "@volter/world-core": "2.0.2",
53
53
  "@volter/world-tooling": "0.1.0",
54
54
  "typescript": "^5.9.0"
55
55
  },
@@ -21,12 +21,12 @@
21
21
  // PURE FRONTEND (R3): this module imports no handler and no twin internals. It MOUNTS the pack's
22
22
  // own fetch adapter as the API backend and the client reads every byte of state back over the wire.
23
23
  import { readFile } from 'node:fs/promises';
24
- import { bundleClient, fileResponse } from '@volter/world-core';
24
+ import { bundleClient, fileResponse, filePathOf } from '@volter/world-core';
25
25
  import { serveHttp } from '@volter/world-core';
26
26
  import { createSegmentTwinFetch } from './segment-server.ts';
27
27
 
28
- const CLIENT_ENTRY = () => new URL('../client/segment-mirror.tsx', import.meta.url).pathname; // lazy: workerd rejects a top-level relative import.meta.url
29
- const CLIENT_CSS = () => new URL('../client/segment-mirror.css', import.meta.url).pathname; // lazy: same
28
+ const CLIENT_ENTRY = () => filePathOf(new URL('../client/segment-mirror.tsx', import.meta.url)); // lazy: workerd rejects a top-level relative import.meta.url
29
+ const CLIENT_CSS = () => filePathOf(new URL('../client/segment-mirror.css', import.meta.url)); // lazy: same
30
30
 
31
31
  // ---------------------------------------------------------------------------
32
32
  // Pure, dependency-free render/format helpers (importable by the React client; Bun tree-shakes