react-client 1.0.12 → 1.0.13

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
@@ -35,7 +35,7 @@ npm install
35
35
  npm run dev
36
36
  ```
37
37
 
38
- This launches the **custom dev server** — not Vite — built on **Connect + WebSocket + esbuild**, featuring:
38
+ This launches the **custom dev server** — built on **Connect + WebSocket + esbuild**, featuring:
39
39
  - Instant rebuilds
40
40
  - React Fast Refresh (HMR)
41
41
  - Auto port detection & confirmation prompt
@@ -85,9 +85,9 @@ Each template is pre-configured for esbuild, HMR, and fast bootstrapping.
85
85
 
86
86
  ## 💎 Core Features
87
87
 
88
- - ⚡ **Custom Dev Server (no Vite)** — Connect + WebSocket + esbuild
88
+ - ⚡ **Custom Dev Server** — Connect + WebSocket + esbuild
89
89
  - 🔁 **React Fast Refresh (HMR)** — State-preserving reloads
90
- - 💥 **Vite-style Overlay** — Syntax-highlighted stack frames, clickable file links (`vscode://file`)
90
+ - 💥 **Overlay** — Syntax-highlighted stack frames, clickable file links (`vscode://file`)
91
91
  - 🔍 **Source Map Stack Mapping** — Maps runtime errors to original TS/JS source lines
92
92
  - 💬 **Auto Port Detection** — Prompts when default port 5173 is occupied
93
93
  - 🧠 **Smart Config Loader** — Detects project root, compiles `.ts` configs dynamically
@@ -112,7 +112,11 @@ async function dev() {
112
112
  });
113
113
  // 2️⃣ Bare module resolver with memory cache
114
114
  app.use('/@modules/', async (req, res, next) => {
115
- const id = req.url?.replace(/^\/@modules\//, '');
115
+ let id = req.url?.replace(/^\/@modules\//, '');
116
+ if (!id)
117
+ return next();
118
+ // 🧩 Normalize: remove leading slashes that may appear (e.g. "/react")
119
+ id = id.replace(/^\/+/, '');
116
120
  if (!id)
117
121
  return next();
118
122
  if (moduleCache.has(id)) {
@@ -153,7 +157,8 @@ async function dev() {
153
157
  let code = await fs_extra_1.default.readFile(filePath, 'utf8');
154
158
  const ext = path_1.default.extname(filePath).toLowerCase();
155
159
  // 🪄 Rewrite bare imports → /@modules/
156
- code = code.replace(/from\s+['"]([^'".\/][^'"]*)['"]/g, (_match, dep) => `from "/@modules/${dep}"`);
160
+ // 🧩 Rewrite *only bare imports* like "react", not "./" or "/" or "../"
161
+ code = code.replace(/from\s+['"]((?![\.\/])[a-zA-Z0-9@/_-]+)['"]/g, (_match, dep) => `from "/@modules/${dep}"`);
157
162
  let loader = 'js';
158
163
  if (ext === '.ts')
159
164
  loader = 'ts';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-client",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
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",