codesandbox-importers
codesandbox-importers copied to clipboard
`getParameters` method in define API requires file content to be a `string` in TypeScript
The getParameters
method currently requires the value under content
(which is a property of a file) to be a string
: https://github.com/codesandbox/codesandbox-importers/blob/e68dcdd289c32045293db862b1897130a0825e0a/packages/import-utils/src/api/define.ts#L6
But in the docs, it's specified that content
under package.json
can be an object.
Either the documentation or the type signature on getParameters
should be updated accordingly. I currently can't use an object in TS.
I made a demo of how the package.json
key could be typed in this TS playground.
Thanks for opening the issue @juliannaroen! You're right, the docs are a bit wrong and we should update them. We're currently in the middle of rewriting the git importer into our Elixir server (instead of having it here as a standalone) and once we've done that we'll be completely rewriting some of the docs, especially the ones for the define
endpoint.
In the meantime I'll try and make a small change to the docs to clarify what should be used now and let you know when I've done this. Hopefully next week.
Any progress on the define
endpoint docs @sbinlondon? Would a PR containing @juliannaroen's proposal be accepted?