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

TypeScript support for config #346

Closed
trustedtomato opened this issue Mar 16, 2025 · 6 comments
Closed

TypeScript support for config #346

trustedtomato opened this issue Mar 16, 2025 · 6 comments
Assignees
Milestone

Comments

@trustedtomato
Copy link

Config can be given through a JSON/YAML file, and through init({config: {backend: {name: "git-gateway"}, ...}}) as shown here.
Right now, the @sveltia/cms is not typed at all, which is fair, given that Decap CMS and as such Sveltia CMS too, is probably mostly used through the JSON/YAML config.
However, providing it through the init function has two major benefits:

Therefore I'm suggesting the typing of the package. Inspiration could be taken from here: https://github.com/decaporg/decap-cms/blob/main/packages/decap-cms-core/index.d.ts

@kyoshino
Copy link
Member

Will do at some point. A workaround can be found in #215 but it’s not perfect as Sveltia CMS has added some new options.

@kyoshino
Copy link
Member

kyoshino commented Mar 17, 2025

Actually we already have JSDoc type definitions. I’ll try to generate .d.ts from the typedef.js like Sveltia UI does.

@kyoshino kyoshino self-assigned this Mar 17, 2025
kyoshino added a commit that referenced this issue Mar 17, 2025
Fix #346
@kyoshino
Copy link
Member

Type generation is working well locally. I’ll make sure all types are up-to-date according to the Decap CMS document.

@kyoshino
Copy link
Member

kyoshino commented Mar 19, 2025

@kyoshino kyoshino added this to the RC milestone Mar 23, 2025
@kyoshino
Copy link
Member

Shipped v0.63.1 with TypeScript support.

@trustedtomato
Copy link
Author

Just checked now. Works great, thank you for the quick fix:)

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

No branches or pull requests

2 participants