react-client 1.0.27 → 1.0.28

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/README.md CHANGED
@@ -91,7 +91,6 @@ Each template is pre-configured for esbuild, HMR, and fast bootstrapping.
91
91
  - 🔍 **Source Map Stack Mapping** — Maps runtime errors to original TS/JS source lines
92
92
  - 💬 **Auto Port Detection** — Prompts when default port 2202 is occupied
93
93
  - 🧠 **Smart Config Loader** — Detects project root, compiles `.ts` configs dynamically
94
- - 🎨 **PrismJS Highlighting** — For pretty overlay code frames
95
94
  - 🔌 **Plugin Hook System** — Extendable with `configResolved`, `transform`, `buildEnd`
96
95
 
97
96
  ---
@@ -104,7 +103,6 @@ Each template is pre-configured for esbuild, HMR, and fast bootstrapping.
104
103
  2. **Connect** serves files and APIs (React Refresh runtime, overlay, source-map).
105
104
  3. **WebSocket** pushes HMR updates and overlay messages.
106
105
  4. **Chokidar** watches `/src` for changes and triggers rebuilds.
107
- 5. **Overlay UI** (via PrismJS) displays mapped stack frames with syntax highlighting.
108
106
 
109
107
  ---
110
108
 
@@ -232,20 +232,8 @@ async function dev() {
232
232
  res.end(`// Failed to resolve module ${id}: ${err.message}`);
233
233
  }
234
234
  });
235
- app.use(async (req, res, next) => {
236
- if (req.url?.startsWith('/@prismjs')) {
237
- const prismPath = require.resolve('prismjs', { paths: [appRoot] });
238
- const code = await fs_extra_1.default.readFile(prismPath, 'utf8');
239
- res.setHeader('Content-Type', 'application/javascript');
240
- return res.end(code);
241
- }
242
- next();
243
- });
244
- // --- Serve runtime overlay (local file) so overlay-runtime.js is loaded automatically
245
- // --- Serve runtime overlay (inline in dev server)
235
+ // --- Serve runtime overlay (inline, no external dependencies)
246
236
  const OVERLAY_RUNTIME = `
247
- import "/@prismjs";
248
-
249
237
  const overlayId = "__rc_error_overlay__";
250
238
 
251
239
  const style = document.createElement("style");
@@ -264,11 +252,11 @@ style.textContent = \`
264
252
  }
265
253
  @keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} }
266
254
  #\${overlayId} h2 { color: #ff6b6b; margin-bottom: 16px; }
267
- #\${overlayId} pre { background: rgba(255,255,255,0.1); padding: 12px; border-radius: 6px; }
255
+ #\${overlayId} pre { background: rgba(255,255,255,0.1); padding: 12px; border-radius: 6px; overflow-x: auto; }
268
256
  #\${overlayId} a { color: #9cf; text-decoration: underline; }
269
257
  #\${overlayId} .frame { margin: 12px 0; }
270
258
  #\${overlayId} .frame-file { color: #ffa500; cursor: pointer; font-weight: bold; margin-bottom: 4px; }
271
- .line-number { opacity: 0.5; margin-right: 10px; }
259
+ .line-number { opacity: 0.5; margin-right: 10px; display: inline-block; width: 2em; text-align: right; }
272
260
  \`;
273
261
  document.head.appendChild(style);
274
262
 
@@ -290,6 +278,14 @@ async function mapStackFrame(frame) {
290
278
  return frame;
291
279
  }
292
280
 
281
+ // 🔹 minimal inline syntax highlighting (keywords only)
282
+ function highlightJS(code) {
283
+ return code
284
+ .replace(/(const|let|var|function|return|import|from|export|class|new|await|async|if|else|for|while|try|catch|throw)/g, '<span style="color:#ffb86c;">$1</span>')
285
+ .replace(/("[^"]*"|'[^']*')/g, '<span style="color:#8be9fd;">$1</span>')
286
+ .replace(/(\\/\\/.*)/g, '<span style="opacity:0.6;">$1</span>');
287
+ }
288
+
293
289
  async function renderOverlay(err) {
294
290
  const overlay =
295
291
  document.getElementById(overlayId) ||
@@ -315,8 +311,7 @@ async function renderOverlay(err) {
315
311
 
316
312
  if (mapped.snippet) {
317
313
  const pre = document.createElement("pre");
318
- pre.classList.add("language-jsx");
319
- pre.innerHTML = Prism.highlight(mapped.snippet, Prism.languages.jsx, "jsx");
314
+ pre.innerHTML = highlightJS(mapped.snippet);
320
315
  frameEl.appendChild(pre);
321
316
  }
322
317
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-client",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "react-client is a lightweight CLI and runtime for building React apps with fast iteration.",
5
5
  "license": "MIT",
6
6
  "author": "Venkatesh Sundaram",
@@ -102,7 +102,6 @@
102
102
  "esbuild": "^0.25.12",
103
103
  "fs-extra": "^11.3.2",
104
104
  "open": "^8.4.2",
105
- "prismjs": "^1.30.0",
106
105
  "prompts": "^2.4.2",
107
106
  "react-refresh": "^0.14.0",
108
107
  "serve-static": "^1.15.0",