@nest-omni/core 1.0.41 → 1.0.43
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/package.json +1 -1
- package/shared/serviceRegistryModule.js +7 -5
- package/tsconfig.tsbuildinfo +1 -1
- package/cli.d.ts +0 -2
- package/cli.js +0 -52
package/cli.d.ts
DELETED
package/cli.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const program = require("commander");
|
|
5
|
-
const fs = require("fs");
|
|
6
|
-
const path = require("path");
|
|
7
|
-
const hygen_1 = require("hygen");
|
|
8
|
-
const logger_1 = require("hygen/dist/logger");
|
|
9
|
-
const process = require("node:process");
|
|
10
|
-
const _hygen_1 = require(".hygen");
|
|
11
|
-
program.version('0.1.0').option('-v, --verbose', 'output extra information');
|
|
12
|
-
program
|
|
13
|
-
.command('create <project>')
|
|
14
|
-
.description('initialize a new project')
|
|
15
|
-
.action((project) => {
|
|
16
|
-
console.log(`Initializing project ${project}`);
|
|
17
|
-
});
|
|
18
|
-
program
|
|
19
|
-
.command('i18n')
|
|
20
|
-
.description('add class-validator i18n support to the project')
|
|
21
|
-
.action(() => {
|
|
22
|
-
copyRecursiveSync(path.join(__dirname, 'i18n'), './i18n');
|
|
23
|
-
});
|
|
24
|
-
program
|
|
25
|
-
.command('crud')
|
|
26
|
-
.description('generate CRUD operations for a module')
|
|
27
|
-
.action(() => {
|
|
28
|
-
console.log(`Generating CRUD operations for module`);
|
|
29
|
-
(0, hygen_1.runner)(['new', 'crud'], {
|
|
30
|
-
templates: _hygen_1.templates,
|
|
31
|
-
helpers: _hygen_1.helpers,
|
|
32
|
-
cwd: process.cwd(),
|
|
33
|
-
logger: new logger_1.default(console.log.bind(console)),
|
|
34
|
-
debug: !!process.env.DEBUG,
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
program.parse(process.argv);
|
|
38
|
-
function copyRecursiveSync(src, dest) {
|
|
39
|
-
const exists = fs.existsSync(src);
|
|
40
|
-
const stats = exists && fs.statSync(src);
|
|
41
|
-
const isDirectory = exists && stats.isDirectory();
|
|
42
|
-
console.log(`Copied ${src} to ${dest}`);
|
|
43
|
-
if (isDirectory) {
|
|
44
|
-
fs.mkdirSync(dest, { recursive: true });
|
|
45
|
-
fs.readdirSync(src).forEach((childItemName) => {
|
|
46
|
-
copyRecursiveSync(path.join(src, childItemName), path.join(dest, childItemName));
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
fs.copyFileSync(src, dest);
|
|
51
|
-
}
|
|
52
|
-
}
|