@vixt/react 0.5.17 → 0.6.0

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.
@@ -0,0 +1,7 @@
1
+ import * as react0 from "react";
2
+ import * as react_router0 from "react-router";
3
+
4
+ //#region src/client/App.d.ts
5
+ declare function App(): react0.FunctionComponentElement<react_router0.RouterProviderProps>;
6
+ //#endregion
7
+ export { App as default };
@@ -0,0 +1,14 @@
1
+ import routes from "~react-pages";
2
+ import { createElement } from "react";
3
+ import { RouterProvider, createBrowserRouter } from "react-router";
4
+ import appConfig from "virtual:vixt:app-config";
5
+ import { setupLayouts } from "virtual:vixt:setup-layouts";
6
+
7
+ //#region src/client/App.ts
8
+ function App() {
9
+ return createElement(RouterProvider, { router: createBrowserRouter(setupLayouts(routes), { basename: appConfig.baseURL }) });
10
+ }
11
+ var App_default = App;
12
+
13
+ //#endregion
14
+ export { App_default as default };
@@ -0,0 +1,8 @@
1
+ import "virtual:vixt:css";
2
+ import "virtual:uno.css";
3
+ import * as react_dom_client0 from "react-dom/client";
4
+
5
+ //#region src/client/entry.d.ts
6
+ declare function entry(): Promise<react_dom_client0.Root>;
7
+ //#endregion
8
+ export { entry as default };
@@ -0,0 +1,29 @@
1
+ import { createElement } from "react";
2
+ import appConfig from "virtual:vixt:app-config";
3
+ import "virtual:vixt:css";
4
+ import "virtual:uno.css";
5
+ import { applyPlugins, createVixtApp } from "@vixt/core/client";
6
+ import { createRoot } from "react-dom/client";
7
+ import plugins from "virtual:vixt:plugins";
8
+ import RootComponent from "virtual:vixt:root-component";
9
+
10
+ //#region src/client/entry.ts
11
+ async function entry() {
12
+ const app = createRoot(document.getElementById(appConfig.rootId || "app"));
13
+ const vixt = createVixtApp({
14
+ app,
15
+ appConfig
16
+ });
17
+ try {
18
+ await applyPlugins(vixt, plugins);
19
+ } catch (err) {
20
+ console.error(err);
21
+ }
22
+ app.render(createElement(RootComponent));
23
+ return app;
24
+ }
25
+ entry();
26
+ var entry_default = entry;
27
+
28
+ //#endregion
29
+ export { entry_default as default };
package/dist/index.d.mts CHANGED
@@ -1,47 +1,7 @@
1
- import * as vite from 'vite';
2
- import * as _vixt_core from '@vixt/core';
3
- import { AppOptions, Vixt, PluginOptions, VixtOptions } from '@vixt/core';
4
- import { Root } from 'react-dom/client';
5
- import { RouteObject } from 'react-router';
6
- import React from '@vitejs/plugin-react';
7
- import UnoCSS from 'unocss/vite';
8
- import AutoImport from 'unplugin-auto-import/vite';
9
- import Pages from 'vite-plugin-pages';
10
- import Layouts from 'vite-plugin-vue-layouts';
1
+ import * as _vixt_core0 from "@vixt/core";
2
+ import * as vite0 from "vite";
11
3
 
12
- declare module '@vixt/core/client' {
13
- interface VixtAppConfig { }
14
-
15
- interface VixtApp {
16
- app: Root
17
- routes: RouteObject[]
18
- appConfig: VixtAppConfig
19
- }
20
- }
21
-
22
- declare const app: _vixt_core.VixtModule<AppOptions>;
23
-
24
- declare function getAppComponentPath(vixt: Vixt): string | undefined;
25
- declare function generateSetupLayouts(vixt: Vixt): void;
26
- declare function genarateAppComponent(vixt: Vixt): string;
27
-
28
- declare function generateMainFile(options: AppOptions, vixt: Vixt): string;
29
-
30
- declare module '@vixt/core' {
31
- interface VixtOptions {
32
- react?: PluginOptions<typeof React>;
33
- /** https://github.com/hannoeru/vite-plugin-pages */
34
- pages?: PluginOptions<typeof Pages>;
35
- /** https://github.com/JohnCampionJr/vite-plugin-vue-layouts */
36
- layouts?: PluginOptions<typeof Layouts>;
37
- /** https://github.com/unplugin/unplugin-auto-import */
38
- imports?: PluginOptions<typeof AutoImport>;
39
- /** https://github.com/unocss/unocss */
40
- unocss?: PluginOptions<typeof UnoCSS>;
41
- }
42
- }
43
- declare const presetReact: _vixt_core.VixtModule<VixtOptions>;
44
-
45
- declare const _default: (options?: VixtOptions | undefined) => vite.PluginOption;
46
-
47
- export { app, _default as default, genarateAppComponent, generateMainFile, generateSetupLayouts, getAppComponentPath, presetReact };
4
+ //#region src/index.d.ts
5
+ declare const _default: (options?: _vixt_core0.VixtOptions | undefined) => vite0.PluginOption;
6
+ //#endregion
7
+ export { _default as default };