@vixt/react 0.5.17 → 0.6.1
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/client/App.d.ts +7 -0
- package/dist/client/App.js +14 -0
- package/dist/client/entry.d.ts +8 -0
- package/dist/client/entry.js +29 -0
- package/dist/index.d.mts +6 -46
- package/dist/index.mjs +8864 -244
- package/dist/types/client.d.ts +12 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/node.d.ts +20 -0
- package/package.json +13 -20
- package/src/client/App.ts +15 -0
- package/src/client/entry.ts +31 -0
- package/src/index.ts +31 -0
- package/src/modules/components.ts +33 -0
- package/src/modules/preset-react.ts +53 -0
- package/src/modules/route-block.ts +52 -0
- package/src/modules/virtual-root-component.ts +40 -0
- package/src/modules/virtual-setup-layouts.ts +42 -0
- package/src/types/client.d.ts +12 -0
- package/src/types/index.d.ts +2 -0
- package/src/types/node.d.ts +20 -0
- package/tsdown.config.ts +15 -0
- package/dist/index.d.ts +0 -47
|
@@ -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,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
|
|
2
|
-
import * as
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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 };
|