@travetto/config 5.0.0-rc.0 → 5.0.0-rc.1
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 +1 -1
- package/package.json +1 -1
- package/src/parser/yaml.ts +2 -2
- package/src/service.ts +3 -3
- package/src/source/file.ts +1 -2
package/README.md
CHANGED
|
@@ -203,7 +203,7 @@ $ trv main doc/dbconfig-run.ts
|
|
|
203
203
|
message: 'Failed to construct @travetto/config:doc/dbconfig○DBConfig as validation errors have occurred',
|
|
204
204
|
category: 'data',
|
|
205
205
|
type: 'ValidationResultError',
|
|
206
|
-
at: 2029-03-14T04:00:00.618Z,
|
|
206
|
+
at: '2029-03-14T04:00:00.618Z',
|
|
207
207
|
details: {
|
|
208
208
|
class: '@travetto/config:doc/dbconfig○DBConfig',
|
|
209
209
|
file: './doc/dbconfig.ts',
|
package/package.json
CHANGED
package/src/parser/yaml.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Injectable } from '@travetto/di';
|
|
2
2
|
import { parse as parseYaml } from 'yaml';
|
|
3
3
|
|
|
4
|
-
import { ConfigParser } from './types';
|
|
4
|
+
import { ConfigData, ConfigParser } from './types';
|
|
5
5
|
|
|
6
6
|
@Injectable()
|
|
7
7
|
export class YAMLConfigParser implements ConfigParser {
|
|
8
8
|
ext = ['.yaml', '.yml'];
|
|
9
|
-
parse = parseYaml;
|
|
9
|
+
parse = (input: string): ConfigData => parseYaml(input) ?? {};
|
|
10
10
|
}
|
package/src/service.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import util from 'node:util';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { RuntimeIndex } from '@travetto/manifest';
|
|
4
|
+
import { AppError, Class, ClassInstance, Env, RuntimeContext, RuntimeResources } from '@travetto/base';
|
|
4
5
|
import { DependencyRegistry, Injectable } from '@travetto/di';
|
|
5
|
-
import { RuntimeIndex, RuntimeContext } from '@travetto/manifest';
|
|
6
6
|
import { BindUtil, DataUtil, SchemaRegistry, SchemaValidator, ValidationResultError } from '@travetto/schema';
|
|
7
7
|
|
|
8
8
|
import { ConfigSourceTarget, ConfigTarget } from './internal/types';
|
|
@@ -22,7 +22,7 @@ export class ConfigurationService {
|
|
|
22
22
|
|
|
23
23
|
#storage: Record<string, unknown> = {}; // Lowered, and flattened
|
|
24
24
|
#specs: ConfigSpecSimple[] = [];
|
|
25
|
-
#secrets: (RegExp | string)[] = [/secure(-|_|[a-z])|password|private|secret|salt|(api(-|_)?key)/i];
|
|
25
|
+
#secrets: (RegExp | string)[] = [/secure(-|_|[a-z])|password|private|secret|salt|(\bkey|key\b)|serviceAccount|(api(-|_)?key)/i];
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Get a sub tree of the config, or everything if namespace is not passed
|
package/src/source/file.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
|
|
4
|
-
import { Env, RuntimeResources } from '@travetto/base';
|
|
5
|
-
import { RuntimeContext } from '@travetto/manifest';
|
|
4
|
+
import { Env, RuntimeContext, RuntimeResources } from '@travetto/base';
|
|
6
5
|
|
|
7
6
|
import { ConfigSource, ConfigSpec } from './types';
|
|
8
7
|
import { ParserManager } from '../parser/parser';
|