pixifact 0.17.0 → 0.18.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.
@@ -277,7 +277,7 @@ export function runtimeSessionDescriptorPath(projectRoot, sessionsRoot = default
277
277
  }
278
278
  function isLoopbackOrigin(origin) {
279
279
  const hostname = new URL(origin).hostname;
280
- return hostname === 'localhost' || hostname === '::1' || hostname.startsWith('127.');
280
+ return hostname === 'localhost' || hostname === '[::1]' || hostname.startsWith('127.');
281
281
  }
282
282
  function validateRuntimeSessionDescriptor(value) {
283
283
  if (!isRecord(value)
@@ -377,10 +377,12 @@ function serverOrigin(server) {
377
377
  if (!address || typeof address === 'string') {
378
378
  throw new Error('Pixifact Runtime requires a listening Vite HTTP server.');
379
379
  }
380
- if (!(address.address === '::1' || address.address.startsWith('127.'))) {
381
- throw new Error('Pixifact Runtime requires the Vite server to bind to a loopback address.');
380
+ const host = address.address === '0.0.0.0' ? '127.0.0.1'
381
+ : address.address === '::' ? '::1' : address.address;
382
+ if (!(host === '::1' || host.startsWith('127.'))) {
383
+ throw new Error('Pixifact Runtime requires the Vite server to bind to a loopback or wildcard address.');
382
384
  }
383
- const hostname = address.address === '::1' ? '[::1]' : address.address;
385
+ const hostname = host === '::1' ? '[::1]' : host;
384
386
  const protocol = server.config.server.https ? 'https' : 'http';
385
387
  return `${protocol}://${hostname}:${address.port}`;
386
388
  }
@@ -6,7 +6,7 @@ const injectedHot = runtimeGlobal[runtimeHotKey];
6
6
  const existingRuntimeClient = runtimeGlobal[runtimeClientKey];
7
7
  const runtimeClient = existingRuntimeClient ?? (injectedHot
8
8
  ? createPixifactRuntimeClient({
9
- runtimeId: crypto.randomUUID(),
9
+ runtimeId: crypto.getRandomValues(new Uint32Array(4)).join('-'),
10
10
  hot: injectedHot,
11
11
  console,
12
12
  window,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixifact",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "Pixifact 2D UI 和轻量游戏 Scene 语义框架。",
5
5
  "packageManager": "bun@1.3.13",
6
6
  "main": "./dist/index.js",