@geastack/geatsc-plugin-gea 0.1.25 → 0.1.26
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/dist/analyze-nodes.js
CHANGED
|
@@ -4,6 +4,14 @@ export const nodeFeatures = ['node-images', 'node-inputs'];
|
|
|
4
4
|
// Separate marker: an analyzer without it never reports node-videos, and its
|
|
5
5
|
// absence must not let a newer CLI drop the video host from the firmware.
|
|
6
6
|
export const videoNodeAnalysisVersion = 'node-video-analysis-v1';
|
|
7
|
+
const nodeFreeCoreExports = new RegExp('^(?:' + [
|
|
8
|
+
'Component', 'ReactiveComponent', 'Store', 'mount', 'Display', 'rgb', 'rgba',
|
|
9
|
+
'touch', 'Input', 'Accelerometer', 'Magnetometer', 'Geolocation', 'geolocation', 'Clock', 'Battery', 'Memory', 'Profiler',
|
|
10
|
+
'WiFi', 'wifi', 'BLE', 'bluetooth', 'BLEServer', 'registerBleServer', 'initBleServers', 'EspNow', 'Uart', 'Gpio', 'Digital', 'Buttons', 'Led', 'Haptics', 'Notify', 'DeviceControl',
|
|
11
|
+
'Audio', 'audioContext', 'flushAudioWorkletOutput',
|
|
12
|
+
'writeCacheFile', 'readCacheFile', 'removeCacheFile', 'listCacheFiles', 'readFileRange', 'readMapArchive',
|
|
13
|
+
'http', 'fetchBytes', 'fetchText', 'fetchAsync', 'fetchReady', 'fetchResult', 'fetchRelease',
|
|
14
|
+
].join('|') + ')$');
|
|
7
15
|
export function addUnknownNodeFeatures(features) {
|
|
8
16
|
for (const feature of nodeFeatures)
|
|
9
17
|
features.add(feature);
|
|
@@ -45,14 +53,16 @@ export function addNodeFeatures(file, text, features) {
|
|
|
45
53
|
}
|
|
46
54
|
if (ts.isJsxOpeningElement(node) || ts.isJsxSelfClosingElement(node))
|
|
47
55
|
name(node.tagName.getText(source).split(':').at(-1));
|
|
48
|
-
// Display controls the panel/canvas
|
|
49
|
-
//
|
|
56
|
+
// Display controls the panel/canvas, and the device services (sensors,
|
|
57
|
+
// radios, storage, audio, clock) have no DOM surface: importing them cannot
|
|
58
|
+
// create image, input or video nodes. Calls that actually create nodes are
|
|
59
|
+
// still scanned.
|
|
50
60
|
if (ts.isImportDeclaration(node) && ts.isStringLiteral(node.moduleSpecifier) &&
|
|
51
61
|
/^(?:gea-embedded|@geastack\/(?:core|engine)|@geajs\/core)(?:\/|$)/.test(node.moduleSpecifier.text) &&
|
|
52
62
|
node.importClause && !node.importClause.isTypeOnly) {
|
|
53
63
|
const bindings = node.importClause.namedBindings;
|
|
54
64
|
if (node.importClause.name || !bindings || !ts.isNamedImports(bindings) ||
|
|
55
|
-
bindings.elements.some(item => !item.isTypeOnly &&
|
|
65
|
+
bindings.elements.some(item => !item.isTypeOnly && !nodeFreeCoreExports.test((item.propertyName ?? item.name).text)))
|
|
56
66
|
unknown();
|
|
57
67
|
}
|
|
58
68
|
// Mutation/markup helpers can create descendants whose tags are not present
|
|
@@ -948,6 +948,17 @@ function lowerHostFacadeCall(context, path, args) {
|
|
|
948
948
|
// BatteryController — charge percentage from the platform PMU.
|
|
949
949
|
'Battery.level': { target: 'gea::host::Battery.level' },
|
|
950
950
|
'__gea_Battery.level': { target: 'gea::host::Battery.level' },
|
|
951
|
+
// ButtonsController — the board's named physical buttons.
|
|
952
|
+
'Buttons.count': { target: 'gea::host::Buttons.count' },
|
|
953
|
+
'__gea_Buttons.count': { target: 'gea::host::Buttons.count' },
|
|
954
|
+
'Buttons.code': { target: 'gea::host::Buttons.code', hints: ['number'] },
|
|
955
|
+
'__gea_Buttons.code': { target: 'gea::host::Buttons.code', hints: ['number'] },
|
|
956
|
+
'Buttons.key': { target: 'gea::host::Buttons.key', hints: ['number'] },
|
|
957
|
+
'__gea_Buttons.key': { target: 'gea::host::Buttons.key', hints: ['number'] },
|
|
958
|
+
'Buttons.pin': { target: 'gea::host::Buttons.pin', hints: ['number'] },
|
|
959
|
+
'__gea_Buttons.pin': { target: 'gea::host::Buttons.pin', hints: ['number'] },
|
|
960
|
+
'Buttons.pressed': { target: 'gea::host::Buttons.pressed', hints: ['string'] },
|
|
961
|
+
'__gea_Buttons.pressed': { target: 'gea::host::Buttons.pressed', hints: ['string'] },
|
|
951
962
|
// NotifyController — transient host->app notification channel.
|
|
952
963
|
'Notify.text': { target: 'gea::host::Notify.text' },
|
|
953
964
|
'__gea_Notify.text': { target: 'gea::host::Notify.text' },
|
|
@@ -61,7 +61,8 @@ const geaGeolocationHostMethods = [
|
|
|
61
61
|
'clearWatch',
|
|
62
62
|
];
|
|
63
63
|
const geaInputHostMethods = ['consumeBackButton'];
|
|
64
|
-
const geaGpioHostMethods = ['configureOutput', 'configureInput', 'write', 'read'];
|
|
64
|
+
const geaGpioHostMethods = ['configureOutput', 'configureInput', 'write', 'read', 'open', 'get', 'set', 'close'];
|
|
65
|
+
const geaButtonsHostMethods = ['count', 'code', 'key', 'pin', 'pressed'];
|
|
65
66
|
const geaMagnetometerHostMethods = ['open', 'close', 'count', 'read'];
|
|
66
67
|
const geaEspNowHostMethods = ['open', 'isOpen', 'canSend', 'setMaxTxPower', 'getMaxTxPower', 'close', 'addPeer', 'send', 'receive'];
|
|
67
68
|
const geaUartHostMethods = ['open', 'isOpen', 'close', 'read', 'write', 'available', 'writable'];
|
|
@@ -147,6 +148,7 @@ const rawGeaHostExternDeclarations = Object.fromEntries([
|
|
|
147
148
|
...geaMemoryHostMethods.map((method) => [`gea::host::Memory.${method}`, geaHostDeclarations]),
|
|
148
149
|
...geaInputHostMethods.map((method) => [`gea::host::Input.${method}`, geaHostDeclarations]),
|
|
149
150
|
...geaGpioHostMethods.map((method) => [`gea::host::Gpio.${method}`, geaHostDeclarations]),
|
|
151
|
+
...geaButtonsHostMethods.map((method) => [`gea::host::Buttons.${method}`, geaHostDeclarations]),
|
|
150
152
|
...geaMagnetometerHostMethods.map((method) => [`gea::host::Magnetometer.${method}`, geaHostDeclarations]),
|
|
151
153
|
...geaEspNowHostMethods.map((method) => [`gea::host::EspNow.${method}`, geaHostDeclarations]),
|
|
152
154
|
...geaUartHostMethods.map((method) => [`gea::host::Uart.${method}`, geaHostDeclarations]),
|
package/dist/host-shims.js
CHANGED
|
@@ -553,7 +553,8 @@ export function createGeaHostShims() {
|
|
|
553
553
|
Memory: "gea::host::Memory",
|
|
554
554
|
memory: "gea::host::Memory",
|
|
555
555
|
Input: "gea::host::Input",
|
|
556
|
-
Gpio
|
|
556
|
+
// `Gpio` itself is a TS class (core runtime/gpio.ts) over `__gea_Gpio`.
|
|
557
|
+
Buttons: "gea::host::Buttons",
|
|
557
558
|
Led: "gea::host::Led",
|
|
558
559
|
Clock: "gea::host::Clock",
|
|
559
560
|
Haptics: "gea::host::Haptics",
|
|
@@ -570,6 +571,7 @@ export function createGeaHostShims() {
|
|
|
570
571
|
__gea_Memory: "gea::host::Memory",
|
|
571
572
|
__gea_Input: "gea::host::Input",
|
|
572
573
|
__gea_Gpio: "gea::host::Gpio",
|
|
574
|
+
__gea_Buttons: "gea::host::Buttons",
|
|
573
575
|
__gea_EspNow: "gea::host::EspNow",
|
|
574
576
|
__gea_Magnetometer: "gea::host::Magnetometer",
|
|
575
577
|
__gea_Uart: "gea::host::Uart",
|
|
@@ -1307,17 +1309,30 @@ export function createGeaHostShims() {
|
|
|
1307
1309
|
__gea_Input: {
|
|
1308
1310
|
consumeBackButton: "gea::host::Input.consumeBackButton",
|
|
1309
1311
|
},
|
|
1310
|
-
Gpio
|
|
1311
|
-
configureOutput: "gea::host::Gpio.configureOutput",
|
|
1312
|
-
configureInput: "gea::host::Gpio.configureInput",
|
|
1313
|
-
write: "gea::host::Gpio.write",
|
|
1314
|
-
read: "gea::host::Gpio.read",
|
|
1315
|
-
},
|
|
1312
|
+
// The one backend under the `Gpio` and ECMA-419 `Digital` classes.
|
|
1316
1313
|
__gea_Gpio: {
|
|
1317
1314
|
configureOutput: "gea::host::Gpio.configureOutput",
|
|
1318
1315
|
configureInput: "gea::host::Gpio.configureInput",
|
|
1319
1316
|
write: "gea::host::Gpio.write",
|
|
1320
1317
|
read: "gea::host::Gpio.read",
|
|
1318
|
+
open: "gea::host::Gpio.open",
|
|
1319
|
+
get: "gea::host::Gpio.get",
|
|
1320
|
+
set: "gea::host::Gpio.set",
|
|
1321
|
+
close: "gea::host::Gpio.close",
|
|
1322
|
+
},
|
|
1323
|
+
Buttons: {
|
|
1324
|
+
count: "gea::host::Buttons.count",
|
|
1325
|
+
code: "gea::host::Buttons.code",
|
|
1326
|
+
key: "gea::host::Buttons.key",
|
|
1327
|
+
pin: "gea::host::Buttons.pin",
|
|
1328
|
+
pressed: "gea::host::Buttons.pressed",
|
|
1329
|
+
},
|
|
1330
|
+
__gea_Buttons: {
|
|
1331
|
+
count: "gea::host::Buttons.count",
|
|
1332
|
+
code: "gea::host::Buttons.code",
|
|
1333
|
+
key: "gea::host::Buttons.key",
|
|
1334
|
+
pin: "gea::host::Buttons.pin",
|
|
1335
|
+
pressed: "gea::host::Buttons.pressed",
|
|
1321
1336
|
},
|
|
1322
1337
|
__gea_Magnetometer: {
|
|
1323
1338
|
open: "gea::host::Magnetometer.open",
|
|
@@ -1423,8 +1438,10 @@ export function createGeaHostShims() {
|
|
|
1423
1438
|
__gea_Memory: MEMORY_NO_THROW_METHODS,
|
|
1424
1439
|
Input: ["consumeBackButton"],
|
|
1425
1440
|
__gea_Input: ["consumeBackButton"],
|
|
1426
|
-
|
|
1427
|
-
__gea_Gpio: ["configureOutput", "configureInput", "write", "read"],
|
|
1441
|
+
// open() stores its callback; it runs later, from Application::frame.
|
|
1442
|
+
__gea_Gpio: ["configureOutput", "configureInput", "write", "read", "open", "get", "set", "close"],
|
|
1443
|
+
Buttons: ["count", "code", "key", "pin", "pressed"],
|
|
1444
|
+
__gea_Buttons: ["count", "code", "key", "pin", "pressed"],
|
|
1428
1445
|
__gea_EspNow: ["open", "isOpen", "canSend", "setMaxTxPower", "getMaxTxPower", "close"],
|
|
1429
1446
|
__gea_Magnetometer: ["open", "close", "count"],
|
|
1430
1447
|
__gea_Uart: ["open", "isOpen", "close", "available", "writable"],
|