@nsxbet/admin-sdk 0.4.0 → 0.5.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/CHECKLIST.md CHANGED
@@ -67,7 +67,7 @@ Expected structure:
67
67
 
68
68
  ### Dev Dependencies
69
69
 
70
- - [ ] `@vitejs/plugin-react` `^4.2.1`
70
+ - [ ] React plugin — either `@vitejs/plugin-react` `^4.2.1` OR `@vitejs/plugin-react-swc` `^3.0.0` (Lovable default)
71
71
  - [ ] `vite` — `^5.0.8`
72
72
  - [ ] `typescript` — `^5.2.2`
73
73
  - [ ] `tailwindcss` — `^3.4.0`
@@ -77,10 +77,10 @@ Expected structure:
77
77
 
78
78
  ## Vite Configuration
79
79
 
80
- - [ ] Imports `defineModuleConfig` from `@nsxbet/admin-sdk/vite`
81
- - [ ] Imports and uses `react()` from `@vitejs/plugin-react`
80
+ - [ ] Uses `defineModuleConfig` from `@nsxbet/admin-sdk/vite` OR spreads `adminModule()` into an existing Vite config
81
+ - [ ] Imports and uses a React plugin (`@vitejs/plugin-react` or `@vitejs/plugin-react-swc`)
82
82
 
83
- Expected:
83
+ Expected (option A — full config):
84
84
 
85
85
  ```typescript
86
86
  import { defineModuleConfig } from "@nsxbet/admin-sdk/vite";
@@ -92,6 +92,18 @@ export default defineModuleConfig({
92
92
  });
93
93
  ```
94
94
 
95
+ Expected (option B — composable plugin for Lovable / existing config):
96
+
97
+ ```typescript
98
+ import { defineConfig } from "vite";
99
+ import react from "@vitejs/plugin-react-swc";
100
+ import { adminModule } from "@nsxbet/admin-sdk/vite";
101
+
102
+ export default defineConfig({
103
+ plugins: [react(), ...adminModule()],
104
+ });
105
+ ```
106
+
95
107
  ## Tailwind Configuration
96
108
 
97
109
  - [ ] Imports `withAdminSdk` from `@nsxbet/admin-sdk/tailwind`
@@ -201,6 +213,83 @@ function MyComponent() {
201
213
  }
