bmdl-sdk 1.5.5 → 1.5.7

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.
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bmdl-sdk",
3
- "version": "1.5.5",
3
+ "version": "1.5.7",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -15,14 +15,20 @@
15
15
  "author": "",
16
16
  "license": "ISC",
17
17
  "dependencies": {
18
+ "react": "^19.2.7",
19
+ "react-dom": "^19.2.7"
20
+ },
21
+ "devDependencies": {
22
+ "@types/node": "^26.1.1",
18
23
  "@types/react": "^19.2.17",
19
24
  "@types/react-dom": "^19.2.3",
20
25
  "@vitejs/plugin-react": "^4.0.0",
21
- "react": "^19.2.7",
22
- "react-dom": "^19.2.7",
23
26
  "vite": "^4.0.0"
24
27
  },
25
- "devDependencies": {
26
- "@types/node": "^26.1.1"
28
+ "peerDependencies": {
29
+ "@types/react": "^19.2.17",
30
+ "@types/react-dom": "^19.2.3",
31
+ "@vitejs/plugin-react": "^4.0.0",
32
+ "vite": "^4.0.0"
27
33
  }
28
34
  }
package/src/App.tsx CHANGED
@@ -19,9 +19,9 @@ const App: React.FC = () => {
19
19
  const loadWidget = async () => {
20
20
  try {
21
21
  // Динамически импортируем компонент из проекта разработчика
22
- const widgetModule = (await import('/src/app/App.tsx')) as WidgetModule
23
- const dataOptionsModule = await import('/src/dataOptions.ts')
24
- const viewOptionsModule = await import('/src/viewOptions.ts')
22
+ const widgetModule = (await import('@project/app/App.tsx')) as WidgetModule
23
+ const dataOptionsModule = await import('@project/dataOptions.ts')
24
+ const viewOptionsModule = await import('@project/viewOptions.ts')
25
25
 
26
26
  setWidgetComponent(() => widgetModule.default)
27
27
  setDataOptions(dataOptionsModule.createDataOptions())
package/src/main.tsx CHANGED
@@ -1,9 +1,15 @@
1
1
  import React from 'react'
2
- import ReactDOM from 'react-dom/client'
2
+ import { createRoot } from 'react-dom/client'
3
3
  import App from './App'
4
4
 
5
- ReactDOM.createRoot(document.getElementById('root')!).render(
6
- <React.StrictMode>
7
- <App />
8
- </React.StrictMode>
9
- )
5
+ console.log('🚀 BMDL SDK Starting...')
6
+
7
+ const container = document.getElementById('root')
8
+ if (container) {
9
+ const root = createRoot(container)
10
+ root.render(
11
+ <React.StrictMode>
12
+ <App />
13
+ </React.StrictMode>,
14
+ )
15
+ }
package/vite.config.ts CHANGED
@@ -1,8 +1,7 @@
1
+ import { defineConfig } from 'vite'
1
2
  import react from '@vitejs/plugin-react'
2
3
  import { resolve } from 'path'
3
- import { defineConfig } from 'vite'
4
4
 
5
- // Получаем корень проекта разработчика
6
5
  const projectRoot = process.env.PROJECT_ROOT || process.cwd()
7
6
  const sdkRoot = process.cwd()
8
7
 
@@ -13,20 +12,19 @@ export default defineConfig({
13
12
  plugins: [react()],
14
13
  server: {
15
14
  port: 3000,
16
- open: true,
17
- watch: {
18
- // Следим за изменениями в проекте разработчика
19
- ignored: ['!**/node_modules/**'],
20
- },
15
+ open: true
21
16
  },
22
17
  resolve: {
23
18
  alias: {
24
- // Перенаправляем импорты из /src в проект разработчика
25
- '/src': resolve(projectRoot, 'src'),
26
- },
19
+ '@project': resolve(projectRoot, 'src')
20
+ }
27
21
  },
28
22
  optimizeDeps: {
29
- include: ['react', 'react-dom'],
23
+ include: ['react', 'react-dom', 'react-dom/client']
30
24
  },
31
- publicDir: resolve(sdkRoot, 'public'),
32
- })
25
+ build: {
26
+ commonjsOptions: {
27
+ include: [/react-dom/, /react/]
28
+ }
29
+ }
30
+ })