Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement support for turning .json files into Lua modules #308

Merged
merged 6 commits into from
Mar 28, 2020

Conversation

LPGhatguy
Copy link
Contributor

@LPGhatguy LPGhatguy commented Mar 26, 2020

Closes #148.

This PR makes Rojo process otherwise unknown JSON files by turning them into ModuleScript instances that return the equivalent structure in Lua. This is done with a module containing a small subset of a Lua AST, and transcoding from serde_json::Value.

This didn't turn out quite as well as I was hoping. Interaction between snapshot middleware is still kind of ill-defined, and so this new middleware has to explicitly avoid turning .meta.json files into instances.

TODO

  • Finish Lua codegen for JSON transform
  • Tests
    • Basic functionality
    • Ensure that .meta.json, .project.json, and .model.json functionality is not affected
    • Ensure generated Lua is valid? Maybe we can run it.

@LPGhatguy LPGhatguy marked this pull request as ready for review March 26, 2020 18:35
@LPGhatguy LPGhatguy merged commit 4bf73c7 into master Mar 28, 2020
@LPGhatguy LPGhatguy deleted the json-to-lua branch March 28, 2020 07:36
Dekkonot pushed a commit to UpliftGames/rojo that referenced this pull request Jan 11, 2024
)

* Stub implementation

* Flesh out feature and add tests. Other snapshots currently failing.

* Blacklist .meta.json in JSON handler

* Write to correct property (Source) instead of Value

* Update changelog
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.

Support syncing .json files
1 participant