vxrn 1.21.6 → 1.21.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.
- package/dist/config/getOptionsFilled.mjs +3 -5
- package/dist/config/getOptionsFilled.mjs.map +1 -1
- package/dist/config/getOptionsFilled.native.js +3 -5
- package/dist/config/getOptionsFilled.native.js.map +1 -1
- package/dist/exports/clean.mjs +84 -16
- package/dist/exports/clean.mjs.map +1 -1
- package/dist/exports/clean.native.js +89 -16
- package/dist/exports/clean.native.js.map +1 -1
- package/dist/exports/clean.test.mjs +81 -0
- package/dist/exports/clean.test.mjs.map +1 -0
- package/dist/exports/clean.test.native.js +88 -0
- package/dist/exports/clean.test.native.js.map +1 -0
- package/dist/exports/dev.mjs +8 -3
- package/dist/exports/dev.mjs.map +1 -1
- package/dist/exports/dev.native.js +8 -3
- package/dist/exports/dev.native.js.map +1 -1
- package/dist/serve/node.mjs +20 -24
- package/dist/serve/node.mjs.map +1 -1
- package/dist/serve/node.native.js +20 -22
- package/dist/serve/node.native.js.map +1 -1
- package/dist/serve/node.test.mjs +60 -0
- package/dist/serve/node.test.mjs.map +1 -0
- package/dist/serve/node.test.native.js +72 -0
- package/dist/serve/node.test.native.js.map +1 -0
- package/dist/utils/state.mjs +11 -1
- package/dist/utils/state.mjs.map +1 -1
- package/dist/utils/state.native.js +11 -1
- package/dist/utils/state.native.js.map +1 -1
- package/package.json +11 -11
- package/src/config/getOptionsFilled.ts +2 -4
- package/src/exports/clean.test.ts +82 -0
- package/src/exports/clean.ts +90 -26
- package/src/exports/dev.ts +8 -3
- package/src/serve/node.test.ts +63 -0
- package/src/serve/node.ts +22 -26
- package/src/utils/state.ts +9 -1
- package/types/config/getOptionsFilled.d.ts +2 -0
- package/types/config/getOptionsFilled.d.ts.map +1 -1
- package/types/exports/build.d.ts +1 -0
- package/types/exports/build.d.ts.map +1 -1
- package/types/exports/clean.d.ts +6 -9
- package/types/exports/clean.d.ts.map +1 -1
- package/types/exports/clean.test.d.ts.map +1 -0
- package/types/exports/dev.d.ts.map +1 -1
- package/types/serve/node.d.ts.map +1 -1
- package/types/serve/node.test.d.ts.map +1 -0
- package/types/utils/state.d.ts.map +1 -1
package/src/exports/clean.ts
CHANGED
|
@@ -1,39 +1,73 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { join } from 'node:path'
|
|
1
|
+
import { mkdir, readFile, rm, writeFile } from 'node:fs/promises'
|
|
2
|
+
import { dirname, join } from 'node:path'
|
|
4
3
|
import type { VXRNOptions } from '../types'
|
|
5
4
|
import { fillOptions } from '../config/getOptionsFilled'
|
|
6
5
|
import { getSSRExternalsCachePath } from '../plugins/autoDepOptimizePlugin'
|
|
7
6
|
import { getCacheDir } from '../utils/getCacheDir'
|
|
7
|
+
import { readState, writeState } from '../utils/state'
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
* Note that much of the logic is being run by plugins:
|
|
13
|
-
*
|
|
14
|
-
* - createFileSystemRouterPlugin does most of the fs-routes/request handling
|
|
15
|
-
* - clientTreeShakePlugin handles loaders/transforms
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
9
|
+
const CLEAN_LOCK_WAIT_MS = 25
|
|
10
|
+
const CLEAN_LOCK_TIMEOUT_MS = 60_000
|
|
18
11
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
function getErrorCode(err: unknown) {
|
|
13
|
+
if (err instanceof Error && 'code' in err && typeof err.code === 'string') {
|
|
14
|
+
return err.code
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async function withCacheCleanLock<T>(cacheDir: string, action: () => Promise<T>) {
|
|
19
|
+
const lockPath = join(dirname(cacheDir), '.vxrn-clean.lock')
|
|
20
|
+
const startedAt = Date.now()
|
|
21
|
+
await mkdir(dirname(lockPath), { recursive: true })
|
|
22
|
+
|
|
23
|
+
while (true) {
|
|
24
|
+
try {
|
|
25
|
+
await writeFile(lockPath, `${process.pid}\n`, { flag: 'wx' })
|
|
26
|
+
break
|
|
27
|
+
} catch (err) {
|
|
28
|
+
if (getErrorCode(err) !== 'EEXIST') {
|
|
29
|
+
throw err
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (Date.now() - startedAt >= CLEAN_LOCK_TIMEOUT_MS) {
|
|
33
|
+
let owner = 'unknown process'
|
|
34
|
+
try {
|
|
35
|
+
owner = `process ${(await readFile(lockPath, 'utf8')).trim()}`
|
|
36
|
+
} catch (readErr) {
|
|
37
|
+
if (getErrorCode(readErr) === 'ENOENT') {
|
|
38
|
+
continue
|
|
39
|
+
}
|
|
40
|
+
throw readErr
|
|
41
|
+
}
|
|
42
|
+
throw new Error(`Timed out waiting for VXRN cache cleanup lock held by ${owner}`)
|
|
43
|
+
}
|
|
44
|
+
await new Promise<void>((resolve) => setTimeout(resolve, CLEAN_LOCK_WAIT_MS))
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
return await action()
|
|
50
|
+
} finally {
|
|
51
|
+
await rm(lockPath, { force: true })
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function removeCachePaths(root: string, only?: 'vite') {
|
|
56
|
+
const removeVxrnCache = process.env.VXRN_DONT_CLEAN_SELF
|
|
57
|
+
? rm(getSSRExternalsCachePath(root)).catch(throwIfNotMissingError)
|
|
58
|
+
: rm(getCacheDir(root), {
|
|
59
|
+
recursive: true,
|
|
60
|
+
force: true,
|
|
61
|
+
}).catch(throwIfNotMissingError)
|
|
22
62
|
|
|
23
63
|
console.info(`[vxrn] cleaning`)
|
|
24
64
|
|
|
25
65
|
await Promise.all([
|
|
26
|
-
rm(getSSRExternalsCachePath(root)).catch(throwIfNotMissingError),
|
|
27
66
|
rm(join(root, 'node_modules', '.vite'), {
|
|
28
67
|
recursive: true,
|
|
29
68
|
force: true,
|
|
30
69
|
}).catch(throwIfNotMissingError),
|
|
31
|
-
|
|
32
|
-
? null
|
|
33
|
-
: rm(getCacheDir(root), {
|
|
34
|
-
recursive: true,
|
|
35
|
-
force: true,
|
|
36
|
-
}).catch(throwIfNotMissingError),
|
|
70
|
+
removeVxrnCache,
|
|
37
71
|
only === 'vite'
|
|
38
72
|
? null
|
|
39
73
|
: rm(join(root, 'dist'), {
|
|
@@ -43,10 +77,40 @@ export const clean = async (rest: VXRNOptions, only?: 'vite') => {
|
|
|
43
77
|
])
|
|
44
78
|
}
|
|
45
79
|
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
80
|
+
export async function prepareCacheForVersion({
|
|
81
|
+
root,
|
|
82
|
+
cacheDir,
|
|
83
|
+
versionHash,
|
|
84
|
+
forceClean = false,
|
|
85
|
+
}: {
|
|
86
|
+
root: string
|
|
87
|
+
cacheDir: string
|
|
88
|
+
versionHash: string
|
|
89
|
+
forceClean?: boolean
|
|
90
|
+
}) {
|
|
91
|
+
return withCacheCleanLock(cacheDir, async () => {
|
|
92
|
+
const state = await readState(cacheDir)
|
|
93
|
+
const versionChanged = !!state.versionHash && state.versionHash !== versionHash
|
|
94
|
+
const shouldClean = forceClean || versionChanged
|
|
95
|
+
|
|
96
|
+
if (shouldClean) {
|
|
97
|
+
await removeCachePaths(root, 'vite')
|
|
98
|
+
}
|
|
99
|
+
if (shouldClean || state.versionHash !== versionHash) {
|
|
100
|
+
await writeState(cacheDir, { versionHash })
|
|
50
101
|
}
|
|
102
|
+
|
|
103
|
+
return shouldClean
|
|
104
|
+
})
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export const clean = async (rest: VXRNOptions, only?: 'vite') => {
|
|
108
|
+
const options = await fillOptions(rest)
|
|
109
|
+
await withCacheCleanLock(options.cacheDir, () => removeCachePaths(options.root, only))
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function throwIfNotMissingError(err: unknown) {
|
|
113
|
+
if (getErrorCode(err) !== 'ENOENT') {
|
|
114
|
+
throw err
|
|
51
115
|
}
|
|
52
116
|
}
|
package/src/exports/dev.ts
CHANGED
|
@@ -44,7 +44,7 @@ export const dev = async (optionsIn: DevOptions) => {
|
|
|
44
44
|
const { fillOptions } = await import('../config/getOptionsFilled')
|
|
45
45
|
const { getViteServerConfig } = await import('../config/getViteServerConfig')
|
|
46
46
|
const { printServerUrls } = await import('../utils/printServerUrls')
|
|
47
|
-
const {
|
|
47
|
+
const { prepareCacheForVersion } = await import('./clean')
|
|
48
48
|
const { filterViteServerResolvedUrls } =
|
|
49
49
|
await import('../utils/filterViteServerResolvedUrls')
|
|
50
50
|
const { removeUndefined } = await import('../utils/removeUndefined')
|
|
@@ -107,8 +107,13 @@ export default defineConfig({
|
|
|
107
107
|
|
|
108
108
|
bindKeypressInput()
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
const cacheWasCleaned = await prepareCacheForVersion({
|
|
111
|
+
root: options.root,
|
|
112
|
+
cacheDir,
|
|
113
|
+
versionHash: options.versionHash,
|
|
114
|
+
forceClean: optionsIn.clean === true,
|
|
115
|
+
})
|
|
116
|
+
if (options.clean || cacheWasCleaned) {
|
|
112
117
|
// signal metro to reset its cache as well
|
|
113
118
|
process.env.METRO_RESET_CACHE = '1'
|
|
114
119
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { createServer } from 'node:http'
|
|
2
|
+
import { Hono } from 'hono'
|
|
3
|
+
import { describe, expect, test } from 'vitest'
|
|
4
|
+
import { honoServeNode } from './node'
|
|
5
|
+
|
|
6
|
+
describe('honoServeNode', () => {
|
|
7
|
+
test('rejects when the listener cannot bind', async () => {
|
|
8
|
+
const occupied = createServer()
|
|
9
|
+
await new Promise<void>((resolve, reject) => {
|
|
10
|
+
occupied.once('error', reject)
|
|
11
|
+
occupied.listen(0, '127.0.0.1', resolve)
|
|
12
|
+
})
|
|
13
|
+
const address = occupied.address()
|
|
14
|
+
if (!address || typeof address === 'string') throw new Error('missing test port')
|
|
15
|
+
|
|
16
|
+
const app = new Hono().get('/health', (context) => context.text('ok'))
|
|
17
|
+
await expect(
|
|
18
|
+
honoServeNode(app, { host: '127.0.0.1', port: address.port })
|
|
19
|
+
).rejects.toMatchObject({ code: 'EADDRINUSE' })
|
|
20
|
+
|
|
21
|
+
await new Promise<void>((resolve, reject) =>
|
|
22
|
+
occupied.close((error) => (error ? reject(error) : resolve()))
|
|
23
|
+
)
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
test('overwrites the trusted peer address header from the socket', async () => {
|
|
27
|
+
const reservation = createServer()
|
|
28
|
+
await new Promise<void>((resolve, reject) => {
|
|
29
|
+
reservation.once('error', reject)
|
|
30
|
+
reservation.listen(0, '127.0.0.1', resolve)
|
|
31
|
+
})
|
|
32
|
+
const address = reservation.address()
|
|
33
|
+
if (!address || typeof address === 'string') throw new Error('missing test port')
|
|
34
|
+
await new Promise<void>((resolve, reject) =>
|
|
35
|
+
reservation.close((error) => (error ? reject(error) : resolve()))
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
const app = new Hono().get('/peer', (context) =>
|
|
39
|
+
context.text(context.req.header('x-vxrn-peer-address') || '')
|
|
40
|
+
)
|
|
41
|
+
const running = honoServeNode(app, { host: '127.0.0.1', port: address.port })
|
|
42
|
+
await new Promise<void>((resolve, reject) => {
|
|
43
|
+
const startedAt = Date.now()
|
|
44
|
+
const probe = async () => {
|
|
45
|
+
try {
|
|
46
|
+
const response = await fetch(`http://127.0.0.1:${address.port}/peer`, {
|
|
47
|
+
headers: { 'x-vxrn-peer-address': '203.0.113.9' },
|
|
48
|
+
})
|
|
49
|
+
expect(await response.text()).toBe('127.0.0.1')
|
|
50
|
+
resolve()
|
|
51
|
+
} catch (error) {
|
|
52
|
+
if (Date.now() - startedAt > 2_000) reject(error)
|
|
53
|
+
else setTimeout(probe, 20)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
void probe()
|
|
57
|
+
})
|
|
58
|
+
const shutdown = process.listeners('SIGTERM').at(-1)
|
|
59
|
+
expect(shutdown).toBeTypeOf('function')
|
|
60
|
+
shutdown?.('SIGTERM')
|
|
61
|
+
await running
|
|
62
|
+
})
|
|
63
|
+
})
|
package/src/serve/node.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { createServer
|
|
1
|
+
import { createServer } from 'node:http'
|
|
2
2
|
import { networkInterfaces, platform } from 'node:os'
|
|
3
3
|
import { getRequestListener } from '@hono/node-server'
|
|
4
|
-
import { serve as honoServe } from '@hono/node-server'
|
|
5
|
-
import type { ServerType } from '@hono/node-server'
|
|
6
4
|
import type { Hono } from 'hono'
|
|
7
5
|
import colors from 'picocolors'
|
|
8
6
|
import type { VXRNServeOptions } from '../types'
|
|
@@ -35,21 +33,20 @@ export async function honoServeNode(app: Hono, options: VXRNServeOptions) {
|
|
|
35
33
|
const port = options.port ?? 3000
|
|
36
34
|
const host = options.host ?? '0.0.0.0'
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
36
|
+
const listener = getRequestListener((request, env) => {
|
|
37
|
+
request.headers.delete('x-vxrn-peer-address')
|
|
38
|
+
const address = env.incoming.socket.remoteAddress
|
|
39
|
+
if (address) request.headers.set('x-vxrn-peer-address', address)
|
|
40
|
+
return app.fetch(request, env)
|
|
41
|
+
})
|
|
42
|
+
const server = createServer(listener)
|
|
43
|
+
server.listen({
|
|
44
|
+
port,
|
|
45
|
+
host,
|
|
46
|
+
...(canReusePort && process.env.ONE_CLUSTER_WORKER === '1'
|
|
47
|
+
? { reusePort: true }
|
|
48
|
+
: {}),
|
|
49
|
+
})
|
|
53
50
|
|
|
54
51
|
const colorUrl = (url: string) =>
|
|
55
52
|
colors.cyan(url.replace(/:(\d+)\//, (_, port) => `:${colors.bold(port)}/`))
|
|
@@ -71,17 +68,16 @@ export async function honoServeNode(app: Hono, options: VXRNServeOptions) {
|
|
|
71
68
|
}
|
|
72
69
|
console.info()
|
|
73
70
|
|
|
74
|
-
const shutdown = () =>
|
|
75
|
-
server.close(() => {
|
|
76
|
-
process.exit(0)
|
|
77
|
-
})
|
|
78
|
-
}
|
|
71
|
+
const shutdown = () => server.close()
|
|
79
72
|
|
|
80
|
-
process.
|
|
81
|
-
process.
|
|
73
|
+
process.once('SIGINT', shutdown)
|
|
74
|
+
process.once('SIGTERM', shutdown)
|
|
82
75
|
|
|
83
|
-
await new Promise<void>((res) => {
|
|
76
|
+
await new Promise<void>((res, rej) => {
|
|
77
|
+
server.once('error', rej)
|
|
84
78
|
server.on('close', () => {
|
|
79
|
+
process.off('SIGINT', shutdown)
|
|
80
|
+
process.off('SIGTERM', shutdown)
|
|
85
81
|
res()
|
|
86
82
|
})
|
|
87
83
|
})
|
package/src/utils/state.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import FSExtra from 'fs-extra'
|
|
2
|
+
import { randomUUID } from 'node:crypto'
|
|
3
|
+
import { rename, rm } from 'node:fs/promises'
|
|
2
4
|
import { join } from 'node:path'
|
|
3
5
|
|
|
4
6
|
type State = {
|
|
@@ -20,6 +22,12 @@ export async function readState(cacheDir: string) {
|
|
|
20
22
|
|
|
21
23
|
export async function writeState(cacheDir: string, state: State) {
|
|
22
24
|
const statePath = join(cacheDir, 'state.json')
|
|
25
|
+
const pendingStatePath = `${statePath}.${process.pid}.${randomUUID()}.tmp`
|
|
23
26
|
await FSExtra.ensureDir(cacheDir)
|
|
24
|
-
|
|
27
|
+
try {
|
|
28
|
+
await FSExtra.writeJSON(pendingStatePath, state)
|
|
29
|
+
await rename(pendingStatePath, statePath)
|
|
30
|
+
} finally {
|
|
31
|
+
await rm(pendingStatePath, { force: true })
|
|
32
|
+
}
|
|
25
33
|
}
|
|
@@ -54,6 +54,7 @@ export declare function fillOptions(options: VXRNOptions, { mode }?: {
|
|
|
54
54
|
};
|
|
55
55
|
readonly packageRootDir: string;
|
|
56
56
|
readonly cacheDir: string;
|
|
57
|
+
readonly versionHash: string;
|
|
57
58
|
readonly skipEnv?: boolean;
|
|
58
59
|
readonly build?: {
|
|
59
60
|
server?: boolean | import("..").VXRNBuildOptions;
|
|
@@ -86,6 +87,7 @@ export declare function getOptionsFilled(): {
|
|
|
86
87
|
};
|
|
87
88
|
readonly packageRootDir: string;
|
|
88
89
|
readonly cacheDir: string;
|
|
90
|
+
readonly versionHash: string;
|
|
89
91
|
readonly skipEnv?: boolean;
|
|
90
92
|
readonly build?: {
|
|
91
93
|
server?: boolean | import("..").VXRNBuildOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOptionsFilled.d.ts","sourceRoot":"","sources":["../../src/config/getOptionsFilled.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAOjD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAAA;AAIvE,wBAAsB,WAAW,CAC/B,OAAO,EAAE,WAAW,EACpB,EAAE,IAAY,EAAE,GAAE;IAAE,IAAI,CAAC,EAAE,IAAI,CAAA;CAAO
|
|
1
|
+
{"version":3,"file":"getOptionsFilled.d.ts","sourceRoot":"","sources":["../../src/config/getOptionsFilled.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAOjD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAAA;AAIvE,wBAAsB,WAAW,CAC/B,OAAO,EAAE,WAAW,EACpB,EAAE,IAAY,EAAE,GAAE;IAAE,IAAI,CAAC,EAAE,IAAI,CAAA;CAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgB9B,CAAR;eAKQ,CAAC;;;;GA4CV;AAED,wBAAgB,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;cAnDtB,CAAR;eAKQ,CAAC;;;;SAgDV"}
|
package/types/exports/build.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export declare const build: (optionsIn: VXRNOptions, buildArgs?: BuildArgs) => P
|
|
|
29
29
|
};
|
|
30
30
|
readonly packageRootDir: string;
|
|
31
31
|
readonly cacheDir: string;
|
|
32
|
+
readonly versionHash: string;
|
|
32
33
|
readonly skipEnv?: boolean;
|
|
33
34
|
readonly build?: {
|
|
34
35
|
server?: boolean | import("..").VXRNBuildOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/exports/build.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAkB,MAAM,UAAU,CAAA;AAaxE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAuBtD,eAAO,MAAM,KAAK,GAAU,WAAW,WAAW,EAAE,YAAW,SAAc
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/exports/build.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAkB,MAAM,UAAU,CAAA;AAaxE,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAuBtD,eAAO,MAAM,KAAK,GAAU,WAAW,WAAW,EAAE,YAAW,SAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiDrE,CAAN;mBAKsE,CAAC;;;;;;;;;;;;EA4SxE,CAAA"}
|
package/types/exports/clean.d.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import type { VXRNOptions } from '../types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* - clientTreeShakePlugin handles loaders/transforms
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
2
|
+
export declare function prepareCacheForVersion({ root, cacheDir, versionHash, forceClean, }: {
|
|
3
|
+
root: string;
|
|
4
|
+
cacheDir: string;
|
|
5
|
+
versionHash: string;
|
|
6
|
+
forceClean?: boolean;
|
|
7
|
+
}): Promise<boolean>;
|
|
11
8
|
export declare const clean: (rest: VXRNOptions, only?: "vite") => Promise<void>;
|
|
12
9
|
//# sourceMappingURL=clean.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../src/exports/clean.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../src/exports/clean.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAuF3C,wBAAsB,sBAAsB,CAAC,EAC3C,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,UAAkB,GACnB,EAAE;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,oBAeA;AAED,eAAO,MAAM,KAAK,GAAU,MAAM,WAAW,EAAE,OAAO,MAAM,kBAG3D,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean.test.d.ts","sourceRoot":"","sources":["../../src/exports/clean.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/exports/dev.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAkB3C,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG;IACrC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,GAAG,GAAU,WAAW,UAAU;;;;;;
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/exports/dev.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAkB3C,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG;IACrC,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,GAAG,GAAU,WAAW,UAAU;;;;;;EA2L9C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/serve/node.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/serve/node.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAEhC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAgBhD,QAAA,MAAM,YAAY,SAMT,CAAA;AAET,OAAO,EAAE,YAAY,EAAE,CAAA;AAEvB,wBAAsB,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,iBAoDvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.test.d.ts","sourceRoot":"","sources":["../../src/serve/node.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/utils/state.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/utils/state.ts"],"names":[],"mappings":"AAKA,KAAK,KAAK,GAAG;IACX,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,wBAAsB,SAAS,CAAC,QAAQ,EAAE,MAAM,kBAW/C;AAED,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,iBAU9D"}
|