Commit e2ef301
authored
refactor(sdk): Clean-up
## Summary
Centralizes the `tsyringe` dependency injection setup by introducing a
dedicated `setupTsyringe.ts` module that handles the `reflect-metadata`
import. This eliminates the need for scattered `import
'reflect-metadata'` statements across source and test files, making the
DI configuration more maintainable and ensuring consistent
initialization.
## Changes
- Created `packages/sdk/src/setupTsyringe.ts` to centralize the
`reflect-metadata` import
- Updated core SDK entry points (`StreamrClient.ts`, `Config.ts`,
`ConfigTypes.ts`, `PersistenceManager.ts`) to import the new setup
module instead of `reflect-metadata` directly
- Added `setupTsyringe.ts` to Jest's `setupFilesAfterEnv` configuration
for automatic test initialization
- Added `setupTsyringe.ts` import to `karma-setup.js` to fix the browser
test build
- Removed redundant `import 'reflect-metadata'` statements from 60+ test
files
## Limitations and future improvements
- The setup module currently only imports `reflect-metadata`, but could
be extended in the future to include other tsyringe configuration or
polyfills if neededtsyringe setup (#3362)1 parent 4f55793 commit e2ef301
File tree
69 files changed
+5
-124
lines changed- packages/sdk
- src
- test
- end-to-end
- integration
- test-utils
- unit
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
69 files changed
+5
-124
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
4 | 2 | | |
5 | 3 | | |
| |||
0 commit comments