refactor: Setup typescript project references across workflow, core, and cli (#4519)
* refactor: use consistent folder structure across workflow, core, and cli * setup typescript project references across workflow, core, and cli
This commit is contained in:
committed by
GitHub
parent
de96def372
commit
698d96a617
28
packages/cli/src/config/index.ts
Normal file
28
packages/cli/src/config/index.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/* eslint-disable @typescript-eslint/unbound-method */
|
||||
/* eslint-disable no-console */
|
||||
import convict from 'convict';
|
||||
import dotenv from 'dotenv';
|
||||
import { schema } from './schema';
|
||||
|
||||
dotenv.config();
|
||||
|
||||
const config = convict(schema);
|
||||
|
||||
config.getEnv = config.get;
|
||||
|
||||
// Overwrite default configuration with settings which got defined in
|
||||
// optional configuration files
|
||||
if (process.env.N8N_CONFIG_FILES !== undefined) {
|
||||
const configFiles = process.env.N8N_CONFIG_FILES.split(',');
|
||||
if (process.env.NODE_ENV !== 'test') {
|
||||
console.log(`\nLoading configuration overwrites from:\n - ${configFiles.join('\n - ')}\n`);
|
||||
}
|
||||
|
||||
config.loadFile(configFiles);
|
||||
}
|
||||
|
||||
config.validate({
|
||||
allowed: 'strict',
|
||||
});
|
||||
|
||||
export = config;
|
||||
Reference in New Issue
Block a user