linuxmint / linuxmint/cinnamon
Typescript support (or at least declarations) inside Cinnamon
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 5.6k
- Forks
- 915
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 3
Description
Is your feature request related to a problem? Please describe.
This includes allowing writing code in Typescript not just in Javascript. This includes:
- Provide Typescript declarations under
imports.gi, generating Cinnamon specific libs during build and provide for those we explicitly depend on. - Provide Typescript declarations in the JS folder as
d.ts - Allow writing code in typescript and generating
jsandd.tsfiles during build - this might need some extra effort so typescript knows about those libraries inimports.
Describe the solution you'd like
- I've got a repository that does just that (output is stored here), it is pretty solid and used with some applets already. I'm happy to transfer over the repo to the Cinnamon team and still maintaining it myself.
- This is a relatively easy task if the 1st step is done (technically 1. can be provided outside of Cinnamon itself for development) - downside is that these will be maintained alongside the JS files. I'm more than happy to commit to write them and maintain them myself.
- If imports are correctly resolve before (in TS) and after build (in JS) the codebase can be slowly converted .
Describe alternatives you've considered
Additional context - why?
- Personally I'd like to add more features to
js->ui->windowManager, this is why I opened this request. - Could reduce regressions in the JS codebase because it will be typed.
- Could provide better support for applets/extensions/desklets with correct types in editors with docstrings
- Could reduce cognitive load to people working on the JS codebase and maybe help people open more PRs because the codebase functionality is easier to read, because everything in
importsis not opaque as it is now or requires to read up documentation (if it exists - I'm looking at the Cinnamon specific libs in imports especially.) - Could enforce better code quality
Possible problems
- One more thing added to the toolchain Cinnamon is built with
- (Slightly) higher level of entry of writing JS code and a bit more work to setup the dev environment
Please respond if you think it's worth having a discussion about, especially that I can pledge to to most of the work around this.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the requested integration points under imports.gi, the JS folder, and the build process, then examine the linked GIR2TS and types-cjs repositories. Define how declarations are generated and how TypeScript sources produce JavaScript and .d.ts files. Done means the build supports the proposed declarations and TypeScript workflow without breaking existing JavaScript development.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- build-system, developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100