@geastack/cli 0.1.88 → 0.1.89

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@geastack/cli",
3
- "version": "0.1.88",
3
+ "version": "0.1.89",
4
4
  "description": "Command-line front door for GeaStack apps, targets, and local toolchains.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -38,13 +38,13 @@
38
38
  "dependencies": {
39
39
  "@clack/prompts": "^1.8.0",
40
40
  "@geastack/simulator": "^0.1.12",
41
- "@geastack/targets": "^0.1.85",
41
+ "@geastack/targets": "^0.1.86",
42
42
  "picocolors": "^1.1.1",
43
43
  "serialport": "^13.0.0"
44
44
  },
45
45
  "starterDependencies": {
46
46
  "@geastack/core": "^0.1.31",
47
- "@geastack/targets": "^0.1.85",
47
+ "@geastack/targets": "^0.1.86",
48
48
  "@geastack/apple": "^0.2.9"
49
49
  },
50
50
  "scripts": {
@@ -1,4 +1,20 @@
1
1
  export const knownBoards = Object.freeze([
2
+ {
3
+ id: 'waveshare-lcd-35b',
4
+ label: 'Waveshare ESP32-S3 Touch LCD 3.5B / 3.5B-C',
5
+ alias: 'lcd-35b',
6
+ target: 'esp32-s3-touch-lcd-3.5b',
7
+ adapter: 'esp32-idf',
8
+ mcu: 'ESP32-S3',
9
+ capabilities: {
10
+ display: '320 × 480 IPS LCD (AXS15231B QSPI)',
11
+ touch: 'AXS15231B capacitive touch',
12
+ wireless: ['WiFi', 'BLE'],
13
+ storage: ['16 MB flash', '8 MB PSRAM', 'microSD'],
14
+ audio: [],
15
+ gps: false
16
+ }
17
+ },
2
18
  {
3
19
  id: 'waveshare-amoled-241',
4
20
  label: 'Waveshare ESP32-S3 Touch AMOLED 2.41 (V1)',
@@ -87,6 +87,17 @@ function ratio(value, where) {
87
87
  if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0) fail(`${where} must be a positive number`)
88
88
  return value
89
89
  }
90
+ function boardDefines(raw, where) {
91
+ if (raw === undefined) return []
92
+ if (!isObject(raw)) fail(`${where} must be an object`)
93
+ return Object.entries(raw).map(([name, value]) => {
94
+ if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name) ||
95
+ !['string', 'number', 'boolean'].includes(typeof value) ||
96
+ (typeof value === 'number' && !Number.isFinite(value)) ||
97
+ /[;\n\r]/.test(String(value))) fail(`${where}.${name} must be a valid native define`)
98
+ return `${name}=${typeof value === 'boolean' ? Number(value) : value}`
99
+ })
100
+ }
90
101
  export function validateBuildManifest(manifest) {
91
102
  flatten(manifest.build, 'gea.build')
92
103
  for (const [platform, target] of Object.entries(manifest.targets || {})) {
@@ -98,7 +109,8 @@ export function validateBuildManifest(manifest) {
98
109
  if (!isObject(target.boards)) fail(where + '.boards must be an object')
99
110
  for (const [id, board] of Object.entries(target.boards)) {
100
111
  if (!/^[A-Za-z0-9][A-Za-z0-9_.-]*$/.test(id) || !isObject(board)) fail(where + '.boards must contain board IDs mapped to objects')
101
- for (const key of Object.keys(board)) if (!['build', 'cssDevicePixelRatio'].includes(key)) fail(`Unknown setting ${where}.boards.${id}.${key}`)
112
+ for (const key of Object.keys(board)) if (!['build', 'cssDevicePixelRatio', 'defines'].includes(key)) fail(`Unknown setting ${where}.boards.${id}.${key}`)
113
+ boardDefines(board.defines, where + '.boards.' + id + '.defines')
102
114
  flatten(board.build, where + '.boards.' + id + '.build')
103
115
  if (board.cssDevicePixelRatio !== undefined) ratio(board.cssDevicePixelRatio, where + '.boards.' + id + '.cssDevicePixelRatio')
104
116
  }
@@ -162,7 +174,10 @@ export function resolveBuildConfig({ app, platform, board = '', targetsRoot = ''
162
174
  apply(boardOverride.build, 'gea.targets.' + platform + '.boards.' + board + '.build', true)
163
175
  const passthroughDefines = []
164
176
  const seenLegacy = new Set()
165
- for (const define of app?.defines || []) {
177
+ const overrides = boardDefines(boardOverride.defines, 'gea.targets.' + platform + '.boards.' + board + '.defines')
178
+ const overridden = new Set(overrides.map(define => define.split('=')[0]))
179
+ const selectedDefines = [...(app?.defines || []).filter(define => !overridden.has(define.split('=')[0])), ...overrides]
180
+ for (const define of selectedDefines) {
166
181
  const [name, ...rest] = define.split('=')
167
182
  if (name === 'GEA_CPP_MINIMAL_GLOBAL_OBJECT' || name === 'GEA_EMBEDDED_NUMBER_F32') fail(`${name} is obsolete and has no active consumer; remove it from gea.defines`)
168
183
  if (['GEA_EMBEDDED_DIRECT_CANVAS_CONTEXT', 'GEA_EMBEDDED_FULL_BOOT_SERVICES'].includes(name)) fail(`${name} is inferred from app capabilities; remove it from gea.defines`)