@fugood/bricks-project 2.24.0-beta.8 → 2.24.0
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/compile/action-name-map.ts +38 -0
- package/compile/index.ts +460 -158
- package/compile/util.ts +2 -0
- package/package.json +7 -3
- package/package.json.bak +27 -0
- package/skills/{bricks-project → bricks-ctor}/SKILL.md +2 -2
- package/skills/{bricks-project → bricks-ctor}/rules/animation.md +1 -1
- package/skills/{bricks-project → bricks-ctor}/rules/architecture-patterns.md +7 -0
- package/skills/{bricks-project → bricks-ctor}/rules/automations.md +7 -7
- package/skills/{bricks-project → bricks-ctor}/rules/buttress.md +10 -7
- package/skills/{bricks-project → bricks-ctor}/rules/data-calculation.md +1 -1
- package/skills/{bricks-project → bricks-ctor}/rules/local-sync.md +2 -2
- package/skills/{bricks-project → bricks-ctor}/rules/media-flow.md +3 -3
- package/skills/{bricks-project → bricks-ctor}/rules/remote-data-bank.md +6 -6
- package/skills/{bricks-project → bricks-ctor}/rules/standby-transition.md +1 -1
- package/skills/bricks-design/LICENSE.txt +180 -0
- package/skills/bricks-design/SKILL.md +66 -0
- package/tools/deploy.ts +66 -12
- package/tools/icons/fa6pro-meta.json +3669 -26125
- package/tools/mcp-server.ts +11 -878
- package/tools/mcp-tools/compile.ts +91 -0
- package/tools/mcp-tools/huggingface.ts +762 -0
- package/tools/mcp-tools/icons.ts +70 -0
- package/tools/mcp-tools/lottie.ts +102 -0
- package/tools/mcp-tools/media.ts +110 -0
- package/tools/postinstall.ts +137 -40
- package/tools/preview-main.mjs +135 -2
- package/tools/preview.ts +41 -2
- package/tools/pull.ts +37 -19
- package/tsconfig.json +16 -0
- package/types/animation.ts +4 -0
- package/types/automation.ts +4 -1
- package/types/brick-base.ts +1 -1
- package/types/bricks/Camera.ts +48 -13
- package/types/bricks/Chart.ts +10 -4
- package/types/bricks/GenerativeMedia.ts +30 -14
- package/types/bricks/Icon.ts +9 -5
- package/types/bricks/Image.ts +10 -6
- package/types/bricks/Items.ts +29 -15
- package/types/bricks/Lottie.ts +15 -7
- package/types/bricks/Maps.ts +16 -8
- package/types/bricks/QrCode.ts +9 -5
- package/types/bricks/Rect.ts +45 -6
- package/types/bricks/RichText.ts +9 -5
- package/types/bricks/Rive.ts +21 -11
- package/types/bricks/Slideshow.ts +20 -10
- package/types/bricks/Svg.ts +8 -4
- package/types/bricks/Text.ts +9 -5
- package/types/bricks/TextInput.ts +23 -13
- package/types/bricks/Video.ts +11 -7
- package/types/bricks/VideoStreaming.ts +8 -4
- package/types/bricks/WebRtcStream.ts +7 -3
- package/types/bricks/WebView.ts +12 -8
- package/types/canvas.ts +4 -2
- package/types/common.ts +19 -12
- package/types/data-calc-command.ts +2 -0
- package/types/data-calc.ts +1 -0
- package/types/data.ts +2 -0
- package/types/generators/AlarmClock.ts +17 -11
- package/types/generators/Assistant.ts +69 -18
- package/types/generators/BleCentral.ts +31 -11
- package/types/generators/BlePeripheral.ts +11 -7
- package/types/generators/CanvasMap.ts +10 -6
- package/types/generators/CastlesPay.ts +15 -7
- package/types/generators/DataBank.ts +44 -9
- package/types/generators/File.ts +109 -30
- package/types/generators/GraphQl.ts +12 -6
- package/types/generators/Http.ts +33 -10
- package/types/generators/HttpServer.ts +23 -15
- package/types/generators/Information.ts +9 -5
- package/types/generators/Intent.ts +15 -5
- package/types/generators/Iterator.ts +15 -11
- package/types/generators/Keyboard.ts +27 -13
- package/types/generators/LlmAnthropicCompat.ts +33 -11
- package/types/generators/LlmAppleBuiltin.ts +25 -10
- package/types/generators/LlmGgml.ts +140 -31
- package/types/generators/LlmMediaTekNeuroPilot.ts +235 -0
- package/types/generators/LlmMlx.ts +227 -0
- package/types/generators/LlmOnnx.ts +34 -14
- package/types/generators/LlmOpenAiCompat.ts +47 -11
- package/types/generators/LlmQualcommAiEngine.ts +45 -13
- package/types/generators/Mcp.ts +375 -34
- package/types/generators/McpServer.ts +58 -19
- package/types/generators/MediaFlow.ts +38 -12
- package/types/generators/MqttBroker.ts +29 -11
- package/types/generators/MqttClient.ts +19 -9
- package/types/generators/Question.ts +13 -9
- package/types/generators/RealtimeTranscription.ts +108 -19
- package/types/generators/RerankerGgml.ts +43 -12
- package/types/generators/SerialPort.ts +18 -10
- package/types/generators/SoundPlayer.ts +10 -4
- package/types/generators/SoundRecorder.ts +24 -9
- package/types/generators/SpeechToTextGgml.ts +52 -18
- package/types/generators/SpeechToTextOnnx.ts +18 -11
- package/types/generators/SpeechToTextPlatform.ts +15 -7
- package/types/generators/SqLite.ts +20 -10
- package/types/generators/Step.ts +9 -5
- package/types/generators/SttAppleBuiltin.ts +22 -9
- package/types/generators/Tcp.ts +13 -9
- package/types/generators/TcpServer.ts +20 -14
- package/types/generators/TextToSpeechAppleBuiltin.ts +21 -8
- package/types/generators/TextToSpeechGgml.ts +29 -11
- package/types/generators/TextToSpeechOnnx.ts +19 -12
- package/types/generators/TextToSpeechOpenAiLike.ts +14 -8
- package/types/generators/ThermalPrinter.ts +13 -9
- package/types/generators/Tick.ts +11 -7
- package/types/generators/Udp.ts +17 -8
- package/types/generators/VadGgml.ts +51 -14
- package/types/generators/VadOnnx.ts +42 -12
- package/types/generators/VadTraditional.ts +28 -13
- package/types/generators/VectorStore.ts +33 -12
- package/types/generators/Watchdog.ts +19 -10
- package/types/generators/WebCrawler.ts +11 -7
- package/types/generators/WebRtc.ts +30 -16
- package/types/generators/WebSocket.ts +11 -7
- package/types/generators/index.ts +2 -0
- package/types/subspace.ts +4 -0
- package/types/system.ts +1 -1
- package/utils/event-props.ts +833 -1022
- package/utils/id.ts +4 -0
- package/api/index.ts +0 -1
- package/api/instance.ts +0 -213
- package/types/generators/TextToSpeechApple.ts +0 -113
- package/types/generators/TtsAppleBuiltin.ts +0 -105
package/tools/deploy.ts
CHANGED
|
@@ -4,29 +4,46 @@ import { parseArgs } from 'util'
|
|
|
4
4
|
const cwd = process.cwd()
|
|
5
5
|
|
|
6
6
|
const {
|
|
7
|
-
values: {
|
|
7
|
+
values: {
|
|
8
|
+
changelogs: changelogsArg,
|
|
9
|
+
'changelogs-file': changelogsFile,
|
|
10
|
+
'auto-commit': autoCommit,
|
|
11
|
+
'auto-version': autoVersion,
|
|
12
|
+
version: versionArg,
|
|
13
|
+
yes,
|
|
14
|
+
help,
|
|
15
|
+
},
|
|
8
16
|
} = parseArgs({
|
|
9
17
|
args: Bun.argv.slice(2),
|
|
10
18
|
options: {
|
|
11
19
|
changelogs: { type: 'string' },
|
|
12
20
|
'changelogs-file': { type: 'string' },
|
|
21
|
+
'auto-commit': { type: 'boolean' },
|
|
22
|
+
'auto-version': { type: 'boolean' },
|
|
23
|
+
version: { type: 'string' },
|
|
13
24
|
yes: { type: 'boolean', short: 'y' },
|
|
25
|
+
help: { type: 'boolean', short: 'h' },
|
|
14
26
|
},
|
|
15
27
|
allowPositionals: true,
|
|
16
28
|
})
|
|
17
29
|
|
|
30
|
+
if (help) {
|
|
31
|
+
console.log(`Options:
|
|
32
|
+
--changelogs <text> Changelogs text for the release
|
|
33
|
+
--changelogs-file <path> Read changelogs from a file
|
|
34
|
+
--auto-commit Auto-commit unstaged changes before deploying
|
|
35
|
+
--auto-version Auto-bump patch version before deploying
|
|
36
|
+
--version <version> Set explicit version for the release
|
|
37
|
+
-y, --yes Skip all prompts
|
|
38
|
+
-h, --help Show this help message`)
|
|
39
|
+
process.exit(0)
|
|
40
|
+
}
|
|
41
|
+
|
|
18
42
|
// Check git status
|
|
19
|
-
const { exitCode } = await $`cd ${cwd} && git status`.nothrow()
|
|
43
|
+
const { exitCode } = await $`cd ${cwd} && git status`.quiet().nothrow()
|
|
20
44
|
const isGitRepo = exitCode === 0
|
|
21
45
|
|
|
22
|
-
|
|
23
|
-
if (isGitRepo) {
|
|
24
|
-
const unstagedChanges = await $`cd ${cwd} && git diff --name-only --diff-filter=ACMR`.text()
|
|
25
|
-
if (unstagedChanges)
|
|
26
|
-
throw new Error('Unstaged changes found, please commit or stash your changes before deploying')
|
|
27
|
-
|
|
28
|
-
commitId = (await $`cd ${cwd} && git rev-parse HEAD`.text()).trim()
|
|
29
|
-
} else if (!yes) {
|
|
46
|
+
if (!isGitRepo && !yes) {
|
|
30
47
|
const confirmContinue = prompt('No git repository found, continue? (y/n)')
|
|
31
48
|
if (confirmContinue !== 'y') throw new Error('Deployment cancelled')
|
|
32
49
|
}
|
|
@@ -35,9 +52,28 @@ if (isGitRepo) {
|
|
|
35
52
|
const app = await Bun.file(`${cwd}/application.json`).json()
|
|
36
53
|
const config = await Bun.file(`${cwd}/.bricks/build/application-config.json`).json()
|
|
37
54
|
|
|
38
|
-
//
|
|
55
|
+
// Resolve version: explicit flag > auto-bump > package.json
|
|
39
56
|
const pkgFile = Bun.file(`${cwd}/package.json`)
|
|
40
|
-
const
|
|
57
|
+
const pkgExists = await pkgFile.exists()
|
|
58
|
+
let version: string | undefined
|
|
59
|
+
|
|
60
|
+
if (versionArg) {
|
|
61
|
+
version = versionArg
|
|
62
|
+
if (pkgExists) {
|
|
63
|
+
const pkg = await pkgFile.json()
|
|
64
|
+
pkg.version = version
|
|
65
|
+
await Bun.write(`${cwd}/package.json`, JSON.stringify(pkg, null, 2) + '\n')
|
|
66
|
+
}
|
|
67
|
+
} else if (autoVersion && pkgExists) {
|
|
68
|
+
const pkg = await pkgFile.json()
|
|
69
|
+
const parts = (pkg.version || '0.0.0').split('.')
|
|
70
|
+
parts[2] = String(Number(parts[2] || 0) + 1)
|
|
71
|
+
version = parts.join('.')
|
|
72
|
+
pkg.version = version
|
|
73
|
+
await Bun.write(`${cwd}/package.json`, JSON.stringify(pkg, null, 2) + '\n')
|
|
74
|
+
} else {
|
|
75
|
+
version = pkgExists ? (await pkgFile.json()).version : undefined
|
|
76
|
+
}
|
|
41
77
|
|
|
42
78
|
// Get changelog from flag or file
|
|
43
79
|
let changelogs = ''
|
|
@@ -53,6 +89,24 @@ if (changelogsArg) {
|
|
|
53
89
|
changelogs = prompt('Enter changelogs (optional, press Enter to skip):') || ''
|
|
54
90
|
}
|
|
55
91
|
|
|
92
|
+
// Handle unstaged changes
|
|
93
|
+
let commitId = ''
|
|
94
|
+
if (isGitRepo) {
|
|
95
|
+
const unstagedChanges = await $`cd ${cwd} && git diff --name-only --diff-filter=ACMR`.text()
|
|
96
|
+
if (unstagedChanges) {
|
|
97
|
+
if (autoCommit) {
|
|
98
|
+
const commitMsg = `chore: release ${version || 'new version'}`
|
|
99
|
+
const commitBody = changelogs || '[no changelogs]'
|
|
100
|
+
await $`cd ${cwd} && git add -A && git commit -m ${commitMsg} -m ${commitBody}`
|
|
101
|
+
} else {
|
|
102
|
+
throw new Error(
|
|
103
|
+
'Unstaged changes found, please commit or stash your changes before deploying',
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
commitId = (await $`cd ${cwd} && git rev-parse HEAD`.text()).trim()
|
|
108
|
+
}
|
|
109
|
+
|
|
56
110
|
// Ask for confirmation
|
|
57
111
|
if (!yes) {
|
|
58
112
|
const confirm = prompt('Are you sure you want to deploy? (y/n)')
|