Skip to content

Commit 2830e9d

Browse files
committed
feat: migrate to TypeScript 5.6. Don't swallow errors thrown during class instance construction. Refactoring. Use modern EcmaScript
1 parent d6760fb commit 2830e9d

37 files changed

+4832
-4890
lines changed

.eslintrc.json

-8
This file was deleted.

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/FUNDING.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
github: wessberg
21
patreon: wessberg

CHANGELOG.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
# 2.1.0 (2022-04-07)
1+
# [2.1.0](https://github.com/wessberg/di/compare/5903e8520730951484bddbeac1759e4a297e9e8c...v2.1.0) (2022-04-07)
2+
23

34
### Bug Fixes
45

5-
- don't run tests with np ([0ec8060](https://github.com/wessberg/di/commit/0ec80603e77c161589fe64bbe265db449d401c41))
6+
* don't run tests with np ([0ec8060](https://github.com/wessberg/di/commit/0ec80603e77c161589fe64bbe265db449d401c41))
7+
68

79
### Features
810

9-
- **api:** API overhaul ([5903e85](https://github.com/wessberg/di/commit/5903e8520730951484bddbeac1759e4a297e9e8c))
10-
- update development dependencies. Update documentation. Produce cleaner output. More informative error descriptions ([7b19929](https://github.com/wessberg/di/commit/7b199295e8d87b83387fc1a2c448fc4431622dfe))
11+
* **api:** API overhaul ([5903e85](https://github.com/wessberg/di/commit/5903e8520730951484bddbeac1759e4a297e9e8c))
12+
* update development dependencies. Update documentation. Produce cleaner output. More informative error descriptions ([7b19929](https://github.com/wessberg/di/commit/7b199295e8d87b83387fc1a2c448fc4431622dfe))
13+
14+
15+

CODE_OF_CONDUCT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
5555
Enforcement
5656

5757
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58-
reported by contacting any of the code of conduct enforcers: [Frederik Wessberg](mailto:frederikwessberg@hotmail.com) ([@FredWessberg](https://twitter.com/FredWessberg)) ([Website](https://github.com/wessberg)).
58+
reported by contacting any of the code of conduct enforcers: .
5959
All complaints will be reviewed and investigated and will result in a response that
6060
is deemed necessary and appropriate to the circumstances. The project team is
6161
obligated to maintain confidentiality with regard to the reporter of an incident.

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
You are more than welcome to contribute to `@wessberg/di` in any way you please, including:
1+
You are more than welcome to contribute to `undefined` in any way you please, including:
22

33
- Updating documentation.
44
- Fixing spelling and grammar
55
- Adding tests
66
- Fixing issues and suggesting new features
7-
- Blogging, tweeting, and creating tutorials about `@wessberg/di`
8-
- Reaching out to [@FredWessberg](https://twitter.com/FredWessberg) on Twitter
7+
- Blogging, tweeting, and creating tutorials about `undefined`
8+
99
- Submit an issue or a Pull Request

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright © 2022 [Frederik Wessberg](mailto:frederikwessberg@hotmail.com) ([@FredWessberg](https://twitter.com/FredWessberg)) ([Website](https://github.com/wessberg))
3+
Copyright © 2024
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+1-12
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ This library is a runtime dependency, but you need to transform your code with t
4444

4545
## Backers
4646

47-
| <a href="https://usebubbles.com"><img alt="Bubbles" src="https://uploads-ssl.webflow.com/5d682047c28b217055606673/5e5360be16879c1d0dca6514_icon-thin-128x128%402x.png" height="70" /></a> | <a href="https://github.com/cblanc"><img alt="Christopher Blanchard" src="https://avatars0.githubusercontent.com/u/2160685?s=400&v=4" height="70" /></a> | <a href="https://github.com/ideal-postcodes"><img alt="Ideal Postcodes" src="https://avatars.githubusercontent.com/u/4996310?s=200&v=4" height="70" /></a> | <a href="https://www.xerox.com"><img alt="Xerox" src="https://avatars.githubusercontent.com/u/9158512?s=200&v=4" height="70" /></a> | <a href="https://changelog.me"><img alt="Trent Raymond" src="https://avatars.githubusercontent.com/u/1509616?v=4" height="70" /></a> | <a href="https://scrubtheweb.com"><img alt="scrubtheweb" src="https://avatars.githubusercontent.com/u/41668218?v=4" height="70" /></a> |
48-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
49-
| [Bubbles](https://usebubbles.com)<br><strong>Twitter</strong>: [@usebubbles](https://twitter.com/usebubbles) | [Christopher Blanchard](https://github.com/cblanc) | [Ideal Postcodes](https://github.com/ideal-postcodes) | [Xerox](https://www.xerox.com) | [Trent Raymond](https://changelog.me) | [scrubtheweb](https://scrubtheweb.com) |
50-
5147
### Patreon
5248

5349
<a href="https://www.patreon.com/bePatron?u=11315442"><img alt="Patrons on Patreon" src="https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dwessberg%26type%3Dpatrons" width="200" /></a>
@@ -72,7 +68,6 @@ This library is a runtime dependency, but you need to transform your code with t
7268
- [Injecting instances of services into classes](#injecting-instances-of-services-into-classes)
7369
- [Getting instances directly from the `DIContainer`](#getting-instances-directly-from-the-dicontainer)
7470
- [Contributing](#contributing)
75-
- [Maintainers](#maintainers)
7671
- [FAQ](#faq)
7772
- [This is pure magic. How does it work?](#this-is-pure-magic-how-does-it-work)
7873
- [Is it possible to have multiple, scoped containers?](#is-it-possible-to-have-multiple-scoped-containers)
@@ -182,12 +177,6 @@ Do you want to contribute? Awesome! Please follow [these recommendations](./CONT
182177

183178
<!-- SHADOW_SECTION_MAINTAINERS_START -->
184179

185-
## Maintainers
186-
187-
| <a href="mailto:frederikwessberg@hotmail.com"><img alt="Frederik Wessberg" src="https://avatars2.githubusercontent.com/u/20454213?s=460&v=4" height="70" /></a> |
188-
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
189-
| [Frederik Wessberg](mailto:frederikwessberg@hotmail.com)<br><strong>Twitter</strong>: [@FredWessberg](https://twitter.com/FredWessberg)<br><strong>Github</strong>: [@wessberg](https://github.com/wessberg)<br>_Lead Developer_ |
190-
191180
<!-- SHADOW_SECTION_MAINTAINERS_END -->
192181

193182
<!-- SHADOW_SECTION_FAQ_START -->
@@ -208,6 +197,6 @@ Sure. You can instantiate as many as you want to, as long as you make sure the [
208197

209198
## License
210199

211-
MIT © [Frederik Wessberg](mailto:frederikwessberg@hotmail.com) ([@FredWessberg](https://twitter.com/FredWessberg)) ([Website](https://github.com/wessberg))
200+
MIT ©
212201

213202
<!-- SHADOW_SECTION_LICENSE_END -->

eslint.config.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import shared from "@wessberg/ts-config/eslint.config.js";
2+
3+
export default [
4+
...shared,
5+
{
6+
rules: {
7+
"@typescript-eslint/no-explicit-any": "off",
8+
"@typescript-eslint/no-unused-vars": "off",
9+
"@typescript-eslint/no-unsafe-assignment": "off",
10+
"@typescript-eslint/no-unsafe-call": "off",
11+
"@typescript-eslint/class-literal-property-style": "off"
12+
}
13+
}
14+
];

package.json

+94-87
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,96 @@
11
{
2-
"name": "@wessberg/di",
3-
"version": "2.1.0",
4-
"description": "A compile-time powered Dependency-Injection container for Typescript that holds services and can produce instances of them as required.",
5-
"scripts": {
6-
"generate:sandhog": "sandhog all --yes",
7-
"generate:changelog": "standard-changelog --first-release",
8-
"generate:all": "pnpm run generate:sandhog && pnpm run generate:changelog",
9-
"clean": "rimraf dist",
10-
"lint": "tsc --noEmit && eslint \"src/**/*.ts\" --color",
11-
"prettier": "prettier --write \"{src,test,documentation}/**/*.{js,ts,json,html,xml,css,md}\"",
12-
"prebuild": "pnpm run clean",
13-
"build": "pnpm run prebuild && pnpm run rollup",
14-
"prewatch": "pnpm run clean",
15-
"watch": "pnpm run prewatch && pnpm run rollup -- --watch",
16-
"rollup": "rollup -c rollup.config.js",
17-
"preversion": "pnpm run lint && pnpm run build",
18-
"version": "pnpm run preversion && pnpm run generate:all && git add .",
19-
"release": "np --no-cleanup --no-yarn --no-tests",
20-
"update:check": "pnpx npm-check-updates -x typescript-* --dep dev,prod",
21-
"update:commit": "pnpx npm-check-updates -u -x typescript-* --dep dev,prod && pnpm update && pnpm install"
22-
},
23-
"keywords": [
24-
"DI",
25-
"dependency injection",
26-
"ioc",
27-
"inversion",
28-
"service",
29-
"container",
30-
"newable",
31-
"reflection",
32-
"singleton",
33-
"transient"
34-
],
35-
"devDependencies": {
36-
"@typescript-eslint/eslint-plugin": "^5.26.0",
37-
"@typescript-eslint/parser": "^5.26.0",
38-
"@wessberg/ts-config": "^2.0.2",
39-
"rollup-plugin-ts": "^2.0.7",
40-
"typescript": "4.6.4",
41-
"tslib": "^2.4.0",
42-
"npm-check-updates": "^13.0.3",
43-
"sandhog": "^1.0.43",
44-
"standard-changelog": "^2.0.27",
45-
"eslint": "^8.16.0",
46-
"eslint-config-prettier": "^8.5.0",
47-
"eslint-plugin-import": "^2.26.0",
48-
"eslint-plugin-jsdoc": "^39.3.1",
49-
"husky": "^8.0.1",
50-
"np": "^7.6.1",
51-
"pnpm": "^7.1.5",
52-
"prettier": "^2.6.2",
53-
"pretty-quick": "^3.1.3",
54-
"rimraf": "^3.0.2",
55-
"rollup": "^2.74.1"
56-
},
57-
"dependencies": {},
58-
"main": "./dist/cjs/index.js",
59-
"module": "./dist/esm/index.js",
60-
"browser": "./dist/esm/index.js",
61-
"types": "./dist/esm/index.d.ts",
62-
"typings": "./dist/esm/index.d.ts",
63-
"es2015": "./dist/esm/index.js",
64-
"repository": {
65-
"type": "git",
66-
"url": "https://github.com/wessberg/di.git"
67-
},
68-
"bugs": {
69-
"url": "https://github.com/wessberg/di/issues"
70-
},
71-
"contributors": [
72-
{
73-
"name": "Frederik Wessberg",
74-
"email": "frederikwessberg@hotmail.com",
75-
"url": "https://github.com/wessberg",
76-
"imageUrl": "https://avatars2.githubusercontent.com/u/20454213?s=460&v=4",
77-
"role": "Lead Developer",
78-
"twitter": "FredWessberg",
79-
"github": "wessberg"
80-
}
81-
],
82-
"engines": {
83-
"node": ">=9.0.0"
84-
},
85-
"license": "MIT",
86-
"files": [
87-
"dist/**/*.*"
88-
]
2+
"name": "@wessberg/di",
3+
"version": "2.1.0",
4+
"description": "A compile-time powered Dependency-Injection container for Typescript that holds services and can produce instances of them as required.",
5+
"scripts": {
6+
"generate:sandhog": "sandhog all --yes",
7+
"generate:changelog": "standard-changelog --first-release",
8+
"generate:all": "pnpm run generate:sandhog && pnpm run generate:changelog",
9+
"clean": "rimraf dist",
10+
"lint": "tsc --noEmit && eslint \"src/**/*.ts\" --color --fix",
11+
"prettier": "prettier --write \"{src,test,documentation}/**/*.{js,ts,json,html,xml,css,md}\"",
12+
"test": "node --import tsx --test \"./test/**/*.test.ts\"",
13+
"prebuild": "pnpm run clean",
14+
"build": "pnpm run clean && tsup \"src/index.ts\" --sourcemap --dts --format esm,cjs",
15+
"preversion": "pnpm run lint && pnpm run build",
16+
"version": "pnpm run preversion && pnpm run generate:all && git add .",
17+
"release": "np --no-cleanup --no-yarn --no-tests",
18+
"update:check": "pnpx npm-check-updates --dep dev,prod",
19+
"update:commit": "pnpx npm-check-updates -u --dep dev,prod && pnpm update && pnpm install"
20+
},
21+
"keywords": [
22+
"DI",
23+
"dependency injection",
24+
"ioc",
25+
"inversion",
26+
"service",
27+
"container",
28+
"newable",
29+
"reflection",
30+
"singleton",
31+
"transient"
32+
],
33+
"devDependencies": {
34+
"@types/node": "22.7.6",
35+
"@wessberg/prettier-config": "^1.0.0",
36+
"@wessberg/ts-config": "^5.0.20",
37+
"@eslint/js": "9.12.0",
38+
"eslint": "^9.12.0",
39+
"eslint-config-prettier": "^9.1.0",
40+
"eslint-plugin-jsdoc": "^50.4.3",
41+
"eslint-plugin-prettier": "^5.2.1",
42+
"typescript-eslint": "^8.10.0",
43+
"typescript": "5.6.3",
44+
"npm-check-updates": "^17.1.4",
45+
"sandhog": "^3.0.2",
46+
"standard-changelog": "^6.0.0",
47+
"husky": "^9.1.6",
48+
"lint-staged": "^15.2.10",
49+
"tsup": "^8.3.0",
50+
"np": "^10.0.7",
51+
"pnpm": "^9.12.2",
52+
"prettier": "^3.3.3",
53+
"rimraf": "^6.0.1",
54+
"tsx": "^4.19.1"
55+
},
56+
"dependencies": {},
57+
"exports": {
58+
".": {
59+
"import": "./dist/index.js",
60+
"require": "./dist/index.cjs"
61+
}
62+
},
63+
"type": "module",
64+
"types": "./dist/index.d.ts",
65+
"main": "./dist/index.cjs",
66+
"module": "./dist/index.js",
67+
"repository": {
68+
"type": "git",
69+
"url": "https://github.com/wessberg/di.git"
70+
},
71+
"bugs": {
72+
"url": "https://github.com/wessberg/di/issues"
73+
},
74+
"contributors": [
75+
{
76+
"name": "Frederik Wessberg",
77+
"email": "frederikwessberg@hotmail.com",
78+
"url": "https://github.com/wessberg",
79+
"imageUrl": "https://avatars2.githubusercontent.com/u/20454213?s=460&v=4",
80+
"role": "Lead Developer",
81+
"twitter": "FredWessberg",
82+
"github": "wessberg"
83+
}
84+
],
85+
"engines": {
86+
"node": ">=12.0.0"
87+
},
88+
"license": "MIT",
89+
"files": [
90+
"dist/**/*.*"
91+
],
92+
"lint-staged": {
93+
"*": "prettier --ignore-unknown --write"
94+
},
95+
"prettier": "@wessberg/prettier-config"
8996
}

0 commit comments

Comments
 (0)