@tsed/config 8.34.0 → 8.36.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/lib/esm/decorators/injectConfigSource.js +1 -1
- package/lib/esm/hooks/afterResolveConfiguration.js +1 -1
- package/lib/esm/providers/dotenv/DotEnvsConfigSource.js +4 -4
- package/lib/esm/providers/yaml/YamlConfigSource.js +1 -1
- package/lib/esm/utils/getConfigSources.js +1 -1
- package/lib/types/providers/dotenv/DotEnvsConfigSource.d.ts +1 -1
- package/lib/types/providers/yaml/YamlConfigSource.d.ts +1 -1
- package/lib/types/utils/getConfigSources.d.ts +1 -1
- package/lib/types/utils/withOptions.d.ts +1 -1
- package/package.json +8 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { configuration, constant, injectable, logger } from "@tsed/di";
|
|
2
1
|
import { $off, $on, $once } from "@tsed/hooks";
|
|
2
|
+
import { configuration, constant, injectable, logger } from "@tsed/di";
|
|
3
3
|
import { CONFIG_SOURCES } from "../constants/constants.js";
|
|
4
4
|
import { getConfigSources } from "../utils/getConfigSources.js";
|
|
5
5
|
export async function afterResolveConfiguration() {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import dotenvExpand from "dotenv-expand";
|
|
1
|
+
import { EnvsConfigSource } from "../envs/EnvsConfigSource.js";
|
|
4
2
|
import dotenv from "dotenv-flow";
|
|
3
|
+
import dotenvExpand from "dotenv-expand";
|
|
5
4
|
import { globby } from "globby";
|
|
6
|
-
import {
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
import { watch } from "node:fs";
|
|
7
7
|
export class DotEnvsConfigSource extends EnvsConfigSource {
|
|
8
8
|
getAll() {
|
|
9
9
|
dotenvExpand.expand(dotenv.config(this.options));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { ProviderScope, inject, injectable } from "@tsed/di";
|
|
1
2
|
import { nameOf } from "@tsed/core";
|
|
2
|
-
import { inject, injectable, ProviderScope } from "@tsed/di";
|
|
3
3
|
import { camelCase } from "change-case";
|
|
4
4
|
export function getConfigSources(configSources) {
|
|
5
5
|
return configSources
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { EnvsConfigSource, type EnvsConfigSourceOptions } from "../envs/EnvsConfigSource.js";
|
|
1
2
|
import { type DotenvFlowConfigOptions } from "dotenv-flow";
|
|
2
3
|
import type { ConfigSourceOnChangeCB } from "../../interfaces/ConfigSource.js";
|
|
3
|
-
import { EnvsConfigSource, type EnvsConfigSourceOptions } from "../envs/EnvsConfigSource.js";
|
|
4
4
|
export type DotEnvsConfigSourceOptions = EnvsConfigSourceOptions & DotenvFlowConfigOptions;
|
|
5
5
|
export declare class DotEnvsConfigSource extends EnvsConfigSource<DotEnvsConfigSourceOptions> {
|
|
6
6
|
getAll(): Record<string, unknown>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type LoadOptions } from "js-yaml";
|
|
2
1
|
import type { ConfigSource, ConfigSourceOnChangeCB } from "../../interfaces/ConfigSource.js";
|
|
2
|
+
import { type LoadOptions } from "js-yaml";
|
|
3
3
|
export interface YamlConfigSourceOptions extends LoadOptions {
|
|
4
4
|
/**
|
|
5
5
|
* The path to the JSON file.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Type } from "@tsed/core";
|
|
2
1
|
import type { ConfigSource, ConfigSourceOptions } from "../interfaces/ConfigSource.js";
|
|
2
|
+
import { type Type } from "@tsed/core";
|
|
3
3
|
export declare function getConfigSources(configSources: (Type<ConfigSource<any>> | ConfigSourceOptions)[]): Map<string, ConfigSourceOptions<any> & {
|
|
4
4
|
instance: ConfigSource<any>;
|
|
5
5
|
data: Record<string, any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Type } from "@tsed/core";
|
|
2
1
|
import type { ConfigSource, InitialConfigSourceOptions } from "../interfaces/ConfigSource.js";
|
|
2
|
+
import type { Type } from "@tsed/core";
|
|
3
3
|
export declare function withOptions<Opts>(use: Type<ConfigSource<Opts>>, { name, priority, validationSchema, enabled, refreshOn, watch, ...opts }: InitialConfigSourceOptions & Opts): {
|
|
4
4
|
name: string | undefined;
|
|
5
5
|
priority: number | undefined;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/config",
|
|
3
|
+
"version": "8.36.0",
|
|
3
4
|
"description": "Configuration management for Ts.ED",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"version": "8.34.0",
|
|
6
5
|
"keywords": [
|
|
7
|
-
"
|
|
6
|
+
"Config",
|
|
8
7
|
"Configuration",
|
|
9
|
-
"
|
|
8
|
+
"Ts.ED"
|
|
10
9
|
],
|
|
11
10
|
"source": "./src/index.ts",
|
|
11
|
+
"type": "module",
|
|
12
12
|
"main": "./lib/esm/index.js",
|
|
13
13
|
"module": "./lib/esm/index.js",
|
|
14
14
|
"typings": "./lib/types/index.d.ts",
|
|
@@ -70,15 +70,14 @@
|
|
|
70
70
|
"tslib": ">=2.7.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@tsed/barrels": "8.
|
|
74
|
-
"@tsed/core": "8.
|
|
75
|
-
"@tsed/di": "8.
|
|
76
|
-
"@tsed/typescript": "8.
|
|
73
|
+
"@tsed/barrels": "8.36.0",
|
|
74
|
+
"@tsed/core": "8.36.0",
|
|
75
|
+
"@tsed/di": "8.36.0",
|
|
76
|
+
"@tsed/typescript": "8.36.0",
|
|
77
77
|
"@types/js-yaml": "4.0.9",
|
|
78
78
|
"dotenv": "^16.5.0",
|
|
79
79
|
"dotenv-expand": "^12.0.2",
|
|
80
80
|
"dotenv-flow": "^4.1.0",
|
|
81
|
-
"eslint": "9.12.0",
|
|
82
81
|
"typescript": "6.0.2",
|
|
83
82
|
"vitest": "4.1.4"
|
|
84
83
|
},
|