Skip to content

Commit a9e06e1

Browse files
committed
deps: update to async-didi@1.0.0
1 parent bfcc7cd commit a9e06e1

File tree

5 files changed

+26
-32
lines changed

5 files changed

+26
-32
lines changed

package-lock.json

Lines changed: 17 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/app/lib/index.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,7 @@ export default function Wuffle(app, { getRouter }) {
9393

9494
// initialize modules ////////////
9595

96-
for (const module of modules) {
97-
98-
const init = /** @type {import('./types.js').DidiModule} */ (module).__init__ || [];
99-
100-
for (const component of init) {
101-
await injector[typeof component === 'function' ? 'invoke' : 'get'](component);
102-
}
103-
104-
}
96+
await injector.init();
10597

10698
await events.emit('wuffle.start');
10799

packages/app/lib/types.d.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,19 @@ import type {
1414

1515
export type Octokit = InstanceType<typeof ProbotOctokit>;
1616

17-
import type { Injector } from 'async-didi';
17+
import type {
18+
AsyncInjector as Injector,
19+
ModuleDefinition as DidiModule
20+
} from 'async-didi';
1821

1922
export {
2023
Logger,
2124
ExpressSession,
2225
Router,
2326
Octokit,
2427
Injector,
25-
ProbotApp
26-
};
27-
28-
export type DidiModule = {
29-
__init__?: Array<String>,
30-
__depends__?: Array<String>,
31-
[propName: string]: any,
28+
ProbotApp,
29+
DidiModule
3230
};
3331

3432
export type GitHubUser = {

packages/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
},
4444
"dependencies": {
4545
"@aws-sdk/client-s3": "^3.525.0",
46-
"async-didi": "^0.3.1",
46+
"async-didi": "^1.0.0",
4747
"body-parser": "^2.0.0",
4848
"compression": "^1.8.1",
4949
"express-session": "^1.18.2",

packages/app/test/helpers/index.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,7 @@ export async function bootstrap(options) {
4242

4343
const injector = new AsyncInjector(modules);
4444

45-
// initialize modules ////////////
46-
47-
for (const module of modules) {
48-
49-
const init = module.__init__ || [];
50-
51-
for (const component of init) {
52-
await injector[typeof component === 'function' ? 'invoke' : 'get'](component);
53-
}
54-
55-
}
45+
await injector.init();
5646

5747
return injector;
5848
}

0 commit comments

Comments
 (0)