@typecad/cuttlefish 0.1.0-alpha.1 → 1.0.0-alpha.3

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 CHANGED
@@ -3,7 +3,7 @@
3
3
  TypeScript → C++ transpiler for embedded firmware. Targets native (desktop),
4
4
  Arduino, and bare-metal MCU builds from a single TypeScript codebase.
5
5
 
6
- `cuttlefish` is the command-line tool at the center of the [TypeCAD](https://github.com/justind000/typecode)
6
+ `cuttlefish` is the command-line tool at the center of the [TypeCAD](https://cuttlefish.typecad.net)
7
7
  toolchain: it loads `cuttlefish.config.ts`, transpiles TypeScript firmware to
8
8
  C++, and can chain compile, upload, and serial-monitor steps.
9
9
 
@@ -67,11 +67,11 @@ export default config;
67
67
 
68
68
  `@typecad/cuttlefish` is the transpiler core. It pairs with sibling packages:
69
69
 
70
- - [`@typecad/hal`](https://github.com/justind000/typecode/tree/main/packages/hal) — hardware abstraction (GPIO, I2C, SPI, UART) as regular TypeScript.
71
- - [`@typecad/ui`](https://github.com/justind000/typecode/tree/main/packages/ui) — HTML/CSS-driven graphics for microcontroller displays.
72
- - [`@typecad/expect`](https://github.com/justind000/typecode/tree/main/packages/expect) — hardware test framework (vitest-style assertions over serial).
73
- - [`@typecad/framework-arduino`](https://github.com/justind000/typecode/tree/main/packages/framework-arduino) — Arduino framework code-gen strategy.
74
- - [`@typecad/framework-native`](https://github.com/justind000/typecode/tree/main/packages/framework-native) — native desktop C++ code-gen strategy.
70
+ - [`@typecad/hal`](https://cuttlefish.typecad.net) — hardware abstraction (GPIO, I2C, SPI, UART) as regular TypeScript.
71
+ - [`@typecad/ui`](https://cuttlefish.typecad.net) — HTML/CSS-driven graphics for microcontroller displays.
72
+ - [`@typecad/expect`](https://cuttlefish.typecad.net) — hardware test framework (vitest-style assertions over serial).
73
+ - [`@typecad/framework-arduino`](https://cuttlefish.typecad.net) — Arduino framework code-gen strategy.
74
+ - [`@typecad/framework-native`](https://cuttlefish.typecad.net) — native desktop C++ code-gen strategy.
75
75
  - `@typecad/mcu-*` and `@typecad/board-*` — silicon- and board-level pin/peripheral definitions.
76
76
 
77
77
  ## License
@@ -1 +1 @@
1
- export type ArchitectureIdentifier = 'avr' | 'esp32' | 'esp32s2' | 'esp32s3' | 'esp32c3' | 'esp32c6' | 'rp2040' | 'samd' | 'stm32' | 'nrf52' | (string & {});
1
+ export type ArchitectureIdentifier = 'avr' | 'esp32' | 'esp32s2' | 'esp32s3' | 'esp32c3' | 'esp32c6' | 'rp2040' | 'rp2350' | 'samd' | 'stm32' | 'nrf52' | (string & {});
@@ -8,6 +8,12 @@ import type { PlatformGraphicsStrategy } from './graphics-strategy.js';
8
8
  export interface PlatformProfileStrategy {
9
9
  /** System #include headers forced at the top of every emitted file. */
10
10
  forcedIncludes(program: ProgramIR, ctx?: PlatformContext): string[];
11
+ /**
12
+ * Filter the HAL-discovered required includes (from __includes metadata).
13
+ * Frameworks that provide native peripheral drivers can strip stale Arduino
14
+ * library includes here. Defaults to returning the includes unchanged.
15
+ */
16
+ filterRequiredIncludes?(includes: string[]): string[];
11
17
  /** Symbol aliases (TypeScript name → C++ name). */
12
18
  symbolAliases(program: ProgramIR, ctx?: PlatformContext): Record<string, string>;
13
19
  /** Extra shim lines emitted after includes (e.g. #define fallbacks). */
package/dist/cli.js CHANGED
@@ -12,7 +12,7 @@ import { resolveStrategy } from "./platform/registry.js";
12
12
  import { loadFrameworkPackage } from "./framework-package.js";
13
13
  import { getLoadedFramework, hasLoadedFramework } from "./framework-registry.js";
14
14
  import { loadCuttlefishConfig, generateVirtualTypeDeclaration } from "./config-loader.js";
15
- import { requireUIHook } from "./ui-hook.js";
15
+ import { requireUIHook, hasUIHook } from "./ui-hook.js";
16
16
  import { loadUIEngine } from "./ui/ui-bridge.js";
17
17
  import { runWatch, discoverWatchDirs } from "./watch.js";
18
18
  import { runExpectTests, assertTypeScriptInput, printDiagnostics, printMappedCompileErrors } from "./cli-utils.js";
@@ -321,7 +321,11 @@ async function main() {
321
321
  // Strategy not yet loaded — env.d.ts will have generic declarations only
322
322
  }
323
323
  generateVirtualTypeDeclaration(config, platformDeclarations);
324
- requireUIHook().generateProjectUITypeDeclarations(path.dirname(config.configPath));
324
+ // @typecad/ui is optional — skip UI type-decl generation when the engine
325
+ // is not loaded (no UI modules exist to declare).
326
+ if (hasUIHook()) {
327
+ requireUIHook().generateProjectUITypeDeclarations(path.dirname(config.configPath));
328
+ }
325
329
  }
326
330
  // Print branded header and build info
327
331
  ui.printHeader();
@@ -357,6 +361,9 @@ async function main() {
357
361
  });
358
362
  printDiagnostics(result.diagnostics);
359
363
  ui.printTasks(result.asyncTaskNames ?? [], result.usesTimers ?? false);
364
+ if (result.diagnosticsReportPath) {
365
+ ui.printInfo(`Diagnostics report: ${result.diagnosticsReportPath}`);
366
+ }
360
367
  if (result.diagnostics.length === 0) {
361
368
  ui.printSuccess();
362
369
  initialBuildOk = true;
@@ -421,7 +428,11 @@ async function main() {
421
428
  console.log();
422
429
  try {
423
430
  if (config) {
424
- requireUIHook().generateProjectUITypeDeclarations(path.dirname(config.configPath));
431
+ // @typecad/ui is optional — skip UI type-decl generation when the
432
+ // engine is not loaded (no UI modules exist to declare).
433
+ if (hasUIHook()) {
434
+ requireUIHook().generateProjectUITypeDeclarations(path.dirname(config.configPath));
435
+ }
425
436
  }
426
437
  ui.printTranspiling();
427
438
  const rebuildResult = await transpileFile({
@@ -443,6 +454,9 @@ async function main() {
443
454
  });
444
455
  printDiagnostics(rebuildResult.diagnostics);
445
456
  ui.printTasks(rebuildResult.asyncTaskNames ?? [], rebuildResult.usesTimers ?? false);
457
+ if (rebuildResult.diagnosticsReportPath) {
458
+ ui.printInfo(`Diagnostics report: ${rebuildResult.diagnosticsReportPath}`);
459
+ }
446
460
  if (rebuildResult.diagnostics.length > 0) {
447
461
  // Errors shown via printDiagnostics — skip compile/upload
448
462
  }
@@ -527,6 +541,9 @@ async function main() {
527
541
  });
528
542
  printDiagnostics(result.diagnostics);
529
543
  ui.printTasks(result.asyncTaskNames ?? [], result.usesTimers ?? false);
544
+ if (result.diagnosticsReportPath) {
545
+ ui.printInfo(`Diagnostics report: ${result.diagnosticsReportPath}`);
546
+ }
530
547
  }
531
548
  if (hasFatalDiagnostics(result)) {
532
549
  ui.printError("Transpilation failed. Fix the transpiler diagnostics above before compiling.");
@@ -66,6 +66,28 @@ const _knownTargets = [
66
66
  buildTarget: 'esp32:esp32:esp32c6',
67
67
  mcu: 'esp32c6',
68
68
  },
69
+ {
70
+ id: 'rp2040',
71
+ displayName: 'RP2040 (Pico)',
72
+ isNative: false,
73
+ architecture: 'rp2040',
74
+ boardPackage: '@typecad/board-rp2040',
75
+ frameworkPackage: '@typecad/framework-arduino',
76
+ framework: 'arduino',
77
+ buildTarget: 'rp2040:rp2040:rpipico',
78
+ mcu: 'rp2040',
79
+ },
80
+ {
81
+ id: 'rp2350',
82
+ displayName: 'RP2350 (Pico 2)',
83
+ isNative: false,
84
+ architecture: 'rp2350',
85
+ boardPackage: '@typecad/board-rp2350',
86
+ frameworkPackage: '@typecad/framework-arduino',
87
+ framework: 'arduino',
88
+ buildTarget: 'rp2040:rp2040:rpipico2',
89
+ mcu: 'rp2350',
90
+ },
69
91
  ];
70
92
  export function registerKnownTarget(target) {
71
93
  const existing = _knownTargets.findIndex(t => t.id === target.id);
@@ -715,7 +715,13 @@ export function buildEmitterContext(program, options) {
715
715
  includes.push(...emittedPolyfills.includes.map((include) => normalizeInclude(include)));
716
716
  }
717
717
  if (program.requiredIncludes) {
718
- includes.push(...program.requiredIncludes);
718
+ let reqIncludes = [...program.requiredIncludes];
719
+ // Let the strategy strip stale includes (e.g. framework-avr removes
720
+ // Arduino library headers it doesn't need — Wire.h, SPI.h, etc.).
721
+ if (strategy.filterRequiredIncludes) {
722
+ reqIncludes = strategy.filterRequiredIncludes(reqIncludes);
723
+ }
724
+ includes.push(...reqIncludes);
719
725
  }
720
726
  // UI text bindings lower to snprintf bodies that need <stdio.h>. Pushed here
721
727
  // (in buildEmitterContext) rather than in emitUIRuntime because emitPreamble
@@ -4,7 +4,7 @@ import ts from "typescript";
4
4
  import { makeDiagnostic } from "../ir/ast-node-utils.js";
5
5
  import { canonicalize, buildSemanticFacts } from "./semantic-facts.js";
6
6
  import { verifyFacts } from "./semantic-facts-verifier.js";
7
- import { requireUIHook } from "../ui-hook.js";
7
+ import { requireUIHook, hasUIHook } from "../ui-hook.js";
8
8
  /**
9
9
  * Type-checks TypeScript files using the TypeScript compiler.
10
10
  * Returns early if any errors are found.
@@ -54,7 +54,9 @@ export function typeCheckFiles(files, _boardPackage, entryFile) {
54
54
  }
55
55
  }
56
56
  }
57
- const uiModules = requireUIHook().allUIModules();
57
+ // @typecad/ui is optional — when the engine is not loaded there are no UI
58
+ // modules and nothing to register with the type-checker.
59
+ const uiModules = hasUIHook() ? requireUIHook().allUIModules() : [];
58
60
  if (uiModules.length > 0) {
59
61
  compilerOptions.allowArbitraryExtensions = true;
60
62
  const rootDirs = new Set((compilerOptions.rootDirs ?? []).map((dir) => path.resolve(dir)));
package/dist/testing.d.ts CHANGED
@@ -14,6 +14,7 @@ export { registerPlatformStrategy, resolveStrategy, clearAllProfileCaches } from
14
14
  export type { EmitMode, GeneratedOutputs, TargetProfile, PlatformContext } from "./types.js";
15
15
  export { findConfigFile, parseConfigFile, loadCuttlefishConfig, generateVirtualTypeDeclaration, } from "./config-loader.js";
16
16
  export { transpileFile } from "./transpile.js";
17
+ export { resetUIEngine, __simulateUIAbsentForTest } from "./ui/ui-bridge.js";
17
18
  export { scaffoldProject, normalizeProjectName, KNOWN_BOARDS, generateProjectPackageJson, generateProjectTsconfig, generateProjectConfig, generateProjectEnvDts, generateStarterSketch, generateGitignore, generateEslintConfig, runInitWizard, } from "./create/index.js";
18
19
  export type { InitProjectOptions } from "./create/index.js";
19
20
  export { scaffoldBoardPackages, parseBoardSpec, safeParseBoardSpec, stripJsonc, } from "./create/index.js";
package/dist/testing.js CHANGED
@@ -15,6 +15,8 @@ export { registerPlatformStrategy, resolveStrategy, clearAllProfileCaches } from
15
15
  export { findConfigFile, parseConfigFile, loadCuttlefishConfig, generateVirtualTypeDeclaration, } from "./config-loader.js";
16
16
  // ── Transpiler internal API ─────────────────────────────────────────────────
17
17
  export { transpileFile } from "./transpile.js";
18
+ // ── UI bridge (optional @typecad/ui) ─────────────────────────────────────────
19
+ export { resetUIEngine, __simulateUIAbsentForTest } from "./ui/ui-bridge.js";
18
20
  // ── Project scaffolding ──────────────────────────────────────────────────────
19
21
  export { scaffoldProject, normalizeProjectName, KNOWN_BOARDS, generateProjectPackageJson, generateProjectTsconfig, generateProjectConfig, generateProjectEnvDts, generateStarterSketch, generateGitignore, generateEslintConfig, runInitWizard, } from "./create/index.js";
20
22
  // ── Board codegen (`cuttlefish board add`) ───────────────────────────────────
package/dist/transpile.js CHANGED
@@ -6,7 +6,7 @@ import ts from "typescript";
6
6
  import { buildProgramIR } from "./ir/build-ir.js";
7
7
  import { classDeclarationToIR } from "./ir/declaration-builders.js";
8
8
  import { clickHandlers } from "./ir/transformers/ui-call-resolver.js";
9
- import { requireUIHook } from "./ui-hook.js";
9
+ import { requireUIHook, hasUIHook } from "./ui-hook.js";
10
10
  import { loadUIEngine } from "./ui/ui-bridge.js";
11
11
  import { setDisplayProfile, resetDisplayProfile } from "./stores/display-profile-store.js";
12
12
  import { setThemeCss, resetThemeCss, setThemeClass } from "./stores/theme-store.js";
@@ -344,9 +344,12 @@ export async function transpileFile(options) {
344
344
  // The graph build above already loaded all .ui.html modules; surface their
345
345
  // parser warnings (unknown CSS properties, unknown HTML tags) here so the
346
346
  // author sees typos and unsupported features instead of silent drops.
347
- for (const mod of requireUIHook().allUIModules()) {
348
- for (const d of mod.diagnostics) {
349
- diagnostics.push({ ...d, source: d.source ?? path.basename(mod.htmlPath) });
347
+ // Guarded: @typecad/ui is optional, so there may be no UI engine loaded.
348
+ if (hasUIHook()) {
349
+ for (const mod of requireUIHook().allUIModules()) {
350
+ for (const d of mod.diagnostics) {
351
+ diagnostics.push({ ...d, source: d.source ?? path.basename(mod.htmlPath) });
352
+ }
350
353
  }
351
354
  }
352
355
  // ── Semantic gates (Phase 3) ──────────────────────────────────────────────
@@ -459,9 +462,12 @@ export async function transpileFile(options) {
459
462
  profiler.captureMemorySnapshot("ir:post-build");
460
463
  profiler.endTimer("ir:build-all");
461
464
  // ── UI mount-time warnings (scroll memory budget, etc.) ─────────────────
462
- for (const mod of requireUIHook().allUIModules()) {
463
- for (const d of mod.mountDiagnostics) {
464
- diagnostics.push({ ...d, source: d.source ?? path.basename(mod.htmlPath) });
465
+ // Guarded: @typecad/ui is optional; no engine means no UI modules.
466
+ if (hasUIHook()) {
467
+ for (const mod of requireUIHook().allUIModules()) {
468
+ for (const d of mod.mountDiagnostics) {
469
+ diagnostics.push({ ...d, source: d.source ?? path.basename(mod.htmlPath) });
470
+ }
465
471
  }
466
472
  }
467
473
  throwIfFatalDiagnostics(rawIRArray.flatMap(({ filePath, programIR }) => programIR.diagnostics.map((diagnostic) => ({ filePath, diagnostic }))));
@@ -683,6 +689,7 @@ export async function transpileFile(options) {
683
689
  profiler.endTimer("post:flatten");
684
690
  // Profiler session ends (profiling disabled - no report generation)
685
691
  // ── Generate diagnostics report if enabled ──────────────────────────────
692
+ let diagnosticsReportPath;
686
693
  if (options.diagnostics) {
687
694
  try {
688
695
  const entryPreBuilt = preBuilt.get(entryFile);
@@ -702,17 +709,23 @@ export async function transpileFile(options) {
702
709
  removedSymbols: allRemovedSymbols,
703
710
  });
704
711
  writeDiagnosticsReport(report, entryPreBuilt?.programIR ?? null, outDir);
712
+ diagnosticsReportPath = path.join(outDir, "diagnostics.md");
705
713
  }
706
714
  catch (e) {
707
- // Diagnostics report generation is best-effort; don't fail the build
708
- if (options.debug) {
709
- logDebug(`Diagnostics report generation failed: ${e instanceof Error ? e.message : String(e)}`, true);
710
- }
715
+ // Diagnostics report generation is best-effort; don't fail the build,
716
+ // but surface the failure so the user knows --diagnostics didn't work.
717
+ diagnostics.push({
718
+ severity: "warning",
719
+ message: `Diagnostics report generation failed: ${e instanceof Error ? e.message : String(e)}`,
720
+ code: "diagnostics-report-failed",
721
+ source: "transpile",
722
+ });
711
723
  }
712
724
  }
713
725
  return {
714
726
  ...entryOutputs,
715
727
  diagnostics,
728
+ diagnosticsReportPath,
716
729
  };
717
730
  }
718
731
  export function generateLibraryDefinitions(options) {
package/dist/types.d.ts CHANGED
@@ -181,6 +181,8 @@ export interface GeneratedOutputs {
181
181
  diagnostics: Diagnostic[];
182
182
  asyncTaskNames?: string[];
183
183
  usesTimers?: boolean;
184
+ /** Path to the diagnostics.md report, if --diagnostics was passed. */
185
+ diagnosticsReportPath?: string;
184
186
  }
185
187
  interface CompileErrorEntry {
186
188
  filePath: string;
@@ -2,3 +2,15 @@
2
2
  * Called by transpile.ts at the start of each transpile run.
3
3
  * Safe to call when @typecad/ui is absent (hook stays null). */
4
4
  export declare function loadUIEngine(): Promise<void>;
5
+ /** Reset the UI bridge to its initial state: forget that a load was attempted
6
+ * and clear the registered hook. Mirrors the other `reset*` session helpers
7
+ * (clearCaches, resetDisplayProfile) so each transpile run — and each test —
8
+ * starts from a clean slate. */
9
+ export declare function resetUIEngine(): void;
10
+ /** Test-only: force the bridge into the "no @typecad/ui" state — mark the load
11
+ * as already attempted and leave the hook null, exactly as if the dynamic
12
+ * import in loadUIEngine() had failed because the package is not installed.
13
+ * This lets the test suite (which runs inside the monorepo where @typecad/ui
14
+ * IS resolvable) reproduce a plain end-user project that has not added
15
+ * @typecad/ui as a dependency. */
16
+ export declare function __simulateUIAbsentForTest(): void;
@@ -32,3 +32,21 @@ export async function loadUIEngine() {
32
32
  // @typecad/ui is not installed — cuttlefish works without UI support.
33
33
  }
34
34
  }
35
+ /** Reset the UI bridge to its initial state: forget that a load was attempted
36
+ * and clear the registered hook. Mirrors the other `reset*` session helpers
37
+ * (clearCaches, resetDisplayProfile) so each transpile run — and each test —
38
+ * starts from a clean slate. */
39
+ export function resetUIEngine() {
40
+ loaded = false;
41
+ setUIHook(null);
42
+ }
43
+ /** Test-only: force the bridge into the "no @typecad/ui" state — mark the load
44
+ * as already attempted and leave the hook null, exactly as if the dynamic
45
+ * import in loadUIEngine() had failed because the package is not installed.
46
+ * This lets the test suite (which runs inside the monorepo where @typecad/ui
47
+ * IS resolvable) reproduce a plain end-user project that has not added
48
+ * @typecad/ui as a dependency. */
49
+ export function __simulateUIAbsentForTest() {
50
+ loaded = true;
51
+ setUIHook(null);
52
+ }
package/package.json CHANGED
@@ -1,127 +1,127 @@
1
- {
2
- "name": "@typecad/cuttlefish",
3
- "version": "0.1.0-alpha.1",
4
- "description": "TypeScript to C++ transpiler — native, Arduino, and bare-metal targets",
5
- "type": "module",
6
- "main": "./dist/transpile.js",
7
- "types": "./dist/transpile.d.ts",
8
- "bin": {
9
- "cuttlefish": "dist/cli.js"
10
- },
11
- "exports": {
12
- ".": {
13
- "types": "./dist/transpile.d.ts",
14
- "default": "./dist/transpile.js"
15
- },
16
- "./testing": {
17
- "types": "./dist/testing.d.ts",
18
- "default": "./dist/testing.js"
19
- },
20
- "./api": {
21
- "types": "./dist/api/index.d.ts",
22
- "default": "./dist/api/index.js"
23
- },
24
- "./api/shared": {
25
- "types": "./dist/api/shared/index.d.ts",
26
- "default": "./dist/api/shared/index.js"
27
- },
28
- "./ui-hook": {
29
- "types": "./dist/ui-hook.d.ts",
30
- "default": "./dist/ui-hook.js"
31
- },
32
- "./config-loader": {
33
- "types": "./dist/config-loader.d.ts",
34
- "default": "./dist/config-loader.js"
35
- },
36
- "./stores/display-profile-store": {
37
- "types": "./dist/stores/display-profile-store.d.ts",
38
- "default": "./dist/stores/display-profile-store.js"
39
- },
40
- "./stores/theme-store": {
41
- "types": "./dist/stores/theme-store.d.ts",
42
- "default": "./dist/stores/theme-store.js"
43
- },
44
- "./api/schema": {
45
- "types": "./dist/api/schema/index.d.ts",
46
- "default": "./dist/api/schema/index.js"
47
- },
48
- "./emit/route-hal-op": {
49
- "types": "./dist/emit/route-hal-op.d.ts",
50
- "default": "./dist/emit/route-hal-op.js"
51
- },
52
- "./ir/transformers/ui-lowering": {
53
- "types": "./dist/ir/transformers/ui-lowering.d.ts",
54
- "default": "./dist/ir/transformers/ui-lowering.js"
55
- },
56
- "./ir/ui-element-auto-wire": {
57
- "types": "./dist/ir/ui-element-auto-wire.d.ts",
58
- "default": "./dist/ir/ui-element-auto-wire.js"
59
- },
60
- "./ir/transformers/ui-mount": {
61
- "types": "./dist/ir/transformers/ui-mount.d.ts",
62
- "default": "./dist/ir/transformers/ui-mount.js"
63
- },
64
- "./ir/transformers/ui-reactive": {
65
- "types": "./dist/ir/transformers/ui-reactive.d.ts",
66
- "default": "./dist/ir/transformers/ui-reactive.js"
67
- }
68
- },
69
- "files": [
70
- "dist"
71
- ],
72
- "publishConfig": {
73
- "access": "public"
74
- },
75
- "scripts": {
76
- "build": "tsc",
77
- "prepublishOnly": "npm run build",
78
- "start": "node dist/cli.js"
79
- },
80
- "dependencies": {
81
- "chalk": "^4.1.2",
82
- "typescript": "^5.7.3",
83
- "zod": "^3.24.0"
84
- },
85
- "peerDependencies": {
86
- "@typecad/ui": "0.1.0-alpha.1"
87
- },
88
- "peerDependenciesMeta": {
89
- "@typecad/ui": {
90
- "optional": true
91
- }
92
- },
93
- "optionalDependencies": {
94
- "@typecad/framework-native": "0.1.0-alpha.1"
95
- },
96
- "devDependencies": {
97
- "@types/node": "^22.10.7"
98
- },
99
- "license": "MIT",
100
- "repository": {
101
- "type": "git",
102
- "url": "git+https://github.com/justind000/typecode.git",
103
- "directory": "packages/cuttlefish"
104
- },
105
- "homepage": "https://github.com/justind000/typecode/tree/main/packages/cuttlefish",
106
- "bugs": {
107
- "url": "https://github.com/justind000/typecode/issues"
108
- },
109
- "keywords": [
110
- "arduino",
111
- "cli",
112
- "codegen",
113
- "cpp",
114
- "cuttlefish",
115
- "embedded",
116
- "firmware",
117
- "microcontroller",
118
- "transpiler",
119
- "typecad",
120
- "typescript"
121
- ],
122
- "engines": {
123
- "node": ">=18"
124
- },
125
- "author": "typecad0",
126
- "sideEffects": false
127
- }
1
+ {
2
+ "name": "@typecad/cuttlefish",
3
+ "version": "1.0.0-alpha.3",
4
+ "description": "TypeScript to C++ transpiler — native, Arduino, and bare-metal targets",
5
+ "type": "module",
6
+ "main": "./dist/transpile.js",
7
+ "types": "./dist/transpile.d.ts",
8
+ "bin": {
9
+ "cuttlefish": "dist/cli.js"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/transpile.d.ts",
14
+ "default": "./dist/transpile.js"
15
+ },
16
+ "./testing": {
17
+ "types": "./dist/testing.d.ts",
18
+ "default": "./dist/testing.js"
19
+ },
20
+ "./api": {
21
+ "types": "./dist/api/index.d.ts",
22
+ "default": "./dist/api/index.js"
23
+ },
24
+ "./api/shared": {
25
+ "types": "./dist/api/shared/index.d.ts",
26
+ "default": "./dist/api/shared/index.js"
27
+ },
28
+ "./ui-hook": {
29
+ "types": "./dist/ui-hook.d.ts",
30
+ "default": "./dist/ui-hook.js"
31
+ },
32
+ "./config-loader": {
33
+ "types": "./dist/config-loader.d.ts",
34
+ "default": "./dist/config-loader.js"
35
+ },
36
+ "./stores/display-profile-store": {
37
+ "types": "./dist/stores/display-profile-store.d.ts",
38
+ "default": "./dist/stores/display-profile-store.js"
39
+ },
40
+ "./stores/theme-store": {
41
+ "types": "./dist/stores/theme-store.d.ts",
42
+ "default": "./dist/stores/theme-store.js"
43
+ },
44
+ "./api/schema": {
45
+ "types": "./dist/api/schema/index.d.ts",
46
+ "default": "./dist/api/schema/index.js"
47
+ },
48
+ "./emit/route-hal-op": {
49
+ "types": "./dist/emit/route-hal-op.d.ts",
50
+ "default": "./dist/emit/route-hal-op.js"
51
+ },
52
+ "./ir/transformers/ui-lowering": {
53
+ "types": "./dist/ir/transformers/ui-lowering.d.ts",
54
+ "default": "./dist/ir/transformers/ui-lowering.js"
55
+ },
56
+ "./ir/ui-element-auto-wire": {
57
+ "types": "./dist/ir/ui-element-auto-wire.d.ts",
58
+ "default": "./dist/ir/ui-element-auto-wire.js"
59
+ },
60
+ "./ir/transformers/ui-mount": {
61
+ "types": "./dist/ir/transformers/ui-mount.d.ts",
62
+ "default": "./dist/ir/transformers/ui-mount.js"
63
+ },
64
+ "./ir/transformers/ui-reactive": {
65
+ "types": "./dist/ir/transformers/ui-reactive.d.ts",
66
+ "default": "./dist/ir/transformers/ui-reactive.js"
67
+ }
68
+ },
69
+ "files": [
70
+ "dist"
71
+ ],
72
+ "publishConfig": {
73
+ "access": "public"
74
+ },
75
+ "scripts": {
76
+ "build": "tsc",
77
+ "prepublishOnly": "npm run build",
78
+ "start": "node dist/cli.js"
79
+ },
80
+ "dependencies": {
81
+ "chalk": "^4.1.2",
82
+ "typescript": "^5.7.3",
83
+ "zod": "^3.24.0"
84
+ },
85
+ "peerDependencies": {
86
+ "@typecad/ui": "1.0.0-alpha.3"
87
+ },
88
+ "peerDependenciesMeta": {
89
+ "@typecad/ui": {
90
+ "optional": true
91
+ }
92
+ },
93
+ "optionalDependencies": {
94
+ "@typecad/framework-native": "1.0.0-alpha.3"
95
+ },
96
+ "devDependencies": {
97
+ "@types/node": "^22.10.7"
98
+ },
99
+ "license": "MIT",
100
+ "repository": {
101
+ "type": "git",
102
+ "url": "git+https://github.com/justind000/typecode.git",
103
+ "directory": "packages/cuttlefish"
104
+ },
105
+ "homepage": "https://github.com/justind000/typecode/tree/main/packages/cuttlefish",
106
+ "bugs": {
107
+ "url": "https://github.com/justind000/typecode/issues"
108
+ },
109
+ "keywords": [
110
+ "arduino",
111
+ "cli",
112
+ "codegen",
113
+ "cpp",
114
+ "cuttlefish",
115
+ "embedded",
116
+ "firmware",
117
+ "microcontroller",
118
+ "transpiler",
119
+ "typecad",
120
+ "typescript"
121
+ ],
122
+ "engines": {
123
+ "node": ">=18"
124
+ },
125
+ "author": "typecad0",
126
+ "sideEffects": false
127
+ }