@typecad/cuttlefish 0.1.0-alpha.2 → 1.0.0-alpha.10
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/README.md +10 -10
- package/dist/api/board-types.d.ts +1 -1
- package/dist/api/config.d.ts +32 -0
- package/dist/api/index.d.ts +1 -1
- package/dist/api/schema/types.d.ts +15 -0
- package/dist/api/shared/async-runtime-static.d.ts +12 -1
- package/dist/api/shared/async-runtime-static.js +69 -24
- package/dist/api/shared/async-symbol-detector.d.ts +11 -0
- package/dist/api/shared/async-symbol-detector.js +140 -0
- package/dist/api/shared/async-types.d.ts +24 -0
- package/dist/api/shared/coop-scheduler.d.ts +60 -0
- package/dist/api/shared/coop-scheduler.js +149 -0
- package/dist/api/shared/display-adapter.d.ts +4 -3
- package/dist/api/shared/display-adapter.js +15 -118
- package/dist/api/shared/display-adapters/sdl.js +38 -31
- package/dist/api/shared/display-profile.d.ts +47 -25
- package/dist/api/shared/display-profile.js +31 -164
- package/dist/api/shared/framework-manifest-registry.d.ts +9 -0
- package/dist/api/shared/framework-manifest-registry.js +27 -0
- package/dist/api/shared/framework-manifest.d.ts +595 -0
- package/dist/api/shared/framework-manifest.js +193 -0
- package/dist/api/shared/glcdfont.d.ts +12 -0
- package/dist/api/shared/glcdfont.js +124 -0
- package/dist/api/shared/graphics-strategy.d.ts +37 -0
- package/dist/api/shared/hal-op-ir.d.ts +764 -1
- package/dist/api/shared/hal-op-ir.js +129 -1
- package/dist/api/shared/index.d.ts +20 -2
- package/dist/api/shared/index.js +25 -1
- package/dist/api/shared/ir-core.d.ts +4 -0
- package/dist/api/shared/ir-declarations.d.ts +6 -0
- package/dist/api/shared/native-display-op-resolver.d.ts +10 -0
- package/dist/api/shared/native-display-op-resolver.js +64 -0
- package/dist/api/shared/platform-strategy.d.ts +119 -2
- package/dist/api/shared/polyfill-helper-registry.js +18 -1
- package/dist/api/shared/promise-runtime.d.ts +1 -1
- package/dist/api/shared/promise-runtime.js +95 -13
- package/dist/api/shared/toolchain-types.d.ts +17 -0
- package/dist/api/shared/types.d.ts +8 -0
- package/dist/api/shared/validate-framework-manifest.d.ts +28 -0
- package/dist/api/shared/validate-framework-manifest.js +494 -0
- package/dist/api/shared/worker-runtime-polyfill.d.ts +22 -0
- package/dist/api/shared/worker-runtime-polyfill.js +34 -0
- package/dist/api/shared/worker-runtime.d.ts +69 -0
- package/dist/api/shared/worker-runtime.js +163 -0
- package/dist/cli-utils.d.ts +1 -0
- package/dist/cli-utils.js +3 -1
- package/dist/cli.js +249 -32
- package/dist/config-loader.d.ts +7 -2
- package/dist/config-loader.js +23 -3
- package/dist/config-schema.d.ts +112 -70
- package/dist/config-schema.js +14 -0
- package/dist/contract/board-generator.d.ts +17 -0
- package/dist/contract/board-generator.js +57 -0
- package/dist/contract/contract-parser.d.ts +217 -0
- package/dist/contract/contract-parser.js +224 -0
- package/dist/contract/index.d.ts +22 -0
- package/dist/contract/index.js +68 -0
- package/dist/create/board-codegen.js +4 -4
- package/dist/create/board-generators.js +4 -5
- package/dist/create/board-spec.d.ts +72 -75
- package/dist/create/board-spec.js +0 -1
- package/dist/create/framework-catalog.d.ts +64 -0
- package/dist/create/framework-catalog.js +136 -0
- package/dist/create/index.d.ts +5 -1
- package/dist/create/index.js +3 -1
- package/dist/create/init-scaffold.d.ts +12 -3
- package/dist/create/init-scaffold.js +49 -14
- package/dist/create/init-templates.d.ts +4 -0
- package/dist/create/init-templates.js +263 -17
- package/dist/create/init-wizard.js +41 -27
- package/dist/create/install-deps.d.ts +32 -0
- package/dist/create/install-deps.js +46 -0
- package/dist/debug/preprocessor.js +178 -39
- package/dist/debug/types.d.ts +23 -0
- package/dist/diagnostics/mermaid-builder.d.ts +1 -1
- package/dist/diagnostics/mermaid-builder.js +34 -24
- package/dist/emit/compliance/arxml-writer.d.ts +11 -0
- package/dist/emit/compliance/arxml-writer.js +34 -0
- package/dist/emit/compliance/compliance-context.d.ts +57 -0
- package/dist/emit/compliance/compliance-context.js +113 -0
- package/dist/emit/compliance/deviation-ledger.d.ts +27 -0
- package/dist/emit/compliance/deviation-ledger.js +47 -0
- package/dist/emit/compliance/deviation-writer.d.ts +30 -0
- package/dist/emit/compliance/deviation-writer.js +37 -0
- package/dist/emit/compliance/index.d.ts +7 -0
- package/dist/emit/compliance/index.js +6 -0
- package/dist/emit/compliance/rule-engine.d.ts +13 -0
- package/dist/emit/compliance/rule-engine.js +101 -0
- package/dist/emit/compliance/rules.d.ts +16 -0
- package/dist/emit/compliance/rules.js +191 -0
- package/dist/emit/compliance/types.d.ts +59 -0
- package/dist/emit/compliance/types.js +8 -0
- package/dist/emit/cpp-emitter.js +4 -3
- package/dist/emit/emitters/class-emitter.js +6 -1
- package/dist/emit/emitters/emitter-context.d.ts +28 -1
- package/dist/emit/emitters/function-emitter-impl.js +153 -53
- package/dist/emit/emitters/line-appender.js +19 -0
- package/dist/emit/emitters/line-marker.d.ts +38 -0
- package/dist/emit/emitters/line-marker.js +39 -0
- package/dist/emit/emitters/output-finalizer.d.ts +6 -0
- package/dist/emit/emitters/output-finalizer.js +101 -12
- package/dist/emit/emitters/setup.d.ts +17 -0
- package/dist/emit/emitters/setup.js +372 -30
- package/dist/emit/emitters/top-level-prep.js +8 -0
- package/dist/emit/emitters/type-decl-emitter.js +28 -3
- package/dist/emit/emitters/ui-emitter.js +33 -9
- package/dist/emit/expression-renderer.d.ts +1 -1
- package/dist/emit/expression-renderer.js +91 -6
- package/dist/emit/route-hal-op.js +18 -5
- package/dist/emit/snprintf-helpers.js +15 -4
- package/dist/emit/statement-renderer.d.ts +10 -0
- package/dist/emit/statement-renderer.js +34 -5
- package/dist/emit/utils/async-state-machine.js +221 -125
- package/dist/emit/utils/hal-op-cpp-type.d.ts +6 -0
- package/dist/emit/utils/hal-op-cpp-type.js +40 -0
- package/dist/framework-package.js +2 -0
- package/dist/framework-registry.d.ts +17 -0
- package/dist/install/framework-catalog.d.ts +53 -0
- package/dist/install/framework-catalog.js +107 -0
- package/dist/install/handle-install.d.ts +35 -0
- package/dist/install/handle-install.js +177 -0
- package/dist/install/index.d.ts +4 -0
- package/dist/install/index.js +3 -0
- package/dist/ir/adc-range-validation.js +40 -26
- package/dist/ir/build-ir-state.d.ts +1 -0
- package/dist/ir/build-ir-state.js +14 -0
- package/dist/ir/build-ir.js +9 -5
- package/dist/ir/call-graph.js +16 -0
- package/dist/ir/expression-to-ir.js +207 -6
- package/dist/ir/feature-registry.js +7 -25
- package/dist/ir/function-builder.js +22 -0
- package/dist/ir/hal/hal-emitter.d.ts +5 -2
- package/dist/ir/hal/hal-emitter.js +50 -18
- package/dist/ir/hal/hal-parser.d.ts +6 -0
- package/dist/ir/hal/hal-parser.js +81 -0
- package/dist/ir/hal/hal-plugins.js +733 -1
- package/dist/ir/identifier-collector.js +35 -0
- package/dist/ir/interrupt-analysis.d.ts +5 -1
- package/dist/ir/interrupt-analysis.js +16 -19
- package/dist/ir/memory-budget-validation.js +1 -0
- package/dist/ir/network-validation.d.ts +4 -0
- package/dist/ir/network-validation.js +184 -0
- package/dist/ir/ownership-analysis.js +39 -1
- package/dist/ir/peripheral-ownership.js +5 -0
- package/dist/ir/peripheral-validation.d.ts +1 -1
- package/dist/ir/peripheral-validation.js +6 -3
- package/dist/ir/pin-alias-conflict.d.ts +1 -1
- package/dist/ir/pin-alias-conflict.js +2 -1
- package/dist/ir/pin-capability-validation.js +71 -32
- package/dist/ir/pin-mode-validation.d.ts +2 -2
- package/dist/ir/pin-mode-validation.js +54 -18
- package/dist/ir/pin-safety.d.ts +1 -1
- package/dist/ir/pin-safety.js +2 -1
- package/dist/ir/program-analysis.d.ts +81 -0
- package/dist/ir/program-analysis.js +429 -0
- package/dist/ir/pulldown-validation.d.ts +1 -1
- package/dist/ir/pulldown-validation.js +2 -1
- package/dist/ir/pwm-timer-sharing.d.ts +1 -1
- package/dist/ir/pwm-timer-sharing.js +2 -1
- package/dist/ir/render-expr.js +11 -0
- package/dist/ir/resource-analysis.js +2 -0
- package/dist/ir/timer0-pwm-timing-conflict.d.ts +1 -1
- package/dist/ir/timer0-pwm-timing-conflict.js +2 -1
- package/dist/ir/timing-validation.d.ts +6 -1
- package/dist/ir/timing-validation.js +61 -13
- package/dist/ir/transformers/call-statement.js +105 -0
- package/dist/ir/transformers/expressions.js +62 -0
- package/dist/ir/transformers/hal-call-resolver.js +21 -0
- package/dist/ir/transformers/hal-emit-helpers.js +1 -1
- package/dist/ir/transformers/namespace-methods.js +17 -12
- package/dist/ir/transformers/ui-reactive.js +2 -2
- package/dist/ir/transformers/variables.js +137 -19
- package/dist/ir/try-catch-validation.js +2 -0
- package/dist/ir/type-resolution.js +20 -2
- package/dist/ir/ui-element-auto-wire.js +7 -5
- package/dist/ir/unit-suspicion-validation.js +9 -7
- package/dist/ir/utils/map-statements.d.ts +4 -0
- package/dist/ir/utils/map-statements.js +79 -0
- package/dist/ir/validation-orchestrator.js +15 -8
- package/dist/ir/worker-analysis.d.ts +10 -0
- package/dist/ir/worker-analysis.js +261 -0
- package/dist/libdef/c-to-decl.d.ts +27 -0
- package/dist/libdef/c-to-decl.js +397 -0
- package/dist/libdef/component-decls.d.ts +2 -0
- package/dist/libdef/component-decls.js +6 -0
- package/dist/libdef/component-discovery.d.ts +43 -0
- package/dist/libdef/component-discovery.js +83 -0
- package/dist/libdef/cpp-to-decl.d.ts +9 -0
- package/dist/libdef/cpp-to-decl.js +72 -0
- package/dist/libdef/registry.js +5 -2
- package/dist/lint-cache.d.ts +59 -0
- package/dist/lint-cache.js +257 -0
- package/dist/orchestrator/graph-builder.js +14 -9
- package/dist/platform/coop-scheduler-runtime.d.ts +19 -0
- package/dist/platform/coop-scheduler-runtime.js +41 -0
- package/dist/platform/generic-strategy.d.ts +15 -3
- package/dist/platform/generic-strategy.js +49 -4
- package/dist/safety/safety-bridge.d.ts +11 -0
- package/dist/safety/safety-bridge.js +48 -0
- package/dist/safety/sidecar-bridge.d.ts +5 -0
- package/dist/safety/sidecar-bridge.js +22 -0
- package/dist/safety-hook.d.ts +79 -0
- package/dist/safety-hook.js +35 -0
- package/dist/testing.d.ts +8 -2
- package/dist/testing.js +9 -2
- package/dist/transpile.d.ts +3 -0
- package/dist/transpile.js +191 -49
- package/dist/types.d.ts +22 -3
- package/dist/ui-hook.d.ts +17 -3
- package/dist/utils/cli.js +122 -2
- package/dist/utils/fs.d.ts +13 -0
- package/dist/utils/fs.js +50 -0
- package/dist/utils/ui.js +3 -1
- package/package.json +23 -3
- package/dist/api/shared/display-adapters/eink-mono.d.ts +0 -2
- package/dist/api/shared/display-adapters/eink-mono.js +0 -53
- package/dist/api/shared/display-adapters/ssd1309.d.ts +0 -2
- package/dist/api/shared/display-adapters/ssd1309.js +0 -136
- package/dist/api/shared/display-adapters/st7796.d.ts +0 -2
- package/dist/api/shared/display-adapters/st7796.js +0 -132
- package/dist/ir/heap-array-validation.d.ts +0 -24
- package/dist/ir/heap-array-validation.js +0 -29
|
@@ -20,7 +20,11 @@
|
|
|
20
20
|
* @param includeWaitForPinEdge Whether to include the `waitForPinEdge` stub
|
|
21
21
|
* (used by Arduino targets).
|
|
22
22
|
*/
|
|
23
|
-
export function generatePromiseRuntime(queueCapacity, includeWaitForPinEdge = false) {
|
|
23
|
+
export function generatePromiseRuntime(queueCapacity, includeWaitForPinEdge = false, strategy) {
|
|
24
|
+
// The current-time expression (millis() on Wiring-derived frameworks,
|
|
25
|
+
// std::chrono on generic). Falling back to millis() preserves the historical
|
|
26
|
+
// behavior when no strategy is supplied.
|
|
27
|
+
const now = strategy?.currentTimeMillis?.() ?? "millis()";
|
|
24
28
|
const waitForPinEdge = includeWaitForPinEdge ? `
|
|
25
29
|
// HAL-level wait for pin edge — polling-based implementation.
|
|
26
30
|
// Detects an actual transition (idle→target), not just the current level.
|
|
@@ -31,18 +35,18 @@ export function generatePromiseRuntime(queueCapacity, includeWaitForPinEdge = fa
|
|
|
31
35
|
return Promise<void>([pin, mode, timeout](std::function<void(const void*)> resolve, std::function<void(const std::string&)> reject) {
|
|
32
36
|
int targetState = (mode == RISING) ? HIGH : LOW;
|
|
33
37
|
int idleState = (mode == RISING) ? LOW : HIGH;
|
|
34
|
-
unsigned long start =
|
|
38
|
+
unsigned long start = ${now};
|
|
35
39
|
// Phase 2 poller: waits for the pin to reach the target state (the edge).
|
|
36
40
|
auto pollTarget = [pin, targetState, timeout, start, resolve]() {
|
|
37
|
-
if (digitalRead(pin) == targetState) {
|
|
41
|
+
if (${strategy?.readDigitalPin?.("pin") ?? "digitalRead(pin)"} == targetState) {
|
|
38
42
|
resolve(nullptr);
|
|
39
|
-
} else if (timeout >= 0 && (
|
|
43
|
+
} else if (timeout >= 0 && (${now} - start >= static_cast<unsigned long>(timeout))) {
|
|
40
44
|
resolve(nullptr);
|
|
41
45
|
} else {
|
|
42
46
|
enqueueMicrotask([pin, targetState, timeout, start, resolve]() {
|
|
43
|
-
if (digitalRead(pin) == targetState) {
|
|
47
|
+
if (${strategy?.readDigitalPin?.("pin") ?? "digitalRead(pin)"} == targetState) {
|
|
44
48
|
resolve(nullptr);
|
|
45
|
-
} else if (timeout >= 0 && (
|
|
49
|
+
} else if (timeout >= 0 && (${now} - start >= static_cast<unsigned long>(timeout))) {
|
|
46
50
|
resolve(nullptr);
|
|
47
51
|
} else {
|
|
48
52
|
enqueueMicrotask([pin, targetState, timeout, start, resolve]() {});
|
|
@@ -52,9 +56,9 @@ export function generatePromiseRuntime(queueCapacity, includeWaitForPinEdge = fa
|
|
|
52
56
|
};
|
|
53
57
|
// Phase 1: wait for idle state before watching for the edge.
|
|
54
58
|
enqueueMicrotask([pin, idleState, timeout, start, resolve, pollTarget]() {
|
|
55
|
-
if (digitalRead(pin) == idleState) {
|
|
59
|
+
if (${strategy?.readDigitalPin?.("pin") ?? "digitalRead(pin)"} == idleState) {
|
|
56
60
|
pollTarget();
|
|
57
|
-
} else if (timeout >= 0 && (
|
|
61
|
+
} else if (timeout >= 0 && (${now} - start >= static_cast<unsigned long>(timeout))) {
|
|
58
62
|
resolve(nullptr);
|
|
59
63
|
} else {
|
|
60
64
|
enqueueMicrotask([pin, idleState, timeout, start, resolve, pollTarget]() {});
|
|
@@ -181,17 +185,95 @@ namespace typecad_async {
|
|
|
181
185
|
std::vector<std::function<void(const std::string&)>> _onRejected;
|
|
182
186
|
};
|
|
183
187
|
|
|
188
|
+
// Promise<void> — T=_value/const T& is illegal for void. Helpers below pass
|
|
189
|
+
// resolve as std::function<void(const void*)> (pointer, not reference).
|
|
190
|
+
template <>
|
|
191
|
+
class Promise<void> {
|
|
192
|
+
public:
|
|
193
|
+
enum class State { Pending, Fulfilled, Rejected };
|
|
194
|
+
|
|
195
|
+
using ResolveFn = std::function<void(const void*)>;
|
|
196
|
+
using RejectFn = std::function<void(const std::string&)>;
|
|
197
|
+
using Executor = std::function<void(ResolveFn, RejectFn)>;
|
|
198
|
+
|
|
199
|
+
Promise() : _state(State::Pending), _error{} {}
|
|
200
|
+
|
|
201
|
+
explicit Promise(Executor executor)
|
|
202
|
+
: _state(State::Pending), _error{} {
|
|
203
|
+
executor(
|
|
204
|
+
[this](const void*) { this->resolve(nullptr); },
|
|
205
|
+
[this](const std::string& error) { this->reject(error); }
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
static Promise<void> resolveValue() {
|
|
210
|
+
Promise<void> promise;
|
|
211
|
+
promise.resolve(nullptr);
|
|
212
|
+
return promise;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
static Promise<void> rejectValue(const std::string& error) {
|
|
216
|
+
Promise<void> promise;
|
|
217
|
+
promise.reject(error);
|
|
218
|
+
return promise;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
void resolve(const void* = nullptr) {
|
|
222
|
+
if (_state != State::Pending) return;
|
|
223
|
+
_state = State::Fulfilled;
|
|
224
|
+
auto callbacks = _onFulfilled;
|
|
225
|
+
enqueueMicrotask([callbacks]() mutable {
|
|
226
|
+
for (auto& callback : callbacks) { callback(nullptr); }
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
void reject(const std::string& error) {
|
|
231
|
+
if (_state != State::Pending) return;
|
|
232
|
+
_state = State::Rejected;
|
|
233
|
+
_error = error;
|
|
234
|
+
auto callbacks = _onRejected;
|
|
235
|
+
enqueueMicrotask([callbacks, error]() mutable {
|
|
236
|
+
for (auto& callback : callbacks) { callback(error); }
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
Promise<void>& then(std::function<void(const void*)> onFulfilled) {
|
|
241
|
+
if (_state == State::Fulfilled) {
|
|
242
|
+
enqueueMicrotask([onFulfilled]() mutable { onFulfilled(nullptr); });
|
|
243
|
+
} else if (_state == State::Pending) {
|
|
244
|
+
_onFulfilled.push_back(std::move(onFulfilled));
|
|
245
|
+
}
|
|
246
|
+
return *this;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
Promise<void>& catchError(std::function<void(const std::string&)> onRejected) {
|
|
250
|
+
if (_state == State::Rejected) {
|
|
251
|
+
const std::string error = _error;
|
|
252
|
+
enqueueMicrotask([onRejected, error]() mutable { onRejected(error); });
|
|
253
|
+
} else if (_state == State::Pending) {
|
|
254
|
+
_onRejected.push_back(std::move(onRejected));
|
|
255
|
+
}
|
|
256
|
+
return *this;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
private:
|
|
260
|
+
State _state;
|
|
261
|
+
std::string _error;
|
|
262
|
+
std::vector<std::function<void(const void*)>> _onFulfilled;
|
|
263
|
+
std::vector<std::function<void(const std::string&)>> _onRejected;
|
|
264
|
+
};
|
|
265
|
+
|
|
184
266
|
// ── HAL-level implementations (inside namespace so they see Promise<T> and enqueueMicrotask) ──
|
|
185
267
|
|
|
186
268
|
// Async.sleep() — cooperative delay using millis polling
|
|
187
269
|
inline Promise<void> __cuttlefish_async_sleep(unsigned long ms) {
|
|
188
270
|
return Promise<void>([ms](std::function<void(const void*)> resolve, std::function<void(const std::string&)> reject) {
|
|
189
|
-
unsigned long start =
|
|
190
|
-
if (
|
|
271
|
+
unsigned long start = ${now};
|
|
272
|
+
if (${now} - start >= ms) {
|
|
191
273
|
resolve(nullptr);
|
|
192
274
|
} else {
|
|
193
275
|
enqueueMicrotask([ms, start, resolve]() {
|
|
194
|
-
if (
|
|
276
|
+
if (${now} - start >= ms) {
|
|
195
277
|
resolve(nullptr);
|
|
196
278
|
} else {
|
|
197
279
|
enqueueMicrotask([ms, start, resolve]() { /* will be re-checked next cycle */ });
|
|
@@ -211,9 +293,9 @@ namespace typecad_async {
|
|
|
211
293
|
// Async.sleepUntil() — poll condition every interval ms
|
|
212
294
|
inline Promise<void> __cuttlefish_async_sleep_until(unsigned long pollIntervalMs) {
|
|
213
295
|
return Promise<void>([pollIntervalMs](std::function<void(const void*)> resolve, std::function<void(const std::string&)> reject) {
|
|
214
|
-
unsigned long start =
|
|
296
|
+
unsigned long start = ${now};
|
|
215
297
|
enqueueMicrotask([pollIntervalMs, start, resolve]() {
|
|
216
|
-
if (
|
|
298
|
+
if (${now} - start >= pollIntervalMs) {
|
|
217
299
|
resolve(nullptr); // caller re-checks condition
|
|
218
300
|
} else {
|
|
219
301
|
enqueueMicrotask([pollIntervalMs, start, resolve]() { /* re-check next cycle */ });
|
|
@@ -31,11 +31,28 @@ export interface ToolchainOptions {
|
|
|
31
31
|
optimize?: string;
|
|
32
32
|
extraFlags?: string[];
|
|
33
33
|
defines?: Record<string, string>;
|
|
34
|
+
/** ESP32 PSRAM type ('opi' | 'quad') when the target board has PSRAM. */
|
|
35
|
+
psram?: 'opi' | 'quad';
|
|
34
36
|
/**
|
|
35
37
|
* Framework-specific config from `cuttlefish.config.ts`.
|
|
36
38
|
* Each framework casts this to its own typed interface.
|
|
37
39
|
*/
|
|
38
40
|
frameworkConfig?: Record<string, unknown>;
|
|
41
|
+
/**
|
|
42
|
+
* Zephyr-specific config from `cuttlefish.config.ts` (the `zephyr` section).
|
|
43
|
+
*/
|
|
44
|
+
zephyrConfig?: Record<string, unknown>;
|
|
45
|
+
/**
|
|
46
|
+
* Display config from `cuttlefish.config.ts` (the `display` section).
|
|
47
|
+
* Frameworks use cs/dc/rst/spiFrequency to generate devicetree wiring.
|
|
48
|
+
*/
|
|
49
|
+
display?: Record<string, unknown>;
|
|
50
|
+
/**
|
|
51
|
+
* True when `--debug` is active. Frameworks read this to generate debug
|
|
52
|
+
* artifacts (e.g. VS Code launch configs, debug Kconfig symbols) and to
|
|
53
|
+
* select their debug mode (gdb vs printf) via PlatformDebugStrategy.
|
|
54
|
+
*/
|
|
55
|
+
debug?: boolean;
|
|
39
56
|
}
|
|
40
57
|
/**
|
|
41
58
|
* Generic compile result. All frameworks return this shape.
|
|
@@ -26,6 +26,14 @@ export interface Diagnostic {
|
|
|
26
26
|
column?: number;
|
|
27
27
|
code?: string;
|
|
28
28
|
source?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Path (or basename) of the source file the diagnostic refers to. When set,
|
|
31
|
+
* it is rendered in the diagnostic header so the location is not just
|
|
32
|
+
* `(line,col)` but `path/to/file.ts (line,col)`. Emitters should prefer the
|
|
33
|
+
* real file path from the originating node's sourceSpan, falling back to a
|
|
34
|
+
* basename when the full path is unavailable.
|
|
35
|
+
*/
|
|
36
|
+
filePath?: string;
|
|
29
37
|
/** Text of the source line for display context. */
|
|
30
38
|
sourceLine?: string;
|
|
31
39
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { PlatformStrategy } from './platform-strategy.js';
|
|
2
|
+
import type { FrameworkToolchain } from '../../framework-registry.js';
|
|
3
|
+
import type { FrameworkManifest } from './framework-manifest.js';
|
|
4
|
+
export interface ManifestValidationContext {
|
|
5
|
+
strategy: PlatformStrategy;
|
|
6
|
+
toolchain?: FrameworkToolchain;
|
|
7
|
+
moduleExports: Record<string, unknown>;
|
|
8
|
+
packageRoot: string;
|
|
9
|
+
repoTestsDir: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ManifestValidationError {
|
|
12
|
+
code: string;
|
|
13
|
+
path: string;
|
|
14
|
+
message: string;
|
|
15
|
+
subject?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ManifestValidationWarning {
|
|
18
|
+
code: string;
|
|
19
|
+
path: string;
|
|
20
|
+
message: string;
|
|
21
|
+
subject?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ManifestValidationResult {
|
|
24
|
+
valid: boolean;
|
|
25
|
+
errors: ManifestValidationError[];
|
|
26
|
+
warnings: ManifestValidationWarning[];
|
|
27
|
+
}
|
|
28
|
+
export declare function validateFrameworkManifest(manifest: FrameworkManifest, ctx: ManifestValidationContext): ManifestValidationResult;
|