@sentzunhat/zacatl 0.0.23 → 0.0.24
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 +10 -15
- package/build/index.d.ts +0 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +0 -2
- package/build/index.js.map +1 -1
- package/build/service/architecture/application/application.js.map +1 -1
- package/build/service/architecture/domain/domain.js.map +1 -1
- package/build/service/architecture/infrastructure/infrastructure.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +4 -3
package/README.md
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
6
|
[](https://www.typescriptlang.org/)
|
|
7
7
|
[](https://nodejs.org/)
|
|
8
|
-
[](#testing)
|
|
9
|
+
[](#testing)
|
|
10
10
|
|
|
11
11
|
**Production-ready TypeScript framework for building scalable microservices, APIs, and distributed systems.**
|
|
12
12
|
|
|
@@ -47,29 +47,24 @@ Zacatl is MIT-licensed (permissive). Please don’t use it to harm people.
|
|
|
47
47
|
npm install @sentzunhat/zacatl
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
## 📦 Import
|
|
50
|
+
## 📦 Import Strategy (v0.0.24+)
|
|
51
51
|
|
|
52
|
-
>
|
|
52
|
+
> **⚠️ Breaking Change in v0.0.24:** Main package no longer exports ORMs. Use dedicated subpaths to prevent eager loading. [Migration Guide](./docs/migration/v0.0.24.md)
|
|
53
53
|
|
|
54
54
|
```typescript
|
|
55
|
-
//
|
|
56
|
-
import {
|
|
57
|
-
Service,
|
|
58
|
-
mongoose,
|
|
59
|
-
Schema,
|
|
60
|
-
Sequelize,
|
|
61
|
-
singleton,
|
|
62
|
-
} from "@sentzunhat/zacatl";
|
|
63
|
-
|
|
64
|
-
// Option 2: Subpath imports (minimal - tree-shakeable)
|
|
55
|
+
// ✅ Recommended: Subpath imports (tree-shakeable, no eager loading)
|
|
65
56
|
import { Service } from "@sentzunhat/zacatl";
|
|
66
57
|
import { mongoose, Schema } from "@sentzunhat/zacatl/orm/mongoose";
|
|
58
|
+
import { Sequelize, DataTypes } from "@sentzunhat/zacatl/orm/sequelize";
|
|
67
59
|
import { resolveDependency } from "@sentzunhat/zacatl/application";
|
|
68
60
|
|
|
69
|
-
//
|
|
61
|
+
// Other subpath shortcuts
|
|
70
62
|
import { BaseRepository, ORMType } from "@sentzunhat/zacatl/infrastructure";
|
|
71
63
|
import { CustomError } from "@sentzunhat/zacatl/errors";
|
|
72
64
|
import { loadConfig } from "@sentzunhat/zacatl/config";
|
|
65
|
+
|
|
66
|
+
// ❌ No longer available (removed in v0.0.24)
|
|
67
|
+
// import { mongoose } from "@sentzunhat/zacatl"; // Would cause eager loading
|
|
73
68
|
```
|
|
74
69
|
|
|
75
70
|
### Hello World HTTP Service
|
package/build/index.d.ts
CHANGED
|
@@ -16,6 +16,4 @@ export { container, singleton, inject } from "tsyringe";
|
|
|
16
16
|
export type { DependencyContainer } from "tsyringe";
|
|
17
17
|
export { z } from "zod";
|
|
18
18
|
export type { ZodSchema, ZodType, ZodError } from "zod";
|
|
19
|
-
export * from "./orm/mongoose.js";
|
|
20
|
-
export * from "./orm/sequelize.js";
|
|
21
19
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"./src/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAE/B,cAAc,uCAAuC,CAAC;AAEtD,OAAO,EACL,UAAU,EACV,YAAY,EACZ,cAAc,EACd,YAAY,GACb,MAAM,+CAA+C,CAAC;AACvD,YAAY,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAGlF,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACxD,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"./src/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAE/B,cAAc,uCAAuC,CAAC;AAEtD,OAAO,EACL,UAAU,EACV,YAAY,EACZ,cAAc,EACd,YAAY,GACb,MAAM,+CAA+C,CAAC;AACvD,YAAY,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAGlF,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACxD,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -12,6 +12,4 @@ export * from "./service/architecture/infrastructure";
|
|
|
12
12
|
export { ServerType, ServerVendor, DatabaseVendor, HandlersType, } from "./service/architecture/platform/server/server";
|
|
13
13
|
export { container, singleton, inject } from "tsyringe";
|
|
14
14
|
export { z } from "zod";
|
|
15
|
-
export * from "./orm/mongoose.js";
|
|
16
|
-
export * from "./orm/sequelize.js";
|
|
17
15
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"./src/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAE/B,cAAc,uCAAuC,CAAC;AAEtD,OAAO,EACL,UAAU,EACV,YAAY,EACZ,cAAc,EACd,YAAY,GACb,MAAM,+CAA+C,CAAC;AAIvD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAExD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"./src/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAE/B,cAAc,uCAAuC,CAAC;AAEtD,OAAO,EACL,UAAU,EACV,YAAY,EACZ,cAAc,EACd,YAAY,GACb,MAAM,+CAA+C,CAAC;AAIvD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAExD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC","sourcesContent":["export * from \"./optionals\";\nexport * from \"./configuration\";\nexport * from \"./utils\";\nexport * from \"./error\";\nexport * from \"./dependency-injection\";\nexport * from \"./service\";\nexport { Service } from \"./service\";\nexport type { ConfigService } from \"./service\";\nexport * from \"./logs\";\nexport * from \"./runtime\";\nexport * from \"./localization\";\n\nexport * from \"./service/architecture/infrastructure\";\n\nexport {\n ServerType,\n ServerVendor,\n DatabaseVendor,\n HandlersType,\n} from \"./service/architecture/platform/server/server\";\nexport type { ConfigServer } from \"./service/architecture/platform/server/server\";\n\n// Third-party integrations\nexport { container, singleton, inject } from \"tsyringe\";\nexport type { DependencyContainer } from \"tsyringe\";\nexport { z } from \"zod\";\nexport type { ZodSchema, ZodType, ZodError } from \"zod\";\n\n// ⚠️ ORM exports REMOVED from main package to prevent eager loading\n// Use dedicated subpath imports instead:\n// import { mongoose, Schema } from \"@sentzunhat/zacatl/orm/mongoose\"\n// import { Sequelize, DataTypes } from \"@sentzunhat/zacatl/orm/sequelize\"\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.js","sourceRoot":"./src/","sources":["service/architecture/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAe,MAAM,iBAAiB,CAAC;AAoBpE,MAAM,OAAO,WAAY,SAAQ,oBAAoB;IAC3C,MAAM,CAAoB;IAE3B,YAAY,GAAkB,EAAE,CAAC;IACjC,aAAa,GAAmB,EAAE,CAAC;IAE1C,YAAY,MAAyB;QACnC,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,SAAS,CAAC;YACb,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;YACrB,cAAc,EAAE,IAAI;YACpB,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,CAAC;SACnD,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAGrB,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YACxB,IAAI,CAAC,YAAY,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;IAKO,YAAY;QAClB,IAAI,CAAC,4BAA4B,CAC/B,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,EACzC,IAAI,CAAC,YAAY,CAClB,CAAC;QAEF,IAAI,CAAC,4BAA4B,CAC/B,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,EAC1C,IAAI,CAAC,aAAa,CACnB,CAAC;IACJ,CAAC;IAEM,KAAK;QAEV,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;YAC9B,IAAI,CAAC,YAAY,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;CACF","sourcesContent":["import i18n from \"i18n\";\nimport path from \"path\";\n\nimport { AbstractArchitecture, Constructor } from \"../architecture\";\nimport { HookHandler, RouteHandler } from \"./entry-points/rest\";\n\nexport type ApplicationHookHandlers = Array<Constructor<HookHandler>>;\nexport type ApplicationRouteHandlers = Array<Constructor<RouteHandler>>;\n\nexport type ApplicationEntryPoints = {\n rest: {\n // Middleware for pre-/post-processing\n hookHandlers: ApplicationHookHandlers;\n // Endpoints (or routes) as the request targets; expect an array of class constructors\n routeHandlers: ApplicationRouteHandlers;\n };\n};\n\nexport type ConfigApplication = {\n entryPoints: ApplicationEntryPoints;\n autoRegister?: boolean; // Auto-register on construction (default: false)\n};\n\nexport class Application extends AbstractArchitecture {\n private config: ConfigApplication;\n\n public hookHandlers: HookHandler[] = [];\n public routeHandlers: RouteHandler[] = [];\n\n constructor(config: ConfigApplication) {\n super();\n\n i18n.configure({\n locales: [\"en\", \"fr\"],\n objectNotation: true,\n directory: path.join(process.cwd(), \"src/locales\"),\n });\n\n this.config = config;\n
|
|
1
|
+
{"version":3,"file":"application.js","sourceRoot":"./src/","sources":["service/architecture/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAe,MAAM,iBAAiB,CAAC;AAoBpE,MAAM,OAAO,WAAY,SAAQ,oBAAoB;IAC3C,MAAM,CAAoB;IAE3B,YAAY,GAAkB,EAAE,CAAC;IACjC,aAAa,GAAmB,EAAE,CAAC;IAE1C,YAAY,MAAyB;QACnC,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,SAAS,CAAC;YACb,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;YACrB,cAAc,EAAE,IAAI;YACpB,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,CAAC;SACnD,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAGrB,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YACxB,IAAI,CAAC,YAAY,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;IAKO,YAAY;QAClB,IAAI,CAAC,4BAA4B,CAC/B,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,YAAY,EACzC,IAAI,CAAC,YAAY,CAClB,CAAC;QAEF,IAAI,CAAC,4BAA4B,CAC/B,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,EAC1C,IAAI,CAAC,aAAa,CACnB,CAAC;IACJ,CAAC;IAEM,KAAK;QAEV,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;YAC9B,IAAI,CAAC,YAAY,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;CACF","sourcesContent":["import i18n from \"i18n\";\nimport path from \"path\";\n\nimport { AbstractArchitecture, Constructor } from \"../architecture\";\nimport { HookHandler, RouteHandler } from \"./entry-points/rest\";\n\nexport type ApplicationHookHandlers = Array<Constructor<HookHandler>>;\nexport type ApplicationRouteHandlers = Array<Constructor<RouteHandler>>;\n\nexport type ApplicationEntryPoints = {\n rest: {\n // Middleware for pre-/post-processing\n hookHandlers: ApplicationHookHandlers;\n // Endpoints (or routes) as the request targets; expect an array of class constructors\n routeHandlers: ApplicationRouteHandlers;\n };\n};\n\nexport type ConfigApplication = {\n entryPoints: ApplicationEntryPoints;\n autoRegister?: boolean; // Auto-register on construction (default: false)\n};\n\nexport class Application extends AbstractArchitecture {\n private config: ConfigApplication;\n\n public hookHandlers: HookHandler[] = [];\n public routeHandlers: RouteHandler[] = [];\n\n constructor(config: ConfigApplication) {\n super();\n\n i18n.configure({\n locales: [\"en\", \"fr\"],\n objectNotation: true,\n directory: path.join(process.cwd(), \"src/locales\"),\n });\n\n this.config = config;\n\n // Auto-register if enabled (useful without Service)\n if (config.autoRegister) {\n this.registerRest();\n }\n }\n\n /**\n * Register and store dependencies for REST entry points\n */\n private registerRest(): void {\n this.registerAndStoreDependencies(\n this.config.entryPoints.rest.hookHandlers,\n this.hookHandlers,\n );\n\n this.registerAndStoreDependencies(\n this.config.entryPoints.rest.routeHandlers,\n this.routeHandlers,\n );\n }\n\n public start(): void {\n // Register if not already done\n if (!this.config.autoRegister) {\n this.registerRest();\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain.js","sourceRoot":"./src/","sources":["service/architecture/domain/domain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAe,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAOrC,MAAM,OAAO,MAAO,SAAQ,oBAAoB;IACtC,MAAM,CAAe;IACrB,SAAS,GAAoB,EAAE,CAAC;IAExC,YAAY,MAAoB;QAC9B,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAGrB,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YACxB,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,KAAK;QAEhB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;YAC9B,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACnD,CAAC;QAGD,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;YAClD,IAAI,SAAS,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC/C,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAa,CAAC;gBACnE,IACE,QAAQ,YAAY,QAAQ;oBAC5B,OAAO,QAAQ,CAAC,KAAK,KAAK,UAAU,EACpC,CAAC;oBACD,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;oBACvB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAChC,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["import { AbstractArchitecture, Constructor } from \"../architecture\";\nimport { Provider } from \"./provider\";\nimport { container } from \"tsyringe\";\n\nexport type ConfigDomain = {\n providers: Array<Constructor>;\n autoRegister?: boolean; // Auto-register on construction (default: false)\n};\n\nexport class Domain extends AbstractArchitecture {\n private config: ConfigDomain;\n private providers: Array<Provider> = [];\n\n constructor(config: ConfigDomain) {\n super();\n\n this.config = config;\n
|
|
1
|
+
{"version":3,"file":"domain.js","sourceRoot":"./src/","sources":["service/architecture/domain/domain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAe,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAOrC,MAAM,OAAO,MAAO,SAAQ,oBAAoB;IACtC,MAAM,CAAe;IACrB,SAAS,GAAoB,EAAE,CAAC;IAExC,YAAY,MAAoB;QAC9B,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAGrB,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YACxB,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,KAAK;QAEhB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;YAC9B,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACnD,CAAC;QAGD,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;YAClD,IAAI,SAAS,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC/C,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAa,CAAC;gBACnE,IACE,QAAQ,YAAY,QAAQ;oBAC5B,OAAO,QAAQ,CAAC,KAAK,KAAK,UAAU,EACpC,CAAC;oBACD,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;oBACvB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBAChC,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["import { AbstractArchitecture, Constructor } from \"../architecture\";\nimport { Provider } from \"./provider\";\nimport { container } from \"tsyringe\";\n\nexport type ConfigDomain = {\n providers: Array<Constructor>;\n autoRegister?: boolean; // Auto-register on construction (default: false)\n};\n\nexport class Domain extends AbstractArchitecture {\n private config: ConfigDomain;\n private providers: Array<Provider> = [];\n\n constructor(config: ConfigDomain) {\n super();\n\n this.config = config;\n\n // Auto-register if enabled (useful without Service)\n if (config.autoRegister) {\n this.registerDependencies(this.config.providers);\n }\n }\n\n public async start(): Promise<void> {\n // Register if not already done\n if (!this.config.autoRegister) {\n this.registerDependencies(this.config.providers);\n }\n\n // Auto-start providers that implement the start method\n for (const ProviderClass of this.config.providers) {\n if (container.isRegistered(ProviderClass.name)) {\n const provider = container.resolve(ProviderClass.name) as Provider;\n if (\n provider instanceof Provider &&\n typeof provider.start === \"function\"\n ) {\n await provider.start();\n this.providers.push(provider);\n }\n }\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infrastructure.js","sourceRoot":"./src/","sources":["service/architecture/infrastructure/infrastructure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAe,MAAM,iBAAiB,CAAC;AAOpE,MAAM,OAAO,cAAe,SAAQ,oBAAoB;IAC9C,MAAM,CAAuB;IAErC,YAAY,MAA4B;QACtC,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAGrB,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YACxB,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;IAEM,KAAK;QAEV,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;YAC9B,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;CACF","sourcesContent":["import { AbstractArchitecture, Constructor } from \"../architecture\";\n\nexport type ConfigInfrastructure = {\n repositories: Array<Constructor>;\n autoRegister?: boolean; // Auto-register on construction (default: false)\n};\n\nexport class Infrastructure extends AbstractArchitecture {\n private config: ConfigInfrastructure;\n\n constructor(config: ConfigInfrastructure) {\n super();\n\n this.config = config;\n
|
|
1
|
+
{"version":3,"file":"infrastructure.js","sourceRoot":"./src/","sources":["service/architecture/infrastructure/infrastructure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAe,MAAM,iBAAiB,CAAC;AAOpE,MAAM,OAAO,cAAe,SAAQ,oBAAoB;IAC9C,MAAM,CAAuB;IAErC,YAAY,MAA4B;QACtC,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAGrB,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YACxB,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;IAEM,KAAK;QAEV,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;YAC9B,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;CACF","sourcesContent":["import { AbstractArchitecture, Constructor } from \"../architecture\";\n\nexport type ConfigInfrastructure = {\n repositories: Array<Constructor>;\n autoRegister?: boolean; // Auto-register on construction (default: false)\n};\n\nexport class Infrastructure extends AbstractArchitecture {\n private config: ConfigInfrastructure;\n\n constructor(config: ConfigInfrastructure) {\n super();\n\n this.config = config;\n\n // Auto-register if enabled (useful without Service)\n if (config.autoRegister) {\n this.registerDependencies(this.config.repositories);\n }\n }\n\n public start(): void {\n // Register if not already done\n if (!this.config.autoRegister) {\n this.registerDependencies(this.config.repositories);\n }\n }\n}\n"]}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -26,6 +26,7 @@ export type { DependencyContainer } from "tsyringe";
|
|
|
26
26
|
export { z } from "zod";
|
|
27
27
|
export type { ZodSchema, ZodType, ZodError } from "zod";
|
|
28
28
|
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
// ⚠️ ORM exports REMOVED from main package to prevent eager loading
|
|
30
|
+
// Use dedicated subpath imports instead:
|
|
31
|
+
// import { mongoose, Schema } from "@sentzunhat/zacatl/orm/mongoose"
|
|
32
|
+
// import { Sequelize, DataTypes } from "@sentzunhat/zacatl/orm/sequelize"
|