Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@spinajs/configuration

Package Overview
Dependencies
Maintainers
1
Versions
281
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spinajs/configuration - npm Package Compare versions

Comparing version 1.0.12 to 1.0.14

1

lib/index.d.ts

@@ -35,2 +35,3 @@ import { IContainer, SyncModule } from '@spinajs/di';

protected Config: any;
protected CustomConfigPaths: string[];
/**

@@ -37,0 +38,0 @@ *

45

lib/index.js

@@ -76,16 +76,18 @@ "use strict";

// other @spinajs modules paths
path_1.normalize(path_1.join(path_1.resolve(__dirname).split(path_1.sep + 'node_modules')[0], '/node_modules/@spinajs/orm/lib/config')),
path_1.normalize(path_1.join(path_1.resolve(__dirname).split(path_1.sep + 'node_modules')[0], '/node_modules/@spinajs/orm-sqlite/lib/config')),
path_1.normalize(path_1.join(path_1.resolve(__dirname).split(path_1.sep + 'node_modules')[0], '/node_modules/@spinajs/orm-sql/lib/config')),
path_1.normalize(path_1.join(path_1.resolve(__dirname).split(path_1.sep + 'node_modules')[0], '/node_modules/@spinajs/log/lib/config')),
path_1.normalize(path_1.join(path_1.resolve(__dirname).split(path_1.sep + 'node_modules')[0], '/node_modules/@spinajs/intl/lib/config')),
path_1.normalize(path_1.join(path_1.resolve(__dirname).split(path_1.sep + 'node_modules')[0], '/node_modules/@spinajs/cli/lib/config')),
path_1.normalize(path_1.join(path_1.resolve(__dirname).split(path_1.sep + 'node_modules')[0], '/node_modules/@spinajs/acl/lib/config')),
path_1.normalize(path_1.join(path_1.resolve(__dirname).split(path_1.sep + 'node_modules')[0], '/node_modules/@spinajs/http/lib/config')),
path_1.normalize(path_1.join(path_1.resolve(__dirname).split(path_1.sep + 'node_modules')[0], '/node_modules/@spinajs/acl-http/lib/config')),
path_1.normalize(path_1.join(path_1.resolve(__dirname).split(path_1.sep + 'node_modules')[0], '/node_modules/@spinajs/jobs/lib/config')),
'/node_modules/@spinajs/orm/lib/config',
'/node_modules/@spinajs/orm-sqlite/lib/config',
'/node_modules/@spinajs/orm-sql/lib/config',
'/node_modules/@spinajs/log/lib/config',
'/node_modules/@spinajs/intl/lib/config',
'/node_modules/@spinajs/cli/lib/config',
'/node_modules/@spinajs/acl/lib/config',
'/node_modules/@spinajs/http/lib/config',
'/node_modules/@spinajs/acl-http/lib/config',
'/node_modules/@spinajs/jobs/lib/config',
'/node_modules/@spinajs/acl-session-provider-dynamodb/lib/config',
// project paths - last to allow overwrite @spinajs conf
path_1.normalize(path_1.join(path_1.resolve(__dirname).split(path_1.sep + 'node_modules')[0], '/dist/config')),
path_1.normalize(path_1.join(path_1.resolve(__dirname).split(path_1.sep + 'node_modules')[0], '/build/config')),
path_1.normalize(path_1.join(path_1.resolve(__dirname).split(path_1.sep + 'node_modules')[0], '/config')),
'/lib/config',
'/dist/config',
'/build/config',
'/config',
];

@@ -96,2 +98,3 @@ /**

this.Config = {};
this.CustomConfigPaths = cfgCustomPaths !== null && cfgCustomPaths !== void 0 ? cfgCustomPaths : [];
this.RunApp = app !== null && app !== void 0 ? app : parseArgv('--app');

@@ -101,5 +104,2 @@ this.BaseDir = (_a = appBaseDir !== null && appBaseDir !== void 0 ? appBaseDir : parseArgv('--appPath')) !== null && _a !== void 0 ? _a : path_1.join(__dirname, '../apps/');

log(`Base dir at: ${this.BaseDir}`);
if (cfgCustomPaths) {
this.CONFIG_DIRS = this.CONFIG_DIRS.concat(cfgCustomPaths);
}
function parseArgv(param) {

@@ -136,3 +136,6 @@ const index = process.argv.indexOf(param);

load(extension, callback) {
this.CONFIG_DIRS.filter(filterDirs)
const basePath = this.RunApp ? this.BaseDir : findBasePath(process.cwd());
this.CONFIG_DIRS.map(f => path_1.join(basePath, f))
.concat(this.CustomConfigPaths)
.filter(filterDirs)
// get all config files

@@ -154,2 +157,8 @@ .map(d => glob.sync(d + `/**/*.${extension}`))

.map(_.curry(merge)(this.Config));
function findBasePath(path) {
if (fs.existsSync(path_1.join(path, 'node_modules'))) {
return path;
}
return findBasePath(path_1.resolve(path, '..'));
}
}

@@ -200,3 +209,3 @@ dir(toJoin) {

log(`Application to run: ${this.RunApp}`);
this.CONFIG_DIRS.push(this.dir(`/${this.RunApp}/config`));
this.CONFIG_DIRS.push(`./${this.RunApp}/config`);
}

@@ -203,0 +212,0 @@ }

{
"name": "@spinajs/configuration",
"version": "1.0.12",
"version": "1.0.14",
"description": "framework configuration module",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc