@travetto/config 3.4.0-rc.0 → 3.4.0-rc.2

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 CHANGED
@@ -55,7 +55,6 @@ with environment variables
55
55
  **Config: Environment variables**
56
56
  ```properties
57
57
  TRV_ENV = prod
58
- TRV_PROFILES = prod
59
58
  ```
60
59
 
61
60
  At runtime the resolved config would be:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/config",
3
- "version": "3.4.0-rc.0",
3
+ "version": "3.4.0-rc.2",
4
4
  "description": "Configuration support",
5
5
  "keywords": [
6
6
  "yaml",
@@ -26,9 +26,9 @@
26
26
  "directory": "module/config"
27
27
  },
28
28
  "dependencies": {
29
- "@travetto/di": "^3.4.0-rc.0",
30
- "@travetto/schema": "^3.4.0-rc.0",
31
- "@travetto/yaml": "^3.4.0-rc.0"
29
+ "@travetto/di": "^3.4.0-rc.2",
30
+ "@travetto/schema": "^3.4.0-rc.2",
31
+ "@travetto/yaml": "^3.4.0-rc.2"
32
32
  },
33
33
  "travetto": {
34
34
  "displayName": "Configuration"
package/src/service.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import util from 'util';
2
2
 
3
- import { AppError, Class, ClassInstance, GlobalEnv, DataUtil } from '@travetto/base';
3
+ import { AppError, Class, ClassInstance, GlobalEnv, DataUtil, Env } from '@travetto/base';
4
4
  import { DependencyRegistry, Injectable } from '@travetto/di';
5
5
  import { RootIndex } from '@travetto/manifest';
6
6
  import { BindUtil, SchemaRegistry, SchemaValidator, ValidationResultError } from '@travetto/schema';
@@ -26,9 +26,9 @@ export class ConfigurationService {
26
26
  }
27
27
 
28
28
  #storage: Record<string, unknown> = {}; // Lowered, and flattened
29
- #profiles: string[] = ['application', ...GlobalEnv.profiles, 'override'];
29
+ #profiles: string[] = ['application', GlobalEnv.envName, ...Env.getList('TRV_PROFILES') ?? [], 'override'];
30
30
  #sources: string[] = [];
31
- #secrets: (RegExp | string)[] = [/password|private|secret|salt|(api(-|_)?key)/i];
31
+ #secrets: (RegExp | string)[] = [/secure(-|_|[a-z])|password|private|secret|salt|(api(-|_)?key)/i];
32
32
 
33
33
  /**
34
34
  * Get a sub tree of the config, or everything if namespace is not passed
@@ -53,6 +53,7 @@ export class FileConfigSource extends FileQueryProvider implements ConfigSource
53
53
  priority: this.priority
54
54
  });
55
55
  }
56
- return out;
56
+ // Ensure more specific files are processed later
57
+ return out.sort((a, b) => (a.source.length - b.source.length) || a.source.localeCompare(b.source));
57
58
  }
58
59
  }