vorzelajs 0.0.6 → 0.0.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"routes-plugin.d.ts","sourceRoot":"","sources":["../../src/vite/routes-plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAwWlC,wBAAsB,cAAc,CAAC,WAAW,SAAgB,iBA2B/D;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CA2C5C"}
1
+ {"version":3,"file":"routes-plugin.d.ts","sourceRoot":"","sources":["../../src/vite/routes-plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAgXlC,wBAAsB,cAAc,CAAC,WAAW,SAAgB,iBA2B/D;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CA2C5C"}
@@ -9,7 +9,7 @@ const SERVER_ONLY_ROUTE_FILE_PATTERN = /\.server\.(ts|tsx)$/u;
9
9
  const SERVER_ONLY_DIR_PATTERN = /[\\/]\.server[\\/]/u;
10
10
  const SERVER_ONLY_SPECIFIER_PATTERN = /(?:^|[\\/])\.server(?:[\\/]|$)|\.server(?:$|\.)/u;
11
11
  const CLIENT_EVENT_HANDLER_PATTERN = /\bon[A-Z][A-Za-z0-9]*\s*=/u;
12
- const CLIENT_ROUTER_HOOK_PATTERN = /\b(useNavigate|useSetSearch|Route\.useSetSearch)\b/u;
12
+ const CLIENT_ROUTER_HOOK_PATTERN = /\b(useNavigate|useSearch|useSetSearch|Route\.useSearch|Route\.useSetSearch)\b/u;
13
13
  const CLIENT_SOLID_HOOK_PATTERN = /\b(createSignal|createEffect|createRenderEffect|createResource|onMount|onCleanup)\b/u;
14
14
  const CLIENT_BROWSER_GLOBAL_PATTERN = /\b(window|document|navigator|localStorage|sessionStorage)\s*\./u;
15
15
  const CLIENT_BROWSER_FUNCTION_PATTERN = /\b(requestAnimationFrame|matchMedia)\s*\(/u;
@@ -188,6 +188,9 @@ function detectRouteHydration(source) {
188
188
  : 'static';
189
189
  }
190
190
  function isHydrationTrackedSpecifier(specifier) {
191
+ if (/^~\/(router|runtime)(\/|$)/u.test(specifier)) {
192
+ return false;
193
+ }
191
194
  return specifier.startsWith('./')
192
195
  || specifier.startsWith('../')
193
196
  || specifier === '~'
@@ -221,8 +224,12 @@ async function resolveLocalModulePath(specifier, importerPath, projectRoot) {
221
224
  : specifier.startsWith('~/')
222
225
  ? path.resolve(projectRoot, SOURCE_DIR, specifier.slice(2))
223
226
  : path.resolve(path.dirname(importerPath), specifier);
224
- const candidates = path.extname(basePath)
225
- ? [basePath]
227
+ const ext = path.extname(basePath);
228
+ const JS_TO_TS_EXTENSIONS = { '.js': ['.ts', '.tsx', '.js'], '.jsx': ['.tsx', '.jsx'] };
229
+ const candidates = ext
230
+ ? ext in JS_TO_TS_EXTENSIONS
231
+ ? JS_TO_TS_EXTENSIONS[ext].map((replacement) => basePath.slice(0, -ext.length) + replacement)
232
+ : [basePath]
226
233
  : [
227
234
  ...SOURCE_FILE_EXTENSIONS.map((extension) => `${basePath}${extension}`),
228
235
  ...SOURCE_FILE_EXTENSIONS.map((extension) => path.join(basePath, `index${extension}`)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vorzelajs",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "type": "module",
5
5
  "description": "Batteries-included SolidJS framework with file-based routing, streamed SSR, and server-only boundaries",
6
6
  "license": "MIT",