@fugood/bricks-project 2.24.0-beta.3 → 2.24.0-beta.5
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/index.ts +6 -5
- package/package.json +3 -3
- package/tools/postinstall.ts +2 -2
- package/utils/calc.ts +10 -8
package/compile/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-underscore-dangle -- Uses __typename, __actionName, etc. for type system */
|
|
2
|
-
import
|
|
2
|
+
import snakeCase from 'lodash/snakeCase'
|
|
3
|
+
import omit from 'lodash/omit'
|
|
3
4
|
import { parse as parseAST } from 'acorn'
|
|
4
5
|
import type { ExportNamedDeclaration, FunctionDeclaration } from 'acorn'
|
|
5
6
|
import escodegen from 'escodegen'
|
|
@@ -70,7 +71,7 @@ const compileEventActionValue = (templateKey, eventKey, value, errorReference) =
|
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
const convertOutletKey = (templateKey: string, key: string) =>
|
|
73
|
-
`${templateKey}_${
|
|
74
|
+
`${templateKey}_${snakeCase(key).toUpperCase()}`
|
|
74
75
|
|
|
75
76
|
const compileOutlets = (
|
|
76
77
|
templateKey: string,
|
|
@@ -84,7 +85,7 @@ const compileOutlets = (
|
|
|
84
85
|
}, {})
|
|
85
86
|
|
|
86
87
|
const convertEventKey = (templateKey: string, key: string) =>
|
|
87
|
-
`${templateKey ? `${templateKey}_` : ''}${
|
|
88
|
+
`${templateKey ? `${templateKey}_` : ''}${snakeCase(key).toUpperCase()}`
|
|
88
89
|
|
|
89
90
|
const basicAnimationEvents = ['show', 'standby', 'breatheStart']
|
|
90
91
|
|
|
@@ -460,7 +461,7 @@ export const compile = async (app: Application) => {
|
|
|
460
461
|
property: animationDef.property,
|
|
461
462
|
type: animationTypeMap[animationDef.config.__type],
|
|
462
463
|
config: compileProperty(
|
|
463
|
-
|
|
464
|
+
omit(animationDef.config, '__type'),
|
|
464
465
|
`(animation: ${animation.id}, subspace ${subspace.id})`,
|
|
465
466
|
),
|
|
466
467
|
}
|
|
@@ -910,7 +911,7 @@ export const compile = async (app: Application) => {
|
|
|
910
911
|
},
|
|
911
912
|
comment: true,
|
|
912
913
|
})
|
|
913
|
-
} catch
|
|
914
|
+
} catch {
|
|
914
915
|
code = scriptCalc.code || ''
|
|
915
916
|
}
|
|
916
917
|
calc.script_config = {
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fugood/bricks-project",
|
|
3
|
-
"version": "2.24.0-beta.
|
|
3
|
+
"version": "2.24.0-beta.5",
|
|
4
4
|
"main": "index.ts",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "bun scripts/build.js"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@fugood/bricks-cli": "^2.24.0-beta.
|
|
9
|
+
"@fugood/bricks-cli": "^2.24.0-beta.4",
|
|
10
10
|
"@huggingface/gguf": "^0.3.2",
|
|
11
11
|
"@iarna/toml": "^3.0.0",
|
|
12
12
|
"@modelcontextprotocol/sdk": "^1.15.0",
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
"lodash": "^4.17.4",
|
|
20
20
|
"uuid": "^8.3.1"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "85c7f1899c1e2d48067196427c53271b4d147af3"
|
|
23
23
|
}
|
package/tools/postinstall.ts
CHANGED
|
@@ -44,7 +44,7 @@ const handleMcpConfigOverride = async (mcpConfigPath: string) => {
|
|
|
44
44
|
mcpConfig = JSON.parse(configStr)
|
|
45
45
|
if (!mcpConfig?.mcpServers) throw new Error('mcpServers is not defined')
|
|
46
46
|
mcpConfig.mcpServers['bricks-project'] = projectMcpServer
|
|
47
|
-
} catch
|
|
47
|
+
} catch {
|
|
48
48
|
mcpConfig = defaultMcpConfig
|
|
49
49
|
}
|
|
50
50
|
} else {
|
|
@@ -111,7 +111,7 @@ if (hasAgentsMd) {
|
|
|
111
111
|
mcpConfig = TOML.parse(configStr)
|
|
112
112
|
if (!mcpConfig?.mcp_servers) throw new Error('mcp_servers is not defined')
|
|
113
113
|
mcpConfig.mcp_servers['bricks-project'] = projectMcpServer
|
|
114
|
-
} catch
|
|
114
|
+
} catch {
|
|
115
115
|
mcpConfig = defaultCodexMcpConfig
|
|
116
116
|
}
|
|
117
117
|
} else {
|
package/utils/calc.ts
CHANGED
|
@@ -33,10 +33,11 @@ export const generateDataCalculationMapEditorInfo = (
|
|
|
33
33
|
nodes.forEach((node) => {
|
|
34
34
|
// Count and track inputs
|
|
35
35
|
if ('inputs' in node) {
|
|
36
|
-
const inputs = node.inputs
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
const inputs = node.inputs.reduce((sum, input) => {
|
|
37
|
+
if (input === null) return sum
|
|
38
|
+
if (Array.isArray(input)) return sum + input.length
|
|
39
|
+
return sum + 1
|
|
40
|
+
}, 0)
|
|
40
41
|
inputCounts.set(node, inputs)
|
|
41
42
|
|
|
42
43
|
// Track connections
|
|
@@ -59,10 +60,11 @@ export const generateDataCalculationMapEditorInfo = (
|
|
|
59
60
|
|
|
60
61
|
// Count outputs
|
|
61
62
|
if ('outputs' in node) {
|
|
62
|
-
const outputs = node.outputs
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
const outputs = node.outputs.reduce((sum, output) => {
|
|
64
|
+
if (output === null) return sum
|
|
65
|
+
if (Array.isArray(output)) return sum + output.length
|
|
66
|
+
return sum + 1
|
|
67
|
+
}, 0)
|
|
66
68
|
outputCounts.set(node, outputs)
|
|
67
69
|
} else {
|
|
68
70
|
outputCounts.set(node, 0)
|