@autometa/app 0.3.2 → 0.3.4
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/CHANGELOG.md +20 -0
- package/dist/esm/index.js +7 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @autometa/app
|
|
2
2
|
|
|
3
|
+
## 0.3.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [2aee2a4]
|
|
8
|
+
- @autometa/injection@0.1.3
|
|
9
|
+
|
|
10
|
+
## 0.3.3
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 536004e: fix: injection errors and http client hooks
|
|
15
|
+
|
|
16
|
+
- The new dependency injection library sometimes returned class prototypes instead of class instances due to inconsistent caching of decorated types.
|
|
17
|
+
- HTTP client hooks were not executing when certain builder methods were called.
|
|
18
|
+
|
|
19
|
+
- bac2661: fix: world not defined on app
|
|
20
|
+
- Updated dependencies [536004e]
|
|
21
|
+
- @autometa/injection@0.1.2
|
|
22
|
+
|
|
3
23
|
## 0.3.2
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/esm/index.js
CHANGED
|
@@ -8,11 +8,15 @@ var AutometaWorld = class {
|
|
|
8
8
|
|
|
9
9
|
// src/get-app.ts
|
|
10
10
|
import { v4 } from "uuid";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
Container,
|
|
13
|
+
defineContainerContext
|
|
14
|
+
} from "@autometa/injection";
|
|
12
15
|
function getApp(appType, containerName = v4()) {
|
|
13
16
|
const context = defineContainerContext(containerName);
|
|
14
17
|
const container = new Container(context);
|
|
15
|
-
|
|
18
|
+
const app = container.get(appType);
|
|
19
|
+
return app;
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
// src/decorators/app-type.ts
|
|
@@ -20,7 +24,7 @@ import { metadata } from "@autometa/injection";
|
|
|
20
24
|
function AppType(container, world, environment = "default") {
|
|
21
25
|
const env = environment ?? "default";
|
|
22
26
|
return (target) => {
|
|
23
|
-
metadata(target
|
|
27
|
+
metadata(target).set({
|
|
24
28
|
key: "world",
|
|
25
29
|
class: world
|
|
26
30
|
});
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/autometa-app.ts","../../src/autometa-world.ts","../../src/get-app.ts","../../src/decorators/app-type.ts"],"sourcesContent":["import { World } from \"./fixtures.typings\";\nexport abstract class AutometaApp {\n id: string;\n [key: string]: unknown;\n world: World;\n}\n","export class AutometaWorld {}\n","import { AutometaApp } from \"./autometa-app\";\nimport { Class } from \"@autometa/types\";\nimport { v4 } from \"uuid\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/autometa-app.ts","../../src/autometa-world.ts","../../src/get-app.ts","../../src/decorators/app-type.ts"],"sourcesContent":["import { World } from \"./fixtures.typings\";\nexport abstract class AutometaApp {\n id: string;\n [key: string]: unknown;\n world: World;\n}\n","export class AutometaWorld {}\n","import { AutometaApp } from \"./autometa-app\";\nimport { Class } from \"@autometa/types\";\nimport { v4 } from \"uuid\";\nimport {\n Container,\n defineContainerContext,\n} from \"@autometa/injection\";\nimport { App } from \"./fixtures.typings\";\nexport function getApp<T extends AutometaApp>(\n appType: Class<T>,\n containerName = v4()\n): App {\n const context = defineContainerContext(containerName);\n const container = new Container(context);\n const app = container.get<App>(appType);\n return app;\n}\n","import { Class } from \"@autometa/types\";\nimport { App, World, AutometaWorld } from \"..\";\nimport { metadata } from \"@autometa/injection\";\nexport function AppType(\n container: Record<string, { app: Class<App>; world: Class<World> }>,\n world: Class<AutometaWorld>,\n environment = \"default\"\n) {\n const env = environment ?? \"default\";\n return (target: Class<unknown>) => {\n metadata(target).set({\n key: \"world\",\n class: world\n });\n container[env] = { app: target as Class<App>, world: world as Class<World> };\n };\n}\n"],"mappings":";AACO,IAAe,cAAf,MAA2B;AAIlC;;;ACLO,IAAM,gBAAN,MAAoB;AAAC;;;ACE5B,SAAS,UAAU;AACnB;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEA,SAAS,OACd,SACA,gBAAgB,GAAG,GACd;AACL,QAAM,UAAU,uBAAuB,aAAa;AACpD,QAAM,YAAY,IAAI,UAAU,OAAO;AACvC,QAAM,MAAM,UAAU,IAAS,OAAO;AACtC,SAAO;AACT;;;ACdA,SAAS,gBAAgB;AAClB,SAAS,QACd,WACA,OACA,cAAc,WACd;AACA,QAAM,MAAM,eAAe;AAC3B,SAAO,CAAC,WAA2B;AACjC,aAAS,MAAM,EAAE,IAAI;AAAA,MACnB,KAAK;AAAA,MACL,OAAO;AAAA,IACT,CAAC;AACD,cAAU,GAAG,IAAI,EAAE,KAAK,QAAsB,MAA6B;AAAA,EAC7E;AACF;","names":[]}
|
package/dist/index.js
CHANGED
|
@@ -41,7 +41,8 @@ var import_injection = require("@autometa/injection");
|
|
|
41
41
|
function getApp(appType, containerName = (0, import_uuid.v4)()) {
|
|
42
42
|
const context = (0, import_injection.defineContainerContext)(containerName);
|
|
43
43
|
const container = new import_injection.Container(context);
|
|
44
|
-
|
|
44
|
+
const app = container.get(appType);
|
|
45
|
+
return app;
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
// src/decorators/app-type.ts
|
|
@@ -49,7 +50,7 @@ var import_injection2 = require("@autometa/injection");
|
|
|
49
50
|
function AppType(container, world, environment = "default") {
|
|
50
51
|
const env = environment ?? "default";
|
|
51
52
|
return (target) => {
|
|
52
|
-
(0, import_injection2.metadata)(target
|
|
53
|
+
(0, import_injection2.metadata)(target).set({
|
|
53
54
|
key: "world",
|
|
54
55
|
class: world
|
|
55
56
|
});
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/autometa-app.ts","../src/autometa-world.ts","../src/get-app.ts","../src/decorators/app-type.ts"],"sourcesContent":["export * from \"./autometa-app\";\nexport * from \"./autometa-world\";\nexport * from \"./get-app\";\nexport * from \"./decorators\";\nexport * from \"./fixtures.typings\";\n","import { World } from \"./fixtures.typings\";\nexport abstract class AutometaApp {\n id: string;\n [key: string]: unknown;\n world: World;\n}\n","export class AutometaWorld {}\n","import { AutometaApp } from \"./autometa-app\";\nimport { Class } from \"@autometa/types\";\nimport { v4 } from \"uuid\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/autometa-app.ts","../src/autometa-world.ts","../src/get-app.ts","../src/decorators/app-type.ts"],"sourcesContent":["export * from \"./autometa-app\";\nexport * from \"./autometa-world\";\nexport * from \"./get-app\";\nexport * from \"./decorators\";\nexport * from \"./fixtures.typings\";\n","import { World } from \"./fixtures.typings\";\nexport abstract class AutometaApp {\n id: string;\n [key: string]: unknown;\n world: World;\n}\n","export class AutometaWorld {}\n","import { AutometaApp } from \"./autometa-app\";\nimport { Class } from \"@autometa/types\";\nimport { v4 } from \"uuid\";\nimport {\n Container,\n defineContainerContext,\n} from \"@autometa/injection\";\nimport { App } from \"./fixtures.typings\";\nexport function getApp<T extends AutometaApp>(\n appType: Class<T>,\n containerName = v4()\n): App {\n const context = defineContainerContext(containerName);\n const container = new Container(context);\n const app = container.get<App>(appType);\n return app;\n}\n","import { Class } from \"@autometa/types\";\nimport { App, World, AutometaWorld } from \"..\";\nimport { metadata } from \"@autometa/injection\";\nexport function AppType(\n container: Record<string, { app: Class<App>; world: Class<World> }>,\n world: Class<AutometaWorld>,\n environment = \"default\"\n) {\n const env = environment ?? \"default\";\n return (target: Class<unknown>) => {\n metadata(target).set({\n key: \"world\",\n class: world\n });\n container[env] = { app: target as Class<App>, world: world as Class<World> };\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCO,IAAe,cAAf,MAA2B;AAIlC;;;ACLO,IAAM,gBAAN,MAAoB;AAAC;;;ACE5B,kBAAmB;AACnB,uBAGO;AAEA,SAAS,OACd,SACA,oBAAgB,gBAAG,GACd;AACL,QAAM,cAAU,yCAAuB,aAAa;AACpD,QAAM,YAAY,IAAI,2BAAU,OAAO;AACvC,QAAM,MAAM,UAAU,IAAS,OAAO;AACtC,SAAO;AACT;;;ACdA,IAAAA,oBAAyB;AAClB,SAAS,QACd,WACA,OACA,cAAc,WACd;AACA,QAAM,MAAM,eAAe;AAC3B,SAAO,CAAC,WAA2B;AACjC,oCAAS,MAAM,EAAE,IAAI;AAAA,MACnB,KAAK;AAAA,MACL,OAAO;AAAA,IACT,CAAC;AACD,cAAU,GAAG,IAAI,EAAE,KAAK,QAAsB,MAA6B;AAAA,EAC7E;AACF;","names":["import_injection"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autometa/app",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "App and World container for Autometa",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"@autometa/asserters": "0.1.8",
|
|
52
52
|
"@autometa/errors": "0.2.2",
|
|
53
53
|
"@autometa/fixture-proxies": "^0.1.3",
|
|
54
|
-
"@autometa/injection": "^0.1.
|
|
54
|
+
"@autometa/injection": "^0.1.3",
|
|
55
55
|
"@autometa/phrases": "0.1.12",
|
|
56
56
|
"tsyringe": "^4.8.0",
|
|
57
57
|
"uuid": "^9.0.1"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
|
-
"test": "vitest run",
|
|
60
|
+
"test": "vitest run --passWithNoTests",
|
|
61
61
|
"coverage": "vitest run --coverage",
|
|
62
62
|
"prettify": "prettier --config .prettierrc 'src/**/*.ts' --write",
|
|
63
63
|
"lint": "eslint . --max-warnings 0",
|