bmdl-sdk 2.0.10 → 2.0.12

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 (75) hide show
  1. package/bin/dev.js +1 -1
  2. package/bin/init.js +103 -0
  3. package/dist/BUILD_ID +1 -1
  4. package/dist/build-manifest.json +3 -3
  5. package/dist/cache/.tsbuildinfo +1 -1
  6. package/dist/fallback-build-manifest.json +3 -3
  7. package/dist/server/app/_global-error.html +1 -1
  8. package/dist/server/app/_global-error.rsc +1 -1
  9. package/dist/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  10. package/dist/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/dist/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/dist/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/dist/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/dist/server/app/_not-found.html +1 -1
  15. package/dist/server/app/_not-found.rsc +1 -1
  16. package/dist/server/app/_not-found.segments/_full.segment.rsc +1 -1
  17. package/dist/server/app/_not-found.segments/_head.segment.rsc +1 -1
  18. package/dist/server/app/_not-found.segments/_index.segment.rsc +1 -1
  19. package/dist/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  20. package/dist/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  21. package/dist/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  22. package/dist/server/app/index.html +1 -1
  23. package/dist/server/app/index.rsc +1 -1
  24. package/dist/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  25. package/dist/server/app/index.segments/_full.segment.rsc +1 -1
  26. package/dist/server/app/index.segments/_head.segment.rsc +1 -1
  27. package/dist/server/app/index.segments/_index.segment.rsc +1 -1
  28. package/dist/server/app/index.segments/_tree.segment.rsc +1 -1
  29. package/dist/server/middleware-build-manifest.js +3 -3
  30. package/dist/server/pages/404.html +1 -1
  31. package/dist/server/pages/500.html +1 -1
  32. package/dist/standalone/dist/BUILD_ID +1 -1
  33. package/dist/standalone/dist/build-manifest.json +3 -3
  34. package/dist/standalone/dist/server/app/_global-error.html +1 -1
  35. package/dist/standalone/dist/server/app/_global-error.rsc +1 -1
  36. package/dist/standalone/dist/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  37. package/dist/standalone/dist/server/app/_global-error.segments/_full.segment.rsc +1 -1
  38. package/dist/standalone/dist/server/app/_global-error.segments/_head.segment.rsc +1 -1
  39. package/dist/standalone/dist/server/app/_global-error.segments/_index.segment.rsc +1 -1
  40. package/dist/standalone/dist/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  41. package/dist/standalone/dist/server/app/_not-found.html +1 -1
  42. package/dist/standalone/dist/server/app/_not-found.rsc +1 -1
  43. package/dist/standalone/dist/server/app/_not-found.segments/_full.segment.rsc +1 -1
  44. package/dist/standalone/dist/server/app/_not-found.segments/_head.segment.rsc +1 -1
  45. package/dist/standalone/dist/server/app/_not-found.segments/_index.segment.rsc +1 -1
  46. package/dist/standalone/dist/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  47. package/dist/standalone/dist/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  48. package/dist/standalone/dist/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  49. package/dist/standalone/dist/server/app/index.html +1 -1
  50. package/dist/standalone/dist/server/app/index.rsc +1 -1
  51. package/dist/standalone/dist/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  52. package/dist/standalone/dist/server/app/index.segments/_full.segment.rsc +1 -1
  53. package/dist/standalone/dist/server/app/index.segments/_head.segment.rsc +1 -1
  54. package/dist/standalone/dist/server/app/index.segments/_index.segment.rsc +1 -1
  55. package/dist/standalone/dist/server/app/index.segments/_tree.segment.rsc +1 -1
  56. package/dist/standalone/dist/server/middleware-build-manifest.js +3 -3
  57. package/dist/standalone/dist/server/pages/404.html +1 -1
  58. package/dist/standalone/dist/server/pages/500.html +1 -1
  59. package/dist/standalone/package.json +4 -2
  60. package/dist/trace +1 -1
  61. package/dist/trace-build +1 -1
  62. package/index.d.ts +88 -0
  63. package/package.json +4 -2
  64. package/templates/App.tsx +11 -0
  65. package/templates/config.ts +13 -0
  66. package/templates/dataOptions.ts +5 -0
  67. package/templates/icon.svg +115 -0
  68. package/templates/tsconfig.json +7 -0
  69. package/templates/viewOptions.ts +5 -0
  70. /package/dist/standalone/dist/static/{GGX8H-C9Y0dHuyji9T6A1 → A20LhbsVmIwzARb_Nlgd1}/_buildManifest.js +0 -0
  71. /package/dist/standalone/dist/static/{GGX8H-C9Y0dHuyji9T6A1 → A20LhbsVmIwzARb_Nlgd1}/_clientMiddlewareManifest.js +0 -0
  72. /package/dist/standalone/dist/static/{GGX8H-C9Y0dHuyji9T6A1 → A20LhbsVmIwzARb_Nlgd1}/_ssgManifest.js +0 -0
  73. /package/dist/static/{GGX8H-C9Y0dHuyji9T6A1 → A20LhbsVmIwzARb_Nlgd1}/_buildManifest.js +0 -0
  74. /package/dist/static/{GGX8H-C9Y0dHuyji9T6A1 → A20LhbsVmIwzARb_Nlgd1}/_clientMiddlewareManifest.js +0 -0
  75. /package/dist/static/{GGX8H-C9Y0dHuyji9T6A1 → A20LhbsVmIwzARb_Nlgd1}/_ssgManifest.js +0 -0
