one 1.1.370 → 1.1.371
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/createApp.native.js +6 -2
- package/dist/cjs/createApp.native.js.map +2 -2
- package/dist/cjs/setup.cjs +1 -7
- package/dist/cjs/setup.js +1 -9
- package/dist/cjs/setup.js.map +1 -1
- package/dist/cjs/vite/build.cjs +1 -1
- package/dist/cjs/vite/build.js +1 -1
- package/dist/cjs/vite/build.native.js +1 -1
- package/dist/cjs/vite/one.cjs +46 -13
- package/dist/cjs/vite/one.js +49 -18
- package/dist/cjs/vite/one.js.map +1 -1
- package/dist/cjs/vite/one.native.js +51 -18
- package/dist/cjs/vite/one.native.js.map +2 -2
- package/dist/cjs/vite/plugins/reactCompilerPlugin.cjs +8 -5
- package/dist/cjs/vite/plugins/reactCompilerPlugin.js +8 -5
- package/dist/cjs/vite/plugins/reactCompilerPlugin.js.map +1 -1
- package/dist/cjs/vite/plugins/reactCompilerPlugin.native.js +26 -21
- package/dist/cjs/vite/plugins/reactCompilerPlugin.native.js.map +2 -2
- package/dist/esm/createApp.native.js +6 -1
- package/dist/esm/createApp.native.js.map +2 -2
- package/dist/esm/setup.js +1 -9
- package/dist/esm/setup.js.map +1 -1
- package/dist/esm/setup.mjs +1 -7
- package/dist/esm/setup.mjs.map +1 -1
- package/dist/esm/vite/build.js +1 -1
- package/dist/esm/vite/build.mjs +1 -1
- package/dist/esm/vite/build.native.js +1 -1
- package/dist/esm/vite/one.js +49 -18
- package/dist/esm/vite/one.js.map +1 -1
- package/dist/esm/vite/one.mjs +46 -13
- package/dist/esm/vite/one.mjs.map +1 -1
- package/dist/esm/vite/one.native.js +51 -18
- package/dist/esm/vite/one.native.js.map +2 -2
- package/dist/esm/vite/plugins/reactCompilerPlugin.js +8 -5
- package/dist/esm/vite/plugins/reactCompilerPlugin.js.map +1 -1
- package/dist/esm/vite/plugins/reactCompilerPlugin.mjs +8 -5
- package/dist/esm/vite/plugins/reactCompilerPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/reactCompilerPlugin.native.js +26 -21
- package/dist/esm/vite/plugins/reactCompilerPlugin.native.js.map +2 -2
- package/package.json +9 -8
- package/src/createApp.native.tsx +13 -1
- package/src/setup.ts +1 -9
- package/src/vite/build.ts +1 -1
- package/src/vite/one.ts +80 -20
- package/src/vite/plugins/reactCompilerPlugin.ts +12 -5
- package/src/vite/types.ts +21 -14
- package/types/createApp.native.d.ts.map +1 -1
- package/types/setup.d.ts.map +1 -1
- package/types/vite/one.d.ts.map +1 -1
- package/types/vite/plugins/reactCompilerPlugin.d.ts.map +1 -1
- package/types/vite/types.d.ts +30 -25
- package/types/vite/types.d.ts.map +1 -1
@@ -1,20 +1,22 @@
|
|
1
1
|
import babel from "@babel/core";
|
2
2
|
import { relative } from "node:path";
|
3
3
|
var createReactCompilerPlugin = function(root) {
|
4
|
-
var
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
[
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
4
|
+
var getBabelConfig = function(target) {
|
5
|
+
return {
|
6
|
+
babelrc: !1,
|
7
|
+
configFile: !1,
|
8
|
+
presets: [
|
9
|
+
"@babel/preset-typescript"
|
10
|
+
],
|
11
|
+
plugins: [
|
12
|
+
[
|
13
|
+
"babel-plugin-react-compiler",
|
14
|
+
{
|
15
|
+
target
|
16
|
+
}
|
17
|
+
]
|
16
18
|
]
|
17
|
-
|
19
|
+
};
|
18
20
|
}, filter = /.*(.tsx?)$/;
|
19
21
|
return {
|
20
22
|
name: "one:react-compiler",
|
@@ -22,14 +24,17 @@ var createReactCompilerPlugin = function(root) {
|
|
22
24
|
async transform(codeIn, id) {
|
23
25
|
var shouldTransform = filter.test(id);
|
24
26
|
if (shouldTransform) {
|
25
|
-
var
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
code
|
31
|
-
|
32
|
-
|
27
|
+
var env = this.environment.name, target = env === "ios" || env === "android" ? "18" : "19";
|
28
|
+
if (!codeIn.startsWith("// disable-compiler")) {
|
29
|
+
var result = await babel.transformAsync(codeIn, {
|
30
|
+
filename: id,
|
31
|
+
...getBabelConfig(target)
|
32
|
+
}), _result_code, code = (_result_code = result?.code) !== null && _result_code !== void 0 ? _result_code : "";
|
33
|
+
return code.includes(target === "18" ? "react-compiler-runtime" : "react/compiler-runtime") && console.info(` \u{1FA84} ${relative(root, id)}`), {
|
34
|
+
code,
|
35
|
+
map: result?.map
|
36
|
+
};
|
37
|
+
}
|
33
38
|
}
|
34
39
|
}
|
35
40
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../src/vite/plugins/Users/n8/one/packages/one/src/vite/plugins/reactCompilerPlugin.ts"],
|
4
|
-
"mappings": "AAAA,OAAOA,WAAW;AAClB,SAASC,gBAAgB;AAGlB,IAAMC,4BAA4B,SAACC,MAAAA;AACxC,MAAMC,
|
5
|
-
"names": ["babel", "relative", "createReactCompilerPlugin", "root", "
|
4
|
+
"mappings": "AAAA,OAAOA,WAAW;AAClB,SAASC,gBAAgB;AAGlB,IAAMC,4BAA4B,SAACC,MAAAA;AACxC,MAAMC,iBAAiB,SAACC,QAAAA;WAAyB;MAC/CC,SAAS;MACTC,YAAY;MACZC,SAAS;QAAC;;MACVC,SAAS;QAAC;UAAC;UAA+B;YAAEJ;UAAO;;;IACrD;KAEMK,SAAS;AAEf,SAAO;IACLC,MAAM;IACNC,SAAS;IAET,MAAMC,UAAUC,QAAQC,IAAE;AACxB,UAAMC,kBAAkBN,OAAOO,KAAKF,EAAAA;AACpC,UAAKC,iBACL;YAAME,MAAM,KAAKC,YAAYR,MACvBN,SAASa,QAAQ,SAASA,QAAQ,YAAY,OAAO;AAE3D,YAAIJ,QAAOM,WAAW,qBAAA,GAItB;cAAMC,SAAS,MAAMrB,MAAMsB,eAAeR,QAAQ;YAAES,UAAUR;YAAI,GAAGX,eAAeC,MAAAA;UAAQ,CAAA,GAC/EgB,cAAPG,QAAOH,eAAAA,QAAQG,UAAI,QAAZH,iBAAAA,SAAAA,eAAgB;AAE7B,iBAAIG,KAAKC,SAASpB,WAAW,OAAO,2BAA2B,wBAAwB,KACrFqB,QAAQC,KAAK,cAAO1B,SAASE,MAAMY,EAAAA,CAAAA,EAAK,GAGnC;YAAES;YAAMI,KAAKP,QAAQO;UAAI;;;IAClC;EAuCF;AACF;",
|
5
|
+
"names": ["babel", "relative", "createReactCompilerPlugin", "root", "getBabelConfig", "target", "babelrc", "configFile", "presets", "plugins", "filter", "name", "enforce", "transform", "codeIn", "id", "shouldTransform", "test", "env", "environment", "startsWith", "result", "transformAsync", "filename", "code", "includes", "console", "info", "map"]
|
6
6
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "one",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.371",
|
4
4
|
"source": "src/index.ts",
|
5
5
|
"types": "./types/index.d.ts",
|
6
6
|
"sideEffects": [
|
@@ -112,15 +112,15 @@
|
|
112
112
|
"@react-navigation/routers": "~6.1.9",
|
113
113
|
"@swc/core": "^1.7.14",
|
114
114
|
"@ungap/structured-clone": "^1.2.0",
|
115
|
-
"@vxrn/resolve": "1.1.
|
116
|
-
"@vxrn/tslib-lite": "1.1.
|
117
|
-
"@vxrn/universal-color-scheme": "1.1.
|
118
|
-
"@vxrn/use-isomorphic-layout-effect": "1.1.
|
115
|
+
"@vxrn/resolve": "1.1.371",
|
116
|
+
"@vxrn/tslib-lite": "1.1.371",
|
117
|
+
"@vxrn/universal-color-scheme": "1.1.371",
|
118
|
+
"@vxrn/use-isomorphic-layout-effect": "1.1.371",
|
119
119
|
"babel-dead-code-elimination": "^1.0.6",
|
120
120
|
"babel-plugin-react-compiler": "^19.0.0-beta-201e55d-20241215",
|
121
121
|
"citty": "^0.1.6",
|
122
122
|
"core-js": "^3.38.1",
|
123
|
-
"create-vxrn": "1.1.
|
123
|
+
"create-vxrn": "1.1.371",
|
124
124
|
"escape-string-regexp": "^5.0.0",
|
125
125
|
"expo-linking": "~6.3.1",
|
126
126
|
"expo-modules-core": "^1.12.24",
|
@@ -134,17 +134,18 @@
|
|
134
134
|
"perfect-debounce": "^1.0.0",
|
135
135
|
"picocolors": "^1.0.0",
|
136
136
|
"react": "^18.3.1",
|
137
|
+
"react-compiler-runtime": "^19.0.0-beta-201e55d-20241215",
|
137
138
|
"react-dom": "^18.3.1",
|
138
139
|
"react-native-gesture-handler": "^2.18.1",
|
139
140
|
"react-native-reanimated": "~3.10.1",
|
140
141
|
"react-native-safe-area-context": "4.10.5",
|
141
142
|
"react-native-screens": "3.31.1",
|
142
|
-
"react-scan": "
|
143
|
+
"react-scan": "0.0.36-native",
|
143
144
|
"rollup-plugin-node-externals": "^7.1.2",
|
144
145
|
"url-parse": "^1.5.10",
|
145
146
|
"vite": "^6.0.5",
|
146
147
|
"vite-tsconfig-paths": "^5.0.1",
|
147
|
-
"vxrn": "1.1.
|
148
|
+
"vxrn": "1.1.371",
|
148
149
|
"ws": "^8.18.0",
|
149
150
|
"xxhashjs": "^0.2.2"
|
150
151
|
},
|
package/src/createApp.native.tsx
CHANGED
@@ -2,6 +2,7 @@ import { AppRegistry, LogBox } from 'react-native' // This should be the first i
|
|
2
2
|
import './polyfills-mobile'
|
3
3
|
import './setup'
|
4
4
|
import { Root } from './Root'
|
5
|
+
import { ReactScan } from 'react-scan/native'
|
5
6
|
|
6
7
|
export type CreateAppProps = { routes: Record<string, () => Promise<unknown>> }
|
7
8
|
|
@@ -9,7 +10,18 @@ export type CreateAppProps = { routes: Record<string, () => Promise<unknown>> }
|
|
9
10
|
LogBox.ignoreLogs([/Sending .* with no listeners registered/])
|
10
11
|
|
11
12
|
export function createApp(options: CreateAppProps): void {
|
12
|
-
const App = () =>
|
13
|
+
const App = () => {
|
14
|
+
let contents = <Root isClient routes={options.routes} path="/" />
|
15
|
+
|
16
|
+
if (process.env.ONE_ENABLE_REACT_SCAN) {
|
17
|
+
console.warn(`React Scan enabled with options: ${process.env.ONE_ENABLE_REACT_SCAN}`)
|
18
|
+
contents = (
|
19
|
+
<ReactScan options={JSON.parse(process.env.ONE_ENABLE_REACT_SCAN)}>{contents}</ReactScan>
|
20
|
+
)
|
21
|
+
}
|
22
|
+
|
23
|
+
return contents
|
24
|
+
}
|
13
25
|
|
14
26
|
AppRegistry.registerComponent('main', () => App)
|
15
27
|
|
package/src/setup.ts
CHANGED
@@ -2,15 +2,7 @@
|
|
2
2
|
import { scan } from 'react-scan'
|
3
3
|
|
4
4
|
if (process.env.ONE_ENABLE_REACT_SCAN) {
|
5
|
-
|
6
|
-
scan(
|
7
|
-
val === true
|
8
|
-
? {
|
9
|
-
enabled: true,
|
10
|
-
showToolbar: false,
|
11
|
-
}
|
12
|
-
: val
|
13
|
-
)
|
5
|
+
scan(JSON.parse(process.env.ONE_ENABLE_REACT_SCAN))
|
14
6
|
}
|
15
7
|
|
16
8
|
// fixes bad import error in expo-modules-core
|
package/src/vite/build.ts
CHANGED
@@ -527,7 +527,7 @@ ${JSON.stringify(params || null, null, 2)}`
|
|
527
527
|
await FSExtra.writeFile(
|
528
528
|
join(options.root, 'dist', 'index.js'),
|
529
529
|
`import { serve } from 'one/serve'
|
530
|
-
const handler = await serve()
|
530
|
+
export const handler = await serve()
|
531
531
|
export const { GET, POST, PUT, PATCH, OPTIONS } = handler`
|
532
532
|
)
|
533
533
|
|
package/src/vite/one.ts
CHANGED
@@ -23,6 +23,13 @@ import { SSRCSSPlugin } from './plugins/SSRCSSPlugin'
|
|
23
23
|
import { createVirtualEntry, virtualEntryId } from './plugins/virtualEntryPlugin'
|
24
24
|
import type { One } from './types'
|
25
25
|
|
26
|
+
/**
|
27
|
+
* This needs a big refactor!
|
28
|
+
* I guess these plugins are all being loaded by native??
|
29
|
+
* At least the react compiler plugin is applying to native, so the entire premise of some things
|
30
|
+
* here are wrong. we can probably refactor and merge all the stuff
|
31
|
+
*/
|
32
|
+
|
26
33
|
events.setMaxListeners(1_000)
|
27
34
|
|
28
35
|
// temporary for tamagui plugin compat
|
@@ -249,30 +256,85 @@ export function one(options: One.PluginOptions = {}): PluginOption {
|
|
249
256
|
// react scan
|
250
257
|
const scan = options.react?.scan
|
251
258
|
|
252
|
-
//
|
253
|
-
|
254
|
-
|
259
|
+
// do it here because it gets called a few times
|
260
|
+
const reactScanConfig = ((): UserConfig => {
|
261
|
+
const stringify = (obj: Object) => JSON.stringify(JSON.stringify(obj))
|
255
262
|
|
256
|
-
|
257
|
-
|
263
|
+
const configs = {
|
264
|
+
disabled: {
|
265
|
+
define: {
|
266
|
+
'process.env.ONE_ENABLE_REACT_SCAN': 'false',
|
267
|
+
},
|
268
|
+
},
|
269
|
+
enabled: {
|
270
|
+
define: {
|
271
|
+
'process.env.ONE_ENABLE_REACT_SCAN': stringify({
|
272
|
+
enabled: true,
|
273
|
+
animationSpeed: 'slow',
|
274
|
+
showToolbar: false,
|
275
|
+
}),
|
276
|
+
},
|
277
|
+
},
|
278
|
+
} satisfies Record<string, UserConfig>
|
279
|
+
|
280
|
+
const getConfigFor = (platform: 'ios' | 'android' | 'client'): UserConfig => {
|
281
|
+
if (!scan) {
|
282
|
+
return configs.disabled
|
283
|
+
}
|
284
|
+
if (scan === true) {
|
285
|
+
return configs.enabled
|
286
|
+
}
|
287
|
+
if (typeof scan === 'string') {
|
288
|
+
if (scan === 'native' && platform === 'client') {
|
289
|
+
return configs.disabled
|
290
|
+
}
|
291
|
+
if (scan === 'web' && platform !== 'client') {
|
292
|
+
return configs.disabled
|
293
|
+
}
|
294
|
+
return configs.enabled
|
295
|
+
}
|
296
|
+
|
297
|
+
const defaultConfig = scan.options || configs.enabled
|
298
|
+
const perPlatformConfig =
|
299
|
+
platform === 'ios' || platform === 'android' ? scan.native : scan.web
|
300
|
+
|
301
|
+
return {
|
302
|
+
define: {
|
303
|
+
'process.env.ONE_ENABLE_REACT_SCAN': stringify({
|
304
|
+
...defaultConfig,
|
305
|
+
...perPlatformConfig,
|
306
|
+
}),
|
307
|
+
},
|
308
|
+
}
|
309
|
+
}
|
258
310
|
|
311
|
+
return {
|
312
|
+
environments: {
|
313
|
+
client: getConfigFor('client'),
|
314
|
+
ios: getConfigFor('ios'),
|
315
|
+
android: getConfigFor('android'),
|
316
|
+
},
|
317
|
+
}
|
318
|
+
})()
|
319
|
+
|
320
|
+
// TODO move to single config and through environments
|
321
|
+
const nativeWebDevAndProdPlugsin: Plugin[] = [
|
322
|
+
clientTreeShakePlugin(),
|
259
323
|
{
|
260
324
|
name: `one:react-scan`,
|
261
325
|
config() {
|
262
|
-
return
|
263
|
-
environments: {
|
264
|
-
// only in client
|
265
|
-
client: {
|
266
|
-
define: {
|
267
|
-
'process.env.ONE_ENABLE_REACT_SCAN': JSON.stringify(
|
268
|
-
typeof scan === 'boolean' ? `${scan}` : scan
|
269
|
-
),
|
270
|
-
},
|
271
|
-
},
|
272
|
-
},
|
273
|
-
}
|
326
|
+
return reactScanConfig
|
274
327
|
},
|
275
328
|
},
|
329
|
+
]
|
330
|
+
|
331
|
+
// TODO make this passed into vxrn through real API
|
332
|
+
globalThis.__vxrnAddNativePlugins = nativeWebDevAndProdPlugsin
|
333
|
+
globalThis.__vxrnAddWebPluginsProd = devAndProdPlugins
|
334
|
+
|
335
|
+
return [
|
336
|
+
...devAndProdPlugins,
|
337
|
+
...nativeWebDevAndProdPlugsin,
|
276
338
|
|
277
339
|
/**
|
278
340
|
* This is really the meat of one, where it handles requests:
|
@@ -281,8 +343,6 @@ export function one(options: One.PluginOptions = {}): PluginOption {
|
|
281
343
|
|
282
344
|
generateFileSystemRouteTypesPlugin(options),
|
283
345
|
|
284
|
-
clientTreeShakePlugin(),
|
285
|
-
|
286
346
|
fixDependenciesPlugin(options.deps),
|
287
347
|
|
288
348
|
createVirtualEntry({
|
@@ -392,7 +452,7 @@ export async function loadUserOneOptions(command: 'serve' | 'build') {
|
|
392
452
|
if (!found) {
|
393
453
|
throw new Error(`No config found in ${process.cwd()}. Is this the correct directory?`)
|
394
454
|
}
|
395
|
-
const foundOptions = getUserOneOptions()
|
455
|
+
const foundOptions = getUserOneOptions(command)
|
396
456
|
if (!foundOptions) {
|
397
457
|
throw new Error(`No One plugin found in this vite.config`)
|
398
458
|
}
|
@@ -3,12 +3,12 @@ import { relative } from 'node:path'
|
|
3
3
|
import type { Plugin } from 'vite'
|
4
4
|
|
5
5
|
export const createReactCompilerPlugin = (root: string): Plugin => {
|
6
|
-
const
|
6
|
+
const getBabelConfig = (target: '18' | '19') => ({
|
7
7
|
babelrc: false,
|
8
8
|
configFile: false,
|
9
9
|
presets: ['@babel/preset-typescript'],
|
10
|
-
plugins: [['babel-plugin-react-compiler', { target
|
11
|
-
}
|
10
|
+
plugins: [['babel-plugin-react-compiler', { target }]],
|
11
|
+
})
|
12
12
|
|
13
13
|
const filter = /.*(.tsx?)$/
|
14
14
|
|
@@ -19,10 +19,17 @@ export const createReactCompilerPlugin = (root: string): Plugin => {
|
|
19
19
|
async transform(codeIn, id) {
|
20
20
|
const shouldTransform = filter.test(id)
|
21
21
|
if (!shouldTransform) return
|
22
|
-
const
|
22
|
+
const env = this.environment.name
|
23
|
+
const target = env === 'ios' || env === 'android' ? '18' : '19'
|
24
|
+
|
25
|
+
if (codeIn.startsWith('// disable-compiler')) {
|
26
|
+
return
|
27
|
+
}
|
28
|
+
|
29
|
+
const result = await babel.transformAsync(codeIn, { filename: id, ...getBabelConfig(target) })
|
23
30
|
const code = result?.code ?? ''
|
24
31
|
|
25
|
-
if (code.includes(`react/compiler-runtime`)) {
|
32
|
+
if (code.includes(target === '18' ? `react-compiler-runtime` : `react/compiler-runtime`)) {
|
26
33
|
console.info(` 🪄 ${relative(root, id)}`)
|
27
34
|
}
|
28
35
|
|
package/src/vite/types.ts
CHANGED
@@ -23,6 +23,22 @@ export namespace One {
|
|
23
23
|
[key: string]: DepOptimize | DepPatch['patchFiles']
|
24
24
|
}
|
25
25
|
|
26
|
+
export type ReactScanOptions = {
|
27
|
+
enabled?: boolean
|
28
|
+
includeChildren?: boolean
|
29
|
+
playSound?: boolean
|
30
|
+
log?: boolean
|
31
|
+
showToolbar?: boolean
|
32
|
+
renderCountThreshold?: number
|
33
|
+
resetCountTimeout?: number
|
34
|
+
maxRenders?: number
|
35
|
+
report?: boolean
|
36
|
+
alwaysShowLabels?: boolean
|
37
|
+
animationSpeed?: 'slow' | 'fast' | 'off'
|
38
|
+
}
|
39
|
+
|
40
|
+
type PluginPlatformTarget = 'native' | 'web'
|
41
|
+
|
26
42
|
export type PluginOptions = {
|
27
43
|
/**
|
28
44
|
* Enabling zero does a couple very simple things:
|
@@ -33,22 +49,13 @@ export namespace One {
|
|
33
49
|
zero?: boolean
|
34
50
|
|
35
51
|
react?: {
|
36
|
-
compiler?: boolean
|
52
|
+
compiler?: boolean | PluginPlatformTarget
|
37
53
|
scan?:
|
38
54
|
| boolean
|
39
|
-
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
log?: boolean
|
44
|
-
showToolbar?: boolean
|
45
|
-
renderCountThreshold?: number
|
46
|
-
resetCountTimeout?: number
|
47
|
-
maxRenders?: number
|
48
|
-
report?: boolean
|
49
|
-
alwaysShowLabels?: boolean
|
50
|
-
animationSpeed?: 'slow' | 'fast' | 'off'
|
51
|
-
}
|
55
|
+
| PluginPlatformTarget
|
56
|
+
| (Record<PluginPlatformTarget, ReactScanOptions> & {
|
57
|
+
options?: ReactScanOptions
|
58
|
+
})
|
52
59
|
}
|
53
60
|
|
54
61
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createApp.native.d.ts","sourceRoot":"","sources":["../src/createApp.native.tsx"],"names":[],"mappings":"AACA,OAAO,oBAAoB,CAAA;AAC3B,OAAO,SAAS,CAAA;
|
1
|
+
{"version":3,"file":"createApp.native.d.ts","sourceRoot":"","sources":["../src/createApp.native.tsx"],"names":[],"mappings":"AACA,OAAO,oBAAoB,CAAA;AAC3B,OAAO,SAAS,CAAA;AAIhB,MAAM,MAAM,cAAc,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA;CAAE,CAAA;AAK/E,wBAAgB,SAAS,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAmBvD"}
|
package/types/setup.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAUA,OAAO,yCAAyC,CAAA"}
|
package/types/vite/one.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"one.d.ts","sourceRoot":"","sources":["../../src/vite/one.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,YAAY,EAAuC,MAAM,MAAM,CAAA;AAU1F,OAAO,qBAAqB,CAAA;AAU5B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;
|
1
|
+
{"version":3,"file":"one.d.ts","sourceRoot":"","sources":["../../src/vite/one.ts"],"names":[],"mappings":"AAGA,OAAO,EAAe,KAAK,YAAY,EAAuC,MAAM,MAAM,CAAA;AAU1F,OAAO,qBAAqB,CAAA;AAU5B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAclC,wBAAgB,GAAG,CAAC,OAAO,GAAE,GAAG,CAAC,aAAkB,GAAG,YAAY,CA0YjE;AAeD,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,8BAalE"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"reactCompilerPlugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/reactCompilerPlugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAElC,eAAO,MAAM,yBAAyB,SAAU,MAAM,KAAG,
|
1
|
+
{"version":3,"file":"reactCompilerPlugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/reactCompilerPlugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAElC,eAAO,MAAM,yBAAyB,SAAU,MAAM,KAAG,MAwExD,CAAA"}
|
package/types/vite/types.d.ts
CHANGED
@@ -1,16 +1,30 @@
|
|
1
1
|
import type { PluginOptions as TSConfigPluginOptions } from 'vite-tsconfig-paths';
|
2
2
|
import type { DepOptimize, DepPatch, AfterBuildProps as VXRNAfterBuildProps, VXRNBuildOptions, VXRNOptions, VXRNServePlatform } from 'vxrn';
|
3
3
|
export declare namespace One {
|
4
|
-
type Options = Omit<VXRNOptions, keyof PluginOptions> & PluginOptions;
|
5
|
-
type RouteRenderMode = 'ssg' | 'spa' | 'ssr';
|
6
|
-
type RouteType = RouteRenderMode | 'api' | 'layout';
|
7
|
-
type RouteOptions = {
|
4
|
+
export type Options = Omit<VXRNOptions, keyof PluginOptions> & PluginOptions;
|
5
|
+
export type RouteRenderMode = 'ssg' | 'spa' | 'ssr';
|
6
|
+
export type RouteType = RouteRenderMode | 'api' | 'layout';
|
7
|
+
export type RouteOptions = {
|
8
8
|
routeModes?: Record<string, RouteRenderMode>;
|
9
9
|
};
|
10
|
-
type FixDependencies = {
|
10
|
+
export type FixDependencies = {
|
11
11
|
[key: string]: DepOptimize | DepPatch['patchFiles'];
|
12
12
|
};
|
13
|
-
type
|
13
|
+
export type ReactScanOptions = {
|
14
|
+
enabled?: boolean;
|
15
|
+
includeChildren?: boolean;
|
16
|
+
playSound?: boolean;
|
17
|
+
log?: boolean;
|
18
|
+
showToolbar?: boolean;
|
19
|
+
renderCountThreshold?: number;
|
20
|
+
resetCountTimeout?: number;
|
21
|
+
maxRenders?: number;
|
22
|
+
report?: boolean;
|
23
|
+
alwaysShowLabels?: boolean;
|
24
|
+
animationSpeed?: 'slow' | 'fast' | 'off';
|
25
|
+
};
|
26
|
+
type PluginPlatformTarget = 'native' | 'web';
|
27
|
+
export type PluginOptions = {
|
14
28
|
/**
|
15
29
|
* Enabling zero does a couple very simple things:
|
16
30
|
*
|
@@ -19,20 +33,10 @@ export declare namespace One {
|
|
19
33
|
*/
|
20
34
|
zero?: boolean;
|
21
35
|
react?: {
|
22
|
-
compiler?: boolean;
|
23
|
-
scan?: boolean | {
|
24
|
-
|
25
|
-
|
26
|
-
playSound?: boolean;
|
27
|
-
log?: boolean;
|
28
|
-
showToolbar?: boolean;
|
29
|
-
renderCountThreshold?: number;
|
30
|
-
resetCountTimeout?: number;
|
31
|
-
maxRenders?: number;
|
32
|
-
report?: boolean;
|
33
|
-
alwaysShowLabels?: boolean;
|
34
|
-
animationSpeed?: 'slow' | 'fast' | 'off';
|
35
|
-
};
|
36
|
+
compiler?: boolean | PluginPlatformTarget;
|
37
|
+
scan?: boolean | PluginPlatformTarget | (Record<PluginPlatformTarget, ReactScanOptions> & {
|
38
|
+
options?: ReactScanOptions;
|
39
|
+
});
|
36
40
|
};
|
37
41
|
/**
|
38
42
|
* Path to a js or ts file to import before the rest of your app runs
|
@@ -121,29 +125,29 @@ export declare namespace One {
|
|
121
125
|
disableAutoDepsPreBundling?: boolean;
|
122
126
|
};
|
123
127
|
};
|
124
|
-
interface RouteContext {
|
128
|
+
export interface RouteContext {
|
125
129
|
keys(): string[];
|
126
130
|
(id: string): any;
|
127
131
|
<T>(id: string): T;
|
128
132
|
resolve(id: string): string;
|
129
133
|
id: string;
|
130
134
|
}
|
131
|
-
type Redirect = {
|
135
|
+
export type Redirect = {
|
132
136
|
source: string;
|
133
137
|
destination: string;
|
134
138
|
permanent: boolean;
|
135
139
|
};
|
136
|
-
type BuildInfo = Pick<AfterBuildProps, 'routeMap' | 'builtRoutes'> & {
|
140
|
+
export type BuildInfo = Pick<AfterBuildProps, 'routeMap' | 'builtRoutes'> & {
|
137
141
|
oneOptions?: PluginOptions;
|
138
142
|
constants: {
|
139
143
|
CACHE_KEY: string;
|
140
144
|
};
|
141
145
|
};
|
142
|
-
type AfterBuildProps = VXRNAfterBuildProps & {
|
146
|
+
export type AfterBuildProps = VXRNAfterBuildProps & {
|
143
147
|
routeMap: Record<string, string>;
|
144
148
|
builtRoutes: RouteBuildInfo[];
|
145
149
|
};
|
146
|
-
type RouteBuildInfo = {
|
150
|
+
export type RouteBuildInfo = {
|
147
151
|
type: One.RouteType;
|
148
152
|
path: string;
|
149
153
|
preloadPath: string;
|
@@ -155,5 +159,6 @@ export declare namespace One {
|
|
155
159
|
loaderData: any;
|
156
160
|
preloads: string[];
|
157
161
|
};
|
162
|
+
export {};
|
158
163
|
}
|
159
164
|
//# sourceMappingURL=types.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/vite/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AACjF,OAAO,KAAK,EACV,WAAW,EACX,QAAQ,EACR,eAAe,IAAI,mBAAmB,EACtC,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EAClB,MAAM,MAAM,CAAA;AAEb,yBAAiB,GAAG,CAAC;IACnB,
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/vite/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AACjF,OAAO,KAAK,EACV,WAAW,EACX,QAAQ,EACR,eAAe,IAAI,mBAAmB,EACtC,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EAClB,MAAM,MAAM,CAAA;AAEb,yBAAiB,GAAG,CAAC;IACnB,MAAM,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,aAAa,CAAC,GAAG,aAAa,CAAA;IAE5E,MAAM,MAAM,eAAe,GAAG,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