@smounters/imperium 1.0.1 → 1.0.3

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 CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to `@smounters/imperium` are documented in this file.
4
4
 
5
+ ## 1.0.3 - 2026-03-20
6
+
7
+ ### Fixed
8
+ - Controller handler methods now correctly bind `this` to the controller instance.
9
+
10
+ ### Changed
11
+ - Config examples use exported `appConfigSchema` instead of inline definitions.
12
+ - Package exports restricted to subpath-only; added `prepack` build enforcement.
13
+ - Added ESLint and Prettier tooling.
14
+
15
+ ### CI
16
+ - Publish workflow consolidated into single tag-based `publish.yml` with GitHub Release creation.
17
+ - npm publish via classic `NPM_TOKEN` secret.
18
+
5
19
  ## 0.1.0 - 2026-02-22
6
20
 
7
21
  - Initial public package setup.
package/README.md CHANGED
@@ -93,14 +93,7 @@ await app.start({ port: 3000 });
93
93
  ```ts
94
94
  import { Application } from "@smounters/imperium/core";
95
95
  import { ConfigService, LoggerService } from "@smounters/imperium/services";
96
- import { z } from "zod";
97
-
98
- const appConfigSchema = z.object({
99
- APP_PORT: z.coerce.number().default(8000),
100
- APP_GLOBAL_PREFIX: z.string().default(""),
101
- });
102
-
103
- type AppConfig = z.infer<typeof appConfigSchema>;
96
+ import { appConfigSchema, type AppConfig } from "@smounters/imperium/validation";
104
97
 
105
98
  const app = new Application(AppModule, {
106
99
  host: "0.0.0.0",
@@ -124,6 +117,17 @@ await app.start({
124
117
  app.resolve(LoggerService).info({ event: "app.started", port: config.APP_PORT });
125
118
  ```
126
119
 
120
+ If your app needs extra config fields, extend the exported base schema:
121
+
122
+ ```ts
123
+ import { appConfigSchema } from "@smounters/imperium/validation";
124
+ import { z } from "zod";
125
+
126
+ const projectConfigSchema = appConfigSchema.extend({
127
+ REDIS_URL: z.url(),
128
+ });
129
+ ```
130
+
127
131
  ## Multi Providers
128
132
 
129
133
  ```ts
@@ -159,7 +159,7 @@ export function createHttpHandler(app, controller, methodName) {
159
159
  transformedArgs[index] = value;
160
160
  }
161
161
  const interceptors = collectInterceptorsForHttp(controller, methodName, app.getGlobalInterceptors()).map((interceptorLike) => resolveEnhancer(requestScope, interceptorLike));
162
- const controllerHandler = instance[methodName];
162
+ const controllerHandler = (instance[methodName].bind(instance));
163
163
  let idx = -1;
164
164
  const next = async () => {
165
165
  idx++;
@@ -141,7 +141,7 @@ export function createRpcHandler(app, controller, methodName) {
141
141
  }
142
142
  const interceptors = collectInterceptorsForRpc(controller, methodName, app.getGlobalInterceptors()).map((interceptorLike) => resolveEnhancer(scope, interceptorLike));
143
143
  const args = buildRpcArgs(payload, context, handler);
144
- const controllerHandler = instance[methodName];
144
+ const controllerHandler = (instance[methodName].bind(instance));
145
145
  let idx = -1;
146
146
  const next = async () => {
147
147
  idx++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smounters/imperium",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "NestJS-like modular DI container with unified HTTP + Connect RPC server for TypeScript",
5
5
  "keywords": [
6
6
  "di",
@@ -53,6 +53,20 @@
53
53
  "engines": {
54
54
  "node": ">=20.0.0"
55
55
  },
56
+ "scripts": {
57
+ "build": "pnpm exec tsc -p tsconfig.json",
58
+ "typecheck": "pnpm exec tsc -p tsconfig.json --noEmit",
59
+ "lint": "eslint \"src/**/*.{ts,tsx}\"",
60
+ "lint:fix": "eslint \"src/**/*.{ts,tsx}\" --fix",
61
+ "format": "prettier . --write",
62
+ "format:check": "prettier . --check",
63
+ "clean": "rm -rf dist",
64
+ "docs:dev": "pnpm exec vitepress dev docs",
65
+ "docs:build": "pnpm exec vitepress build docs",
66
+ "docs:preview": "pnpm exec vitepress preview docs",
67
+ "prepack": "pnpm run clean && pnpm run build",
68
+ "prepublishOnly": "pnpm run clean && pnpm run build"
69
+ },
56
70
  "peerDependencies": {
57
71
  "@connectrpc/connect": "^2.1.1",
58
72
  "@connectrpc/connect-fastify": "^2.1.1",
@@ -82,17 +96,5 @@
82
96
  "vitepress": "^1.6.4",
83
97
  "zod": "^4.3.6"
84
98
  },
85
- "dependencies": {},
86
- "scripts": {
87
- "build": "pnpm exec tsc -p tsconfig.json",
88
- "typecheck": "pnpm exec tsc -p tsconfig.json --noEmit",
89
- "lint": "eslint \"src/**/*.{ts,tsx}\"",
90
- "lint:fix": "eslint \"src/**/*.{ts,tsx}\" --fix",
91
- "format": "prettier . --write",
92
- "format:check": "prettier . --check",
93
- "clean": "rm -rf dist",
94
- "docs:dev": "pnpm exec vitepress dev docs",
95
- "docs:build": "pnpm exec vitepress build docs",
96
- "docs:preview": "pnpm exec vitepress preview docs"
97
- }
98
- }
99
+ "dependencies": {}
100
+ }