package/bin/dev.js CHANGED
@@ -2,7 +2,7 @@
2
2
  const { spawn } = require('child_process')
3
3
  const path = require('path')
4
4
 
5
- const serverPath = path.join(__dirname, '..', 'dist/standalone/server.js')
5
+ const serverPath = path.join(__dirname, '../dist/standalone/server.js')
6
6
 
7
7
  // Запускаем сервер
8
8
  const server = spawn('node', [serverPath], {
package/bin/init.js ADDED
@@ -0,0 +1,103 @@
1
+ #!/usr/bin/env node
2
+
3
+ import {
4
+ copyFileSync,
5
+ existsSync,
6
+ mkdirSync,
7
+ readFileSync,
8
+ writeFileSync,
9
+ } from 'fs'
10
+ import { basename, dirname, resolve } from 'path'
11
+ import { fileURLToPath } from 'url'
12
+
13
+ const __dirname = dirname(fileURLToPath(import.meta.url))
14
+ const projectRoot = process.cwd()
15
+ const projectName = basename(projectRoot)
16
+ const templatesDir = resolve(__dirname, '../templates')
17
+ const packageJsonPath = resolve(projectRoot, 'package.json')
18
+
19
+ console.log('📦 Initializing new component project...')
20
+
21
+ if (!existsSync(packageJsonPath)) {
22
+ console.error('❌ No package.json found. Run "npm init -y" first.')
23
+ process.exit(1)
24
+ }
25
+
26
+ const srcDir = resolve(projectRoot, 'src')
27
+ const appDir = resolve(srcDir, 'app')
28
+ const publicDir = resolve(projectRoot, 'public')
29
+ const folders = [srcDir, appDir, publicDir]
30
+
31
+ folders.forEach(dir => {
32
+ if (!existsSync(dir)) {
33
+ mkdirSync(dir, { recursive: true })
34
+ }
35
+ })
36
+
37
+ const templateFiles = {
38
+ 'src/app/App.tsx': 'App.tsx',
39
+ 'src/config.ts': 'config.ts',
40
+ 'src/dataOptions.ts': 'dataOptions.ts',
41
+ 'src/viewOptions.ts': 'viewOptions.ts',
42
+ 'public/icon.svg': 'icon.svg',
43
+ 'tsconfig.json': 'tsconfig.json',
44
+ '.gitignore': '.gitignore',
45
+ }
46
+
47
+ for (const [dest, template] of Object.entries(templateFiles)) {
48
+ const destPath = resolve(projectRoot, dest)
49
+ const templatePath = resolve(templatesDir, template)
50
+
51
+ if (existsSync(templatePath) && !existsSync(destPath)) {
52
+ if (dest.includes('src')) {
53
+ const newCode = updateTypesPath(templatePath)
54
+ writeFileSync(destPath, newCode)
55
+ } else {
56
+ copyFileSync(templatePath, destPath)
57
+ }
58
+ }
59
+ }
60
+
61
+ updatePackageJson(projectRoot)
62
+
63
+ console.log('✅ Project initialized successfully!')
64
+ console.log('\nNext steps:')
65
+ console.log(' 1. yarn run start:dev')
66
+ console.log(' 2. yarn run build')
67
+
68
+ //////
69
+
70
+ function updatePackageJson(projectRoot) {
71
+ const packageJsonPath = resolve(projectRoot, 'package.json')
72
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'))
73
+
74
+ packageJson.scripts = {
75
+ 'start:dev': 'bmdl-sdk dev',
76
+ build: 'bmdl-sdk build',
77
+ }
78
+
79
+ writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2))
80
+ }
81
+
82
+ //
83
+
84
+ function updateTypesPath(filePath) {
85
+ const fileCode = readFileSync(filePath, 'utf-8')
86
+
87
+ let finalCode = fileCode.replace("from '../'", "from 'bmdl-sdk'")
88
+ finalCode = finalCode.replace(
89
+ /NameComponent/g,
90
+ kebabToCapitalize(`${projectName}-component`),
91
+ )
92
+
93
+ return finalCode
94
+ }
95
+
96
+ //
97
+
98
+ function kebabToCapitalize(str) {
99
+ return str
100
+ .split('-')
101
+ .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
102
+ .join('')
103
+ }
package/dist/BUILD_ID CHANGED
@@ -1 +1 @@
1
- GGX8H-C9Y0dHuyji9T6A1
1
+ A20LhbsVmIwzARb_Nlgd1
@@ -7,9 +7,9 @@
7
7
  "static/chunks/0cz1d0mv5g_q7.js"
8
8
  ],
9
9
  "lowPriorityFiles": [
10
- "static/GGX8H-C9Y0dHuyji9T6A1/_buildManifest.js",
11
- "static/GGX8H-C9Y0dHuyji9T6A1/_ssgManifest.js",
12
- "static/GGX8H-C9Y0dHuyji9T6A1/_clientMiddlewareManifest.js"
10
+ "static/A20LhbsVmIwzARb_Nlgd1/_buildManifest.js",
11
+ "static/A20LhbsVmIwzARb_Nlgd1/_ssgManifest.js",
12
+ "static/A20LhbsVmIwzARb_Nlgd1/_clientMiddlewareManifest.js"
13
13
  ],
14
14
  "rootMainFiles": [
15
15
  "static/chunks/3z5q_p4msz2ha.js",