nody-greeter icon indicating copy to clipboard operation
nody-greeter copied to clipboard

Misc Improvements

Open s0 opened this issue 2 years ago • 6 comments

After playing around with this code base for a couple of days, I've had a lot of fun and would love to become more involved! I've had a few ideas for how things could be improved, and happy to go into more detail for any of them, but wanted to open an issue to check that you're open to these kinds of changes before going ahead and doing any of them?

  • [x] Add CI checks for type errors, linting, formatting etc... using GitHub Actions
  • [x] Increase strictness of TypeScript configuration, and eventually enable strict: true (I've made a couple of mistakes (like this one), that would have been caught if TypeScript settings were a little stricter).
  • [ ] Replace all synchronous I/O operations with async / await
  • [x] Start using JavaScript naming conventions for symbols (variables, classes, etc...)
  • [x] Use io-ts for definition of types for configuration
  • [ ] Use io-ts for definition of types for message-passing between windows
  • [ ] Pull out all "magic constants" into the consts.ts file introduced in #11 (especially shared strings etc..., so they don't get out-of-sync with one another)
  • [x] Add explicit public / private modifiers to all class methods / properties
  • [ ] Replace any binds for methods with lambda methods
  • [x] Migrate default themes to TypeScript
  • [x] Enable sourcemaps for better debugging in both main process and renderer preload.

I'll add more things to this list as I think of them!

s0 avatar Jan 16 '22 11:01 s0

Looks nice~

However, I don't know if I like to use asynchronous I/O operations instead of sync ones... I think this change is unnecessary as almost every I/O operation is done before the windows are started; the exceptions are the battery and brightness features, which didn't seem to block the Renderer process.

About io-ts, I didn't know about it, so I will have to check it~

JezerM avatar Jan 16 '22 23:01 JezerM

I think Github Actions are covered now:

  • ESLint and Prettier check on Push and Pull Request
  • Fix code with eslint and prettier through a Pull Request (fired manually)
  • Build deb package and publish on tag release

JezerM avatar Jan 30 '22 06:01 JezerM

Sorry for not responding sooner, been a busy couple of weeks for me! Glad to see that you've made progress with the CI checks and increasing strictness too! I've opened a PR to make a few further improvements to the CI, including running TS compilation checks, and checking package-lock.json is up-to-date too!

s0 avatar Feb 11 '22 17:02 s0

Added explicit member accessibility (public/private) in 81bfa93. Also, the sourceMap option in tsconfig.json is set to true, so "Enable sourcemaps for better debugging..." should be covered~

JezerM avatar Mar 09 '22 19:03 JezerM

Default themes were migrated to TypeScript~ Now, I'm looking to remove the _vendors packages by using npm packages instead, if possible.

JezerM avatar Apr 15 '22 18:04 JezerM

JavaScript naming convention was adopted in 87944b1c6340bed74e1c57557e5d8d585c4e0177. The exceptions to this are JavaScript API objects like lightdm, greeter_config, theme_utils and greeter_comm, as this would deprecate all existing themes and would force theme maintainers to change API access. Perhaps, in the future, the latter can be done.

JezerM avatar Aug 01 '22 04:08 JezerM