@h3ravel/shared 0.13.0 → 0.15.0

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
@@ -1,5 +1,17 @@
1
1
  # @h3ravel/shared
2
2
 
3
+ ## 0.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d07ff49: feat: reserve the `app.` namespace for generic service provider resolution.
8
+
9
+ ## 0.14.0
10
+
11
+ ### Minor Changes
12
+
13
+ - feat: add app to HttpContext interface
14
+
3
15
  ## 0.13.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.d.cts CHANGED
@@ -53,7 +53,7 @@ interface IContainer {
53
53
  * @param key - The key or constructor for the service.
54
54
  * @returns The resolved service instance.
55
55
  */
56
- make<T extends UseKey>(key: T | (new (...args: any[]) => Bindings[T])): Bindings[T];
56
+ make<T extends UseKey, X = undefined>(key: T | (new (..._args: any[]) => Bindings[T])): X extends undefined ? Bindings[T] : X;
57
57
  /**
58
58
  * Checks if a service is registered in the container.
59
59
  * @param key - The key to check.
@@ -304,6 +304,7 @@ interface IRouter {
304
304
  middleware(path: string | IMiddleware[], handler: Middleware, opts?: MiddlewareOptions): this;
305
305
  }
306
306
  interface HttpContext {
307
+ app: IApplication;
307
308
  request: IRequest;
308
309
  response: IResponse;
309
310
  }
@@ -356,6 +357,7 @@ type RemoveIndexSignature<T> = {
356
357
  };
357
358
  type Bindings = {
358
359
  [key: string]: any;
360
+ [key: `app.${string}`]: any;
359
361
  env(): NodeJS.ProcessEnv;
360
362
  env<T extends string>(key: T, def?: any): any;
361
363
  view(templatePath: string, state?: Record<string, any>): Promise<string>;
@@ -370,7 +372,7 @@ type Bindings = {
370
372
  };
371
373
  'http.app': H3;
372
374
  'path.base': string;
373
- 'app.paths': PathLoader;
375
+ 'load.paths': PathLoader;
374
376
  'http.serve': typeof serve;
375
377
  'http.request': IRequest;
376
378
  'http.response': IResponse;
package/dist/index.d.ts CHANGED
@@ -53,7 +53,7 @@ interface IContainer {
53
53
  * @param key - The key or constructor for the service.
54
54
  * @returns The resolved service instance.
55
55
  */
56
- make<T extends UseKey>(key: T | (new (...args: any[]) => Bindings[T])): Bindings[T];
56
+ make<T extends UseKey, X = undefined>(key: T | (new (..._args: any[]) => Bindings[T])): X extends undefined ? Bindings[T] : X;
57
57
  /**
58
58
  * Checks if a service is registered in the container.
59
59
  * @param key - The key to check.
@@ -304,6 +304,7 @@ interface IRouter {
304
304
  middleware(path: string | IMiddleware[], handler: Middleware, opts?: MiddlewareOptions): this;
305
305
  }
306
306
  interface HttpContext {
307
+ app: IApplication;
307
308
  request: IRequest;
308
309
  response: IResponse;
309
310
  }
@@ -356,6 +357,7 @@ type RemoveIndexSignature<T> = {
356
357
  };
357
358
  type Bindings = {
358
359
  [key: string]: any;
360
+ [key: `app.${string}`]: any;
359
361
  env(): NodeJS.ProcessEnv;
360
362
  env<T extends string>(key: T, def?: any): any;
361
363
  view(templatePath: string, state?: Record<string, any>): Promise<string>;
@@ -370,7 +372,7 @@ type Bindings = {
370
372
  };
371
373
  'http.app': H3;
372
374
  'path.base': string;
373
- 'app.paths': PathLoader;
375
+ 'load.paths': PathLoader;
374
376
  'http.serve': typeof serve;
375
377
  'http.request': IRequest;
376
378
  'http.response': IResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h3ravel/shared",
3
- "version": "0.13.0",
3
+ "version": "0.15.0",
4
4
  "description": "Shared Utilities.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -17,6 +17,7 @@ type RemoveIndexSignature<T> = {
17
17
 
18
18
  export type Bindings = {
19
19
  [key: string]: any;
20
+ [key: `app.${string}`]: any;
20
21
  env (): NodeJS.ProcessEnv
21
22
  env<T extends string> (key: T, def?: any): any
22
23
  view (templatePath: string, state?: Record<string, any>): Promise<string>
@@ -33,7 +34,7 @@ export type Bindings = {
33
34
  }
34
35
  'http.app': H3
35
36
  'path.base': string
36
- 'app.paths': PathLoader
37
+ 'load.paths': PathLoader
37
38
  'http.serve': typeof serve
38
39
  'http.request': IRequest
39
40
  'http.response': IResponse
@@ -27,7 +27,9 @@ export interface IContainer {
27
27
  * @param key - The key or constructor for the service.
28
28
  * @returns The resolved service instance.
29
29
  */
30
- make<T extends UseKey> (key: T | (new (...args: any[]) => Bindings[T])): Bindings[T];
30
+ make<T extends UseKey, X = undefined> (
31
+ key: T | (new (..._args: any[]) => Bindings[T])
32
+ ): X extends undefined ? Bindings[T] : X
31
33
 
32
34
  /**
33
35
  * Checks if a service is registered in the container.
@@ -111,6 +111,7 @@ export interface IRouter {
111
111
  }
112
112
 
113
113
  export interface HttpContext {
114
+ app: IApplication
114
115
  request: IRequest
115
116
  response: IResponse
116
117
  }