vxrn 0.1.16 → 0.1.18
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/VXRNConfigFilled.js +53 -0
- package/dist/cjs/VXRNConfigFilled.js.map +6 -0
- package/dist/cjs/VXRNConfigFilled.native.js +307 -0
- package/dist/cjs/VXRNConfigFilled.native.js.map +6 -0
- package/dist/cjs/build.js +96 -0
- package/dist/cjs/build.js.map +6 -0
- package/dist/cjs/build.native.js +237 -0
- package/dist/cjs/build.native.js.map +6 -0
- package/dist/cjs/commands/cli-build.js +36 -0
- package/dist/cjs/commands/cli-build.js.map +6 -0
- package/dist/cjs/commands/cli-build.native.js +171 -0
- package/dist/cjs/commands/cli-build.native.js.map +6 -0
- package/dist/cjs/commands/cli-dev.js +2 -2
- package/dist/cjs/commands/cli-dev.js.map +1 -1
- package/dist/cjs/commands/cli-dev.native.js +2 -2
- package/dist/cjs/commands/cli-dev.native.js.map +2 -2
- package/dist/cjs/commands/index.js +3 -1
- package/dist/cjs/commands/index.js.map +1 -1
- package/dist/cjs/commands/index.native.js +4 -0
- package/dist/cjs/commands/index.native.js.map +2 -2
- package/dist/cjs/createDevServer.js +602 -0
- package/dist/cjs/createDevServer.js.map +6 -0
- package/dist/cjs/createDevServer.native.js +1222 -0
- package/dist/cjs/createDevServer.native.js.map +6 -0
- package/dist/cjs/getBaseViteConfig.js +40 -0
- package/dist/cjs/getBaseViteConfig.js.map +6 -0
- package/dist/cjs/getBaseViteConfig.native.js +46 -0
- package/dist/cjs/getBaseViteConfig.native.js.map +6 -0
- package/dist/cjs/getOptionsFIlled.js +53 -0
- package/dist/cjs/getOptionsFIlled.js.map +6 -0
- package/dist/cjs/getOptionsFIlled.native.js +307 -0
- package/dist/cjs/getOptionsFIlled.native.js.map +6 -0
- package/dist/cjs/index.js +3 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +4 -2
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/nativePlugin.js +1 -1
- package/dist/cjs/nativePlugin.native.js +1 -1
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/utils/getBaseViteConfig.js +40 -0
- package/dist/cjs/utils/getBaseViteConfig.js.map +6 -0
- package/dist/cjs/utils/getBaseViteConfig.native.js +46 -0
- package/dist/cjs/utils/getBaseViteConfig.native.js.map +6 -0
- package/dist/cjs/utils/getOptionsFilled.js +53 -0
- package/dist/cjs/utils/getOptionsFilled.js.map +6 -0
- package/dist/cjs/utils/getOptionsFilled.native.js +307 -0
- package/dist/cjs/utils/getOptionsFilled.native.js.map +6 -0
- package/dist/cjs/utils/getVitePath.js +49 -0
- package/dist/cjs/utils/getVitePath.js.map +6 -0
- package/dist/cjs/utils/getVitePath.native.js +198 -0
- package/dist/cjs/utils/getVitePath.native.js.map +6 -0
- package/dist/esm/VXRNConfigFilled.js +30 -0
- package/dist/esm/VXRNConfigFilled.js.map +6 -0
- package/dist/esm/VXRNConfigFilled.mjs +34 -0
- package/dist/esm/VXRNConfigFilled.native.js +279 -0
- package/dist/esm/VXRNConfigFilled.native.js.map +6 -0
- package/dist/esm/build.js +83 -0
- package/dist/esm/build.js.map +6 -0
- package/dist/esm/build.mjs +56 -0
- package/dist/esm/build.native.js +217 -0
- package/dist/esm/build.native.js.map +6 -0
- package/dist/esm/commands/cli-build.js +23 -0
- package/dist/esm/commands/cli-build.js.map +6 -0
- package/dist/esm/commands/cli-build.mjs +22 -0
- package/dist/esm/commands/cli-build.native.js +156 -0
- package/dist/esm/commands/cli-build.native.js.map +6 -0
- package/dist/esm/commands/cli-dev.js +2 -2
- package/dist/esm/commands/cli-dev.js.map +1 -1
- package/dist/esm/commands/cli-dev.mjs +2 -2
- package/dist/esm/commands/cli-dev.native.js +2 -2
- package/dist/esm/commands/cli-dev.native.js.map +2 -2
- package/dist/esm/commands/index.js +3 -1
- package/dist/esm/commands/index.js.map +1 -1
- package/dist/esm/commands/index.mjs +3 -1
- package/dist/esm/commands/index.native.js +4 -0
- package/dist/esm/commands/index.native.js.map +2 -2
- package/dist/esm/createDevServer.js +613 -0
- package/dist/esm/createDevServer.js.map +6 -0
- package/dist/esm/createDevServer.mjs +574 -0
- package/dist/esm/createDevServer.native.js +1211 -0
- package/dist/esm/createDevServer.native.js.map +6 -0
- package/dist/esm/getBaseViteConfig.js +24 -0
- package/dist/esm/getBaseViteConfig.js.map +6 -0
- package/dist/esm/getBaseViteConfig.mjs +23 -0
- package/dist/esm/getBaseViteConfig.native.js +25 -0
- package/dist/esm/getBaseViteConfig.native.js.map +6 -0
- package/dist/esm/getOptionsFIlled.js +30 -0
- package/dist/esm/getOptionsFIlled.js.map +6 -0
- package/dist/esm/getOptionsFIlled.mjs +34 -0
- package/dist/esm/getOptionsFIlled.native.js +279 -0
- package/dist/esm/getOptionsFIlled.native.js.map +6 -0
- package/dist/esm/index.js +4 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +3 -2
- package/dist/esm/index.native.js +4 -2
- package/dist/esm/index.native.js.map +2 -2
- package/dist/esm/nativePlugin.js +1 -1
- package/dist/esm/nativePlugin.mjs +1 -1
- package/dist/esm/nativePlugin.native.js +1 -1
- package/dist/esm/utils/getBaseViteConfig.js +24 -0
- package/dist/esm/utils/getBaseViteConfig.js.map +6 -0
- package/dist/esm/utils/getBaseViteConfig.mjs +23 -0
- package/dist/esm/utils/getBaseViteConfig.native.js +25 -0
- package/dist/esm/utils/getBaseViteConfig.native.js.map +6 -0
- package/dist/esm/utils/getOptionsFilled.js +30 -0
- package/dist/esm/utils/getOptionsFilled.js.map +6 -0
- package/dist/esm/utils/getOptionsFilled.mjs +34 -0
- package/dist/esm/utils/getOptionsFilled.native.js +279 -0
- package/dist/esm/utils/getOptionsFilled.native.js.map +6 -0
- package/dist/esm/utils/getVitePath.js +27 -0
- package/dist/esm/utils/getVitePath.js.map +6 -0
- package/dist/esm/utils/getVitePath.mjs +20 -0
- package/dist/esm/utils/getVitePath.native.js +171 -0
- package/dist/esm/utils/getVitePath.native.js.map +6 -0
- package/package.json +6 -6
- package/src/build.ts +96 -0
- package/src/commands/cli-build.ts +25 -0
- package/src/commands/cli-dev.ts +2 -2
- package/src/commands/index.ts +2 -1
- package/src/{create.ts → createDevServer.ts} +122 -180
- package/src/index.ts +2 -1
- package/src/nativePlugin.ts +1 -1
- package/src/types.ts +2 -1
- package/src/utils/getBaseViteConfig.ts +22 -0
- package/src/utils/getOptionsFilled.ts +43 -0
- package/src/{getVitePath.ts → utils/getVitePath.ts} +17 -17
- package/types/VXRNConfigFilled.d.ts +21 -0
- package/types/build.d.ts +4 -0
- package/types/commands/cli-build.d.ts +3 -0
- package/types/commands/index.d.ts +1 -0
- package/types/create.d.ts +2 -1
- package/types/createDevServer.d.ts +13 -0
- package/types/getBaseViteConfig.d.ts +5 -0
- package/types/getOptionsFIlled.d.ts +21 -0
- package/types/index.d.ts +2 -1
- package/types/types.d.ts +2 -1
- package/types/utils/getBaseViteConfig.d.ts +5 -0
- package/types/utils/getOptionsFilled.d.ts +22 -0
- package/types/utils/getVitePath.d.ts +2 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { join, relative, dirname } from 'path'
|
|
1
|
+
import { join, relative, dirname } from 'node:path'
|
|
2
2
|
|
|
3
3
|
import resolve from 'esm-resolve'
|
|
4
4
|
import FSExtra from 'fs-extra'
|
|
@@ -27,21 +27,21 @@ export async function getVitePath(
|
|
|
27
27
|
const rootAt = importer.indexOf(rootPath)
|
|
28
28
|
const base = join(dirname(importer.slice(rootAt)), moduleName)
|
|
29
29
|
return base + '.js'
|
|
30
|
-
} else {
|
|
31
|
-
const sourceFile = join(process.cwd(), 'index.js')
|
|
32
|
-
const resolved = resolve(sourceFile)(moduleName)
|
|
33
|
-
// figure out symlinks
|
|
34
|
-
if (!resolved) {
|
|
35
|
-
throw new Error(`❌ cant find`)
|
|
36
|
-
}
|
|
37
|
-
const real = await FSExtra.realpath(resolved)
|
|
38
|
-
let id = real
|
|
39
|
-
if (!absolute) {
|
|
40
|
-
id = relative(importer, real)
|
|
41
|
-
}
|
|
42
|
-
if (id.endsWith(`/react/jsx-dev-runtime.js`)) {
|
|
43
|
-
id = 'react/jsx-runtime'
|
|
44
|
-
}
|
|
45
|
-
return id
|
|
46
30
|
}
|
|
31
|
+
|
|
32
|
+
const sourceFile = join(process.cwd(), 'index.js')
|
|
33
|
+
const resolved = resolve(sourceFile)(moduleName)
|
|
34
|
+
// figure out symlinks
|
|
35
|
+
if (!resolved) {
|
|
36
|
+
throw new Error(`❌ cant find`)
|
|
37
|
+
}
|
|
38
|
+
const real = await FSExtra.realpath(resolved)
|
|
39
|
+
let id = real
|
|
40
|
+
if (!absolute) {
|
|
41
|
+
id = relative(importer, real)
|
|
42
|
+
}
|
|
43
|
+
if (id.endsWith(`/react/jsx-dev-runtime.js`)) {
|
|
44
|
+
id = 'react/jsx-runtime'
|
|
45
|
+
}
|
|
46
|
+
return id
|
|
47
47
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { VXRNConfig } from './types';
|
|
2
|
+
export type VXRNConfigFilled = Awaited<ReturnType<typeof getOptionsFilled>>;
|
|
3
|
+
export declare function getOptionsFilled(options: VXRNConfig): Promise<{
|
|
4
|
+
packageJSON: import("pkg-types").PackageJson;
|
|
5
|
+
state: State;
|
|
6
|
+
packageRootDir: string;
|
|
7
|
+
cacheDir: string;
|
|
8
|
+
userPatchesDir: string;
|
|
9
|
+
internalPatchesDir: string;
|
|
10
|
+
host: string;
|
|
11
|
+
root: string;
|
|
12
|
+
port: number;
|
|
13
|
+
webConfig?: import("vite").InlineConfig | undefined;
|
|
14
|
+
buildConfig?: import("vite").InlineConfig | undefined;
|
|
15
|
+
flow?: import("@vxrn/vite-flow").Options | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
type State = {
|
|
18
|
+
applyPatches?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=VXRNConfigFilled.d.ts.map
|
package/types/build.d.ts
ADDED
package/types/create.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { VXRNConfig } from './types';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const resolveFile: (path: string) => string;
|
|
4
|
+
export declare const createDevServer: (optionsIn: VXRNConfig) => Promise<{
|
|
4
5
|
nativeServer: import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
|
5
6
|
viteServer: import("vite").ViteDevServer;
|
|
6
7
|
start(): Promise<{
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { VXRNConfig } from './types';
|
|
3
|
+
export declare const resolveFile: (path: string) => string;
|
|
4
|
+
export declare const createDevServer: (optionsIn: VXRNConfig) => Promise<{
|
|
5
|
+
nativeServer: import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
|
6
|
+
viteServer: import("vite").ViteDevServer;
|
|
7
|
+
start(): Promise<{
|
|
8
|
+
closePromise: Promise<unknown>;
|
|
9
|
+
}>;
|
|
10
|
+
stop: () => Promise<void>;
|
|
11
|
+
}>;
|
|
12
|
+
export declare function bindKeypressInput(): void;
|
|
13
|
+
//# sourceMappingURL=createDevServer.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { VXRNConfig } from './types';
|
|
2
|
+
export type VXRNConfigFilled = Awaited<ReturnType<typeof getOptionsFilled>>;
|
|
3
|
+
export declare function getOptionsFilled(options: VXRNConfig): Promise<{
|
|
4
|
+
packageJSON: import("pkg-types").PackageJson;
|
|
5
|
+
state: State;
|
|
6
|
+
packageRootDir: string;
|
|
7
|
+
cacheDir: string;
|
|
8
|
+
userPatchesDir: string;
|
|
9
|
+
internalPatchesDir: string;
|
|
10
|
+
host: string;
|
|
11
|
+
root: string;
|
|
12
|
+
port: number;
|
|
13
|
+
webConfig?: import("vite").InlineConfig | undefined;
|
|
14
|
+
buildConfig?: import("vite").InlineConfig | undefined;
|
|
15
|
+
flow?: import("@vxrn/vite-flow").Options | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
type State = {
|
|
18
|
+
applyPatches?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=getOptionsFilled.d.ts.map
|
package/types/index.d.ts
CHANGED
package/types/types.d.ts
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { VXRNConfig } from '../types';
|
|
2
|
+
export type VXRNConfigFilled = Awaited<ReturnType<typeof getOptionsFilled>>;
|
|
3
|
+
export declare function getOptionsFilled(options: VXRNConfig): Promise<{
|
|
4
|
+
packageJSON: import("pkg-types").PackageJson;
|
|
5
|
+
state: State;
|
|
6
|
+
packageRootDir: string;
|
|
7
|
+
cacheDir: string;
|
|
8
|
+
userPatchesDir: string;
|
|
9
|
+
internalPatchesDir: string;
|
|
10
|
+
host: string;
|
|
11
|
+
root: string;
|
|
12
|
+
port: number;
|
|
13
|
+
entryNative?: string | undefined;
|
|
14
|
+
webConfig?: import("vite").InlineConfig | undefined;
|
|
15
|
+
buildConfig?: import("vite").InlineConfig | undefined;
|
|
16
|
+
flow?: import("@vxrn/vite-flow").Options | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
type State = {
|
|
19
|
+
applyPatches?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=getOptionsFilled.d.ts.map
|