one 1.1.442 → 1.1.443
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/cjs/fork/getStateFromPath.cjs +2 -2
- package/dist/cjs/fork/getStateFromPath.js +1 -1
- package/dist/cjs/fork/getStateFromPath.js.map +1 -1
- package/dist/cjs/fork/getStateFromPath.native.js +2 -2
- package/dist/cjs/fork/getStateFromPath.native.js.map +1 -1
- package/dist/cjs/serve-worker.cjs +1 -1
- package/dist/cjs/serve-worker.js +1 -1
- package/dist/cjs/serve-worker.js.map +1 -1
- package/dist/cjs/serve-worker.native.js +1 -1
- package/dist/cjs/serve-worker.native.js.map +1 -1
- package/dist/cjs/serve.cjs +1 -0
- package/dist/cjs/serve.js +1 -0
- package/dist/cjs/serve.js.map +1 -1
- package/dist/cjs/serve.native.js +1 -0
- package/dist/cjs/serve.native.js.map +2 -2
- package/dist/cjs/server/oneServe.cjs +1 -1
- package/dist/cjs/server/oneServe.js +1 -1
- package/dist/cjs/server/oneServe.js.map +1 -1
- package/dist/cjs/server/oneServe.native.js +1 -1
- package/dist/cjs/server/oneServe.native.js.map +2 -2
- package/dist/cjs/utils/getHonoPath.cjs +2 -1
- package/dist/cjs/utils/getHonoPath.js +2 -1
- package/dist/cjs/utils/getHonoPath.js.map +1 -1
- package/dist/cjs/utils/getHonoPath.native.js +2 -1
- package/dist/cjs/utils/getHonoPath.native.js.map +2 -2
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.cjs +2 -2
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.js +1 -1
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.js.map +1 -1
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.native.js +1 -1
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.native.js.map +1 -1
- package/dist/esm/fork/getStateFromPath.js +1 -1
- package/dist/esm/fork/getStateFromPath.js.map +1 -1
- package/dist/esm/fork/getStateFromPath.mjs +2 -2
- package/dist/esm/fork/getStateFromPath.mjs.map +1 -1
- package/dist/esm/fork/getStateFromPath.native.js +2 -2
- package/dist/esm/fork/getStateFromPath.native.js.map +1 -1
- package/dist/esm/serve-worker.js +1 -1
- package/dist/esm/serve-worker.js.map +1 -1
- package/dist/esm/serve-worker.mjs +1 -1
- package/dist/esm/serve-worker.mjs.map +1 -1
- package/dist/esm/serve-worker.native.js +1 -1
- package/dist/esm/serve-worker.native.js.map +1 -1
- package/dist/esm/serve.js +1 -0
- package/dist/esm/serve.js.map +1 -1
- package/dist/esm/serve.mjs +1 -0
- package/dist/esm/serve.mjs.map +1 -1
- package/dist/esm/serve.native.js +1 -0
- package/dist/esm/serve.native.js.map +2 -2
- package/dist/esm/server/oneServe.js +1 -1
- package/dist/esm/server/oneServe.js.map +1 -1
- package/dist/esm/server/oneServe.mjs +1 -1
- package/dist/esm/server/oneServe.mjs.map +1 -1
- package/dist/esm/server/oneServe.native.js +1 -1
- package/dist/esm/server/oneServe.native.js.map +2 -2
- package/dist/esm/utils/getHonoPath.js +2 -1
- package/dist/esm/utils/getHonoPath.js.map +1 -1
- package/dist/esm/utils/getHonoPath.mjs +2 -1
- package/dist/esm/utils/getHonoPath.mjs.map +1 -1
- package/dist/esm/utils/getHonoPath.native.js +2 -1
- package/dist/esm/utils/getHonoPath.native.js.map +2 -2
- package/dist/esm/vite/plugins/clientTreeShakePlugin.js +1 -1
- package/dist/esm/vite/plugins/clientTreeShakePlugin.js.map +1 -1
- package/dist/esm/vite/plugins/clientTreeShakePlugin.mjs +1 -1
- package/dist/esm/vite/plugins/clientTreeShakePlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/clientTreeShakePlugin.native.js +1 -1
- package/dist/esm/vite/plugins/clientTreeShakePlugin.native.js.map +2 -2
- package/package.json +12 -12
- package/src/fork/getStateFromPath.ts +1 -0
- package/src/serve-worker.ts +1 -1
- package/src/serve.ts +3 -1
- package/src/server/oneServe.ts +1 -6
- package/src/utils/getHonoPath.ts +18 -15
- package/src/vite/plugins/clientTreeShakePlugin.ts +4 -2
- package/types/serve.d.ts +4 -1
- package/types/serve.d.ts.map +1 -1
- package/types/server/oneServe.d.ts +1 -1
- package/types/server/oneServe.d.ts.map +1 -1
- package/types/utils/getHonoPath.d.ts.map +1 -1
- package/types/vite/plugins/clientTreeShakePlugin.d.ts.map +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "one",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.443",
|
4
4
|
"license": "BSD-3-Clause",
|
5
5
|
"sideEffects": [
|
6
6
|
"setup.mjs",
|
@@ -80,9 +80,9 @@
|
|
80
80
|
},
|
81
81
|
"dependencies": {
|
82
82
|
"@azure/core-asynciterator-polyfill": "^1.0.2",
|
83
|
-
"@babel/generator": "^7.26.
|
84
|
-
"@babel/parser": "^7.26.
|
85
|
-
"@babel/traverse": "^7.26.
|
83
|
+
"@babel/generator": "^7.26.8",
|
84
|
+
"@babel/parser": "^7.26.8",
|
85
|
+
"@babel/traverse": "^7.26.8",
|
86
86
|
"@radix-ui/react-slot": "^1.0.2",
|
87
87
|
"@react-native-masked-view/masked-view": "^0.3.1",
|
88
88
|
"@react-navigation/bottom-tabs": "~7",
|
@@ -94,15 +94,15 @@
|
|
94
94
|
"@react-navigation/routers": "~7",
|
95
95
|
"@swc/core": "^1.10.4",
|
96
96
|
"@ungap/structured-clone": "^1.2.0",
|
97
|
-
"@vxrn/compiler": "1.1.
|
98
|
-
"@vxrn/resolve": "1.1.
|
99
|
-
"@vxrn/tslib-lite": "1.1.
|
100
|
-
"@vxrn/universal-color-scheme": "1.1.
|
101
|
-
"@vxrn/use-isomorphic-layout-effect": "1.1.
|
102
|
-
"babel-dead-code-elimination": "^1.0.
|
97
|
+
"@vxrn/compiler": "1.1.443",
|
98
|
+
"@vxrn/resolve": "1.1.443",
|
99
|
+
"@vxrn/tslib-lite": "1.1.443",
|
100
|
+
"@vxrn/universal-color-scheme": "1.1.443",
|
101
|
+
"@vxrn/use-isomorphic-layout-effect": "1.1.443",
|
102
|
+
"babel-dead-code-elimination": "^1.0.9",
|
103
103
|
"citty": "^0.1.6",
|
104
104
|
"core-js": "^3.38.1",
|
105
|
-
"create-vxrn": "1.1.
|
105
|
+
"create-vxrn": "1.1.443",
|
106
106
|
"escape-string-regexp": "^5.0.0",
|
107
107
|
"expo-linking": "~6.3.1",
|
108
108
|
"expo-modules-core": "2.1.2",
|
@@ -129,7 +129,7 @@
|
|
129
129
|
"vite": "^6.1.0",
|
130
130
|
"vite-plugin-barrel": "^0.4.1",
|
131
131
|
"vite-tsconfig-paths": "^5.0.1",
|
132
|
-
"vxrn": "1.1.
|
132
|
+
"vxrn": "1.1.443",
|
133
133
|
"ws": "^8.18.0",
|
134
134
|
"xxhashjs": "^0.2.2"
|
135
135
|
},
|
@@ -461,6 +461,7 @@ const matchAgainstConfigs = (remaining: string, configs: RouteConfig[]) => {
|
|
461
461
|
}, {})
|
462
462
|
|
463
463
|
if (params && Object.keys(params).length) {
|
464
|
+
Object.assign(allParams, params) // @modified: let page access layout params
|
464
465
|
return { name, params }
|
465
466
|
}
|
466
467
|
|
package/src/serve-worker.ts
CHANGED
package/src/serve.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import './polyfills-server'
|
2
2
|
|
3
3
|
import FSExtra from 'fs-extra'
|
4
|
+
import type { Hono } from 'hono'
|
4
5
|
import type { VXRNOptions } from 'vxrn'
|
5
6
|
import { setServerGlobals } from './server/setServerGlobals'
|
6
7
|
import { setupBuildInfo } from './server/setupBuildOptions'
|
@@ -11,7 +12,7 @@ process.on('uncaughtException', (err) => {
|
|
11
12
|
console.error(`[one] Uncaught exception`, err?.stack || err)
|
12
13
|
})
|
13
14
|
|
14
|
-
export async function serve(args: VXRNOptions['server'] = {}) {
|
15
|
+
export async function serve(args: VXRNOptions['server'] & { app?: Hono } = {}) {
|
15
16
|
const buildInfo = (await FSExtra.readJSON(`dist/buildInfo.json`)) as One.BuildInfo
|
16
17
|
const { oneOptions } = buildInfo
|
17
18
|
|
@@ -32,6 +33,7 @@ export async function serve(args: VXRNOptions['server'] = {}) {
|
|
32
33
|
}
|
33
34
|
|
34
35
|
return await vxrnServe({
|
36
|
+
app: args.app,
|
35
37
|
// fallback to one plugin
|
36
38
|
...oneOptions.server,
|
37
39
|
// override with any flags given to cli
|
package/src/server/oneServe.ts
CHANGED
@@ -11,12 +11,7 @@ import { toAbsolute } from '../utils/toAbsolute'
|
|
11
11
|
import type { One } from '../vite/types'
|
12
12
|
import type { RouteInfoCompiled } from './createRoutesManifest'
|
13
13
|
|
14
|
-
export async function oneServe(
|
15
|
-
oneOptions: One.PluginOptions,
|
16
|
-
buildInfo: One.BuildInfo,
|
17
|
-
app: Hono,
|
18
|
-
serveStatic = true
|
19
|
-
) {
|
14
|
+
export async function oneServe(oneOptions: One.PluginOptions, buildInfo: One.BuildInfo, app: Hono) {
|
20
15
|
const { resolveAPIRoute, resolveLoaderRoute, resolvePageRoute } = await import(
|
21
16
|
'../createHandleRequest'
|
22
17
|
)
|
package/src/utils/getHonoPath.ts
CHANGED
@@ -1,17 +1,20 @@
|
|
1
1
|
export function getHonoPath(page: string) {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
2
|
+
const cleaned = page
|
3
|
+
// /(param) => (empty)
|
4
|
+
.replaceAll(/\/\(([^\)]+)\)/gi, '')
|
5
|
+
// [...params] => *
|
6
|
+
.replace(/\[\.\.\.([^\]]+)\]/gi, '*')
|
7
|
+
// [param] => :param
|
8
|
+
.replaceAll(/\[([^\]]+)\]/gi, ':$1')
|
9
|
+
// +not-found => *
|
10
|
+
.replace('+not-found', '*')
|
11
|
+
// /index => /
|
12
|
+
.replace(/\/index$/, '/')
|
13
|
+
|
14
|
+
if (cleaned !== '/') {
|
15
|
+
// remove trailing / for non / paths
|
16
|
+
return cleaned.replace(/\/$/, '')
|
17
|
+
}
|
18
|
+
|
19
|
+
return cleaned
|
17
20
|
}
|
@@ -2,9 +2,9 @@ import BabelGenerate from '@babel/generator'
|
|
2
2
|
import { parse } from '@babel/parser'
|
3
3
|
import BabelTraverse from '@babel/traverse'
|
4
4
|
import { deadCodeElimination, findReferencedIdentifiers } from 'babel-dead-code-elimination'
|
5
|
+
import { extname, relative } from 'node:path'
|
5
6
|
import type { Plugin } from 'vite'
|
6
7
|
import { EMPTY_LOADER_STRING } from '../constants'
|
7
|
-
import { extname, relative } from 'node:path'
|
8
8
|
|
9
9
|
const traverse = BabelTraverse['default'] as typeof BabelTraverse
|
10
10
|
const generate = BabelGenerate['default'] as any as typeof BabelGenerate
|
@@ -45,7 +45,9 @@ export async function transformTreeShakeClient(code: string, id: string) {
|
|
45
45
|
return
|
46
46
|
}
|
47
47
|
|
48
|
-
|
48
|
+
// `as any` because babel-dead-code-elimination using @types and it conflicts :/
|
49
|
+
const ast = parse(code, { sourceType: 'module', plugins: ['typescript', 'jsx'] }) as any
|
50
|
+
|
49
51
|
const referenced = findReferencedIdentifiers(ast)
|
50
52
|
|
51
53
|
const removed = {
|
package/types/serve.d.ts
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
import './polyfills-server';
|
2
|
+
import type { Hono } from 'hono';
|
2
3
|
import type { VXRNOptions } from 'vxrn';
|
3
|
-
export declare function serve(args?: VXRNOptions['server']
|
4
|
+
export declare function serve(args?: VXRNOptions['server'] & {
|
5
|
+
app?: Hono;
|
6
|
+
}): Promise<void | Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/"> | {
|
4
7
|
handler: (req: Request) => Response | Promise<Response>;
|
5
8
|
GET: (req: Request) => Response | Promise<Response>;
|
6
9
|
POST: (req: Request) => Response | Promise<Response>;
|
package/types/serve.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA;AAG3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAUvC,wBAAsB,KAAK,CAAC,IAAI,GAAE,WAAW,CAAC,QAAQ,
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../src/serve.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAA;AAG3B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAChC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAUvC,wBAAsB,KAAK,CAAC,IAAI,GAAE,WAAW,CAAC,QAAQ,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,IAAI,CAAA;CAAO;;;;;;;GAsC5E"}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import type { Hono } from 'hono';
|
2
2
|
import type { One } from '../vite/types';
|
3
|
-
export declare function oneServe(oneOptions: One.PluginOptions, buildInfo: One.BuildInfo, app: Hono
|
3
|
+
export declare function oneServe(oneOptions: One.PluginOptions, buildInfo: One.BuildInfo, app: Hono): Promise<void>;
|
4
4
|
//# sourceMappingURL=oneServe.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"oneServe.d.ts","sourceRoot":"","sources":["../../src/server/oneServe.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAqB,MAAM,MAAM,CAAA;AASnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAGxC,wBAAsB,QAAQ,
|
1
|
+
{"version":3,"file":"oneServe.d.ts","sourceRoot":"","sources":["../../src/server/oneServe.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAqB,MAAM,MAAM,CAAA;AASnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAGxC,wBAAsB,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC,aAAa,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,GAAG,EAAE,IAAI,iBAwOhG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getHonoPath.d.ts","sourceRoot":"","sources":["../../src/utils/getHonoPath.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"getHonoPath.d.ts","sourceRoot":"","sources":["../../src/utils/getHonoPath.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,UAmBvC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"clientTreeShakePlugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/clientTreeShakePlugin.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"clientTreeShakePlugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/clientTreeShakePlugin.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAMlC,eAAO,MAAM,qBAAqB,QAAO,MA6BxC,CAAA;AAED,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM;;;;;;;;;;;eAuEtE"}
|