@tsed/config 8.9.4 → 8.9.5
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/lib/esm/providers/json/JsonConfigSource.js.map +1 -1
- package/lib/esm/providers/yaml/YamlConfigSource.js.map +1 -1
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/interfaces/ConfigSource.d.ts +1 -1
- package/lib/types/providers/json/JsonConfigSource.d.ts +2 -2
- package/lib/types/providers/yaml/YamlConfigSource.d.ts +2 -2
- package/package.json +7 -7
- package/src/interfaces/ConfigSource.ts +1 -1
- package/src/providers/json/JsonConfigSource.ts +2 -2
- package/src/providers/yaml/YamlConfigSource.ts +2 -2
|
@@ -42,7 +42,7 @@ export interface ConfigSourceOptions<Opts = any> {
|
|
|
42
42
|
}
|
|
43
43
|
export type InitialConfigSourceOptions = Omit<ConfigSourceOptions, "options" | "use">;
|
|
44
44
|
export type ConfigSourceWatchCloseCB = () => Promise<void> | void;
|
|
45
|
-
export type ConfigSourceOnChangeCB = () => void
|
|
45
|
+
export type ConfigSourceOnChangeCB = () => Promise<void>;
|
|
46
46
|
/**
|
|
47
47
|
* Interface for a configuration source that can provide configuration values.
|
|
48
48
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
import type { ConfigSource } from "../../interfaces/ConfigSource.js";
|
|
2
|
+
import type { ConfigSource, ConfigSourceOnChangeCB } from "../../interfaces/ConfigSource.js";
|
|
3
3
|
export interface JsonConfigSourceOptions {
|
|
4
4
|
/**
|
|
5
5
|
* The path to the JSON file.
|
|
@@ -14,5 +14,5 @@ export interface JsonConfigSourceOptions {
|
|
|
14
14
|
export declare class JsonConfigSource implements ConfigSource<JsonConfigSourceOptions> {
|
|
15
15
|
options: JsonConfigSourceOptions;
|
|
16
16
|
getAll(): Record<string, unknown>;
|
|
17
|
-
watch(onChange:
|
|
17
|
+
watch(onChange: ConfigSourceOnChangeCB): () => void;
|
|
18
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type LoadOptions } from "js-yaml";
|
|
2
|
-
import type { ConfigSource } from "../../interfaces/ConfigSource.js";
|
|
2
|
+
import type { ConfigSource, ConfigSourceOnChangeCB } from "../../interfaces/ConfigSource.js";
|
|
3
3
|
export interface YamlConfigSourceOptions extends LoadOptions {
|
|
4
4
|
/**
|
|
5
5
|
* The path to the JSON file.
|
|
@@ -9,5 +9,5 @@ export interface YamlConfigSourceOptions extends LoadOptions {
|
|
|
9
9
|
export declare class YamlConfigSource implements ConfigSource<YamlConfigSourceOptions> {
|
|
10
10
|
options: YamlConfigSourceOptions;
|
|
11
11
|
getAll(): Promise<Record<string, unknown>>;
|
|
12
|
-
watch(onChange:
|
|
12
|
+
watch(onChange: ConfigSourceOnChangeCB): () => void;
|
|
13
13
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tsed/config",
|
|
3
3
|
"description": "Configuration management for Ts.ED",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "8.9.
|
|
5
|
+
"version": "8.9.5",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Ts.ED",
|
|
8
8
|
"Configuration",
|
|
@@ -61,18 +61,18 @@
|
|
|
61
61
|
"tslib": "2.7.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@tsed/ajv": "8.9.
|
|
65
|
-
"@tsed/barrels": "8.9.
|
|
66
|
-
"@tsed/core": "8.9.
|
|
67
|
-
"@tsed/di": "8.9.
|
|
68
|
-
"@tsed/typescript": "8.9.
|
|
64
|
+
"@tsed/ajv": "8.9.5",
|
|
65
|
+
"@tsed/barrels": "8.9.5",
|
|
66
|
+
"@tsed/core": "8.9.5",
|
|
67
|
+
"@tsed/di": "8.9.5",
|
|
68
|
+
"@tsed/typescript": "8.9.5",
|
|
69
69
|
"@types/js-yaml": "4.0.9",
|
|
70
70
|
"dotenv": "^16.5.0",
|
|
71
71
|
"dotenv-expand": "^12.0.2",
|
|
72
72
|
"dotenv-flow": "^4.1.0",
|
|
73
73
|
"eslint": "9.12.0",
|
|
74
74
|
"typescript": "5.4.5",
|
|
75
|
-
"vitest": "3.1.
|
|
75
|
+
"vitest": "3.1.4"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
78
|
"@tsed/core": "workspace:*",
|
|
@@ -46,7 +46,7 @@ export interface ConfigSourceOptions<Opts = any> {
|
|
|
46
46
|
|
|
47
47
|
export type InitialConfigSourceOptions = Omit<ConfigSourceOptions, "options" | "use">;
|
|
48
48
|
export type ConfigSourceWatchCloseCB = () => Promise<void> | void;
|
|
49
|
-
export type ConfigSourceOnChangeCB = () => void
|
|
49
|
+
export type ConfigSourceOnChangeCB = () => Promise<void>;
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* Interface for a configuration source that can provide configuration values.
|
|
@@ -2,7 +2,7 @@ import {existsSync, readFileSync, watch} from "node:fs";
|
|
|
2
2
|
|
|
3
3
|
import {logger} from "@tsed/di";
|
|
4
4
|
|
|
5
|
-
import type {ConfigSource} from "../../interfaces/ConfigSource.js";
|
|
5
|
+
import type {ConfigSource, ConfigSourceOnChangeCB} from "../../interfaces/ConfigSource.js";
|
|
6
6
|
|
|
7
7
|
export interface JsonConfigSourceOptions {
|
|
8
8
|
/**
|
|
@@ -34,7 +34,7 @@ export class JsonConfigSource implements ConfigSource<JsonConfigSourceOptions> {
|
|
|
34
34
|
return JSON.parse(fileContent);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
watch(onChange:
|
|
37
|
+
watch(onChange: ConfigSourceOnChangeCB) {
|
|
38
38
|
const {path} = this.options;
|
|
39
39
|
const watcher = watch(path, onChange);
|
|
40
40
|
|
|
@@ -3,7 +3,7 @@ import {existsSync, watch} from "node:fs";
|
|
|
3
3
|
import {logger} from "@tsed/di";
|
|
4
4
|
import JsYaml, {type LoadOptions} from "js-yaml";
|
|
5
5
|
|
|
6
|
-
import type {ConfigSource} from "../../interfaces/ConfigSource.js";
|
|
6
|
+
import type {ConfigSource, ConfigSourceOnChangeCB} from "../../interfaces/ConfigSource.js";
|
|
7
7
|
|
|
8
8
|
export interface YamlConfigSourceOptions extends LoadOptions {
|
|
9
9
|
/**
|
|
@@ -28,7 +28,7 @@ export class YamlConfigSource implements ConfigSource<YamlConfigSourceOptions> {
|
|
|
28
28
|
return (await JsYaml.load(path, opts)) as Record<string, unknown>;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
watch(onChange:
|
|
31
|
+
watch(onChange: ConfigSourceOnChangeCB) {
|
|
32
32
|
const {path} = this.options;
|
|
33
33
|
const watcher = watch(path, onChange);
|
|
34
34
|
|