Skip to content

poc: Add TypeScript and Go code generation#268

Open
emaarco wants to merge 7 commits into
mainfrom
claude/plan-bpmn-implementation-1F6Hm
Open

poc: Add TypeScript and Go code generation#268
emaarco wants to merge 7 commits into
mainfrom
claude/plan-bpmn-implementation-1F6Hm

Conversation

@emaarco
Copy link
Copy Markdown
Owner

@emaarco emaarco commented Apr 19, 2026

Extends bpmn-to-code with two new output languages delivered via the web module.

  • Add TYPESCRIPT and GO to OutputLanguage enum
  • TypeScriptProcessApiBuilder: generates a single exported const object with as const / as const satisfies Record<string, T> annotations per group, matching the Kotlin access pattern (ProcessApi.Elements.X)
  • TypeScriptSharedTypesBuilder: generates 5 individual interface files (BpmnTimer, BpmnError, BpmnEscalation, BpmnFlow, BpmnRelations) in a types/ sub-directory
  • GoProcessApiBuilder: generates package-level const block for process/engine ID and anonymous struct vars per group (Elements, Timers, etc.), giving the package.Elements.X access pattern; uses SCREAMING_SNAKE→PascalCase conversion for exported Go field names
  • GoSharedTypesBuilder: generates a single bpmn_types.go file in the types sub-package containing all 5 struct types
  • Register both builder pairs in CodeGenerationAdapter
  • Add TypeScript and Go options to the web frontend language dropdown and syntax-highlight map
  • Add fixture-based tests for all 4 builders

https://claude.ai/code/session_01MSGu2Y3YgZHEMqWa6wdFeM

claude and others added 4 commits April 20, 2026 11:53
Extends bpmn-to-code with two new output languages delivered via the web module.

- Add TYPESCRIPT and GO to OutputLanguage enum
- TypeScriptProcessApiBuilder: generates a single exported const object with `as const` / `as const satisfies Record<string, T>` annotations per group, matching the Kotlin access pattern (ProcessApi.Elements.X)
- TypeScriptSharedTypesBuilder: generates 5 individual interface files (BpmnTimer, BpmnError, BpmnEscalation, BpmnFlow, BpmnRelations) in a types/ sub-directory
- GoProcessApiBuilder: generates package-level const block for process/engine ID and anonymous struct vars per group (Elements, Timers, etc.), giving the `package.Elements.X` access pattern; uses SCREAMING_SNAKE→PascalCase conversion for exported Go field names
- GoSharedTypesBuilder: generates a single bpmn_types.go file in the types sub-package containing all 5 struct types
- Register both builder pairs in CodeGenerationAdapter
- Add TypeScript and Go options to the web frontend language dropdown and syntax-highlight map
- Add fixture-based tests for all 4 builders

https://claude.ai/code/session_01MSGu2Y3YgZHEMqWa6wdFeM
Add second test to GoProcessApiBuilderTest and TypeScriptProcessApiBuilderTest
using a MergedBpmnModel with escalations, mirroring the existing Kotlin/Java pattern.
Fixes JaCoCo coverage violations on EscalationsWriter and VariantsWriter inner classes.
- OutputLanguage: add experimental flag (true for TYPESCRIPT and GO)
- index.html: add TypeScript & Go options to language dropdown, hero badge
- docs/configuration.md: add TS/Go rows with experimental warning
- README: drop "JVM projects" from tagline
- kotlin.md: rule against top-level functions in files that define classes
- styles.css: sync tab-switcher styles from main
@emaarco emaarco force-pushed the claude/plan-bpmn-implementation-1F6Hm branch from 9e16df4 to 484c9cb Compare April 20, 2026 09:55
emaarco added 3 commits April 20, 2026 13:15
Introduce a ProcessApi interface covering the full object shape so
generated files use a single 'as const satisfies ProcessApi' instead
of repeating as const / satisfies on every section. Also adds blank
lines between sections and expands Flows/Relations entries to
multi-line format.
@emaarco emaarco changed the title Add TypeScript and Go code generation poc: Add TypeScript and Go code generation Apr 20, 2026
@emaarco
Copy link
Copy Markdown
Owner Author

emaarco commented May 12, 2026

Closing for now. Until further requests.

However proofs that it could work. Even though println seems kind of unprofessional.

And knowingly it will only support web module - as long as it's Java based

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants