@travetto/config
Advanced tools
Comparing version 0.0.28 to 0.0.29
@@ -19,3 +19,3 @@ { | ||
"scripts": {}, | ||
"version": "0.0.28" | ||
"version": "0.0.29" | ||
} |
@@ -1,5 +0,5 @@ | ||
import { bulkRead, bulkReadSync, AppEnv, bulkFindSync } from '@travetto/base'; | ||
import { bulkRead, bulkReadSync, AppEnv, bulkFindSync, findAppFilesByExt } from '@travetto/base'; | ||
import * as path from 'path'; | ||
import * as yaml from 'js-yaml'; | ||
import { readdirSync } from 'fs'; | ||
import { readdirSync, readFileSync } from 'fs'; | ||
import { ConfigMap } from './map'; | ||
@@ -39,6 +39,9 @@ | ||
// Load all namespaces from core | ||
let files = bulkReadSync([/^node_modules\/@travetto\/.*\/config\/.*[.]yml$/]); | ||
const allYaml = findAppFilesByExt('.yml'); | ||
// Load all configs, exclude env configs | ||
files = files.concat(bulkReadSync([/^config\/.*[.]yml$/])); | ||
const files = allYaml.filter(x => | ||
x.file.includes('node_modules/@travetto') | ||
&& x.file.includes('/config/')) | ||
.concat(allYaml.filter(x => x.file.startsWith(`${process.cwd()}/config/`))) | ||
.map(x => ({ name: x.file, data: readFileSync(x.file).toString() })); | ||
@@ -53,3 +56,4 @@ for (const file of files) { | ||
const loaded: string[] = []; | ||
const envFiles = bulkReadSync([/^env\/.*[.]yml$/]) | ||
const envFiles = allYaml.filter(x => x.file.startsWith(`${process.cwd()}/env/`)) | ||
.map(x => ({ name: x.file, data: readFileSync(x.file).toString() })) | ||
.map(x => { | ||
@@ -56,0 +60,0 @@ const tested = path.basename(x.name, '.yml'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8284
190