@geastack/cli 0.1.90 → 0.1.92

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.90",
3
+ "version": "0.1.92",
4
4
  "description": "Command-line front door for GeaStack apps, targets, and local toolchains.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -37,15 +37,15 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@clack/prompts": "^1.8.0",
40
- "@geastack/simulator": "^0.1.12",
41
- "@geastack/targets": "^0.1.86",
40
+ "@geastack/simulator": "^0.1.13",
41
+ "@geastack/targets": "^0.1.88",
42
42
  "picocolors": "^1.1.1",
43
43
  "serialport": "^13.0.0"
44
44
  },
45
45
  "starterDependencies": {
46
- "@geastack/core": "^0.1.31",
47
- "@geastack/targets": "^0.1.86",
48
- "@geastack/apple": "^0.2.9"
46
+ "@geastack/core": "^0.1.34",
47
+ "@geastack/targets": "^0.1.88",
48
+ "@geastack/apple": "^0.2.13"
49
49
  },
50
50
  "scripts": {
51
51
  "check": "node --check bin/gea.mjs && node --check bin/create-geastack.mjs && find src test packages -name '*.mjs' -print0 | xargs -0 -n1 node --check",
@@ -151,6 +151,7 @@ export function normalizeCustomTarget(raw, catalog) {
151
151
  [imu, 'chips.imu'],
152
152
  [expander, 'chips.expander']
153
153
  ].filter(([chip]) => chip && chip.interface === 'i2c')
154
+ if (audio) i2cChips.push([audio, 'chips.audio (codec control)'])
154
155
  if (absent(buses.i2c) && i2cChips.length > 0) {
155
156
  throw new Error(`buses.i2c is required because ${i2cChips.map(([, label]) => label).join(', ')} ${i2cChips.length > 1 ? 'are' : 'is'} on the I2C bus.`)
156
157
  }
@@ -171,7 +172,8 @@ export function normalizeCustomTarget(raw, catalog) {
171
172
  const spiHost = display && displayInterface === 'qspi' ? String(display.spiHost ?? 'spi2').toLowerCase() : 'spi2'
172
173
  if (display && displayInterface === 'qspi' && !['spi2', 'spi3'].includes(spiHost)) throw new Error("chips.display.spiHost must be 'spi2' or 'spi3'.")
173
174
  const expanderOutputs = expander ? (absent(expander.outputs) ? {} : object(expander.outputs, 'chips.expander.outputs')) : null
174
- const expanderPin = (value, label) => (absent(value) ? -1 : integer(value, label, { min: 0, max: 15 }))
175
+ const expanderMaxPin = expander?.driver === 'tca9554' ? 7 : expander?.driver === 'ch422g' ? 11 : 15
176
+ const expanderPin = (value, label) => (absent(value) ? -1 : integer(value, label, { min: 0, max: expanderMaxPin }))
175
177
 
176
178
  // Flash size and the partition table are board geometry, not app policy: a
177
179
  // module with 16MB of flash cannot borrow its base's 32MB layout, and every
@@ -208,6 +210,36 @@ export function normalizeCustomTarget(raw, catalog) {
208
210
  throw new Error(`psram.speed must be 40, 80 or 120 MHz, not ${psramSpeed}.`)
209
211
  }
210
212
 
213
+ const controller = display && !absent(display.controller) ? object(display.controller, 'chips.display.controller') : null
214
+ if (controller && (displayInterface !== 'rgb' || !expander)) throw new Error('RGB controller initialization requires an I/O expander.')
215
+ const byte = (value, label) => integer(value, label, { min: 0, max: 255 })
216
+ const controllerConfig = controller ? {
217
+ cs: expanderPin(controller.cs, 'controller.cs'),
218
+ clock: expanderPin(controller.clock, 'controller.clock'),
219
+ data: expanderPin(controller.data, 'controller.data'),
220
+ reset: expanderPin(controller.reset, 'controller.reset'),
221
+ addressSelect: expanderPin(controller.addressSelect, 'controller.addressSelect'),
222
+ commands: Array.isArray(controller.commands) ? controller.commands.map((command, index) => {
223
+ object(command, `controller.commands[${index}]`)
224
+ if (!Array.isArray(command.data) || command.data.length > 32) throw new Error('Controller command data must be an array of at most 32 bytes.')
225
+ return { command: byte(command.command, 'controller command'), data: command.data.map(value => byte(value, 'controller data')), delayMs: integer(command.delayMs ?? 0, 'controller delayMs', { min: 0, max: 1000 }) }
226
+ }) : []
227
+ } : null
228
+ if (controllerConfig && (controllerConfig.cs < 0 || controllerConfig.clock < 0 || controllerConfig.data < 0 || !controllerConfig.commands.length)) throw new Error('Controller requires CS, clock, data and initialization commands.')
229
+
230
+ if (controllerConfig) {
231
+ const assigned = new Set()
232
+ for (const [label, value] of Object.entries(controllerConfig)) {
233
+ if (label === 'commands' || value < 0) continue
234
+ if (assigned.has(value)) throw new Error(`Controller control pins overlap at expander pin ${value}.`)
235
+ assigned.add(value)
236
+ }
237
+ for (const [label, value] of Object.entries(expanderOutputs)) {
238
+ if (label.startsWith('_') || absent(value)) continue
239
+ if (assigned.has(value)) throw new Error(`Controller pin overlaps expander.outputs.${label}.`)
240
+ }
241
+ }
242
+
211
243
  const target = {
212
244
  id,
213
245
  extends: base,
@@ -239,6 +271,8 @@ export function normalizeCustomTarget(raw, catalog) {
239
271
  vsyncBackPorch: integer(display.vsyncBackPorch ?? 8, 'chips.display.vsyncBackPorch', { min: 0, max: 1024 }),
240
272
  vsyncFrontPorch: integer(display.vsyncFrontPorch ?? 8, 'chips.display.vsyncFrontPorch', { min: 0, max: 1024 }),
241
273
  pclkActiveNeg: boolean(display.pclkActiveNeg, 'chips.display.pclkActiveNeg', true),
274
+ backlightActiveLow: boolean(display.backlightActiveLow, 'chips.display.backlightActiveLow', false),
275
+ controller: controllerConfig,
242
276
  nativeSources: display.nativeSources,
243
277
  bindingSources: display.bindingSources,
244
278
  requires: display.requires,
@@ -290,8 +324,11 @@ export function normalizeCustomTarget(raw, catalog) {
290
324
  nativeSources: expander.nativeSources,
291
325
  bindingSources: expander.bindingSources,
292
326
  requires: expander.requires,
327
+ address: integer(expander.address ?? 32, 'chips.expander.address', { min: 8, max: 119 }),
328
+ initialDirections: byte(expander.initialDirections ?? 255, 'chips.expander.initialDirections'),
293
329
  initialOutputs: integer(expander.initialOutputs ?? 255, 'chips.expander.initialOutputs', { min: 0, max: 255 }),
294
330
  outputs: {
331
+ powerAmplifier: expanderPin(expanderOutputs.powerAmplifier, 'chips.expander.outputs.powerAmplifier'),
295
332
  backlight: expanderPin(expanderOutputs.backlight, 'chips.expander.outputs.backlight'),
296
333
  touchReset: expanderPin(expanderOutputs.touchReset, 'chips.expander.outputs.touchReset'),
297
334
  displayReset: expanderPin(expanderOutputs.displayReset, 'chips.expander.outputs.displayReset')
@@ -314,6 +351,7 @@ export function normalizeCustomTarget(raw, catalog) {
314
351
  audio: audio === null ? null : {
315
352
  driver: audio.driver,
316
353
  interface: exact(audio.interface, 'i2s', 'chips.audio.interface'),
354
+ es7210Address: integer(audio.es7210Address ?? 0, 'chips.audio.es7210Address', { min: 0, max: 119 }),
317
355
  nativeSources: audio.nativeSources,
318
356
  bindingSources: audio.bindingSources,
319
357
  requires: audio.requires,
@@ -323,7 +361,7 @@ export function normalizeCustomTarget(raw, catalog) {
323
361
  ws: pin(audioPins.ws, 'chips.audio.pins.ws'),
324
362
  dout: pin(audioPins.dout, 'chips.audio.pins.dout'),
325
363
  din: pin(audioPins.din, 'chips.audio.pins.din'),
326
- powerAmplifier: pin(audioPins.powerAmplifier, 'chips.audio.pins.powerAmplifier')
364
+ powerAmplifier: pin(audioPins.powerAmplifier, 'chips.audio.pins.powerAmplifier', { optional: true })
327
365
  }
328
366
  }
329
367
  },
@@ -448,6 +486,7 @@ ${includes}
448
486
  #define GEA_BOARD_HAS_MICROSD ${target.storage.microSD ? 1 : 0}
449
487
  #define GEA_BOARD_HAS_LAUNCHER_BUTTON ${target.controls.launcherButton ? 1 : 0}
450
488
  #define GEA_BOARD_HAS_EXPANDER ${expander ? 1 : 0}
489
+ #define GEA_BOARD_HAS_RGB_CONTROLLER ${rgb?.controller ? 1 : 0}
451
490
 
452
491
  namespace gea::platform::board {
453
492
 
@@ -464,7 +503,7 @@ ${qspi ? 'struct Co5300DisplayConfig { spi_host_device_t spiHost; gpio_num_t cs;
464
503
  // framebuffer out with these timings. data[0..4] are blue, [5..10] green,
465
504
  // [11..15] red (RGB565 lane order). backlight is a PWM-capable GPIO, or
466
505
  // GPIO_NUM_NC when the expander drives it.
467
- struct RgbPanelDisplayConfig { gpio_num_t de; gpio_num_t hsync; gpio_num_t vsync; gpio_num_t pclk; gpio_num_t disp; gpio_num_t backlight; gpio_num_t data[16]; int pclkHz; int hsyncPulseWidth; int hsyncBackPorch; int hsyncFrontPorch; int vsyncPulseWidth; int vsyncBackPorch; int vsyncFrontPorch; bool pclkActiveNeg; };` : ''}${touch ? '\nstruct Ft3168TouchConfig { gpio_num_t reset; gpio_num_t interrupt; };' : ''}${expander ? '\n// Expander pin numbers (0-based, the chip\'s own), -1 where a line is not routed through it.\nstruct IoExpanderConfig { int initialOutputs; int backlight; int touchReset; int displayReset; };' : ''}${audio ? '\nstruct Es8311AudioConfig { int i2sPort; gpio_num_t mclk; gpio_num_t bclk; gpio_num_t ws; gpio_num_t dout; gpio_num_t din; gpio_num_t powerAmplifier; };' : ''}
506
+ struct RgbPanelDisplayConfig { gpio_num_t de; gpio_num_t hsync; gpio_num_t vsync; gpio_num_t pclk; gpio_num_t disp; gpio_num_t backlight; gpio_num_t data[16]; int pclkHz; int hsyncPulseWidth; int hsyncBackPorch; int hsyncFrontPorch; int vsyncPulseWidth; int vsyncBackPorch; int vsyncFrontPorch; bool pclkActiveNeg; bool backlightActiveLow; };` : ''}${touch ? '\nstruct Ft3168TouchConfig { gpio_num_t reset; gpio_num_t interrupt; };' : ''}${expander ? '\n// Expander pin numbers (0-based, the chip\'s own), -1 where a line is not routed through it.\nstruct IoExpanderConfig { int initialOutputs; int backlight; int touchReset; int displayReset; int address; int initialDirections; int powerAmplifier; };' : ''}${audio ? '\nstruct Es8311AudioConfig { int i2sPort; gpio_num_t mclk; gpio_num_t bclk; gpio_num_t ws; gpio_num_t dout; gpio_num_t din; gpio_num_t powerAmplifier; int es7210Address; };' : ''}
468
507
 
469
508
  inline constexpr I2cBusConfig i2c{ .sda = ${gpio(i2c.sda)}, .scl = ${gpio(i2c.scl)} };
470
509
  inline constexpr SdMmcConfig storage{ .clk = ${gpio(sdPins.clk)}, .cmd = ${gpio(sdPins.cmd)}, .data0 = ${gpio(sdPins.data0)} };
@@ -476,7 +515,8 @@ ${rgb ? `inline constexpr RgbPanelDisplayConfig display{
476
515
  .pclkHz = ${rgb.pclkHz},
477
516
  .hsyncPulseWidth = ${rgb.hsyncPulseWidth}, .hsyncBackPorch = ${rgb.hsyncBackPorch}, .hsyncFrontPorch = ${rgb.hsyncFrontPorch},
478
517
  .vsyncPulseWidth = ${rgb.vsyncPulseWidth}, .vsyncBackPorch = ${rgb.vsyncBackPorch}, .vsyncFrontPorch = ${rgb.vsyncFrontPorch},
479
- .pclkActiveNeg = ${rgb.pclkActiveNeg ? 'true' : 'false'}
518
+ .pclkActiveNeg = ${rgb.pclkActiveNeg ? 'true' : 'false'},
519
+ .backlightActiveLow = ${rgb.backlightActiveLow ? 'true' : 'false'}
480
520
  };` : ''}${qspi ? `inline constexpr Co5300DisplayConfig display{
481
521
  .spiHost = ${display.spiHost === 'spi3' ? 'SPI3_HOST' : 'SPI2_HOST'}, .cs = ${gpio(displayPins.cs)}, .pclk = ${gpio(displayPins.pclk)},
482
522
  .data0 = ${gpio(displayPins.data0)}, .data1 = ${gpio(displayPins.data1)},
@@ -484,13 +524,19 @@ ${rgb ? `inline constexpr RgbPanelDisplayConfig display{
484
524
  .reset = ${gpio(displayPins.reset)}, .te = ${gpio(displayPins.te)}
485
525
  };` : ''}${touch ? `
486
526
  inline constexpr Ft3168TouchConfig touch{ .reset = ${gpio(touchPins.reset)}, .interrupt = ${gpio(touchPins.interrupt)} };` : ''}${expander ? `
487
- inline constexpr IoExpanderConfig expander{ .initialOutputs = ${expander.initialOutputs}, .backlight = ${expander.outputs.backlight}, .touchReset = ${expander.outputs.touchReset}, .displayReset = ${expander.outputs.displayReset} };` : ''}${audio ? `
527
+ inline constexpr IoExpanderConfig expander{ .initialOutputs = ${expander.initialOutputs}, .backlight = ${expander.outputs.backlight}, .touchReset = ${expander.outputs.touchReset}, .displayReset = ${expander.outputs.displayReset}, .address = ${expander.address}, .initialDirections = ${expander.initialDirections}, .powerAmplifier = ${expander.outputs.powerAmplifier} };` : ''}${audio ? `
488
528
  inline constexpr Es8311AudioConfig audio{
489
529
  .i2sPort = I2S_NUM_AUTO, .mclk = ${gpio(audioPins.mclk)}, .bclk = ${gpio(audioPins.bclk)},
490
530
  .ws = ${gpio(audioPins.ws)}, .dout = ${gpio(audioPins.dout)}, .din = ${gpio(audioPins.din)},
491
- .powerAmplifier = ${gpio(audioPins.powerAmplifier)}
531
+ .powerAmplifier = ${gpio(audioPins.powerAmplifier)}, .es7210Address = ${audio.es7210Address}
492
532
  };` : ''}
493
533
 
534
+ ${rgb?.controller ? `struct RgbControllerConfig { int cs; int clock; int data; int reset; int addressSelect; };
535
+ inline constexpr RgbControllerConfig rgbController{ ${rgb.controller.cs}, ${rgb.controller.clock}, ${rgb.controller.data}, ${rgb.controller.reset}, ${rgb.controller.addressSelect} };
536
+ struct RgbControllerCommand { unsigned char command; unsigned char data[32]; int length; int delayMs; };
537
+ inline constexpr RgbControllerCommand rgbControllerCommands[] = {
538
+ ${rgb.controller.commands.map(command => ` { ${command.command}, { ${command.data.join(', ')} }, ${command.data.length}, ${command.delayMs} },`).join('\n')}
539
+ };` : ''}
494
540
  } // namespace gea::platform::board
495
541
  `
496
542
  }
@@ -22,6 +22,9 @@ const cliVersion = cliPackage.version
22
22
  const starterDependencies = cliPackage.starterDependencies || {}
23
23
  const coreDependencyDefault = starterDependencies['@geastack/core'] || 'latest'
24
24
  const targetsDependencyDefault = starterDependencies['@geastack/targets'] || 'latest'
25
+ // The native tooling uses the TypeScript 5 compiler API. Do not let a
26
+ // floating version in an older example select an incompatible major.
27
+ const typescriptDependencyDefault = '^5.9.3'
25
28
  const starterFontPath = fileURLToPath(new URL('../starters/fonts/Inter-Regular.ttf', import.meta.url))
26
29
 
27
30
  export async function runCreateGeastack(argv, io = {}) {
@@ -82,7 +85,7 @@ export async function runCreateGeastack(argv, io = {}) {
82
85
  : starter.kind === 'empty'
83
86
  ? targetManifest(starter.targets || ['web'])
84
87
  : targetManifestFromObject(sourceManifest.targets)
85
- writeJson(path.join(targetDir, 'package.json'), packageJson({
88
+ const projectPackage = packageJson({
86
89
  appId,
87
90
  displayName,
88
91
  targets,
@@ -91,11 +94,20 @@ export async function runCreateGeastack(argv, io = {}) {
91
94
  cliDependency,
92
95
  sourcePackage,
93
96
  sourceManifest
94
- }))
97
+ })
98
+ writeJson(path.join(targetDir, 'package.json'), projectPackage)
95
99
  if (targets.web) ensureFile(path.join(targetDir, 'index.html'), () => indexHtml(displayName, entry))
96
100
  fs.mkdirSync(path.join(targetDir, '.gea'), { recursive: true })
97
101
  writeJson(path.join(targetDir, '.gea', 'boards.json'), {})
98
102
  ensureJson(path.join(targetDir, 'tsconfig.json'), () => tsconfigJson(targets))
103
+ if (/^(?:\^|~)?5\./.test(projectPackage.devDependencies.typescript)) {
104
+ const configPath = path.join(targetDir, 'tsconfig.json')
105
+ const config = readJson(configPath)
106
+ if (config.compilerOptions?.ignoreDeprecations === '6.0') {
107
+ config.compilerOptions.ignoreDeprecations = '5.0'
108
+ writeJson(configPath, config)
109
+ }
110
+ }
99
111
  ensureFile(path.join(targetDir, '.gitignore'), gitignore)
100
112
  if (targets.web) ensureFile(path.join(targetDir, 'vite.web.config.ts'), viteConfigTs)
101
113
  fs.writeFileSync(path.join(targetDir, 'README.md'), readme({ appId, displayName, starter, targets }))
@@ -353,7 +365,9 @@ function packageJson({ appId, displayName, targets, entry, coreDependency, cliDe
353
365
  },
354
366
  devDependencies: {
355
367
  ...(sourcePackage.devDependencies || {}),
356
- typescript: sourcePackage.devDependencies?.typescript || 'latest',
368
+ typescript: !sourcePackage.devDependencies?.typescript || ['latest', '*'].includes(sourcePackage.devDependencies.typescript)
369
+ ? typescriptDependencyDefault
370
+ : sourcePackage.devDependencies.typescript,
357
371
  ...(targets.web ? { vite: sourcePackage.devDependencies?.vite || 'latest' } : {})
358
372
  },
359
373
  gea: geaManifest,
@@ -101,7 +101,9 @@ export function withRendererFeatureDefines(defines, features, { devicePixelRatio
101
101
  // An older plugin knows nothing about renderer features. Absence without the
102
102
  // version marker is not proof of unreachability: retain engine defaults.
103
103
  const generatedNames = new Set([...rendererFeatureDefines, ...cssFeatureVersions.flat(), ...nodeFeatureDefines, ...nodeAuxFeatureDefines, ...compactStyleDefines].map(([, name]) => name).concat(triangleOcclusionMacro, circleCacheMacros, rangeFamilies.map(rangeMacro), ['GEA_UI_CLASS_INLINE_TOKENS', 'GEA_UI_CLASS_OVERFLOW']))
104
+ generatedNames.add('GEA_RUNTIME_REALMS')
104
105
  const result = defines.split(';').filter((define) => define && !generatedNames.has(define.split('=')[0]))
106
+ if (features.includes('worker-realms')) result.push('GEA_RUNTIME_REALMS=1')
105
107
  if (features.includes('node-analysis-v1')) {
106
108
  for (const [feature, name] of nodeFeatureDefines) result.push(`${name}=${features.includes(feature) ? 1 : 0}`)
107
109
  }
@@ -11,7 +11,7 @@
11
11
  "@geajs/core": "1.4.3"
12
12
  },
13
13
  "devDependencies": {
14
- "typescript": "latest"
14
+ "typescript": "^5.9.3"
15
15
  },
16
16
  "gea": {
17
17
  "id": "counter",
package/NOTICE DELETED
@@ -1,4 +0,0 @@
1
- GeaStack cli
2
- Copyright 2026 GeaStack
3
-
4
- Licensed under the Apache License, Version 2.0; see LICENSE.