Skip to content

Add graph JSON references and prefixes - #48

Merged
ollieatkinson merged 1 commit into
trunkfrom
oliver--todo-generators-json
Jun 3, 2026
Merged

Add graph JSON references and prefixes#48
ollieatkinson merged 1 commit into
trunkfrom
oliver--todo-generators-json

Conversation

@ollieatkinson

Copy link
Copy Markdown
Owner

Adds graph JSON reference metadata, ordered JSON dictionaries for generated contracts, and configurable generated type prefixes for Swift, Kotlin, and TypeScript output.

Validation:

  • swift test --filter JSONClasses™ --filter SourceIdentifierTests --filter SwiftLexiconGeneratorTests --filter SwiftStandAloneGeneratorTests --filter KotlinStandAloneGeneratorTests --filter TypeScriptStandAloneGeneratorTests --filter LexiconGeneratorsTests

@ollieatkinson
ollieatkinson marked this pull request as ready for review June 3, 2026 09:57
@ollieatkinson
ollieatkinson requested a review from Copilot June 3, 2026 09:57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 527e2ab9b2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/Lexicon/Lexicon.Graph.JSON.swift Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the lexicon “graph JSON” contract with reference metadata and ordered JSON dictionaries, and adds configurable generated type prefixes across Swift, Kotlin, and TypeScript generators (including CLI wiring and updated tests).

Changes:

  • Add references to Lexicon.Graph.JSON / Lexicon.Graph.Node.Class.JSON, plus OrderedJSONDictionary for stable key ordering in generated JSON.
  • Introduce StandAloneTypePrefixes and thread customizable prefixes through SwiftLexicon / SwiftStandAlone / KotlinStandAlone / TypeScriptStandAlone generators.
  • Update lexicon-generate CLI options and expand generator test coverage for custom prefixes and new JSON behaviors.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Tests/LexiconGeneratorsTests/StandAloneGeneratorTests.swift Adds tests validating custom class/protocol prefixes across Swift/Kotlin/TypeScript generators.
Tests/LexiconGeneratorsTests/SourceIdentifierTests.swift Updates prefix API usage and adds coverage for separating base symbols (L/I) from generated prefixes.
Tests/LexiconGeneratorsTests/JSONClassesTests.swift Switches from raw JSON string equality to decoding assertions; validates references and ordered dictionary output.
Sources/LexiconGenerators/SwiftTypeDeclarations.swift Threads StandAloneTypePrefixes through Swift type declaration generation.
Sources/LexiconGenerators/SwiftProperties.swift Threads StandAloneTypePrefixes through Swift property generation.
Sources/LexiconGenerators/SwiftLexiconGenerator.swift Adds generateSource(..., prefixes:) overload and uses prefixes for root/type naming.
Sources/LexiconGenerators/StandAlone/TypeScriptStandAloneGenerator.swift Adds prefix-configurable generation and updates internal helpers to use StandAloneTypePrefixes.
Sources/LexiconGenerators/StandAlone/SwiftStandAloneGenerator.swift Adds generateSource(..., prefixes:) overload and uses prefixes for root/type naming.
Sources/LexiconGenerators/StandAlone/KotlinStandAloneGenerator.swift Adds generateSource(..., prefixes:) overload and uses prefixes for root/type naming.
Sources/LexiconGenerators/SourceIdentifier.swift Introduces StandAloneTypePrefixes and updates naming logic to keep base symbols distinct.
Sources/Lexicon/Lexicon.Graph.JSON.swift Adds ordered dictionary type, references computation, and updates JSON model to include references and ordered maps.
Sources/lexicon-generate/CodeGenerator.swift Adds CLI options for class/protocol prefixes and routes them into supported generators.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/Lexicon/Lexicon.Graph.JSON.swift
@ollieatkinson
ollieatkinson force-pushed the oliver--todo-generators-json branch from 527e2ab to eceb790 Compare June 3, 2026 10:39
@ollieatkinson
ollieatkinson merged commit 8491cbe into trunk Jun 3, 2026
2 checks passed
@ollieatkinson
ollieatkinson deleted the oliver--todo-generators-json branch June 3, 2026 20:01
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