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.
Files changed (139) hide show
  1. package/dist/cjs/VXRNConfigFilled.js +53 -0
  2. package/dist/cjs/VXRNConfigFilled.js.map +6 -0
  3. package/dist/cjs/VXRNConfigFilled.native.js +307 -0
  4. package/dist/cjs/VXRNConfigFilled.native.js.map +6 -0
  5. package/dist/cjs/build.js +96 -0
  6. package/dist/cjs/build.js.map +6 -0
  7. package/dist/cjs/build.native.js +237 -0
  8. package/dist/cjs/build.native.js.map +6 -0
  9. package/dist/cjs/commands/cli-build.js +36 -0
  10. package/dist/cjs/commands/cli-build.js.map +6 -0
  11. package/dist/cjs/commands/cli-build.native.js +171 -0
  12. package/dist/cjs/commands/cli-build.native.js.map +6 -0
  13. package/dist/cjs/commands/cli-dev.js +2 -2
  14. package/dist/cjs/commands/cli-dev.js.map +1 -1
  15. package/dist/cjs/commands/cli-dev.native.js +2 -2
  16. package/dist/cjs/commands/cli-dev.native.js.map +2 -2
  17. package/dist/cjs/commands/index.js +3 -1
  18. package/dist/cjs/commands/index.js.map +1 -1
  19. package/dist/cjs/commands/index.native.js +4 -0
  20. package/dist/cjs/commands/index.native.js.map +2 -2
  21. package/dist/cjs/createDevServer.js +602 -0
  22. package/dist/cjs/createDevServer.js.map +6 -0
  23. package/dist/cjs/createDevServer.native.js +1222 -0
  24. package/dist/cjs/createDevServer.native.js.map +6 -0
  25. package/dist/cjs/getBaseViteConfig.js +40 -0
  26. package/dist/cjs/getBaseViteConfig.js.map +6 -0
  27. package/dist/cjs/getBaseViteConfig.native.js +46 -0
  28. package/dist/cjs/getBaseViteConfig.native.js.map +6 -0
  29. package/dist/cjs/getOptionsFIlled.js +53 -0
  30. package/dist/cjs/getOptionsFIlled.js.map +6 -0
  31. package/dist/cjs/getOptionsFIlled.native.js +307 -0
  32. package/dist/cjs/getOptionsFIlled.native.js.map +6 -0
  33. package/dist/cjs/index.js +3 -2
  34. package/dist/cjs/index.js.map +1 -1
  35. package/dist/cjs/index.native.js +4 -2
  36. package/dist/cjs/index.native.js.map +1 -1
  37. package/dist/cjs/nativePlugin.js +1 -1
  38. package/dist/cjs/nativePlugin.native.js +1 -1
  39. package/dist/cjs/types.native.js.map +1 -1
  40. package/dist/cjs/utils/getBaseViteConfig.js +40 -0
  41. package/dist/cjs/utils/getBaseViteConfig.js.map +6 -0
  42. package/dist/cjs/utils/getBaseViteConfig.native.js +46 -0
  43. package/dist/cjs/utils/getBaseViteConfig.native.js.map +6 -0
  44. package/dist/cjs/utils/getOptionsFilled.js +53 -0
  45. package/dist/cjs/utils/getOptionsFilled.js.map +6 -0
  46. package/dist/cjs/utils/getOptionsFilled.native.js +307 -0
  47. package/dist/cjs/utils/getOptionsFilled.native.js.map +6 -0
  48. package/dist/cjs/utils/getVitePath.js +49 -0
  49. package/dist/cjs/utils/getVitePath.js.map +6 -0
  50. package/dist/cjs/utils/getVitePath.native.js +198 -0
  51. package/dist/cjs/utils/getVitePath.native.js.map +6 -0
  52. package/dist/esm/VXRNConfigFilled.js +30 -0
  53. package/dist/esm/VXRNConfigFilled.js.map +6 -0
  54. package/dist/esm/VXRNConfigFilled.mjs +34 -0
  55. package/dist/esm/VXRNConfigFilled.native.js +279 -0
  56. package/dist/esm/VXRNConfigFilled.native.js.map +6 -0
  57. package/dist/esm/build.js +83 -0
  58. package/dist/esm/build.js.map +6 -0
  59. package/dist/esm/build.mjs +56 -0
  60. package/dist/esm/build.native.js +217 -0
  61. package/dist/esm/build.native.js.map +6 -0
  62. package/dist/esm/commands/cli-build.js +23 -0
  63. package/dist/esm/commands/cli-build.js.map +6 -0
  64. package/dist/esm/commands/cli-build.mjs +22 -0
  65. package/dist/esm/commands/cli-build.native.js +156 -0
  66. package/dist/esm/commands/cli-build.native.js.map +6 -0
  67. package/dist/esm/commands/cli-dev.js +2 -2
  68. package/dist/esm/commands/cli-dev.js.map +1 -1
  69. package/dist/esm/commands/cli-dev.mjs +2 -2
  70. package/dist/esm/commands/cli-dev.native.js +2 -2
  71. package/dist/esm/commands/cli-dev.native.js.map +2 -2
  72. package/dist/esm/commands/index.js +3 -1
  73. package/dist/esm/commands/index.js.map +1 -1
  74. package/dist/esm/commands/index.mjs +3 -1
  75. package/dist/esm/commands/index.native.js +4 -0
  76. package/dist/esm/commands/index.native.js.map +2 -2
  77. package/dist/esm/createDevServer.js +613 -0
  78. package/dist/esm/createDevServer.js.map +6 -0
  79. package/dist/esm/createDevServer.mjs +574 -0
  80. package/dist/esm/createDevServer.native.js +1211 -0
  81. package/dist/esm/createDevServer.native.js.map +6 -0
  82. package/dist/esm/getBaseViteConfig.js +24 -0
  83. package/dist/esm/getBaseViteConfig.js.map +6 -0
  84. package/dist/esm/getBaseViteConfig.mjs +23 -0
  85. package/dist/esm/getBaseViteConfig.native.js +25 -0
  86. package/dist/esm/getBaseViteConfig.native.js.map +6 -0
  87. package/dist/esm/getOptionsFIlled.js +30 -0
  88. package/dist/esm/getOptionsFIlled.js.map +6 -0
  89. package/dist/esm/getOptionsFIlled.mjs +34 -0
  90. package/dist/esm/getOptionsFIlled.native.js +279 -0
  91. package/dist/esm/getOptionsFIlled.native.js.map +6 -0
  92. package/dist/esm/index.js +4 -2
  93. package/dist/esm/index.js.map +1 -1
  94. package/dist/esm/index.mjs +3 -2
  95. package/dist/esm/index.native.js +4 -2
  96. package/dist/esm/index.native.js.map +2 -2
  97. package/dist/esm/nativePlugin.js +1 -1
  98. package/dist/esm/nativePlugin.mjs +1 -1
  99. package/dist/esm/nativePlugin.native.js +1 -1
  100. package/dist/esm/utils/getBaseViteConfig.js +24 -0
  101. package/dist/esm/utils/getBaseViteConfig.js.map +6 -0
  102. package/dist/esm/utils/getBaseViteConfig.mjs +23 -0
  103. package/dist/esm/utils/getBaseViteConfig.native.js +25 -0
  104. package/dist/esm/utils/getBaseViteConfig.native.js.map +6 -0
  105. package/dist/esm/utils/getOptionsFilled.js +30 -0
  106. package/dist/esm/utils/getOptionsFilled.js.map +6 -0
  107. package/dist/esm/utils/getOptionsFilled.mjs +34 -0
  108. package/dist/esm/utils/getOptionsFilled.native.js +279 -0
  109. package/dist/esm/utils/getOptionsFilled.native.js.map +6 -0
  110. package/dist/esm/utils/getVitePath.js +27 -0
  111. package/dist/esm/utils/getVitePath.js.map +6 -0
  112. package/dist/esm/utils/getVitePath.mjs +20 -0
  113. package/dist/esm/utils/getVitePath.native.js +171 -0
  114. package/dist/esm/utils/getVitePath.native.js.map +6 -0
  115. package/package.json +6 -6
  116. package/src/build.ts +96 -0
  117. package/src/commands/cli-build.ts +25 -0
  118. package/src/commands/cli-dev.ts +2 -2
  119. package/src/commands/index.ts +2 -1
  120. package/src/{create.ts → createDevServer.ts} +122 -180
  121. package/src/index.ts +2 -1
  122. package/src/nativePlugin.ts +1 -1
  123. package/src/types.ts +2 -1
  124. package/src/utils/getBaseViteConfig.ts +22 -0
  125. package/src/utils/getOptionsFilled.ts +43 -0
  126. package/src/{getVitePath.ts → utils/getVitePath.ts} +17 -17
  127. package/types/VXRNConfigFilled.d.ts +21 -0
  128. package/types/build.d.ts +4 -0
  129. package/types/commands/cli-build.d.ts +3 -0
  130. package/types/commands/index.d.ts +1 -0
  131. package/types/create.d.ts +2 -1
  132. package/types/createDevServer.d.ts +13 -0
  133. package/types/getBaseViteConfig.d.ts +5 -0
  134. package/types/getOptionsFIlled.d.ts +21 -0
  135. package/types/index.d.ts +2 -1
  136. package/types/types.d.ts +2 -1
  137. package/types/utils/getBaseViteConfig.d.ts +5 -0
  138. package/types/utils/getOptionsFilled.d.ts +22 -0
  139. 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
@@ -0,0 +1,4 @@
1
+ import type { VXRNConfig } from './types';
2
+ export declare const resolveFile: (path: string) => string;
3
+ export declare const build: (optionsIn: VXRNConfig) => Promise<void>;
4
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1,3 @@
1
+ declare const _default: import("citty").CommandDef<{}>;
2
+ export default _default;
3
+ //# sourceMappingURL=cli-build.d.ts.map
@@ -1,5 +1,6 @@
1
1
  import type { CommandDef } from 'citty';
2
2
  export declare const commands: {
3
3
  dev: () => Promise<CommandDef>;
4
+ build: () => Promise<CommandDef>;
4
5
  };
5
6
  //# sourceMappingURL=index.d.ts.map
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 create: (optionsIn: VXRNConfig) => Promise<{
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,5 @@
1
+ import { type UserConfig } from 'vite';
2
+ export declare function getBaseViteConfig({ mode }: {
3
+ mode: 'development' | 'production';
4
+ }): UserConfig;
5
+ //# sourceMappingURL=getBaseViteConfig.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
@@ -1,4 +1,5 @@
1
- export { create } from './create';
1
+ export { createDevServer as create } from './createDevServer';
2
+ export { build } from './build';
2
3
  export { nativePlugin } from './nativePlugin';
3
4
  export * from './types';
4
5
  //# sourceMappingURL=index.d.ts.map
package/types/types.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import type { InlineConfig } from 'vite';
2
1
  import type { Options as FlowOptions } from '@vxrn/vite-flow';
2
+ import type { InlineConfig } from 'vite';
3
3
  export type VXRNConfig = {
4
+ entryNative?: string;
4
5
  root?: string;
5
6
  host?: string;
6
7
  port?: number;
@@ -0,0 +1,5 @@
1
+ import type { UserConfig } from 'vite';
2
+ export declare function getBaseViteConfig({ mode }: {
3
+ mode: 'development' | 'production';
4
+ }): UserConfig;
5
+ //# sourceMappingURL=getBaseViteConfig.d.ts.map
@@ -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
@@ -0,0 +1,2 @@
1
+ export declare function getVitePath(rootPath: string, importer: string, moduleName: string, absolute?: boolean): Promise<string>;
2
+ //# sourceMappingURL=getVitePath.d.ts.map