-
-
Notifications
You must be signed in to change notification settings - Fork 807
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
Add export package-information command #4298
Add export package-information command #4298
Conversation
8db0fdd
to
e858ca1
Compare
d2d59b7
to
0d0f3df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonderful, thank you!
Let's make it always render all the fields, even if they are the defaults. This will make it easier to understand what all the fields are.
It would also be good to have some round-trip tests, to ensure that a config file serialised and then deserialise doesn't have a bug that results in data-loss.
compiler-core/src/snapshots/gleam_core__config__package_config_to_json.snap
Outdated
Show resolved
Hide resolved
c59d105
to
f10e47a
Compare
@lpil I think all comments have been handled. Let me know if I should squash some commits or something. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, but not all the comments have been resolved. Please remove all the serialisation skipping, the trait use, and merge the duplicate serde attribute.
Dammit, I think I had some rebasing issue 😮💨 |
Ah I hate it when that happens! |
b90a873
to
ad02832
Compare
@lpil The duplicate serde attribute was removed rather than merged due to the removal of all skips. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! The test failed due to ordering, but you've got preserve_order
as a serde feature. Is that not enough to make the order deterministic or is there more to do there?
I thought it was enough as you can expect, sigh. Gonna investigate as it! |
4669f34
to
6f72a8b
Compare
Should be fixed now, it was my fault (obsolete snapshot). |
6f72a8b
to
ce4c4b1
Compare
Tests are failing! |
c52c70d
to
403801c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Could you update the changelog please
gleam_version_constraint format was that of pubgrub's. Now it's hex's.
This allows us to have a single field in PackageConfig for both hex and pubgrub
e110ae1
to
b8302ed
Compare
Done and rebased due to conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I've just noticed that the top level {"gleam.toml":
is missing!
Oh, nice catch. That was definitely lost when I trashed the first iteration. Working on it 🚀 |
In fact there is no test for this nesting thing, as the snapshots are for the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We want the tests to test this output, not just a subset of that output 🙏 Move the nesting out of the command please and have the test do that new serialisation thingy
Ensure that JSON nesting is in the snapshot by introducing a new PackageInformation struct
I introduced the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!!
Closes #4240
Serialize
trait toPackageConfig
and all types it depends on.gleam export package-information --out [out]
commandgleam export package-interface
format forgleam_version_constraint
, which was being exported like:"gleam-version-constraint":"1.8.0 <= v"
because it relied on pubgrub. Now it uses hexpm format and emits>= 1.8.0
.