@toijs/modular 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# @toijs/modular
|
|
2
2
|
|
|
3
|
-
Compose TypeScript applications with
|
|
4
|
-
|
|
3
|
+
Compose TypeScript applications with an isomorphic module pattern, explicit DI, and Shell — on Node.js and in the browser.
|
|
5
4
|
[](https://www.npmjs.com/package/@toijs/modular)
|
|
6
5
|
[](https://www.typescriptlang.org/)
|
|
7
6
|
[](https://nodejs.org/api/esm.html)
|
|
@@ -9,16 +8,15 @@ Compose TypeScript applications with modules, explicit dependency injection, and
|
|
|
9
8
|
|
|
10
9
|
## Overview
|
|
11
10
|
|
|
12
|
-
`@toijs/modular` is
|
|
11
|
+
`@toijs/modular` is an isomorphic **composition pattern** for TypeScript: modules, explicit dependency injection, a bootstrap lifecycle, and a small runtime (`Task`, `Config`, `Metadata`, `Shell`). Use it on **Node.js servers** and in **browser clients**. App hosts (Express, Vue, React, …) plug in through **Shell** kits — this package never embeds HTTP or UI.
|
|
13
12
|
|
|
14
|
-
It does **not** include HTTP, routing, validation, GraphQL, or
|
|
13
|
+
It does **not** include HTTP, routing, validation, GraphQL, an ORM, or a renderer. Those belong in the application or in separate kits such as `@toijs/express-kit`, `@toijs/vue-kit`, and `@toijs/typeorm`.
|
|
15
14
|
|
|
16
15
|
## Why @toijs/modular?
|
|
17
16
|
|
|
18
|
-
Most TypeScript backends either assemble everything by hand or adopt a full platform such as NestJS. `@toijs/modular` sits between those options:
|
|
17
|
+
Most TypeScript backends either assemble everything by hand or adopt a full platform such as NestJS. Frontends often wire Pinia/Vuex/React context ad hoc. `@toijs/modular` sits between those options: one composition model for server and client, without inheriting an HTTP server, a CLI, or a decorator-heavy application model.
|
|
19
18
|
|
|
20
19
|
Constructor dependencies are **explicit**. `@Injectable([UserRepository])` does not read `design:paramtypes`. That is intentional — the container never infers tokens from TypeScript types.
|
|
21
|
-
|
|
22
20
|
## Features
|
|
23
21
|
|
|
24
22
|
Implemented in this package:
|
|
@@ -28,11 +26,11 @@ Implemented in this package:
|
|
|
28
26
|
- **Explicit tokens** — `@Injectable([tokens])`, `@Inject(token)`, `@Optional()`
|
|
29
27
|
- **Scopes** — `singleton` (default) and `transient` on class and factory providers
|
|
30
28
|
- **Parent/child containers** — `container.createChild()`
|
|
31
|
-
- **Lifecycle** — resolve factories, then `prepare` → `register` → `ready`
|
|
29
|
+
- **Lifecycle** — resolve factories, then `await prepare` → `await register` → `ready` (not awaited)
|
|
32
30
|
- **Task bus** — `subscribe` / `invoke` (`sequential` or `parallel`)
|
|
33
31
|
- **Config** — nested values via dot paths on a metadata-backed store
|
|
34
|
-
- **Shell** — host-app bootstrap (`create` / `register` / `ready`)
|
|
35
|
-
|
|
32
|
+
- **Shell** — host-app bootstrap (`create` / `register` / `ready`) for Express, Vue, React, … kits
|
|
33
|
+
- **Isomorphic** — same pattern on Node.js server and browser client
|
|
36
34
|
Not in this package:
|
|
37
35
|
|
|
38
36
|
- HTTP server, router, controllers as a framework primitive
|
|
@@ -117,9 +115,9 @@ Optional fields:
|
|
|
117
115
|
| --- | --- |
|
|
118
116
|
| `name` | Required identity. Duplicate names are **skipped**. Empty names are skipped. |
|
|
119
117
|
| `dependencies` | Extra `ModuleFactory[]` resolved after this module is recorded |
|
|
120
|
-
| `prepare` | Register providers, subscribe to tasks, define routes in a kit |
|
|
121
|
-
| `register` | Create the host (`shell.create`) —
|
|
122
|
-
| `ready` | After register; often unused in features |
|
|
118
|
+
| `prepare` | Register providers, subscribe to tasks, define routes in a kit — **awaited** |
|
|
119
|
+
| `register` | Create the host (`shell.create`) — **awaited**; kits must **return** the create promise |
|
|
120
|
+
| `ready` | After register — **not** awaited; often unused in features |
|
|
123
121
|
|
|
124
122
|
The factory body runs during resolve, **before** any lifecycle hook. Put `config.define` there so later factories can read config.
|
|
125
123
|
|
|
@@ -207,32 +205,31 @@ launcher.container.register(ReportService);
|
|
|
207
205
|
|
|
208
206
|
## Lifecycle
|
|
209
207
|
|
|
210
|
-
`Launcher.start()`:
|
|
208
|
+
`await Launcher.start()`:
|
|
211
209
|
|
|
212
210
|
```text
|
|
213
211
|
resolve factories (and `dependencies`)
|
|
214
212
|
↓
|
|
215
|
-
|
|
213
|
+
await prepare() × all modules
|
|
216
214
|
↓
|
|
217
|
-
|
|
215
|
+
await register() × all modules
|
|
218
216
|
↓
|
|
219
|
-
ready()
|
|
217
|
+
ready() × all modules (not awaited)
|
|
220
218
|
```
|
|
221
219
|
|
|
222
|
-
Hooks are
|
|
220
|
+
Hooks are `() => void | Promise<void>`. `start()` **awaits** `prepare` and `register` sequentially. **`ready` is not awaited.** Kits that create a host must **return** `shell.create(...)` from `register` so bootstrap waits for the host and `task.root.register` / `task.root.ready`.
|
|
223
221
|
|
|
224
|
-
`Shell` is
|
|
222
|
+
`Shell` is the second, host-specific flow used by app-shell kits (Express, Vue, React, …):
|
|
225
223
|
|
|
226
224
|
```text
|
|
227
|
-
shell.create(fn)
|
|
225
|
+
await shell.create(fn)
|
|
228
226
|
↓
|
|
229
|
-
invoke "task.root.register"
|
|
227
|
+
await invoke "task.root.register"
|
|
230
228
|
↓
|
|
231
|
-
invoke "task.root.ready"
|
|
229
|
+
await invoke "task.root.ready"
|
|
232
230
|
```
|
|
233
231
|
|
|
234
|
-
Feature modules subscribe with `shell.register` / `shell.ready`. They should not call `shell.create`.
|
|
235
|
-
|
|
232
|
+
Feature modules subscribe with `shell.register` / `shell.ready`. They should not call `shell.create`. The same modular pattern runs on Node.js and in the browser; only the kit (shell) changes.
|
|
236
233
|
## Application composition
|
|
237
234
|
|
|
238
235
|
```ts
|
|
@@ -291,23 +288,22 @@ Launcher
|
|
|
291
288
|
├── task named handler bus
|
|
292
289
|
├── metadata key/value + change events
|
|
293
290
|
├── config metadata-backed settings (dot paths)
|
|
294
|
-
└── shell host instance (Express, Vue, …)
|
|
291
|
+
└── shell host instance (Express, Vue, React, …)
|
|
295
292
|
|
|
296
293
|
Module factory
|
|
297
294
|
├── factory body runs at resolve time
|
|
298
|
-
├── prepare
|
|
299
|
-
├── register
|
|
300
|
-
└── ready
|
|
295
|
+
├── prepare awaited by start()
|
|
296
|
+
├── register awaited by start()
|
|
297
|
+
└── ready not awaited
|
|
301
298
|
```
|
|
302
299
|
|
|
303
|
-
Keep domain types and business logic as plain TypeScript. Depend on `@toijs/modular` only at the composition root (modules, `@Injectable`, `container.register`).
|
|
304
|
-
|
|
300
|
+
Keep domain types and business logic as plain TypeScript. Depend on `@toijs/modular` only at the composition root (modules, `@Injectable`, `container.register`). Same pattern on server and browser; kits supply the app shell.
|
|
305
301
|
## Use cases
|
|
306
302
|
|
|
307
303
|
Fits:
|
|
308
304
|
|
|
309
305
|
- API process composed with a kit such as `@toijs/express-kit`
|
|
310
|
-
- Vue SPA composed with `@toijs/vue-kit`
|
|
306
|
+
- Vue / React SPA composed with a UI kit (`@toijs/vue-kit` or equivalent)
|
|
311
307
|
- CLI / batch scripts that need modules + DI
|
|
312
308
|
- Long-running workers, if **you** wire the consumer (no SQS adapter ships here)
|
|
313
309
|
- Lambda handlers, if **you** bootstrap `Launcher` per cold start (no Lambda adapter ships here)
|
|
@@ -325,16 +321,16 @@ Does not fit as a drop-in:
|
|
|
325
321
|
| --- | --- | --- |
|
|
326
322
|
| DI | Explicit tokens, class/value/factory/existing | Reflection + tokens, large provider model |
|
|
327
323
|
| Module | Function factory | `@Module()` class |
|
|
328
|
-
| Lifecycle | `prepare` → `register` → `ready` (
|
|
329
|
-
| HTTP | Not included | First-class |
|
|
324
|
+
| Lifecycle | `await prepare` → `await register` → `ready` (not awaited) | Nest lifecycle hooks |
|
|
325
|
+
| HTTP / UI | Not included — Shell + kits (Express, Vue, React, …) | First-class HTTP |
|
|
326
|
+
| Runtime | Node.js and browser | Primarily Node.js |
|
|
330
327
|
| CLI | Not included | `@nestjs/cli` |
|
|
331
328
|
| ORM | Separate `@toijs/typeorm` | Separate `@nestjs/typeorm` etc. |
|
|
332
329
|
| Lambda / worker | Usable; no official adapter | Usable; larger bootstrap |
|
|
333
330
|
| Ecosystem | Small (`typeorm`, private kits) | Large |
|
|
334
331
|
| Learning curve | Small API, unusual module shape | Large API, more tutorials |
|
|
335
332
|
|
|
336
|
-
Use NestJS when you want a platform. Use `@toijs/modular` when you want composition and DI without that platform.
|
|
337
|
-
|
|
333
|
+
Use NestJS when you want a platform. Use `@toijs/modular` when you want isomorphic composition and DI without that platform.
|
|
338
334
|
A longer comparison with Effect and plain Node.js is in [docs/guides/comparison.md](docs/guides/comparison.md).
|
|
339
335
|
|
|
340
336
|
## API overview
|
|
@@ -356,14 +352,13 @@ A longer comparison with Effect and plain Node.js is in [docs/guides/comparison.
|
|
|
356
352
|
|
|
357
353
|
| Package | Status | Role |
|
|
358
354
|
| --- | --- | --- |
|
|
359
|
-
| `@toijs/modular` | v1.0.
|
|
355
|
+
| `@toijs/modular` | v1.0.4, `private: false` | Core (isomorphic composition) |
|
|
360
356
|
| `@toijs/typeorm` | v1.0.7, `private: false` | `TypeORMModule`, `ConnectionManager` |
|
|
361
|
-
| `@toijs/express-kit` | `private: true` | Express `shell.create` + router |
|
|
362
|
-
| `@toijs/vue-kit` | `private: true` | Vue `shell.create` + router |
|
|
357
|
+
| `@toijs/express-kit` | `private: true` | Express `shell.create` + router (server shell) |
|
|
358
|
+
| `@toijs/vue-kit` | `private: true` | Vue `shell.create` + router (browser shell) |
|
|
363
359
|
| `@toijs/graphql` | `private: true` | Stub — do not treat as shipped |
|
|
364
360
|
|
|
365
|
-
HTTP, Vue, i18n, layout, and device kits live outside this package. They are not required to use the container.
|
|
366
|
-
|
|
361
|
+
HTTP, Vue, React, i18n, layout, and device kits live outside this package. They are not required to use the container.
|
|
367
362
|
## Documentation
|
|
368
363
|
|
|
369
364
|
- [Documentation index](docs/README.md)
|
|
@@ -382,18 +377,18 @@ There is no `CONTRIBUTING.md` yet. Source of truth is `src/` in this package. Do
|
|
|
382
377
|
|
|
383
378
|
Not implemented, not scheduled in-repo (ideas only):
|
|
384
379
|
|
|
385
|
-
-
|
|
380
|
+
- Await `ready` hooks (today only `prepare` / `register` are awaited)
|
|
386
381
|
- Request scope
|
|
387
382
|
- CJS build
|
|
388
383
|
- Official Lambda / SQS examples as packages
|
|
384
|
+
- First-party React kit
|
|
389
385
|
- Test utilities
|
|
390
386
|
- License, changelog, CI, coverage
|
|
391
|
-
|
|
392
387
|
## Open-source status
|
|
393
388
|
|
|
394
389
|
| Item | Status |
|
|
395
390
|
| --- | --- |
|
|
396
|
-
| Version | `1.0.
|
|
391
|
+
| Version | `1.0.4` |
|
|
397
392
|
| License | **Missing** (GitHub `license: null`, no `license` field in `package.json`) |
|
|
398
393
|
| Tests | **None** in this package |
|
|
399
394
|
| CI | **None** in the repository |
|
|
@@ -402,8 +397,7 @@ Not implemented, not scheduled in-repo (ideas only):
|
|
|
402
397
|
| ESM / CJS | ESM only |
|
|
403
398
|
| README (previous) | **Missing** — this file is new |
|
|
404
399
|
|
|
405
|
-
Version `1.0.
|
|
406
|
-
|
|
400
|
+
Version `1.0.4` means the package is versioned, not that it has a stability policy. Treat breaking changes as possible until a changelog and semver policy exist.
|
|
407
401
|
## License
|
|
408
402
|
|
|
409
403
|
**NEEDS VERIFICATION.** No license file is present in the package or on [toijs/framework](https://github.com/toijs/framework). Do not assume MIT or any other license until one is published.
|
|
@@ -12,6 +12,8 @@ export declare class Launcher {
|
|
|
12
12
|
config: Config;
|
|
13
13
|
options: StartOptions;
|
|
14
14
|
instances: Map<string, Module>;
|
|
15
|
+
/** Factories already invoked — keeps re-entrant `start()` from re-running side effects. */
|
|
16
|
+
private factories;
|
|
15
17
|
constructor();
|
|
16
18
|
/**
|
|
17
19
|
* Attach a capability onto the launcher (and optionally register it in DI).
|
|
@@ -26,13 +28,16 @@ export declare class Launcher {
|
|
|
26
28
|
*/
|
|
27
29
|
modules(modules: ModuleFactory[]): this;
|
|
28
30
|
/**
|
|
29
|
-
* Resolve
|
|
30
|
-
*
|
|
31
|
-
*
|
|
31
|
+
* Resolve module factories into instances.
|
|
32
|
+
* Skips factories already invoked so a later `modules([...]).start()` (e.g. plugin
|
|
33
|
+
* attach) does not re-run host factory side effects. Only newly resolved modules
|
|
34
|
+
* are returned so prepare/register/ready run for them alone.
|
|
32
35
|
*/
|
|
33
36
|
private resolveModuleInstances;
|
|
34
37
|
/**
|
|
35
|
-
* Start the application
|
|
38
|
+
* Start (or continue starting) the application.
|
|
39
|
+
* Safe to call again after `modules([...])` adds more factories — only new
|
|
40
|
+
* modules run prepare → register → ready.
|
|
36
41
|
*/
|
|
37
42
|
start(): Promise<void>;
|
|
38
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.service.d.ts","sourceRoot":"","sources":["../../../src/launcher/services/launcher.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,qBAAa,QAAQ;IACZ,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,CAEV;IACX,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAa;;
|
|
1
|
+
{"version":3,"file":"launcher.service.d.ts","sourceRoot":"","sources":["../../../src/launcher/services/launcher.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,qBAAa,QAAQ;IACZ,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,CAEV;IACX,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAa;IAClD,2FAA2F;IAC3F,OAAO,CAAC,SAAS,CAA4B;;IA8B7C;;;;;OAKG;IACH,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EACxB,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,CAAC,EACR,KAAK,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,GACxB,IAAI,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;IAoBtB;;;OAGG;IACH,OAAO,CAAC,OAAO,EAAE,aAAa,EAAE;IAKhC;;;;;OAKG;YACW,sBAAsB;IA+BpC;;;;OAIG;IACG,KAAK;CAqBZ"}
|
|
@@ -13,6 +13,8 @@ export class Launcher {
|
|
|
13
13
|
modules: [],
|
|
14
14
|
};
|
|
15
15
|
instances = new Map();
|
|
16
|
+
/** Factories already invoked — keeps re-entrant `start()` from re-running side effects. */
|
|
17
|
+
factories = new Set();
|
|
16
18
|
constructor() {
|
|
17
19
|
this.container = new Container();
|
|
18
20
|
this.task = new Task();
|
|
@@ -71,21 +73,24 @@ export class Launcher {
|
|
|
71
73
|
return this;
|
|
72
74
|
}
|
|
73
75
|
/**
|
|
74
|
-
* Resolve
|
|
75
|
-
*
|
|
76
|
-
*
|
|
76
|
+
* Resolve module factories into instances.
|
|
77
|
+
* Skips factories already invoked so a later `modules([...]).start()` (e.g. plugin
|
|
78
|
+
* attach) does not re-run host factory side effects. Only newly resolved modules
|
|
79
|
+
* are returned so prepare/register/ready run for them alone.
|
|
77
80
|
*/
|
|
78
81
|
async resolveModuleInstances(modules, instances = []) {
|
|
79
82
|
for (const module of modules) {
|
|
83
|
+
if (this.factories.has(module)) {
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
80
86
|
const moduleInstance = module(this);
|
|
81
|
-
|
|
87
|
+
this.factories.add(module);
|
|
88
|
+
// Duplicate or empty name: factory side effects already ran once; skip hooks.
|
|
82
89
|
if (this.instances.has(moduleInstance.name) || !moduleInstance.name) {
|
|
83
90
|
continue;
|
|
84
91
|
}
|
|
85
|
-
// Register the module instance
|
|
86
92
|
this.instances.set(moduleInstance.name, moduleInstance);
|
|
87
93
|
instances.push(moduleInstance);
|
|
88
|
-
// Resolve the module instances
|
|
89
94
|
if (moduleInstance.dependencies) {
|
|
90
95
|
instances = await this.resolveModuleInstances(moduleInstance.dependencies, instances);
|
|
91
96
|
}
|
|
@@ -93,13 +98,15 @@ export class Launcher {
|
|
|
93
98
|
return instances;
|
|
94
99
|
}
|
|
95
100
|
/**
|
|
96
|
-
* Start the application
|
|
101
|
+
* Start (or continue starting) the application.
|
|
102
|
+
* Safe to call again after `modules([...])` adds more factories — only new
|
|
103
|
+
* modules run prepare → register → ready.
|
|
97
104
|
*/
|
|
98
105
|
async start() {
|
|
99
106
|
if (this.options.modules.length === 0) {
|
|
100
107
|
throw new Error("No modules registered");
|
|
101
108
|
}
|
|
102
|
-
|
|
109
|
+
const instances = await this.resolveModuleInstances(this.options.modules);
|
|
103
110
|
for (const instance of instances) {
|
|
104
111
|
await instance.prepare?.();
|
|
105
112
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.service.js","sourceRoot":"","sources":["../../../src/launcher/services/launcher.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAuB,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,MAAM,OAAO,QAAQ;IACZ,IAAI,CAAO;IACX,QAAQ,CAAW;IACnB,SAAS,CAAY;IACrB,KAAK,CAAQ;IACb,MAAM,CAAS;IACf,OAAO,GAAiB;QAC7B,OAAO,EAAE,EAAqB;KACf,CAAC;IACX,SAAS,GAAwB,IAAI,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"launcher.service.js","sourceRoot":"","sources":["../../../src/launcher/services/launcher.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAuB,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,MAAM,OAAO,QAAQ;IACZ,IAAI,CAAO;IACX,QAAQ,CAAW;IACnB,SAAS,CAAY;IACrB,KAAK,CAAQ;IACb,MAAM,CAAS;IACf,OAAO,GAAiB;QAC7B,OAAO,EAAE,EAAqB;KACf,CAAC;IACX,SAAS,GAAwB,IAAI,GAAG,EAAE,CAAC;IAClD,2FAA2F;IACnF,SAAS,GAAG,IAAI,GAAG,EAAiB,CAAC;IAE7C;QACE,IAAI,CAAC,SAAS,GA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AAK;QACT,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC3C,CAAC;QAED,MAAM,SAAS,GAAa,MAAM,IAAI,CAAC,sBAAsB,CAC3D,IAAI,CAAC,OAAO,CAAC,OAAO,CACrB,CAAC;QAEF,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YACjC,MAAM,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;QAC7B,CAAC;QAED,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YACjC,MAAM,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC;QAC9B,CAAC;QAED,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YACjC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;QACrB,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toijs/modular",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
|
-
"description": "TypeScript
|
|
6
|
+
"description": "Isomorphic TypeScript composition pattern: modules, explicit DI, and Shell for Node.js and browser apps (Express, Vue, React, …)",
|
|
7
7
|
"keywords": [
|
|
8
|
+
"isomorphic",
|
|
9
|
+
"browser",
|
|
8
10
|
"nodejs",
|
|
9
11
|
"typescript",
|
|
10
12
|
"dependency-injection",
|
|
@@ -14,7 +16,8 @@
|
|
|
14
16
|
"modular",
|
|
15
17
|
"ioc",
|
|
16
18
|
"composition",
|
|
17
|
-
"launcher"
|
|
19
|
+
"launcher",
|
|
20
|
+
"shell"
|
|
18
21
|
],
|
|
19
22
|
"repository": {
|
|
20
23
|
"type": "git",
|