@fugood/bricks-project 2.24.0-beta.6 → 2.24.0-beta.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.
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@fugood/bricks-project",
3
- "version": "2.24.0-beta.6",
3
+ "version": "2.24.0-beta.7",
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.6",
9
+ "@fugood/bricks-cli": "^2.24.0-beta.7",
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": "893f3e56ec87e71bfc093434c9a8517fca6c0f99"
22
+ "gitHead": "f65832e45dc04049f9fa91e55109e72ebc438d11"
23
23
  }
@@ -33,14 +33,14 @@ Automations can validate:
33
33
  ```typescript
34
34
  const testLoginFlow: AutomationTest = {
35
35
  __typename: 'AutomationTest',
36
- id: 'test-login-flow',
36
+ id: makeId('test'),
37
37
  title: 'Test Login Flow',
38
38
  timeout: 30000,
39
39
  trigger_type: 'launch',
40
40
  cases: [
41
41
  {
42
42
  __typename: 'TestCase',
43
- id: 'wait-login-canvas',
43
+ id: makeId('test_case'),
44
44
  name: 'Wait for login canvas',
45
45
  run: ['wait_until_canvas_change', () => mainSubspace, () => loginCanvas, 5000],
46
46
  exit_on_failed: true,
@@ -51,7 +51,7 @@ const testLoginFlow: AutomationTest = {
51
51
  },
52
52
  {
53
53
  __typename: 'TestCase',
54
- id: 'press-username',
54
+ id: makeId('test_case'),
55
55
  name: 'Press username input',
56
56
  run: ['brick_press', () => mainSubspace, () => usernameInput],
57
57
  exit_on_failed: true,
@@ -62,7 +62,7 @@ const testLoginFlow: AutomationTest = {
62
62
  },
63
63
  {
64
64
  __typename: 'TestCase',
65
- id: 'assert-username',
65
+ id: makeId('test_case'),
66
66
  name: 'Assert username value',
67
67
  run: ['assert_property', () => mainSubspace, () => usernameData, 'testuser'],
68
68
  exit_on_failed: true,
@@ -73,7 +73,7 @@ const testLoginFlow: AutomationTest = {
73
73
  },
74
74
  {
75
75
  __typename: 'TestCase',
76
- id: 'press-login',
76
+ id: makeId('test_case'),
77
77
  name: 'Press login button',
78
78
  run: ['brick_press', () => mainSubspace, () => loginButton],
79
79
  exit_on_failed: true,
@@ -84,7 +84,7 @@ const testLoginFlow: AutomationTest = {
84
84
  },
85
85
  {
86
86
  __typename: 'TestCase',
87
- id: 'wait-dashboard',
87
+ id: makeId('test_case'),
88
88
  name: 'Wait for dashboard',
89
89
  run: ['wait_until_canvas_change', () => mainSubspace, () => dashboardCanvas, 10000],
90
90
  exit_on_failed: true,
@@ -42,13 +42,17 @@ let config = JSON.parse(await readFile(`${cwd}/.bricks/build/application-config.
42
42
  let testId = values['test-id'] || null
43
43
  if (!testId && values['test-title-like']) {
44
44
  const titleLike = values['test-title-like'].toLowerCase()
45
- const testMap = config.test_map || {}
46
- const found = Object.entries(testMap).find(([, test]) =>
47
- test.title?.toLowerCase().includes(titleLike),
48
- )
49
- if (found) {
50
- ;[testId] = found
51
- } else {
45
+ const automationMap = config.automation_map || {}
46
+ for (const group of Object.values(automationMap)) {
47
+ const found = Object.entries(group.map || {}).find(([, test]) =>
48
+ test.title?.toLowerCase().includes(titleLike),
49
+ )
50
+ if (found) {
51
+ ;[testId] = found
52
+ break
53
+ }
54
+ }
55
+ if (!testId) {
52
56
  throw new Error(`No automation found matching title: ${values['test-title-like']}`)
53
57
  }
54
58
  }
package/utils/calc.ts CHANGED
@@ -33,11 +33,12 @@ 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.reduce((sum, input) => {
37
- if (input === null) return sum
38
- if (Array.isArray(input)) return sum + input.length
39
- return sum + 1
40
- }, 0)
36
+ let inputs = 0
37
+ for (const input of node.inputs) {
38
+ if (input === null) continue
39
+ if (Array.isArray(input)) inputs += input.length
40
+ else inputs += 1
41
+ }
41
42
  inputCounts.set(node, inputs)
42
43
 
43
44
  // Track connections
@@ -60,11 +61,12 @@ export const generateDataCalculationMapEditorInfo = (
60
61
 
61
62
  // Count outputs
62
63
  if ('outputs' in node) {
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)
64
+ let outputs = 0
65
+ for (const output of node.outputs) {
66
+ if (output === null) continue
67
+ if (Array.isArray(output)) outputs += output.length
68
+ else outputs += 1
69
+ }
68
70
  outputCounts.set(node, outputs)
69
71
  } else {
70
72
  outputCounts.set(node, 0)