@typecad/cuttlefish 1.0.0-alpha.13 → 1.0.0-alpha.15
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 +82 -79
- package/assets/editor-extensions/typecad-debug/README.md +141 -0
- package/assets/editor-extensions/typecad-debug/out/extension.js +347 -0
- package/assets/editor-extensions/typecad-debug/out/extension.js.map +1 -0
- package/assets/editor-extensions/typecad-debug/package.json +76 -0
- package/assets/editor-extensions/typecad-ui/LICENSE +27 -0
- package/assets/editor-extensions/typecad-ui/README.md +52 -0
- package/assets/editor-extensions/typecad-ui/file-icon-dark.png +0 -0
- package/assets/editor-extensions/typecad-ui/file-icon-light.png +0 -0
- package/assets/editor-extensions/typecad-ui/icon.png +0 -0
- package/assets/editor-extensions/typecad-ui/language-configuration.json +43 -0
- package/assets/editor-extensions/typecad-ui/package.json +54 -0
- package/assets/editor-extensions/typecad-ui/snippets/typecad-ui.json +80 -0
- package/assets/editor-extensions/typecad-ui/syntaxes/markdown-ui.json +45 -0
- package/assets/editor-extensions/typecad-ui/syntaxes/typecad-ui.tmLanguage.json +1269 -0
- package/dist/api/config.d.ts +30 -27
- package/dist/api/schema/types.d.ts +20 -3
- package/dist/api/shared/async-runtime-static.d.ts +1 -1
- package/dist/api/shared/async-runtime-static.js +5 -5
- package/dist/api/shared/async-types.d.ts +3 -2
- package/dist/api/shared/board-catalog.d.ts +2 -0
- package/dist/api/shared/board-catalog.js +6 -0
- package/dist/api/shared/board-resolver.d.ts +4 -7
- package/dist/api/shared/board-resolver.js +2 -1
- package/dist/api/shared/coop-scheduler.d.ts +1 -1
- package/dist/api/shared/coop-scheduler.js +1 -1
- package/dist/api/shared/cpp-type-ir.d.ts +1 -1
- package/dist/api/shared/cpp-type-ir.js +1 -1
- package/dist/api/shared/display-profile.d.ts +1 -1
- package/dist/api/shared/display-profile.js +3 -5
- package/dist/api/shared/framework-manifest-registry.d.ts +1 -1
- package/dist/api/shared/framework-manifest-registry.js +0 -1
- package/dist/api/shared/framework-manifest.d.ts +65 -507
- package/dist/api/shared/framework-manifest.js +6 -11
- package/dist/api/shared/hal-op-ir.d.ts +294 -685
- package/dist/api/shared/hal-op-ir.js +31 -65
- package/dist/api/shared/index.d.ts +0 -4
- package/dist/api/shared/index.js +1 -7
- package/dist/api/shared/ir-core.d.ts +6 -0
- package/dist/api/shared/ir-declarations.d.ts +4 -0
- package/dist/api/shared/ir.d.ts +1 -3
- package/dist/api/shared/platform-strategy.d.ts +14 -37
- package/dist/api/shared/polyfill-helper-registry.js +0 -5
- package/dist/api/shared/polyfill-types.js +0 -27
- package/dist/api/shared/promise-runtime.js +3 -3
- package/dist/api/shared/spdx-licenses.d.ts +12 -10
- package/dist/api/shared/spdx-licenses.js +1 -1
- package/dist/api/shared/toolchain-types.d.ts +1 -1
- package/dist/api/shared/toolchain-types.js +3 -3
- package/dist/api/shared/types.d.ts +0 -3
- package/dist/api/shared/validate-framework-manifest.js +13 -33
- package/dist/board-catalog/dts-reader.d.ts +220 -0
- package/dist/board-catalog/dts-reader.js +1052 -0
- package/dist/board-catalog/index.d.ts +11 -0
- package/dist/board-catalog/index.js +12 -0
- package/dist/board-catalog/pinconfig.d.ts +48 -0
- package/dist/board-catalog/pinconfig.js +263 -0
- package/dist/board-catalog/sdk.d.ts +82 -0
- package/dist/board-catalog/sdk.js +180 -0
- package/dist/board-catalog/store.d.ts +196 -0
- package/dist/board-catalog/store.js +363 -0
- package/dist/board-catalog/types.d.ts +233 -0
- package/dist/board-catalog/types.js +7 -0
- package/dist/board-catalog/walker.d.ts +112 -0
- package/dist/board-catalog/walker.js +1101 -0
- package/dist/cli-utils.d.ts +2 -2
- package/dist/cli-utils.js +5 -5
- package/dist/cli.js +227 -244
- package/dist/config-loader.d.ts +14 -19
- package/dist/config-loader.js +242 -78
- package/dist/config-schema.d.ts +19 -227
- package/dist/config-schema.js +9 -8
- package/dist/contract/board-generator.d.ts +4 -4
- package/dist/contract/board-generator.js +16 -5
- package/dist/contract/contract-parser.d.ts +36 -127
- package/dist/contract/contract-parser.js +76 -0
- package/dist/contract/index.d.ts +1 -1
- package/dist/contract/index.js +70 -21
- package/dist/create/active-board-catalog.d.ts +9 -0
- package/dist/create/active-board-catalog.js +94 -0
- package/dist/create/board-catalog.generated.d.ts +96 -0
- package/dist/create/board-catalog.generated.js +128737 -0
- package/dist/create/board-search.d.ts +23 -0
- package/dist/create/board-search.js +88 -0
- package/dist/create/editor-integration.d.ts +32 -0
- package/dist/create/editor-integration.js +257 -0
- package/dist/create/eslint-rules-template.d.ts +2 -2
- package/dist/create/framework-catalog.d.ts +48 -8
- package/dist/create/framework-catalog.js +58 -44
- package/dist/create/index.d.ts +8 -13
- package/dist/create/index.js +5 -9
- package/dist/create/mcu-target.d.ts +39 -0
- package/dist/create/mcu-target.js +80 -0
- package/dist/create/pack-targets.d.ts +19 -0
- package/dist/create/pack-targets.js +56 -0
- package/dist/create/{init-scaffold.d.ts → scaffold.d.ts} +8 -11
- package/dist/create/{init-scaffold.js → scaffold.js} +28 -87
- package/dist/create/templates.d.ts +51 -0
- package/dist/create/{init-templates.js → templates.js} +135 -116
- package/dist/create/wizard.d.ts +19 -0
- package/dist/create/wizard.js +314 -0
- package/dist/debug/preprocessor.d.ts +5 -0
- package/dist/debug/preprocessor.js +31 -7
- package/dist/diagnostics/diagnostics-report.d.ts +1 -1
- package/dist/diagnostics/diagnostics-report.js +3 -11
- package/dist/diagnostics/json-schema.d.ts +1 -1
- package/dist/diagnostics/md-writer.js +2 -2
- package/dist/diagnostics/mermaid-builder.d.ts +1 -1
- package/dist/diagnostics/mermaid-builder.js +1 -1
- package/dist/emit/cpp-emitter.js +4 -1
- package/dist/emit/emitters/class-emitter.js +32 -4
- package/dist/emit/emitters/emitter-context.d.ts +11 -0
- package/dist/emit/emitters/entrypoint-synthesizer.js +1 -1
- package/dist/emit/emitters/function-emitter-impl.js +33 -17
- package/dist/emit/emitters/output-finalizer.d.ts +7 -0
- package/dist/emit/emitters/output-finalizer.js +31 -23
- package/dist/emit/emitters/setup.js +147 -63
- package/dist/emit/emitters/top-level-prep.js +1 -1
- package/dist/emit/emitters/type-decl-emitter.js +13 -8
- package/dist/emit/emitters/ui-emitter.js +1 -1
- package/dist/emit/expression-renderer.d.ts +3 -3
- package/dist/emit/expression-renderer.js +17 -7
- package/dist/emit/route-hal-op.js +17 -48
- package/dist/emit/snprintf-helpers.d.ts +1 -3
- package/dist/emit/snprintf-helpers.js +1 -39
- package/dist/emit/statement-renderer.d.ts +0 -4
- package/dist/emit/statement-renderer.js +54 -45
- package/dist/emit/utils/async-state-machine.d.ts +16 -9
- package/dist/emit/utils/async-state-machine.js +56 -54
- package/dist/emit/utils/comment-helpers.d.ts +0 -8
- package/dist/emit/utils/comment-helpers.js +1 -1
- package/dist/emit/utils/cpp-helpers.d.ts +2 -2
- package/dist/emit/utils/cpp-helpers.js +2 -2
- package/dist/emit/utils/hal-op-cpp-type.js +4 -6
- package/dist/emit/utils/index.d.ts +3 -3
- package/dist/emit/utils/index.js +3 -3
- package/dist/emit/utils/type-inference.d.ts +1 -29
- package/dist/emit/utils/type-inference.js +0 -75
- package/dist/framework-package.d.ts +3 -0
- package/dist/framework-package.js +23 -6
- package/dist/framework-registry.d.ts +5 -5
- package/dist/frameworks/native/graphics/terminal-preview.d.ts +5 -0
- package/dist/frameworks/native/graphics/terminal-preview.js +33 -0
- package/dist/frameworks/native/index.d.ts +3 -0
- package/dist/frameworks/native/index.js +15 -0
- package/dist/frameworks/native/native-compile.d.ts +17 -0
- package/dist/frameworks/native/native-compile.js +170 -0
- package/dist/frameworks/native/native-config.d.ts +41 -0
- package/dist/frameworks/native/native-config.js +7 -0
- package/dist/frameworks/native/strategy.d.ts +97 -0
- package/dist/frameworks/native/strategy.js +664 -0
- package/dist/ir/board-resolver.d.ts +18 -23
- package/dist/ir/board-resolver.js +43 -401
- package/dist/ir/build-ir-state.d.ts +3 -0
- package/dist/ir/build-ir-state.js +42 -0
- package/dist/ir/build-ir.d.ts +1 -1
- package/dist/ir/build-ir.js +64 -45
- package/dist/ir/declaration-builders.js +1 -0
- package/dist/ir/expression-to-ir.js +17 -10
- package/dist/ir/hal/hal-emitter.d.ts +0 -2
- package/dist/ir/hal/hal-emitter.js +92 -41
- package/dist/ir/hal/hal-parser.d.ts +5 -5
- package/dist/ir/hal/hal-parser.js +128 -36
- package/dist/ir/hal/hal-plugins.d.ts +0 -1
- package/dist/ir/hal/hal-plugins.js +425 -716
- package/dist/ir/heap-analysis.js +2 -41
- package/dist/ir/identifier-collector.js +32 -20
- package/dist/ir/network-validation.js +7 -11
- package/dist/ir/ownership-analysis.js +75 -13
- package/dist/ir/peripheral-usage.d.ts +8 -2
- package/dist/ir/peripheral-usage.js +78 -149
- package/dist/ir/peripheral-validation.js +23 -3
- package/dist/ir/pin-capability-validation.d.ts +12 -0
- package/dist/ir/pin-capability-validation.js +61 -97
- package/dist/ir/pin-mode-validation.js +5 -5
- package/dist/ir/program-analysis.d.ts +8 -15
- package/dist/ir/program-analysis.js +140 -323
- package/dist/ir/pulldown-validation.js +11 -4
- package/dist/ir/resource-analysis.js +15 -3
- package/dist/ir/statement-to-ir.js +0 -6
- package/dist/ir/timing-validation.js +1 -1
- package/dist/ir/transformers/array-methods.js +11 -5
- package/dist/ir/transformers/call-statement.js +20 -87
- package/dist/ir/transformers/callback-context-registry.d.ts +1 -1
- package/dist/ir/transformers/callback-context-registry.js +8 -16
- package/dist/ir/transformers/control-flow.js +0 -13
- package/dist/ir/transformers/expressions.js +10 -9
- package/dist/ir/transformers/hal-call-resolver.d.ts +2 -2
- package/dist/ir/transformers/hal-call-resolver.js +24 -10
- package/dist/ir/transformers/hal-emit-helpers.d.ts +2 -2
- package/dist/ir/transformers/hal-emit-helpers.js +2 -2
- package/dist/ir/transformers/namespace-methods.js +1 -1
- package/dist/ir/transformers/ui-callback-lowering.d.ts +0 -2
- package/dist/ir/transformers/ui-callback-lowering.js +0 -24
- package/dist/ir/transformers/variables.js +338 -42
- package/dist/ir/try-catch-validation.js +4 -3
- package/dist/ir/type-resolution.js +15 -4
- package/dist/ir/validation-orchestrator.js +0 -9
- package/dist/libdef/cpp-to-decl.d.ts +0 -9
- package/dist/libdef/cpp-to-decl.js +0 -72
- package/dist/libdef/registry.d.ts +0 -1
- package/dist/libdef/registry.js +1 -24
- package/dist/library/catalog.d.ts +35 -0
- package/dist/library/catalog.js +67 -0
- package/dist/library/cli.d.ts +2 -0
- package/dist/library/cli.js +168 -0
- package/dist/library/init.d.ts +25 -0
- package/dist/library/init.js +397 -0
- package/dist/library/install.d.ts +9 -0
- package/dist/library/install.js +80 -0
- package/dist/library/registry-search.d.ts +34 -0
- package/dist/library/registry-search.js +50 -0
- package/dist/library/validate.d.ts +17 -0
- package/dist/library/validate.js +175 -0
- package/dist/library-packages.d.ts +95 -0
- package/dist/library-packages.js +275 -0
- package/dist/mapping/peripheral-names.js +9 -4
- package/dist/mapping/source-map.d.ts +3 -4
- package/dist/mapping/source-map.js +12 -18
- package/dist/orchestrator/graph-builder.d.ts +3 -3
- package/dist/orchestrator/graph-builder.js +29 -12
- package/dist/orchestrator/type-checker.d.ts +3 -3
- package/dist/orchestrator/type-checker.js +3 -3
- package/dist/platform/async-runtime.js +1 -1
- package/dist/platform/coop-scheduler-runtime.js +2 -2
- package/dist/platform/generic-debug-codegen.d.ts +36 -0
- package/dist/platform/generic-debug-codegen.js +185 -0
- package/dist/platform/generic-strategy.d.ts +3 -4
- package/dist/platform/generic-strategy.js +5 -80
- package/dist/platform/index.js +1 -1
- package/dist/platform/registry.d.ts +2 -2
- package/dist/platform/registry.js +2 -2
- package/dist/preview/client.js +17 -3
- package/dist/safety/asil-decorators.d.ts +32 -0
- package/dist/safety/asil-decorators.js +32 -0
- package/dist/safety/authoring.d.ts +85 -0
- package/dist/safety/authoring.js +61 -0
- package/dist/safety/engine.d.ts +3 -0
- package/dist/safety/engine.js +83 -0
- package/dist/safety/hal/ops.d.ts +48 -0
- package/dist/safety/hal/ops.js +46 -0
- package/dist/safety/iso26262/analyze.d.ts +13 -0
- package/dist/safety/iso26262/analyze.js +29 -0
- package/dist/safety/iso26262/asil.d.ts +10 -0
- package/dist/safety/iso26262/asil.js +22 -0
- package/dist/safety/iso26262/collect.d.ts +14 -0
- package/dist/safety/iso26262/collect.js +137 -0
- package/dist/safety/iso26262/goto-checker.d.ts +10 -0
- package/dist/safety/iso26262/goto-checker.js +72 -0
- package/dist/safety/iso26262/heap-checker.d.ts +7 -0
- package/dist/safety/iso26262/heap-checker.js +57 -0
- package/dist/safety/iso26262/init-checker.d.ts +13 -0
- package/dist/safety/iso26262/init-checker.js +127 -0
- package/dist/safety/iso26262/loop-checker.d.ts +7 -0
- package/dist/safety/iso26262/loop-checker.js +86 -0
- package/dist/safety/iso26262/recursion-checker.d.ts +9 -0
- package/dist/safety/iso26262/recursion-checker.js +134 -0
- package/dist/safety/iso26262/sidecar-writer.d.ts +25 -0
- package/dist/safety/iso26262/sidecar-writer.js +13 -0
- package/dist/safety/passes/pinMode-intercept.d.ts +3 -0
- package/dist/safety/passes/pinMode-intercept.js +60 -0
- package/dist/safety/runtime/mode-table.d.ts +5 -0
- package/dist/safety/runtime/mode-table.js +55 -0
- package/dist/safety/runtime/polyfills.d.ts +6 -0
- package/dist/safety/runtime/polyfills.js +12 -0
- package/dist/safety/runtime/result-struct.d.ts +11 -0
- package/dist/safety/runtime/result-struct.js +98 -0
- package/dist/safety/runtime/safe-int.d.ts +33 -0
- package/dist/safety/runtime/safe-int.js +170 -0
- package/dist/safety/runtime/safe-traits.d.ts +4 -0
- package/dist/safety/runtime/safe-traits.js +95 -0
- package/dist/safety/runtime/safe-variable.d.ts +39 -0
- package/dist/safety/runtime/safe-variable.js +226 -0
- package/dist/safety/runtime/vote.d.ts +8 -0
- package/dist/safety/runtime/vote.js +92 -0
- package/dist/safety/runtime/write-verify.d.ts +8 -0
- package/dist/safety/runtime/write-verify.js +71 -0
- package/dist/safety/safe-int-types.d.ts +45 -0
- package/dist/safety/safe-int-types.js +25 -0
- package/dist/safety/safe-variable-types.d.ts +29 -0
- package/dist/safety/safe-variable-types.js +19 -0
- package/dist/safety/safety-bridge.d.ts +5 -6
- package/dist/safety/safety-bridge.js +15 -28
- package/dist/safety/sidecar-bridge.d.ts +1 -3
- package/dist/safety/sidecar-bridge.js +3 -20
- package/dist/safety/specifiers.d.ts +6 -0
- package/dist/safety/specifiers.js +14 -0
- package/dist/safety-hook.d.ts +8 -7
- package/dist/safety-hook.js +12 -13
- package/dist/testing.d.ts +5 -6
- package/dist/testing.js +5 -5
- package/dist/transpile/resolution.d.ts +1 -1
- package/dist/transpile/resolution.js +18 -9
- package/dist/transpile/test-pins.d.ts +18 -0
- package/dist/transpile/test-pins.js +142 -0
- package/dist/transpile.d.ts +1 -2
- package/dist/transpile.js +90 -29
- package/dist/types.d.ts +45 -26
- package/dist/ui-hook.d.ts +1 -1
- package/dist/utils/cli.d.ts +2 -2
- package/dist/utils/cli.js +160 -157
- package/dist/utils/fs.d.ts +3 -4
- package/dist/utils/fs.js +4 -5
- package/dist/utils/strings.d.ts +0 -1
- package/dist/utils/strings.js +0 -8
- package/dist/utils/ui.d.ts +5 -2
- package/dist/utils/ui.js +13 -3
- package/package.json +158 -149
- package/dist/add-preset.d.ts +0 -4
- package/dist/add-preset.js +0 -74
- package/dist/api/shared/async-symbol-detector.d.ts +0 -11
- package/dist/api/shared/async-symbol-detector.js +0 -140
- package/dist/api/shared/native-display-op-resolver.d.ts +0 -10
- package/dist/api/shared/native-display-op-resolver.js +0 -64
- package/dist/create/board-checklist.d.ts +0 -2
- package/dist/create/board-checklist.js +0 -52
- package/dist/create/board-codegen.d.ts +0 -9
- package/dist/create/board-codegen.js +0 -238
- package/dist/create/board-generators.d.ts +0 -12
- package/dist/create/board-generators.js +0 -651
- package/dist/create/board-spec.d.ts +0 -637
- package/dist/create/board-spec.js +0 -214
- package/dist/create/init-templates.d.ts +0 -28
- package/dist/create/init-wizard.d.ts +0 -8
- package/dist/create/init-wizard.js +0 -182
- package/dist/install/framework-catalog.d.ts +0 -53
- package/dist/install/framework-catalog.js +0 -107
- package/dist/install/handle-install.d.ts +0 -35
- package/dist/install/handle-install.js +0 -177
- package/dist/install/index.d.ts +0 -4
- package/dist/install/index.js +0 -3
- package/dist/ir/pin-state-tracking.d.ts +0 -58
- package/dist/ir/pin-state-tracking.js +0 -182
- package/dist/ir/pwm-timer-sharing.d.ts +0 -4
- package/dist/ir/pwm-timer-sharing.js +0 -94
- package/dist/ir/timer0-pwm-timing-conflict.d.ts +0 -4
- package/dist/ir/timer0-pwm-timing-conflict.js +0 -72
- package/dist/libdef/component-decls.d.ts +0 -2
- package/dist/libdef/component-decls.js +0 -6
- package/dist/libdef/component-discovery.d.ts +0 -43
- package/dist/libdef/component-discovery.js +0 -83
- package/dist/theme-tokens.d.ts +0 -22
- package/dist/theme-tokens.js +0 -172
package/dist/create/index.d.ts
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
export { scaffoldProject, normalizeProjectName, KNOWN_TARGETS,
|
|
2
|
-
export type { KnownTarget,
|
|
3
|
-
export { FRAMEWORK_CATALOG, frameworksForTarget, frameworkCatalogEntry, detectPackageManager, frameworkTargetProfile } from './framework-catalog.js';
|
|
4
|
-
export type { FrameworkCatalogEntry, BoardLike, PackageManager, FrameworkTargetProfile, TargetProfileInput } from './framework-catalog.js';
|
|
1
|
+
export { scaffoldProject, normalizeProjectName, KNOWN_TARGETS, printCreateNextSteps } from './scaffold.js';
|
|
2
|
+
export type { KnownTarget, ScaffoldProjectResult } from './scaffold.js';
|
|
3
|
+
export { FRAMEWORK_CATALOG, frameworksForTarget, frameworkCompatibleWithTarget, frameworkCatalogEntry, detectPackageManager, frameworkTargetProfile, probeMethodsForBoard } from './framework-catalog.js';
|
|
4
|
+
export type { FrameworkCatalogEntry, BoardLike, PackageManager, FrameworkTargetProfile, TargetProfileInput, CatalogProbeMethod } from './framework-catalog.js';
|
|
5
5
|
export { installProjectDependencies, __setProjectInstallRunnerForTest } from './install-deps.js';
|
|
6
6
|
export type { ProjectInstallResult } from './install-deps.js';
|
|
7
|
-
export { generateProjectPackageJson, generateProjectTsconfig, generateProjectConfig, generateProjectEnvDts,
|
|
8
|
-
export type {
|
|
9
|
-
export {
|
|
7
|
+
export { generateProjectPackageJson, generateProjectTsconfig, generateProjectConfig, generateProjectEnvDts, generateStarterProgram, generateStarterTest, generateStarterSim, generateGitignore, generateEditorconfig, generateEslintConfig, } from './templates.js';
|
|
8
|
+
export type { CreateProjectOptions } from './templates.js';
|
|
9
|
+
export { runCreateWizard } from './wizard.js';
|
|
10
10
|
export { generateFrameworkDebugArtifacts } from './debug-artifacts.js';
|
|
11
11
|
export type { FrameworkDebugArtifactsOptions, FrameworkModuleLoader } from './debug-artifacts.js';
|
|
12
|
-
export {
|
|
13
|
-
export type { ScaffoldBoardResult } from './board-codegen.js';
|
|
14
|
-
export { generateFrameworkChecklist } from './board-checklist.js';
|
|
15
|
-
export { parseBoardSpec, safeParseBoardSpec, stripJsonc, BoardSpecSchema } from './board-spec.js';
|
|
16
|
-
export type { BoardSpec } from './board-spec.js';
|
|
17
|
-
export * as BoardGenerators from './board-generators.js';
|
|
12
|
+
export { generateExtensionsJson, generateTasksJson, watchBuildTask, writeEditorIntegration, bundledExtensionSourceDir, typecadUiExtensionSourceDir, TYPECAD_UI_EXTENSION_ID, TYPECAD_DEBUG_EXTENSION_ID, WATCH_TASK_LABEL, } from './editor-integration.js';
|
package/dist/create/index.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
export { scaffoldProject, normalizeProjectName, KNOWN_TARGETS,
|
|
2
|
-
export { FRAMEWORK_CATALOG, frameworksForTarget, frameworkCatalogEntry, detectPackageManager, frameworkTargetProfile } from './framework-catalog.js';
|
|
1
|
+
export { scaffoldProject, normalizeProjectName, KNOWN_TARGETS, printCreateNextSteps } from './scaffold.js';
|
|
2
|
+
export { FRAMEWORK_CATALOG, frameworksForTarget, frameworkCompatibleWithTarget, frameworkCatalogEntry, detectPackageManager, frameworkTargetProfile, probeMethodsForBoard } from './framework-catalog.js';
|
|
3
3
|
export { installProjectDependencies, __setProjectInstallRunnerForTest } from './install-deps.js';
|
|
4
|
-
export { generateProjectPackageJson, generateProjectTsconfig, generateProjectConfig, generateProjectEnvDts,
|
|
5
|
-
export {
|
|
4
|
+
export { generateProjectPackageJson, generateProjectTsconfig, generateProjectConfig, generateProjectEnvDts, generateStarterProgram, generateStarterTest, generateStarterSim, generateGitignore, generateEditorconfig, generateEslintConfig, } from './templates.js';
|
|
5
|
+
export { runCreateWizard } from './wizard.js';
|
|
6
6
|
export { generateFrameworkDebugArtifacts } from './debug-artifacts.js';
|
|
7
|
-
|
|
8
|
-
export { scaffoldBoardPackages } from './board-codegen.js';
|
|
9
|
-
export { generateFrameworkChecklist } from './board-checklist.js';
|
|
10
|
-
export { parseBoardSpec, safeParseBoardSpec, stripJsonc, BoardSpecSchema } from './board-spec.js';
|
|
11
|
-
export * as BoardGenerators from './board-generators.js';
|
|
7
|
+
export { generateExtensionsJson, generateTasksJson, watchBuildTask, writeEditorIntegration, bundledExtensionSourceDir, typecadUiExtensionSourceDir, TYPECAD_UI_EXTENSION_ID, TYPECAD_DEBUG_EXTENSION_ID, WATCH_TASK_LABEL, } from './editor-integration.js';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type KnownMcu, type KnownTarget } from './scaffold.js';
|
|
2
|
+
/** An MCU catalog entry shaped for the create flow (KnownTarget-compatible:
|
|
3
|
+
* no board target, soc set, plus the silicon extras). */
|
|
4
|
+
export interface McuCreateTarget extends KnownTarget {
|
|
5
|
+
isNative: false;
|
|
6
|
+
board?: undefined;
|
|
7
|
+
/** Zephyr SoC name — the curated soc descriptor key. */
|
|
8
|
+
soc: string;
|
|
9
|
+
/** Datasheet port pin for the starter program. */
|
|
10
|
+
starterPin: string;
|
|
11
|
+
}
|
|
12
|
+
/** Look up an MCU catalog entry by id (e.g. 'stm32f411'). */
|
|
13
|
+
export declare function findKnownMcu(id: string): KnownMcu | undefined;
|
|
14
|
+
/** Convert a catalog entry into the create-flow target shape. */
|
|
15
|
+
export declare function mcuAsTarget(mcu: KnownMcu): McuCreateTarget;
|
|
16
|
+
/** True when the MCU package carries silicon Zephyr data (socs) — the
|
|
17
|
+
* precondition for both generated custom boards and the board snapshot. */
|
|
18
|
+
export declare function mcuSupportsZephyr(mcu: McuCreateTarget): boolean;
|
|
19
|
+
/** A snapshot board plus its default qualified `west build -b` target. */
|
|
20
|
+
export interface McuZephyrBoard {
|
|
21
|
+
name: string;
|
|
22
|
+
vendor: string;
|
|
23
|
+
soc: string;
|
|
24
|
+
/** Qualified target (e.g. 'blackpill_f411ce/stm32f411xe',
|
|
25
|
+
* 'esp32s3_devkitc/esp32s3/procpu'). */
|
|
26
|
+
target: string;
|
|
27
|
+
}
|
|
28
|
+
/** Every catalog board variant whose SoC matches the bare-silicon soc. */
|
|
29
|
+
export declare function zephyrBoardsForMcu(mcu: McuCreateTarget): McuZephyrBoard[];
|
|
30
|
+
/** Look one board up by its (bare) name — for the non-interactive
|
|
31
|
+
* `--zephyr-board <name>` flag. Undefined when the board is not in the
|
|
32
|
+
* snapshot under one of the MCU's SoCs. */
|
|
33
|
+
export declare function findZephyrBoardForMcu(mcu: McuCreateTarget, name: string): McuZephyrBoard | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Sanitize a raw name into a legal Zephyr board name — the same rules
|
|
36
|
+
* framework-zephyr's generator applies (lowercase `[a-z0-9_]`), duplicated
|
|
37
|
+
* here because create runs before the framework package is installed.
|
|
38
|
+
*/
|
|
39
|
+
export declare function sanitizeBoardName(raw: string): string;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// MCU-only create-target resolution
|
|
3
|
+
//
|
|
4
|
+
// Shared logic for `cuttlefish create --mcu <id>` and the wizard's bare-MCU
|
|
5
|
+
// entries: framework narrowing (Zephyr needs the package's silicon zephyr
|
|
6
|
+
// block), the Zephyr board decision (generated custom board vs any upstream
|
|
7
|
+
// board whose SoC matches, from the exhaustive snapshot), and the default
|
|
8
|
+
// qualified `west build -b` target.
|
|
9
|
+
// ---------------------------------------------------------------------------
|
|
10
|
+
import { KNOWN_MCUS } from './scaffold.js';
|
|
11
|
+
import { activeBoardCatalog } from './active-board-catalog.js';
|
|
12
|
+
/** Look up an MCU catalog entry by id (e.g. 'stm32f411'). */
|
|
13
|
+
export function findKnownMcu(id) {
|
|
14
|
+
return KNOWN_MCUS.find((m) => m.id === id);
|
|
15
|
+
}
|
|
16
|
+
/** Convert a catalog entry into the create-flow target shape. */
|
|
17
|
+
export function mcuAsTarget(mcu) {
|
|
18
|
+
return {
|
|
19
|
+
id: mcu.id,
|
|
20
|
+
displayName: mcu.displayName,
|
|
21
|
+
isNative: false,
|
|
22
|
+
architecture: mcu.architecture,
|
|
23
|
+
soc: mcu.soc,
|
|
24
|
+
starterPin: mcu.starterPin,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/** True when the MCU package carries silicon Zephyr data (socs) — the
|
|
28
|
+
* precondition for both generated custom boards and the board snapshot. */
|
|
29
|
+
export function mcuSupportsZephyr(mcu) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
// ── Zephyr board snapshot ────────────────────────────────────────────────────
|
|
33
|
+
/**
|
|
34
|
+
* CPU-cluster qualifier defaults for multi-variant SoCs — Zephyr rejects the
|
|
35
|
+
* bare board name when a board ships multiple variants with no default, and
|
|
36
|
+
* the application core / M33 cluster is the one firmware targets (mirrors the
|
|
37
|
+
* qualified forms in framework-catalog's ZEPHYR_BOARD_IDS).
|
|
38
|
+
*/
|
|
39
|
+
const SOC_CLUSTER_QUALIFIER = {
|
|
40
|
+
esp32: 'procpu',
|
|
41
|
+
esp32s3: 'procpu',
|
|
42
|
+
esp32c6: 'hpcore',
|
|
43
|
+
rp2350a: 'm33',
|
|
44
|
+
rp2350b: 'm33',
|
|
45
|
+
};
|
|
46
|
+
/** Every catalog board variant whose SoC matches the bare-silicon soc. */
|
|
47
|
+
export function zephyrBoardsForMcu(mcu) {
|
|
48
|
+
const results = [];
|
|
49
|
+
for (const [identifier, entry] of Object.entries(activeBoardCatalog())) {
|
|
50
|
+
const soc = identifier.split('/')[1];
|
|
51
|
+
if (soc !== mcu.soc)
|
|
52
|
+
continue;
|
|
53
|
+
results.push({
|
|
54
|
+
name: entry.name,
|
|
55
|
+
vendor: entry.vendor,
|
|
56
|
+
soc,
|
|
57
|
+
target: identifier,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return results.sort((a, b) => a.name.localeCompare(b.name));
|
|
61
|
+
}
|
|
62
|
+
/** Look one board up by its (bare) name — for the non-interactive
|
|
63
|
+
* `--zephyr-board <name>` flag. Undefined when the board is not in the
|
|
64
|
+
* snapshot under one of the MCU's SoCs. */
|
|
65
|
+
export function findZephyrBoardForMcu(mcu, name) {
|
|
66
|
+
return zephyrBoardsForMcu(mcu).find((b) => b.name === name);
|
|
67
|
+
}
|
|
68
|
+
// ── Custom-board naming ──────────────────────────────────────────────────────
|
|
69
|
+
/**
|
|
70
|
+
* Sanitize a raw name into a legal Zephyr board name — the same rules
|
|
71
|
+
* framework-zephyr's generator applies (lowercase `[a-z0-9_]`), duplicated
|
|
72
|
+
* here because create runs before the framework package is installed.
|
|
73
|
+
*/
|
|
74
|
+
export function sanitizeBoardName(raw) {
|
|
75
|
+
const cleaned = raw
|
|
76
|
+
.toLowerCase()
|
|
77
|
+
.replace(/[^a-z0-9_]+/g, '_')
|
|
78
|
+
.replace(/^_+|_+$/g, '');
|
|
79
|
+
return cleaned.length > 0 ? cleaned : 'custom_board';
|
|
80
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { BoardDataEntry } from '../board-catalog/types.js';
|
|
2
|
+
import type { KnownTarget } from './scaffold.js';
|
|
3
|
+
export declare function architectureFromSoc(soc: string): string;
|
|
4
|
+
/** Look up a pack entry by qualified identifier or bare board name.
|
|
5
|
+
* Bare names with multiple variants return the first (deterministic —
|
|
6
|
+
* the pack is keyed in directory-walk order). */
|
|
7
|
+
export declare function findPackBoard(idOrTarget: string): {
|
|
8
|
+
identifier: string;
|
|
9
|
+
name: string;
|
|
10
|
+
vendor: string;
|
|
11
|
+
soc: string;
|
|
12
|
+
probeMethods?: BoardDataEntry['probeMethods'];
|
|
13
|
+
} | undefined;
|
|
14
|
+
/** Build a create-flow KnownTarget from a pack entry. */
|
|
15
|
+
export declare function packBoardAsTarget(entry: {
|
|
16
|
+
identifier: string;
|
|
17
|
+
name: string;
|
|
18
|
+
soc: string;
|
|
19
|
+
}): KnownTarget;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// pack-targets.ts — any-board target resolution off the generated catalog.
|
|
3
|
+
//
|
|
4
|
+
// The curated KNOWN_TARGETS list covers the nine hardware-validated boards;
|
|
5
|
+
// the board data pack carries every Zephyr board variant (1,300+). This
|
|
6
|
+
// module turns a pack entry into the same KnownTarget shape the create flow
|
|
7
|
+
// consumes, so `cuttlefish create --target <any-zephyr-board>` works with no
|
|
8
|
+
// per-board catalog entry. The soc's prefix derives an architecture id for
|
|
9
|
+
// framework narrowing (the fallback maps unknowns to zephyr anyway).
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
import { activeBoardCatalog, findBoardInCatalog } from '../board-catalog/index.js';
|
|
12
|
+
/** A coarse architecture id derived from a Zephyr soc name. Used only for
|
|
13
|
+
* framework narrowing and display — every value here resolves through
|
|
14
|
+
* FALLBACK_FRAMEWORKS to zephyr, which is correct for every pack board;
|
|
15
|
+
* the known families just display nicely. */
|
|
16
|
+
const SOC_FAMILIES = [
|
|
17
|
+
[/^esp32/, 'esp32'],
|
|
18
|
+
[/^nrf5/, 'nrf52'],
|
|
19
|
+
[/^nrf9/, 'nrf91'],
|
|
20
|
+
[/^stm32/, 'stm32'],
|
|
21
|
+
[/^stm32mp/, 'stm32mp1'],
|
|
22
|
+
[/^rp2/, 'rp2040'],
|
|
23
|
+
[/^samd/, 'samd'],
|
|
24
|
+
[/^mcimx|^imx/, 'imx'],
|
|
25
|
+
];
|
|
26
|
+
export function architectureFromSoc(soc) {
|
|
27
|
+
for (const [re, family] of SOC_FAMILIES) {
|
|
28
|
+
if (re.test(soc))
|
|
29
|
+
return family;
|
|
30
|
+
}
|
|
31
|
+
return soc;
|
|
32
|
+
}
|
|
33
|
+
/** Look up a pack entry by qualified identifier or bare board name.
|
|
34
|
+
* Bare names with multiple variants return the first (deterministic —
|
|
35
|
+
* the pack is keyed in directory-walk order). */
|
|
36
|
+
export function findPackBoard(idOrTarget) {
|
|
37
|
+
const data = activeBoardCatalog();
|
|
38
|
+
const raw = idOrTarget.trim();
|
|
39
|
+
const entry = findBoardInCatalog(data, raw);
|
|
40
|
+
if (entry) {
|
|
41
|
+
return { identifier: entry.identifier, name: entry.name, vendor: entry.vendor, soc: entry.identifier.split('/')[1], probeMethods: entry.probeMethods };
|
|
42
|
+
}
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
/** Build a create-flow KnownTarget from a pack entry. */
|
|
46
|
+
export function packBoardAsTarget(entry) {
|
|
47
|
+
return {
|
|
48
|
+
id: entry.identifier.split('/')[0],
|
|
49
|
+
displayName: entry.name,
|
|
50
|
+
isNative: false,
|
|
51
|
+
architecture: architectureFromSoc(entry.soc),
|
|
52
|
+
board: entry.identifier,
|
|
53
|
+
buildTarget: entry.identifier,
|
|
54
|
+
soc: entry.soc,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { ArchitectureIdentifier } from "../api/index.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { CreateProjectOptions } from "./templates.js";
|
|
3
3
|
export interface KnownTarget {
|
|
4
4
|
id: string;
|
|
5
5
|
displayName: string;
|
|
6
6
|
isNative: boolean;
|
|
7
7
|
architecture?: ArchitectureIdentifier;
|
|
8
|
-
|
|
8
|
+
/** Qualified Zephyr board target — the config's board: value and the
|
|
9
|
+
* boardgen input (materialized to .cuttlefish/board.ts at create). */
|
|
10
|
+
board?: string;
|
|
9
11
|
/** Framework package + id. Optional on embedded targets: the scaffold wizard
|
|
10
12
|
* fills these in by discovering installed @typecad/framework-* packages, so
|
|
11
13
|
* KNOWN_TARGETS board entries do not hardcode a framework. Native targets
|
|
@@ -13,25 +15,20 @@ export interface KnownTarget {
|
|
|
13
15
|
frameworkPackage?: string;
|
|
14
16
|
framework?: string;
|
|
15
17
|
buildTarget?: string;
|
|
16
|
-
|
|
18
|
+
soc?: string;
|
|
17
19
|
/** Framework-specific config (becomes frameworkData in cuttlefish.config.ts).
|
|
18
20
|
* Carries framework-specific target/options data for the selected framework. */
|
|
19
21
|
frameworkData?: Record<string, unknown>;
|
|
20
22
|
}
|
|
21
|
-
export declare function registerKnownTarget(target: KnownTarget): void;
|
|
22
23
|
export declare const KNOWN_TARGETS: ReadonlyArray<KnownTarget>;
|
|
23
|
-
/** @deprecated Use KNOWN_TARGETS */
|
|
24
|
-
export declare const KNOWN_BOARDS: KnownTarget[];
|
|
25
|
-
/** @deprecated Use KnownTarget */
|
|
26
|
-
export type KnownBoard = KnownTarget;
|
|
27
24
|
export declare function normalizeProjectName(name: string): string;
|
|
28
25
|
export interface ScaffoldProjectResult {
|
|
29
26
|
createdFiles: string[];
|
|
30
27
|
outDir: string;
|
|
31
|
-
options:
|
|
28
|
+
options: CreateProjectOptions;
|
|
32
29
|
}
|
|
33
|
-
export declare function scaffoldProject(options:
|
|
34
|
-
export declare function
|
|
30
|
+
export declare function scaffoldProject(options: CreateProjectOptions, outDir?: string): ScaffoldProjectResult;
|
|
31
|
+
export declare function printCreateNextSteps(options: CreateProjectOptions, outDir: string, opts?: {
|
|
35
32
|
installed?: boolean;
|
|
36
33
|
debugProfile?: boolean;
|
|
37
34
|
}): void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import chalk from "chalk";
|
|
4
|
-
import { generateProjectPackageJson, generateProjectTsconfig, generateProjectConfig, generateProjectEnvDts,
|
|
4
|
+
import { generateProjectPackageJson, generateProjectTsconfig, generateProjectConfig, generateProjectEnvDts, generateStarterProgram, generateStarterTest, generateStarterSim, generateGitignore, generateEditorconfig, generateEslintConfig, } from "./templates.js";
|
|
5
5
|
import { generateEslintRules } from "./eslint-rules-template.js";
|
|
6
|
+
import { writeEditorIntegration } from "./editor-integration.js";
|
|
6
7
|
const _knownTargets = [
|
|
7
8
|
{
|
|
8
9
|
id: 'native',
|
|
@@ -11,82 +12,10 @@ const _knownTargets = [
|
|
|
11
12
|
frameworkPackage: '@typecad/framework-native',
|
|
12
13
|
framework: 'native',
|
|
13
14
|
},
|
|
14
|
-
{
|
|
15
|
-
id: 'arduino-uno',
|
|
16
|
-
displayName: 'Arduino Uno',
|
|
17
|
-
isNative: false,
|
|
18
|
-
architecture: 'avr',
|
|
19
|
-
boardPackage: '@typecad/board-arduino-uno',
|
|
20
|
-
buildTarget: 'arduino:avr:uno',
|
|
21
|
-
mcu: 'atmega328p',
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: 'esp32-devkit',
|
|
25
|
-
displayName: 'ESP32 DevKit',
|
|
26
|
-
isNative: false,
|
|
27
|
-
architecture: 'esp32',
|
|
28
|
-
boardPackage: '@typecad/board-esp32-devkit',
|
|
29
|
-
buildTarget: 'esp32:esp32:esp32',
|
|
30
|
-
mcu: 'esp32',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
id: 'esp32s3',
|
|
34
|
-
displayName: 'ESP32-S3',
|
|
35
|
-
isNative: false,
|
|
36
|
-
architecture: 'esp32s3',
|
|
37
|
-
boardPackage: '@typecad/board-esp32s3',
|
|
38
|
-
buildTarget: 'esp32:esp32:esp32s3',
|
|
39
|
-
mcu: 'esp32s3',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
id: 'esp32c3',
|
|
43
|
-
displayName: 'ESP32-C3',
|
|
44
|
-
isNative: false,
|
|
45
|
-
architecture: 'esp32c3',
|
|
46
|
-
boardPackage: '@typecad/board-esp32c3',
|
|
47
|
-
buildTarget: 'esp32:esp32:esp32c3',
|
|
48
|
-
mcu: 'esp32c3',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
id: 'esp32c6',
|
|
52
|
-
displayName: 'ESP32-C6',
|
|
53
|
-
isNative: false,
|
|
54
|
-
architecture: 'esp32c6',
|
|
55
|
-
boardPackage: '@typecad/board-esp32c6',
|
|
56
|
-
buildTarget: 'esp32:esp32:esp32c6',
|
|
57
|
-
mcu: 'esp32c6',
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
id: 'rp2040',
|
|
61
|
-
displayName: 'RP2040 (Pico)',
|
|
62
|
-
isNative: false,
|
|
63
|
-
architecture: 'rp2040',
|
|
64
|
-
boardPackage: '@typecad/board-rp2040',
|
|
65
|
-
buildTarget: 'rp2040:rp2040:rpipico',
|
|
66
|
-
mcu: 'rp2040',
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
id: 'rp2350',
|
|
70
|
-
displayName: 'RP2350 (Pico 2)',
|
|
71
|
-
isNative: false,
|
|
72
|
-
architecture: 'rp2350',
|
|
73
|
-
boardPackage: '@typecad/board-rp2350',
|
|
74
|
-
buildTarget: 'rp2040:rp2040:rpipico2',
|
|
75
|
-
mcu: 'rp2350',
|
|
76
|
-
},
|
|
77
15
|
];
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if (existing >= 0) {
|
|
81
|
-
_knownTargets[existing] = target;
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
_knownTargets.push(target);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
16
|
+
// Bare-silicon (contract) targets were removed with the curated soc layer:
|
|
17
|
+
// every embedded target resolves through the board catalog like any other.
|
|
87
18
|
export const KNOWN_TARGETS = _knownTargets;
|
|
88
|
-
/** @deprecated Use KNOWN_TARGETS */
|
|
89
|
-
export const KNOWN_BOARDS = _knownTargets;
|
|
90
19
|
export function normalizeProjectName(name) {
|
|
91
20
|
return name
|
|
92
21
|
.toLowerCase()
|
|
@@ -125,16 +54,23 @@ export function scaffoldProject(options, outDir) {
|
|
|
125
54
|
writeFile('.cuttlefish/eslint.config.mjs', generateEslintConfig(options));
|
|
126
55
|
writeFile('.cuttlefish/eslint-transpiler-rules.mjs', generateEslintRules(options));
|
|
127
56
|
writeFile('.gitignore', generateGitignore(options));
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
57
|
+
writeFile('.editorconfig', generateEditorconfig(options));
|
|
58
|
+
// Editor integration: workspace-bundled VS Code extension for .ui syntax
|
|
59
|
+
// highlighting (best-effort — warns and skips if the assets are missing).
|
|
60
|
+
// hideNpm: end-user projects are not npm packages — hide VS Code's NPM
|
|
61
|
+
// Scripts view and npm task detection.
|
|
62
|
+
for (const file of writeEditorIntegration(resolvedOutDir, undefined, true))
|
|
63
|
+
createdFiles.push(file);
|
|
64
|
+
if (options.board) {
|
|
65
|
+
// Board-target projects materialize .cuttlefish/board.ts + board.json on
|
|
66
|
+
// the first build (config-loader → the framework's board generator);
|
|
67
|
+
// nothing to write here.
|
|
132
68
|
}
|
|
133
|
-
if (options.
|
|
69
|
+
if (options.includeStarter) {
|
|
134
70
|
const entryName = 'main.ts';
|
|
135
|
-
const
|
|
136
|
-
fs.writeFileSync(
|
|
137
|
-
createdFiles.push(
|
|
71
|
+
const entryPath = path.join(srcDir, entryName);
|
|
72
|
+
fs.writeFileSync(entryPath, generateStarterProgram(options), 'utf-8');
|
|
73
|
+
createdFiles.push(entryPath);
|
|
138
74
|
}
|
|
139
75
|
// Embedded projects get a starter hardware test (@typecad/expect / cuttlefish-test).
|
|
140
76
|
// Native projects have no serial/board path, so they get no test setup.
|
|
@@ -156,7 +92,7 @@ export function scaffoldProject(options, outDir) {
|
|
|
156
92
|
}
|
|
157
93
|
return { createdFiles, outDir: resolvedOutDir, options };
|
|
158
94
|
}
|
|
159
|
-
export function
|
|
95
|
+
export function printCreateNextSteps(options, outDir, opts = {}) {
|
|
160
96
|
const relativeDir = path.relative(process.cwd(), outDir) || '.';
|
|
161
97
|
console.log();
|
|
162
98
|
console.log(chalk.cyan(`⤳ Cuttlefish`));
|
|
@@ -173,8 +109,10 @@ export function printInitNextSteps(options, outDir, opts = {}) {
|
|
|
173
109
|
console.log(chalk.bold.white("To debug (VS Code):"));
|
|
174
110
|
console.log(` ${chalk.cyan("open the folder and press F5")} ${chalk.dim("(builds + flashes, then attaches GDB)")}`);
|
|
175
111
|
}
|
|
112
|
+
console.log();
|
|
113
|
+
console.log(chalk.bold.white("To edit .ui files (VS Code):"));
|
|
114
|
+
console.log(` ${chalk.cyan("open the folder and approve the workspace extension")} ${chalk.dim("(adds .ui syntax highlighting)")}`);
|
|
176
115
|
if (!options.isNative) {
|
|
177
|
-
const portHint = process.platform === 'win32' ? 'COM4' : '/dev/ttyACM0';
|
|
178
116
|
console.log();
|
|
179
117
|
console.log(chalk.bold.white("To simulate without hardware:"));
|
|
180
118
|
console.log(` ${chalk.cyan("npm run simulate")}`);
|
|
@@ -184,7 +122,10 @@ export function printInitNextSteps(options, outDir, opts = {}) {
|
|
|
184
122
|
console.log();
|
|
185
123
|
console.log(chalk.bold.white("To run hardware tests:"));
|
|
186
124
|
console.log(` ${chalk.cyan("npm run test:hw")}`);
|
|
187
|
-
|
|
188
|
-
|
|
125
|
+
if (!options.port) {
|
|
126
|
+
const portHint = process.platform === 'win32' ? 'COM4' : '/dev/ttyACM0';
|
|
127
|
+
console.log();
|
|
128
|
+
console.log(chalk.dim(`No serial port was set — edit ${chalk.white("cuttlefish.config.ts")} to change ${chalk.white(portHint)} to your port (or pass --port on any command).`));
|
|
129
|
+
}
|
|
189
130
|
}
|
|
190
131
|
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ArchitectureIdentifier } from '../api/index.js';
|
|
2
|
+
export interface CreateProjectOptions {
|
|
3
|
+
projectName: string;
|
|
4
|
+
targetId: string;
|
|
5
|
+
targetDisplayName: string;
|
|
6
|
+
isNative: boolean;
|
|
7
|
+
architecture?: ArchitectureIdentifier;
|
|
8
|
+
/** Qualified Zephyr board target (board-target projects). */
|
|
9
|
+
board?: string;
|
|
10
|
+
/** True when the board's devicetree declares an LED (pack fact — drives
|
|
11
|
+
* the starter between an I/O skeleton and LED-blink). */
|
|
12
|
+
hasLed?: boolean;
|
|
13
|
+
frameworkPackage: string;
|
|
14
|
+
framework: string;
|
|
15
|
+
buildTarget?: string;
|
|
16
|
+
/** Zephyr SoC name (bare-silicon / contract projects). */
|
|
17
|
+
soc?: string;
|
|
18
|
+
baudRate?: number;
|
|
19
|
+
includeStarter: boolean;
|
|
20
|
+
toolchainType?: string;
|
|
21
|
+
/** Extra frameworkData fields (e.g. `{ target: 'esp32s3' }` for framework-esp32). */
|
|
22
|
+
frameworkData?: Record<string, unknown>;
|
|
23
|
+
/** Selected probe-method id (Zephyr boards with a probeMethods table);
|
|
24
|
+
* emits the zephyr.probe section in the scaffolded config. */
|
|
25
|
+
probeMethod?: string;
|
|
26
|
+
/** Probe methods the board supports (wizard/catalog data) — used to write
|
|
27
|
+
* the config comment listing the alternatives. */
|
|
28
|
+
probeMethods?: {
|
|
29
|
+
id: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
}[];
|
|
32
|
+
/** Serial port picked at create time (test.port). Absent →
|
|
33
|
+
* the platform hint placeholder. */
|
|
34
|
+
port?: string;
|
|
35
|
+
/** MCU-only Zephyr target: emit `zephyr.customBoard: true` so the framework
|
|
36
|
+
* generates an out-of-tree board named after the build target. */
|
|
37
|
+
zephyrCustomBoard?: boolean;
|
|
38
|
+
/** Starter-program pin for MCU-only targets (a port name — bare silicon has
|
|
39
|
+
* no board-level LED alias). */
|
|
40
|
+
starterPin?: string;
|
|
41
|
+
}
|
|
42
|
+
export declare function generateProjectPackageJson(options: CreateProjectOptions): string;
|
|
43
|
+
export declare function generateProjectTsconfig(options: CreateProjectOptions): string;
|
|
44
|
+
export declare function generateProjectConfig(options: CreateProjectOptions): string;
|
|
45
|
+
export declare function generateProjectEnvDts(options: CreateProjectOptions): string;
|
|
46
|
+
export declare function generateStarterProgram(options: CreateProjectOptions): string;
|
|
47
|
+
export declare function generateStarterTest(_options: CreateProjectOptions): string;
|
|
48
|
+
export declare function generateStarterSim(options: CreateProjectOptions): string;
|
|
49
|
+
export declare function generateGitignore(_options: CreateProjectOptions): string;
|
|
50
|
+
export declare function generateEditorconfig(_options: CreateProjectOptions): string;
|
|
51
|
+
export declare function generateEslintConfig(_options: CreateProjectOptions): string;
|