Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

v2.3 #155

Merged
merged 27 commits into from
Mar 4, 2024
Merged

v2.3 #155

merged 27 commits into from
Mar 4, 2024

Conversation

barthofu
Copy link
Owner

@barthofu barthofu commented Feb 12, 2024

TSCord template v2.3

This is the changelog, you can see the migration guide from the v2.2 here.

This update mainly focus on 3 things:

  • developer experience
  • refactoring and cleaning the codebase
  • keeping the dependencies and ecosystem up to date

Warning

If you want to see the changes coming alongside this PR, check commit per commit because we've ran the new code formater and it has changed by default the style of nearly all the files.

Features

  • HMR (Hot Module Replacement) on commands and events files ([Feature] HMR #131)
  • Logs auto-archiving and retention policies ([Feature] Log auto-archive policy #143)
  • Linting and formatting through an eslint config using antfu/eslint-config as base ([Feature] Code Formatting #128)
  • Lint stage in github actions workflows
  • Environment variables validation ([Feature] Env variables validation #130)
  • Created wrapper @Service decorator for @singleton, which can take a keepInstanceAfterHmr parameter in order to keep the instance state between HMR reloads (e.g: Store service)
  • Created wrappers @Injectable and @AutoInjectable of respectively @injectable and @autoInjectable to uniformize names and import source (@/decorators instead of tsyringe)
  • Type discordx client config in the src/client.ts file (6f83ffb)

Refactor

  • Switching back from swc to tsc in order to improve stability at the cost of little speed deperdition (feat(#132): switching from swc to tsc #135)
  • Renamed all internal path aliases from @<module_name> to @/<module_name> (e.g: @services -> @/services)
  • Remove useless botOnline api middleware HTTP request (8060043)
  • Remove useless websocket client and all related events by switching them to REST endpoints for the dashboard (8db5d31)
  • Remove all eval from the code, for security concerns (60baa42)
  • Remove undesired typesafe-i18n logs at startup (c570dde)

Bug fixes

  • isJSONEncodable isn't a function at startup (65338ea)
  • Plugins can't import intents from client config (add934f - @Mr-Artemus)

Chores

  • Update to node v20.11 (LTS)
  • Update dependencies

@barthofu
Copy link
Owner Author

barthofu commented Feb 12, 2024

Todo

  • Deprecate tscord-cli (through npm deprecated command)
  • Update plugins
  • [Bonus] Documentation on how to disable the linter
  • Update CLI templates
  • Add a disclaimer in the doc to advertise that TSCord, as it is today, is not suited for sharding and then for >2000 servers bots
  • Publish tscord-cli to now available tscord npm name
  • Fix HMR and add the doc relative to it
  • Test on windows
  • Test on docker
  • try npm audit fix --force

barthofu and others added 22 commits February 21, 2024 00:13
`swc`, despite being a little faster, was involving way too much random issues and wasn't stable at all.
and convert the old WS event emitters to API endpoints for the dashboard
+ change typescript aliases from `@<module>` to `@/<module>` (ex: `@services` -> `@/services` to distinguish them from external npm packages
@Mr-Artemus Mr-Artemus marked this pull request as ready for review February 26, 2024 20:39
@barthofu barthofu merged commit b1b46d0 into main Mar 4, 2024
1 check passed
@barthofu barthofu deleted the version/2.3 branch March 4, 2024 10:41
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants