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.
- package/bin/dev.js +1 -1
- package/bin/init.js +103 -0
- package/dist/BUILD_ID +1 -1
- package/dist/build-manifest.json +3 -3
- package/dist/cache/.tsbuildinfo +1 -1
- package/dist/fallback-build-manifest.json +3 -3
- package/dist/server/app/_global-error.html +1 -1
- package/dist/server/app/_global-error.rsc +1 -1
- package/dist/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dist/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/server/app/_not-found.html +1 -1
- package/dist/server/app/_not-found.rsc +1 -1
- package/dist/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/server/app/index.html +1 -1
- package/dist/server/app/index.rsc +1 -1
- package/dist/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/server/app/index.segments/_full.segment.rsc +1 -1
- package/dist/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/server/app/index.segments/_index.segment.rsc +1 -1
- package/dist/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/server/middleware-build-manifest.js +3 -3
- package/dist/server/pages/404.html +1 -1
- package/dist/server/pages/500.html +1 -1
- package/dist/standalone/dist/BUILD_ID +1 -1
- package/dist/standalone/dist/build-manifest.json +3 -3
- package/dist/standalone/dist/server/app/_global-error.html +1 -1
- package/dist/standalone/dist/server/app/_global-error.rsc +1 -1
- package/dist/standalone/dist/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dist/standalone/dist/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/standalone/dist/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dist/standalone/dist/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/standalone/dist/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/standalone/dist/server/app/_not-found.html +1 -1
- package/dist/standalone/dist/server/app/_not-found.rsc +1 -1
- package/dist/standalone/dist/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dist/standalone/dist/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dist/standalone/dist/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/standalone/dist/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/standalone/dist/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/standalone/dist/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/standalone/dist/server/app/index.html +1 -1
- package/dist/standalone/dist/server/app/index.rsc +1 -1
- package/dist/standalone/dist/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dist/standalone/dist/server/app/index.segments/_full.segment.rsc +1 -1
- package/dist/standalone/dist/server/app/index.segments/_head.segment.rsc +1 -1
- package/dist/standalone/dist/server/app/index.segments/_index.segment.rsc +1 -1
- package/dist/standalone/dist/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dist/standalone/dist/server/middleware-build-manifest.js +3 -3
- package/dist/standalone/dist/server/pages/404.html +1 -1
- package/dist/standalone/dist/server/pages/500.html +1 -1
- package/dist/standalone/package.json +4 -2
- package/dist/trace +1 -1
- package/dist/trace-build +1 -1
- package/index.d.ts +88 -0
- package/package.json +4 -2
- package/templates/App.tsx +11 -0
- package/templates/config.ts +13 -0
- package/templates/dataOptions.ts +5 -0
- package/templates/icon.svg +115 -0
- package/templates/tsconfig.json +7 -0
- package/templates/viewOptions.ts +5 -0
- /package/dist/standalone/dist/static/{GGX8H-C9Y0dHuyji9T6A1 → A20LhbsVmIwzARb_Nlgd1}/_buildManifest.js +0 -0
- /package/dist/standalone/dist/static/{GGX8H-C9Y0dHuyji9T6A1 → A20LhbsVmIwzARb_Nlgd1}/_clientMiddlewareManifest.js +0 -0
- /package/dist/standalone/dist/static/{GGX8H-C9Y0dHuyji9T6A1 → A20LhbsVmIwzARb_Nlgd1}/_ssgManifest.js +0 -0
- /package/dist/static/{GGX8H-C9Y0dHuyji9T6A1 → A20LhbsVmIwzARb_Nlgd1}/_buildManifest.js +0 -0
- /package/dist/static/{GGX8H-C9Y0dHuyji9T6A1 → A20LhbsVmIwzARb_Nlgd1}/_clientMiddlewareManifest.js +0 -0
- /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, '
|
|
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
|
-
|
|
1
|
+
A20LhbsVmIwzARb_Nlgd1
|
package/dist/build-manifest.json
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
"static/chunks/0cz1d0mv5g_q7.js"
|
|
8
8
|
],
|
|
9
9
|
"lowPriorityFiles": [
|
|
10
|
-
"static/
|
|
11
|
-
"static/
|
|
12
|
-
"static/
|
|
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",
|