chore: Imports directly from files instead of index files (#4400)

Currently we import from `index.js` files where we could simply import the actual file(s) or module we need.

This also creates a bit of confusion since it isn't obvious from where stuff is coming from, especially when we are importing types such as `Discord<XYZ>` types both from `@discordeno/types` and a `index.js` in the same file, one such example is `transformers/reverse/component.ts`.

As far as I can tell, this does not have any specific advantage beside readability, maybe something with tree-shaking. (and for us, tree-shaking doesn't really matter)

The only files that still import index.js files are:
- index.js files themself
- bot/src/handlers.js since it does a `import * as handlers from './handlers/index.js'` and the alternative is like 90 lines of imports

Co-authored-by: Link <link20050703@gmail.com>
This commit is contained in:
Fleny
2025-08-26 20:41:14 +02:00
committed by GitHub
co-authored by Link
parent 3af54ca144
commit e94308c8f2
116 changed files with 405 additions and 425 deletions
@@ -1,6 +1,6 @@
import { expect } from 'chai'
import { describe, it } from 'mocha'
import { createDesiredPropertiesObject } from '../../src/index.js'
import { createDesiredPropertiesObject } from '../../src/desiredProperties.js'
describe('desired properties', () => {
it('fills defaults', () => {