nestjs-gen
Advanced tools
Comparing version 1.3.1 to 1.3.2
39
index.js
@@ -17,4 +17,4 @@ #!/usr/bin/env node | ||
.option('-a', 'Generate all (Module + Controller + Service + Repository + Model') | ||
.option('--all', 'Generate all (Module + Controller + Service + Repository + Model') | ||
.option('-a', 'Generate all (Module + Controller + Service + Repository + Model)') | ||
.option('--all', 'Generate all (Module + Controller + Service + Repository + Model)') | ||
@@ -60,7 +60,9 @@ .option('-m', 'Generate a Module') | ||
// first see if there is a configuration file available, and start with that | ||
const config = _findConfig(); | ||
console.log(`Running nestjs-gen v${version} generator...`) | ||
// first see if there's a configuration file available, and start with that | ||
const { configFilePath, config } = _findConfig(); | ||
if (config) { | ||
console.log("Using tsconfig settings..."); | ||
console.log(`Using ${configFilePath} settings...`); | ||
@@ -238,27 +240,26 @@ if (config["prefix"] && !o.prefix) | ||
// todo: look into parent directories if not found? | ||
function _findConfig() { | ||
let ngenConfig; | ||
let config; | ||
let configFilePath; | ||
function _read(configFile) { | ||
let ngenConfig; | ||
if (fs.existsSync(configFile)) { | ||
let config = require(configFile); | ||
if (config['ngen-config']) { | ||
ngenConfig = config['ngen-config'] | ||
function _read(filePath) { | ||
if (fs.existsSync(filePath)) { | ||
let _config = require(filePath); | ||
if (_config['ngen-config']) { | ||
configFilePath = filePath; | ||
return _config['ngen-config']; | ||
} | ||
} | ||
return ngenConfig; | ||
} | ||
// look in tsconfig.app.json? | ||
let configFile = path.resolve("./tsconfig.app.json"); | ||
ngenConfig = _read(configFile); | ||
config = _read(path.resolve("./tsconfig.app.json")); | ||
// look in tsconfig.json? | ||
if (!ngenConfig) { | ||
configFile = path.resolve("./tsconfig.json"); | ||
ngenConfig = _read(configFile); | ||
if (!config) { | ||
config = _read(path.resolve("./tsconfig.json")); | ||
} | ||
return ngenConfig; | ||
return { configFilePath, config }; | ||
} |
{ | ||
"name": "nestjs-gen", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "NestJS model package generator", | ||
"main": "index.js", | ||
"scripts": {}, | ||
"scripts": { | ||
"install": "npm install" | ||
}, | ||
"bin": { | ||
@@ -8,0 +10,0 @@ "ngen": "./index.js", |
21
todo.md
@@ -1,6 +0,21 @@ | ||
-add option to output 'console.log' statements | ||
-add option to add logging statements (to some arbitrary logging interface) to all method calls | ||
-ADD option to output 'console.log' statements | ||
-ADD option to add logging statements (to some arbitrary logging interface) to all method calls | ||
-change generated module to import forFeature(EntityRepostiroy) instead of forFeature(Entity), if using a custom repository. | ||
-ADD option to 'findOneOrFail' vs. just 'findOne' in repositories. | ||
-CHANGE generated module to import forFeature(EntityRepostiroy) instead of forFeature(Entity), if using a custom repository. | ||
-TEST import of other modules into each other, to ensure repository/other dependencies work as expected. | ||
-TODO: look into parent directories for tsconfig(.app)?.json if not found in current. | ||
-ADD JSdoc comments to generated file methods (as a config option); | ||
-ADD prompts to override existing files, or config option. | ||
-ADD demo videos or scenarios | ||
-ADD docs website? | ||
-ADD feature request form | ||
-Replace templating engine with quicktemplate: | ||
https://github.com/valyala/quicktemplate |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
35684
2