@jxrstudios/jxr 1.0.7 → 1.0.9
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/index.js +30 -2
- package/dist/jxr-server-manager.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +48 -0
- package/src/jxr-server-manager.ts +15 -7
package/dist/index.js
CHANGED
|
@@ -1744,16 +1744,19 @@ var JXRServerManager = class {
|
|
|
1744
1744
|
}
|
|
1745
1745
|
async processPendingChanges() {
|
|
1746
1746
|
if (this.pendingChanges.size === 0) return;
|
|
1747
|
-
console.log(`\u{1F504} Processing ${this.pendingChanges.size} file
|
|
1747
|
+
console.log(`\u{1F504} Processing ${this.pendingChanges.size} file change(s)...`);
|
|
1748
1748
|
for (const [path3, file] of this.pendingChanges) {
|
|
1749
1749
|
this.runtime.vfs.write("/" + path3, file.content);
|
|
1750
1750
|
const existingIndex = this.projectFiles.findIndex((f) => f.path === path3);
|
|
1751
1751
|
if (existingIndex >= 0) {
|
|
1752
1752
|
this.projectFiles[existingIndex] = file;
|
|
1753
1753
|
}
|
|
1754
|
+
this.transpiler.invalidateFile("/" + path3);
|
|
1755
|
+
console.log(` \u2713 Updated: ${path3}`);
|
|
1754
1756
|
}
|
|
1755
1757
|
this.pendingChanges.clear();
|
|
1756
1758
|
this.broadcastReload();
|
|
1759
|
+
console.log("\u{1F525} HMR update sent to browser");
|
|
1757
1760
|
}
|
|
1758
1761
|
broadcastReload() {
|
|
1759
1762
|
const message = JSON.stringify({ type: "reload", timestamp: Date.now() });
|
|
@@ -1904,11 +1907,36 @@ export default \`${escapedCSS}\`;
|
|
|
1904
1907
|
"wouter": "https://esm.sh/wouter@3.6.0?external=react",
|
|
1905
1908
|
"lucide-react": "https://esm.sh/lucide-react@0.483.0?external=react",
|
|
1906
1909
|
"sonner": "https://esm.sh/sonner@2.0.1?external=react",
|
|
1910
|
+
"next-themes": "https://esm.sh/next-themes@0.4.6?external=react",
|
|
1907
1911
|
"@radix-ui/react-dialog": "https://esm.sh/@radix-ui/react-dialog@1.1.6?external=react",
|
|
1908
1912
|
"@radix-ui/react-tooltip": "https://esm.sh/@radix-ui/react-tooltip@1.1.8?external=react",
|
|
1913
|
+
"@radix-ui/react-slot": "https://esm.sh/@radix-ui/react-slot@1.1.2?external=react",
|
|
1914
|
+
"@radix-ui/react-primitive": "https://esm.sh/@radix-ui/react-primitive@2.0.2?external=react",
|
|
1915
|
+
"@radix-ui/react-compose-refs": "https://esm.sh/@radix-ui/react-compose-refs@1.1.1?external=react",
|
|
1916
|
+
"@radix-ui/react-context": "https://esm.sh/@radix-ui/react-context@1.1.1?external=react",
|
|
1917
|
+
"@radix-ui/react-use-controllable-state": "https://esm.sh/@radix-ui/react-use-controllable-state@1.1.0?external=react",
|
|
1918
|
+
"@radix-ui/react-use-escape-keydown": "https://esm.sh/@radix-ui/react-use-escape-keydown@1.1.0?external=react",
|
|
1919
|
+
"@radix-ui/react-use-layout-effect": "https://esm.sh/@radix-ui/react-use-layout-effect@1.1.0?external=react",
|
|
1920
|
+
"@radix-ui/react-dismissable-layer": "https://esm.sh/@radix-ui/react-dismissable-layer@1.1.5?external=react",
|
|
1921
|
+
"@radix-ui/react-focus-guards": "https://esm.sh/@radix-ui/react-focus-guards@1.1.1?external=react",
|
|
1922
|
+
"@radix-ui/react-focus-scope": "https://esm.sh/@radix-ui/react-focus-scope@1.1.2?external=react",
|
|
1923
|
+
"@radix-ui/react-portal": "https://esm.sh/@radix-ui/react-portal@1.1.4?external=react",
|
|
1924
|
+
"@radix-ui/react-presence": "https://esm.sh/@radix-ui/react-presence@1.1.2?external=react",
|
|
1925
|
+
"@radix-ui/react-id": "https://esm.sh/@radix-ui/react-id@1.1.0?external=react",
|
|
1926
|
+
"@radix-ui/primitive": "https://esm.sh/@radix-ui/primitive@1.1.1",
|
|
1927
|
+
"aria-hidden": "https://esm.sh/aria-hidden@1.2.4",
|
|
1928
|
+
"react-remove-scroll": "https://esm.sh/react-remove-scroll@2.6.3?external=react",
|
|
1929
|
+
"tslib": "https://esm.sh/tslib@2.8.1",
|
|
1930
|
+
"get-nonce": "https://esm.sh/get-nonce@1.0.1",
|
|
1931
|
+
"use-callback-ref": "https://esm.sh/use-callback-ref@1.3.3?external=react",
|
|
1932
|
+
"use-sidecar": "https://esm.sh/use-sidecar@1.1.3?external=react",
|
|
1933
|
+
"detect-node-es": "https://esm.sh/detect-node-es@1.1.0",
|
|
1934
|
+
"copy-to-clipboard": "https://esm.sh/copy-to-clipboard@3.3.3",
|
|
1935
|
+
"toggle-selection": "https://esm.sh/toggle-selection@1.0.6",
|
|
1909
1936
|
"clsx": "https://esm.sh/clsx@2.1.1",
|
|
1910
1937
|
"tailwind-merge": "https://esm.sh/tailwind-merge@3.0.2",
|
|
1911
|
-
"class-variance-authority": "https://esm.sh/class-variance-authority@0.7.1"
|
|
1938
|
+
"class-variance-authority": "https://esm.sh/class-variance-authority@0.7.1",
|
|
1939
|
+
"framer-motion": "https://esm.sh/framer-motion@12.5.0?external=react"
|
|
1912
1940
|
}
|
|
1913
1941
|
};
|
|
1914
1942
|
const hasMainFile = this.projectFiles.some(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jxr-server-manager.d.ts","sourceRoot":"","sources":["../src/jxr-server-manager.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,OAAO,CAAa;IAC5B,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,YAAY,CAAqB;IACzC,OAAO,CAAC,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KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA2HtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA+B3B,OAAO,CAAC,YAAY;CA8GrB"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -61,3 +61,51 @@ export type { JXRServerConfig } from './jxr-server-manager.ts';
|
|
|
61
61
|
// Deployer
|
|
62
62
|
export { JXRDeployer, jxrDeployer } from './deployer.ts';
|
|
63
63
|
export type { DeployConfig, DeployResult, DeploymentStatus } from './deployer.ts';
|
|
64
|
+
|
|
65
|
+
// Config helper
|
|
66
|
+
export interface JXRConfig {
|
|
67
|
+
name: string;
|
|
68
|
+
platform: 'web' | 'native' | 'expo' | 'cloudflare-worker' | 'deno' | 'node';
|
|
69
|
+
workers?: {
|
|
70
|
+
size?: number;
|
|
71
|
+
enablePriority?: boolean;
|
|
72
|
+
maxQueueSize?: number;
|
|
73
|
+
taskTimeout?: number;
|
|
74
|
+
};
|
|
75
|
+
moq?: {
|
|
76
|
+
enabled?: boolean;
|
|
77
|
+
relayUrl?: string;
|
|
78
|
+
trackPriority?: 'high' | 'normal' | 'low';
|
|
79
|
+
maxSubscriptions?: number;
|
|
80
|
+
reconnectDelay?: number;
|
|
81
|
+
};
|
|
82
|
+
crypto?: {
|
|
83
|
+
enabled?: boolean;
|
|
84
|
+
algorithm?: 'AES-GCM' | 'AES-CBC';
|
|
85
|
+
keySize?: number;
|
|
86
|
+
signing?: boolean;
|
|
87
|
+
keyDerivation?: 'HKDF';
|
|
88
|
+
};
|
|
89
|
+
build?: {
|
|
90
|
+
entry?: string;
|
|
91
|
+
outDir?: string;
|
|
92
|
+
minify?: boolean;
|
|
93
|
+
sourcemap?: boolean;
|
|
94
|
+
splitting?: 'auto' | 'manual' | false;
|
|
95
|
+
target?: string[];
|
|
96
|
+
external?: string[];
|
|
97
|
+
};
|
|
98
|
+
devServer?: {
|
|
99
|
+
port?: number;
|
|
100
|
+
host?: string;
|
|
101
|
+
hmr?: boolean;
|
|
102
|
+
open?: boolean;
|
|
103
|
+
https?: boolean;
|
|
104
|
+
};
|
|
105
|
+
imports?: Record<string, string>;
|
|
106
|
+
plugins?: any[];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function defineConfig(config: JXRConfig): JXRConfig {
|
|
110
|
+
return config;
|
|
111
|
+
}
|
|
@@ -151,23 +151,29 @@ export class JXRServerManager {
|
|
|
151
151
|
|
|
152
152
|
private async processPendingChanges(): Promise<void> {
|
|
153
153
|
if (this.pendingChanges.size === 0) return;
|
|
154
|
-
|
|
155
|
-
console.log(`🔄 Processing ${this.pendingChanges.size} file
|
|
156
|
-
|
|
154
|
+
|
|
155
|
+
console.log(`🔄 Processing ${this.pendingChanges.size} file change(s)...`);
|
|
156
|
+
|
|
157
157
|
for (const [path, file] of this.pendingChanges) {
|
|
158
158
|
this.runtime.vfs.write("/" + path, file.content);
|
|
159
|
-
|
|
159
|
+
|
|
160
160
|
// Update project files array
|
|
161
161
|
const existingIndex = this.projectFiles.findIndex(f => f.path === path);
|
|
162
162
|
if (existingIndex >= 0) {
|
|
163
163
|
this.projectFiles[existingIndex] = file;
|
|
164
164
|
}
|
|
165
|
+
|
|
166
|
+
// Invalidate transpiler cache for this file
|
|
167
|
+
this.transpiler.invalidateFile("/" + path);
|
|
168
|
+
|
|
169
|
+
console.log(` ✓ Updated: ${path}`);
|
|
165
170
|
}
|
|
166
|
-
|
|
171
|
+
|
|
167
172
|
this.pendingChanges.clear();
|
|
168
|
-
|
|
173
|
+
|
|
169
174
|
// Notify connected clients
|
|
170
175
|
this.broadcastReload();
|
|
176
|
+
console.log("🔥 HMR update sent to browser");
|
|
171
177
|
}
|
|
172
178
|
|
|
173
179
|
private broadcastReload(): void {
|
|
@@ -385,7 +391,9 @@ export default \`${escapedCSS}\`;
|
|
|
385
391
|
"toggle-selection": "https://esm.sh/toggle-selection@1.0.6",
|
|
386
392
|
"clsx": "https://esm.sh/clsx@2.1.1",
|
|
387
393
|
"tailwind-merge": "https://esm.sh/tailwind-merge@3.0.2",
|
|
388
|
-
"class-variance-authority": "https://esm.sh/class-variance-authority@0.7.1"
|
|
394
|
+
"class-variance-authority": "https://esm.sh/class-variance-authority@0.7.1",
|
|
395
|
+
"framer-motion": "https://esm.sh/framer-motion@12.5.0?external=react,motion-dom",
|
|
396
|
+
"motion-dom": "https://esm.sh/motion-dom@12.5.0"
|
|
389
397
|
}
|
|
390
398
|
};
|
|
391
399
|
|