Skip to content

Commit 6de8386

Browse files
committed
Minor fix & update version
1 parent 8b1b433 commit 6de8386

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-codegen-cli",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"description": "Software Development Kit for React",
55
"main": "lib/index.js",
66
"bin": {

src/core/FileService.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from 'fs-extra';
22
import path from 'path';
33

4-
import { CONFIG, EXT } from '../constants';
4+
import { CONFIG, EXT, APP_ROOT } from '../constants';
55
import { Logger } from './Logger';
66

77
export class FileService {
@@ -23,7 +23,10 @@ export class FileService {
2323
const filePath = this.getFilePath(EXT.component);
2424
if (!fs.pathExistsSync(filePath)) {
2525
fs.writeFileSync(filePath, template);
26-
Logger.success(chalk => `Successfully generated component file ${chalk.white(filePath)}`);
26+
Logger.success(
27+
chalk =>
28+
`Successfully generated component file ${chalk.white(path.relative(APP_ROOT, filePath))}`
29+
);
2730
} else {
2831
Logger.warn(chalk => `File already exists ${chalk.white(filePath)}`);
2932
}
@@ -33,7 +36,10 @@ export class FileService {
3336
const filePath = this.getFilePath(EXT.style, 'style');
3437
if (!fs.pathExistsSync(filePath)) {
3538
fs.writeFileSync(filePath, template);
36-
Logger.success(chalk => `Successfully generated style file ${chalk.white(filePath)}`);
39+
Logger.success(
40+
chalk =>
41+
`Successfully generated style file ${chalk.white(path.relative(APP_ROOT, filePath))}`
42+
);
3743
} else {
3844
Logger.warn(chalk => `File already exists ${chalk.white(filePath)}`);
3945
}
@@ -43,7 +49,10 @@ export class FileService {
4349
const filePath = this.getFilePath(EXT.component, 'test');
4450
if (!fs.pathExistsSync(filePath)) {
4551
fs.writeFileSync(filePath, template);
46-
Logger.success(chalk => `Successfully generated test file ${chalk.white(filePath)}`);
52+
Logger.success(
53+
chalk =>
54+
`Successfully generated test file ${chalk.white(path.relative(APP_ROOT, filePath))}`
55+
);
4756
} else {
4857
Logger.warn(chalk => `File already exists ${chalk.white(filePath)}`);
4958
}

0 commit comments

Comments
 (0)