@bytebrand/export-cars 1.0.6 → 1.0.8
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/dist/export.command.js +3 -5
- package/dist/export.command.js.map +1 -1
- package/dist/main.js +15 -2
- package/dist/main.js.map +1 -1
- package/dist/services/loader.service.js +1 -1
- package/dist/services/loader.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +5 -3
- package/src/export.command.ts +1 -3
- package/src/main.ts +21 -2
- package/src/services/loader.service.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bytebrand/export-cars",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "bytebrand",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -34,10 +34,12 @@
|
|
|
34
34
|
"lodash": "^4.17.21",
|
|
35
35
|
"moment": "^2.29.4",
|
|
36
36
|
"nest-commander": "^3.1.0",
|
|
37
|
+
"nest-winston": "^1.8.0",
|
|
37
38
|
"reflect-metadata": "^0.1.13",
|
|
38
39
|
"rimraf": "^3.0.2",
|
|
39
40
|
"rxjs": "^7.2.0",
|
|
40
|
-
"vin-generator": "^1.0.1"
|
|
41
|
+
"vin-generator": "^1.0.1",
|
|
42
|
+
"winston": "^3.8.2"
|
|
41
43
|
},
|
|
42
44
|
"devDependencies": {
|
|
43
45
|
"@nestjs/cli": "^9.0.0",
|
|
@@ -62,5 +64,5 @@
|
|
|
62
64
|
"engines": {
|
|
63
65
|
"node": ">=14.0.0"
|
|
64
66
|
},
|
|
65
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "483c1f6632515345e3bb0adcce0dfc77bebfcec9"
|
|
66
68
|
}
|
package/src/export.command.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { Exporter } from './interfaces/exporter.interface';
|
|
|
11
11
|
options: { isDefault: true },
|
|
12
12
|
})
|
|
13
13
|
export class ExportRunner extends CommandRunner {
|
|
14
|
-
private readonly logger = new Logger(
|
|
14
|
+
private readonly logger = new Logger();
|
|
15
15
|
|
|
16
16
|
constructor(
|
|
17
17
|
private readonly inquirer: InquirerService,
|
|
@@ -29,7 +29,5 @@ export class ExportRunner extends CommandRunner {
|
|
|
29
29
|
this.configService.config = new exportSchema[input.params.exportType].config(input.params);
|
|
30
30
|
const exporter = await this.moduleRef.create<Exporter>(exportSchema[input.params.exportType].exporter);
|
|
31
31
|
await exporter.export();
|
|
32
|
-
|
|
33
|
-
this.logger.log({ complete: 1, code: 0 });
|
|
34
32
|
}
|
|
35
33
|
}
|
package/src/main.ts
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
|
-
import { Logger } from '@nestjs/common';
|
|
2
1
|
import { CommandFactory } from 'nest-commander';
|
|
3
2
|
import { AppModule } from './app.module';
|
|
3
|
+
import { WinstonModule } from 'nest-winston';
|
|
4
|
+
import { transports as winstonTransports, format as winstonFormat } from 'winston';
|
|
4
5
|
|
|
5
6
|
async function bootstrap() {
|
|
6
|
-
|
|
7
|
+
try {
|
|
8
|
+
await CommandFactory.run(
|
|
9
|
+
AppModule,
|
|
10
|
+
WinstonModule.createLogger({
|
|
11
|
+
transports: [
|
|
12
|
+
new winstonTransports.Console({
|
|
13
|
+
format: winstonFormat.combine(
|
|
14
|
+
winstonFormat.splat(),
|
|
15
|
+
winstonFormat.simple(),
|
|
16
|
+
winstonFormat.colorize({ all: true }),
|
|
17
|
+
),
|
|
18
|
+
}),
|
|
19
|
+
],
|
|
20
|
+
}),
|
|
21
|
+
);
|
|
22
|
+
console.log({ complete: 1, code: 0 });
|
|
23
|
+
} catch (e) {
|
|
24
|
+
console.error({ description: e.message || e, complete: 1, code: 1 });
|
|
25
|
+
}
|
|
7
26
|
}
|
|
8
27
|
|
|
9
28
|
bootstrap();
|
|
@@ -20,7 +20,7 @@ export class LoaderService {
|
|
|
20
20
|
await fn(chunk);
|
|
21
21
|
|
|
22
22
|
const progress = (toNumber(chunk.id) + 1) / chunk.total;
|
|
23
|
-
this.logger.log(progress < 1 ? progress : 1);
|
|
23
|
+
this.logger.log(`progress - ${progress < 1 ? progress : 1}`);
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
this.loader.onError(reject);
|