202
214
  ```
203
215
 
216
+ ## Lovable Projects (additional guidance)
217
+
218
+ If your module was scaffolded by Lovable, the following differences apply:
219
+
220
+ - [ ] `vite.config.ts` uses `adminModule()` spread into the existing plugins array (option B above), NOT `defineModuleConfig`
221
+ - [ ] React plugin is `@vitejs/plugin-react-swc` (Lovable default) — this is supported
222
+ - [ ] `index.html` entry point references `/src/main.tsx` (Lovable default) — this serves as the standalone dev entry
223
+ - [ ] `src/main.tsx` wraps your App with `AdminShell` (same role as `src/standalone.tsx` in non-Lovable modules)
224
+ - [ ] `src/spa.tsx` still required — `export default App` for shell mode
225
+ - [ ] `admin.module.json` still required at project root
226
+ - [ ] `module.manifest.json` is auto-generated at build time by `adminModule()` — do NOT manually copy `admin.module.json` to `dist/`
227
+ - [ ] Lovable's existing `server`, `resolve.alias`, and plugin settings are preserved — `adminModule()` only affects `vite build`
228
+ - [ ] Build script can be `"vite build"` (Lovable default) or `"tsc && vite build"` — both work
229
+
230
+ Expected `vite.config.ts` for Lovable:
231
+
232
+ ```typescript
233
+ import { defineConfig } from "vite";
234
+ import react from "@vitejs/plugin-react-swc";
235
+ import path from "path";
236
+ import { componentTagger } from "lovable-tagger";
237
+ import { adminModule } from "@nsxbet/admin-sdk/vite";
238
+
239
+ export default defineConfig(({ mode }) => ({
240
+ server: {
241
+ host: "::",
242
+ port: 8080,
243
+ hmr: { overlay: false },
244
+ },
245
+ plugins: [
246
+ react(),
247
+ mode === "development" && componentTagger(),
248
+ ...adminModule(),
249
+ ].filter(Boolean),
250
+ resolve: {
251
+ alias: {
252
+ "@": path.resolve(__dirname, "./src"),
253
+ },
254
+ },
255
+ }));
256
+ ```
257
+
258
+ Expected `src/main.tsx` for Lovable (standalone dev entry):
259
+
260
+ ```tsx
261
+ import React from "react";
262
+ import ReactDOM from "react-dom/client";
263
+ import {
264
+ AdminShell,
265
+ createInMemoryAuthClient,
266
+ createMockUsersFromRoles,
267
+ } from "@nsxbet/admin-sdk";
268
+ import type { AdminModuleManifest } from "@nsxbet/admin-sdk";
269
+ import { App } from "./App";
270
+ import manifest from "../admin.module.json";
271
+ import "./index.css";
272
+
273
+ const moduleManifest = manifest as AdminModuleManifest;
274
+
275
+ const mockUsers = createMockUsersFromRoles({
276
+ admin: ["admin.mymodule.view", "admin.mymodule.edit", "admin.mymodule.delete"],
277
+ editor: ["admin.mymodule.view", "admin.mymodule.edit"],
278
+ viewer: ["admin.mymodule.view"],
279
+ noAccess: [],
280
+ });
281
+
282
+ const authClient = createInMemoryAuthClient({ users: mockUsers });
283
+
284
+ ReactDOM.createRoot(document.getElementById("root")!).render(
285
+ <React.StrictMode>
286
+ <AdminShell modules={[moduleManifest]} authClient={authClient}>
287
+ <App />
288
+ </AdminShell>
289
+ </React.StrictMode>
290
+ );
291
+ ```
292
+
204
293
  ## Anti-Patterns (MUST NOT be present)
205
294
 
206
295
  - [ ] No `@supabase/supabase-js` or `supabase` imports in `src/**`
package/README.md CHANGED
@@ -539,7 +539,16 @@ Use [Lucide](https://lucide.dev/icons) icon names in **kebab-case**:
539
539
 
540
540
  ## Vite Configuration
541
541
 
542
- The SDK provides `defineModuleConfig` to simplify Vite setup:
542
+ The SDK provides two ways to configure Vite for admin modules:
543
+
544
+ 1. **`defineModuleConfig()`** — returns a complete Vite config. Best for new modules with no existing Vite setup.
545
+ 2. **`adminModule()`** — returns a `Plugin[]` you spread into an existing config. Best for Lovable projects or any existing Vite config.
546
+
547
+ Both produce identical build artifacts. Both support `@vitejs/plugin-react` and `@vitejs/plugin-react-swc`.
548
+
549
+ > **Note:** `module.manifest.json` is generated automatically at build time by both `defineModuleConfig` and `adminModule`. No manual `cp admin.module.json dist/` step is needed.
550
+
551
+ ### `defineModuleConfig()` — Full Config
543
552
 
544
553
  ```typescript
545
554
  import { defineModuleConfig } from "@nsxbet/admin-sdk/vite";
@@ -547,7 +556,7 @@ import react from "@vitejs/plugin-react";
547
556
 
548
557
  export default defineModuleConfig({
549
558
  port: 3003,
550
- plugins: [react()], // REQUIRED: you must add the React plugin
559
+ plugins: [react()], // REQUIRED: you must add a React plugin
551
560
  });
552
561
  ```
553
562
 
@@ -556,7 +565,7 @@ export default defineModuleConfig({
556
565
  > - API: 4000
557
566
  > - Modules: 3002, 3003, 3004, etc.
558
567
 
559
- ### Options
568
+ #### `defineModuleConfig` Options
560
569
 
561
570
  | Option | Type | Default | Description |
562
571
  |--------|------|---------|-------------|
@@ -567,6 +576,46 @@ export default defineModuleConfig({
567
576
  | `additionalExternals` | string[] | `[]` | Extra externals |
568
577
  | `overrides` | object | `{}` | Override any Vite config |
569
578
 
579
+ ### `adminModule()` — Composable Plugin (Lovable / Custom Vite Config)
580
+
581
+ Use `adminModule()` when you already have a `vite.config.ts` and want to add admin module support without replacing it. This is the recommended approach for **Lovable projects**.
582
+
583
+ `adminModule()` only affects `vite build` — during `vite dev`, your app runs as a normal SPA with HMR working as expected.
584
+
585
+ ```typescript
586
+ import { defineConfig } from "vite";
587
+ import react from "@vitejs/plugin-react-swc";
588
+ import path from "path";
589
+ import { componentTagger } from "lovable-tagger";
590
+ import { adminModule } from "@nsxbet/admin-sdk/vite";
591
+
592
+ export default defineConfig(({ mode }) => ({
593
+ server: {
594
+ host: "::",
595
+ port: 8080,
596
+ hmr: { overlay: false },
597
+ },
598
+ plugins: [
599
+ react(),
600
+ mode === "development" && componentTagger(),
601
+ ...adminModule(),
602
+ ].filter(Boolean),
603
+ resolve: {
604
+ alias: {
605
+ "@": path.resolve(__dirname, "./src"),
606
+ },
607
+ },
608
+ }));
609
+ ```
610
+
611
+ #### `adminModule` Options
612
+
613
+ | Option | Type | Default | Description |
614
+ |--------|------|---------|-------------|
615
+ | `entry` | string | `"./src/spa.tsx"` | Entry file path |
616
+ | `outDir` | string | `"dist"` | Output directory |
617
+ | `additionalExternals` | string[] | `[]` | Extra externals |
618
+
570
619
  ### Shared Externals
571
620
 
572
621
  These dependencies are provided by the shell (do not bundle them):
@@ -575,6 +624,65 @@ These dependencies are provided by the shell (do not bundle them):
575
624
  ["react", "react-dom", "react-router-dom", "i18next", "react-i18next"]
576
625
  ```
577
626
 
627
+ ### Getting Started in Lovable
628
+
629
+ Lovable projects come with a default `vite.config.ts`, `index.html`, and `src/main.tsx` entry point. To turn a Lovable project into an admin module:
630
+
631
+ 1. **Install the SDK:**
632
+
633
+ ```bash
634
+ npm install @nsxbet/admin-sdk @nsxbet/admin-ui
635
+ ```
636
+
637
+ 2. **Add `adminModule()` to your existing `vite.config.ts`:**
638
+
639
+ ```typescript
640
+ import { adminModule } from "@nsxbet/admin-sdk/vite";
641
+
642
+ // Inside your plugins array:
643
+ plugins: [
644
+ react(),
645
+ mode === "development" && componentTagger(),
646
+ ...adminModule(),
647
+ ].filter(Boolean),
648
+ ```
649
+
650
+ 3. **Create `admin.module.json`** at the project root with your module metadata.
651
+
652
+ 4. **Create `src/spa.tsx`** — the shell entry point:
653
+
654
+ ```tsx
655
+ import { App } from "./App";
656
+ export default App;
657
+ ```
658
+
659
+ 5. **Update `src/main.tsx`** — wrap your app with `AdminShell` for standalone dev:
660
+
661
+ ```tsx
662
+ import { AdminShell, createInMemoryAuthClient, createMockUsersFromRoles } from "@nsxbet/admin-sdk";
663
+ import manifest from "../admin.module.json";
664
+ import { App } from "./App";
665
+
666
+ const mockUsers = createMockUsersFromRoles({
667
+ admin: ["admin.mymodule.view", "admin.mymodule.edit"],
668
+ editor: ["admin.mymodule.view", "admin.mymodule.edit"],
669
+ viewer: ["admin.mymodule.view"],
670
+ noAccess: [],
671
+ });
672
+
673
+ const authClient = createInMemoryAuthClient({ users: mockUsers });
674
+
675
+ ReactDOM.createRoot(document.getElementById("root")!).render(
676
+ <AdminShell modules={[manifest]} authClient={authClient}>
677
+ <App />
678
+ </AdminShell>
679
+ );
680
+ ```
681
+
682
+ 6. **Build:** `npm run build` produces `dist/assets/spa-[hash].js` + `dist/module.manifest.json`
683
+
684
+ Your Lovable preview (`vite dev`) continues to work as before — `adminModule()` only changes the `vite build` output.
685
+
578
686
  ## ESLint Plugin
579
687
 
580
688
  Install `@nsxbet/eslint-plugin-admin` (requires ESLint 9+) to catch common mistakes at development time:
@@ -1,14 +1,10 @@
1
+ import type { Plugin } from "vite";
1
2
  /**
2
3
  * Shared dependencies that are externalized in module builds.
3
4
  * These are provided by the shell via import maps.
4
5
  */
