Skip to content

Output json in nested structure#86

Merged
tylersayshi merged 3 commits intotylersayshi:mainfrom
jphastings:directory-output
Apr 6, 2026
Merged

Output json in nested structure#86
tylersayshi merged 3 commits intotylersayshi:mainfrom
jphastings:directory-output

Conversation

@jphastings
Copy link
Copy Markdown
Contributor

@jphastings jphastings commented Apr 6, 2026

gen-emit now writes schemas into a nested directory structure based on the NSID (e.g. com/atproto/repo/strongRef.json instead of com.atproto.repo.strongRef.json).

$ gen-emit ./lexicons ./src/lexicons/**/*.ts

$ tree ./lexicons
lexicons
└── com
    └── atproto
        └── repo
            └── strongRef.json

This is the layout used by goat, lex, lpm, and others.

@tylersayshi
Copy link
Copy Markdown
Owner

Do you think this should just be the default?

@jphastings
Copy link
Copy Markdown
Contributor Author

Yeah! If you're comfortable with the breaking change I could either swap it over the other way (eg. --flat) or remove the 'flat' style entirely?

@tylersayshi
Copy link
Copy Markdown
Owner

Yeah! If you're comfortable with the breaking change I could either swap it over the other way (eg. --flat) or remove the 'flat' style entirely?

yep! that's fine with me. if you note the "breaking change" in the changeset it'll show up in the release notes and I think that's sufficient.

Let's just remove flat entirely and conform with other ecosystem tools on this. It's not something I have a reason to deviate on afaik. Just was the arbitrary decision I made at the time of the initial implementation.

`gen-emit` now writes schemas into a nested directory structure based on the NSID (e.g. `com/atproto/repo/strongRef.json` instead of `com.atproto.repo.strongRef.json`).

This is the layout expected by goat, lex, lpm, and others.
@jphastings jphastings changed the title Add option to output json in nested structure Output json in nested structure Apr 6, 2026
@jphastings
Copy link
Copy Markdown
Contributor Author

jphastings commented Apr 6, 2026

Rejigged to make it a permanent swap out to directory-based output 😊 Ready for review @tylersayshi !

Copy link
Copy Markdown
Owner

@tylersayshi tylersayshi left a comment

Choose a reason for hiding this comment

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

otherwise looks good, thanks!

@tylersayshi tylersayshi merged commit a4c76a1 into tylersayshi:main Apr 6, 2026
7 checks passed
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