5
6
  export declare const SHARED_EXTERNALS: readonly ["react", "react-dom", "react-router-dom", "i18next", "react-i18next"];
6
- export interface ModuleConfigOptions {
7
- /**
8
- * Development server port
9
- * @default 8080
10
- */
11
- port?: number;
7
+ export interface AdminModuleOptions {
12
8
  /**
13
9
  * Entry file for the module SPA
14
10
  * @default "./src/spa.tsx"
@@ -23,6 +19,21 @@ export interface ModuleConfigOptions {
23
19
  * Additional externals to add to SHARED_EXTERNALS
24
20
  */
25
21
  additionalExternals?: string[];
22
+ /**
23
+ * Controls when lib mode build config is applied.
24
+ * - "auto" (default): Only apply when ADMIN_MODULE=true env var is set.
25
+ * Use this in Lovable projects so `vite build` produces a normal HTML SPA
26
+ * and `vite build` with ADMIN_MODULE=true produces the module library entry.
27
+ * - "always": Always apply during `vite build`. Used by defineModuleConfig().
28
+ */
29
+ buildMode?: "auto" | "always";
30
+ }
31
+ export interface ModuleConfigOptions extends AdminModuleOptions {
32
+ /**
33
+ * Development server port
34
+ * @default 8080
35
+ */
36
+ port?: number;
26
37
  /**
27
38
  * Additional Vite plugins (will be spread into plugins array)
28
39
  */
@@ -32,17 +43,47 @@ export interface ModuleConfigOptions {
32
43
  */
33
44
  overrides?: Record<string, any>;
34
45
  }
46
+ /**
47
+ * Composable Vite plugin array for admin modules.
48
+ * Returns plugins that handle build-time lib config, dist serving, and manifest generation.
49
+ *
50
+ * Use this when you already have a Vite config (e.g. Lovable) and want to add
51
+ * admin module support without replacing your entire config.
52
+ *
53
+ * The build config plugin only applies during `vite build` — dev server works as a normal SPA.
54
+ *
55
+ * @example In a Lovable project
56
+ * ```ts
57
+ * import { defineConfig } from "vite";
58
+ * import react from "@vitejs/plugin-react-swc";
59
+ * import { adminModule } from "@nsxbet/admin-sdk/vite";
60
+ *
61
+ * export default defineConfig(({ mode }) => ({
62
+ * plugins: [
63
+ * react(),
64
+ * mode === "development" && componentTagger(),
65
+ * ...adminModule(),
66
+ * ].filter(Boolean),
67
+ * }));
68
+ * ```
69
+ *
70
+ * @example With custom entry and externals
71
+ * ```ts
72
+ * ...adminModule({
73
+ * entry: "./src/custom-spa.tsx",
74
+ * additionalExternals: ["lodash"],
75
+ * })
76
+ * ```
77
+ */
78
+ export declare function adminModule(options?: AdminModuleOptions): Plugin[];
35
79
  /**
36
80
  * Creates a pre-configured Vite config for admin modules.
37
81
  *
38
82
  * **Note:** This function does NOT include the React plugin automatically.
39
83
  * You must import and add it yourself to avoid version conflicts.
40
84
  *
41
- * Includes:
42
- * - serveDistPlugin (serves dist files during dev)
43
- * - generateModuleManifestPlugin (generates module.manifest.json)
44
- * - ES module build format
45
- * - Externalized shared dependencies
85
+ * For Lovable or other existing Vite configs, use the composable `adminModule()` plugin
86
+ * instead it can be spread into any existing plugins array.
46
87
  *
47
88
  * @example
48
89
  * ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/vite/config.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,gBAAgB,iFAMnB,CAAC;AAEX,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE/B;;OAEG;IAEH,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAEhB;;OAEG;IAEH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,GAAG,CA8CpE"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/vite/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAGnC;;;GAGG;AACH,eAAO,MAAM,gBAAgB,iFAMnB,CAAC;AAEX,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE/B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC/B;AAED,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC7D;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IAEH,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAEhB;;OAEG;IAEH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,MAAM,EAAE,CA8CtE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,GAAG,CAiBpE"}
@@ -10,17 +10,85 @@ export const SHARED_EXTERNALS = [
10
10
  "i18next",
11
11
  "react-i18next",
12
12
  ];
13
+ /**
14
+ * Composable Vite plugin array for admin modules.
15
+ * Returns plugins that handle build-time lib config, dist serving, and manifest generation.
16
+ *
17
+ * Use this when you already have a Vite config (e.g. Lovable) and want to add
18
+ * admin module support without replacing your entire config.
19
+ *
20
+ * The build config plugin only applies during `vite build` — dev server works as a normal SPA.
21
+ *
22
+ * @example In a Lovable project
23
+ * ```ts
24
+ * import { defineConfig } from "vite";
25
+ * import react from "@vitejs/plugin-react-swc";
26
+ * import { adminModule } from "@nsxbet/admin-sdk/vite";
27
+ *
28
+ * export default defineConfig(({ mode }) => ({
29
+ * plugins: [
30
+ * react(),
31
+ * mode === "development" && componentTagger(),
32
+ * ...adminModule(),
33
+ * ].filter(Boolean),
34
+ * }));
35
+ * ```
36
+ *
37
+ * @example With custom entry and externals
38
+ * ```ts
39
+ * ...adminModule({
40
+ * entry: "./src/custom-spa.tsx",
41
+ * additionalExternals: ["lodash"],
42
+ * })
43
+ * ```
44
+ */
45
+ export function adminModule(options = {}) {
46
+ const { entry = "./src/spa.tsx", outDir = "dist", additionalExternals = [], buildMode = "auto", } = options;
47
+ const externals = [...SHARED_EXTERNALS, ...additionalExternals];
48
+ function isModuleBuild() {
49
+ if (buildMode === "always")
50
+ return true;
51
+ return process.env.ADMIN_MODULE === "true";
52
+ }
53
+ const buildConfigPlugin = {
54
+ name: "admin-module-build-config",
55
+ config(_config, { command }) {
56
+ if (command !== "build" || !isModuleBuild())
57
+ return;
58
+ return {
59
+ build: {
60
+ outDir,
61
+ emptyOutDir: true,
62
+ lib: {
63
+ entry,
64
+ formats: ["es"],
65
+ fileName: () => `assets/spa-[hash].js`,
66
+ },
67
+ rollupOptions: {
68
+ external: externals,
69
+ output: {
70
+ entryFileNames: "assets/[name]-[hash].js",
71
+ chunkFileNames: "assets/[name]-[hash].js",
72
+ },
73
+ },
74
+ },
75
+ };
76
+ },
77
+ };
78
+ return [
79
+ serveDistPlugin({ distDir: outDir }),
80
+ generateModuleManifestPlugin(),
81
+ buildConfigPlugin,
82
+ ];
83
+ }
13
84
  /**
14
85
  * Creates a pre-configured Vite config for admin modules.
15
86
  *
16
87
  * **Note:** This function does NOT include the React plugin automatically.
17
88
  * You must import and add it yourself to avoid version conflicts.
18
89
  *
19
- * Includes:
20
- * - serveDistPlugin (serves dist files during dev)
21
- * - generateModuleManifestPlugin (generates module.manifest.json)
22
- * - ES module build format
23
- * - Externalized shared dependencies
90
+ * For Lovable or other existing Vite configs, use the composable `adminModule()` plugin
91
+ * instead it can be spread into any existing plugins array.
24
92
  *
25
93
  * @example
26
94
  * ```ts
@@ -48,34 +116,13 @@ export const SHARED_EXTERNALS = [
48
116
  */
49
117
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
50
118
  export function defineModuleConfig(options) {
51
- const { port = 8080, entry = "./src/spa.tsx", outDir = "dist", additionalExternals = [], plugins = [], overrides = {}, } = options;
52
- const externals = [...SHARED_EXTERNALS, ...additionalExternals];
119
+ const { port = 8080, plugins = [], overrides = {} } = options;
53
120
  return {
54
- plugins: [
55
- serveDistPlugin({ distDir: outDir }),
56
- generateModuleManifestPlugin(),
57
- ...plugins,
58
- ],
121
+ plugins: [...adminModule({ ...options, buildMode: "always" }), ...plugins],
59
122
  define: {
60
123
  "process.env": {},
61
124
  "process.env.NODE_ENV": JSON.stringify("production"),
62
125
  },
63
- build: {
64
- outDir,
65
- emptyOutDir: true,
66
- lib: {
67
- entry,
68
- formats: ["es"],
69
- fileName: () => `assets/spa-[hash].js`,
70
- },
71
- rollupOptions: {
72
- external: externals,
73
- output: {
74
- entryFileNames: "assets/[name]-[hash].js",
75
- chunkFileNames: "assets/[name]-[hash].js",
76
- },
77
- },
78
- },
79
126
  server: {
80
127
  port,
81
128
  },
@@ -14,5 +14,5 @@
14
14
  * @packageDocumentation
15
15
  */
16
16
  export { generateModuleManifestPlugin, serveDistPlugin, type GenerateModuleManifestPluginOptions, type ServeDistPluginOptions, } from "./plugins.js";
17
- export { defineModuleConfig, SHARED_EXTERNALS, type ModuleConfigOptions, } from "./config.js";
17
+ export { adminModule, defineModuleConfig, SHARED_EXTERNALS, type AdminModuleOptions, type ModuleConfigOptions, } from "./config.js";
18
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,4BAA4B,EAC5B,eAAe,EACf,KAAK,mCAAmC,EACxC,KAAK,sBAAsB,GAC5B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,mBAAmB,GACzB,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,4BAA4B,EAC5B,eAAe,EACf,KAAK,mCAAmC,EACxC,KAAK,sBAAsB,GAC5B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,aAAa,CAAC"}
@@ -14,4 +14,4 @@
14
14
  * @packageDocumentation
15
15
  */
16
16
  export { generateModuleManifestPlugin, serveDistPlugin, } from "./plugins.js";
17
- export { defineModuleConfig, SHARED_EXTERNALS, } from "./config.js";
17
+ export { adminModule, defineModuleConfig, SHARED_EXTERNALS, } from "./config.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nsxbet/admin-sdk",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "description": "SDK for building NSX Admin modules with integrated shell",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -39,6 +39,7 @@
39
39
  "peerDependencies": {
40
40
  "@nsxbet/admin-ui": "^0.2.0",
41
41
  "@vitejs/plugin-react": "^4.0.0",
42
+ "@vitejs/plugin-react-swc": "^3.0.0",
42
43
  "i18next": "^23.0.0 || ^24.0.0 || ^25.0.0",
43
44
  "react": "^18.2.0",
44
45
  "react-dom": "^18.2.0",
@@ -50,6 +51,9 @@
50
51
  "@vitejs/plugin-react": {
51
52
  "optional": true
52
53
  },
54
+ "@vitejs/plugin-react-swc": {
55
+ "optional": true
56
+ },
53
57
  "vite": {
54
58
  "optional": true
55
59
  }