Skip to content

Commit 7fe3543

Browse files
committedApr 11, 2019
fix(utils): refactors utils
impoves the codebase by adding comments
1 parent 0b28fb3 commit 7fe3543

File tree

4 files changed

+327
-320
lines changed

4 files changed

+327
-320
lines changed
 

‎junit.xml

+316-316
Large diffs are not rendered by default.

‎packages/utils/defineTest.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as fs from "fs";
22
import * as path from "path";
3+
34
import { IJSCodeshift, INode } from "./types/NodePath";
45

56
interface IModule {

‎packages/utils/find-root.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import * as findup from "findup-sync";
22
import * as path from "path";
33

4+
/**
5+
* Returns the absolute path of the project directory
6+
* Finds the package.json, by using findup-sync
7+
* @returns {String} path of project directory
8+
*/
9+
410
export function findProjectRoot(): string {
511
const rootFilePath = findup(`package.json`);
612
const projectRoot = path.dirname(rootFilePath);

‎packages/utils/scaffold.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,16 @@ export default function runTransform(transformConfig: ITransformConfig, action:
9090
console.error(err.message ? err.message : err);
9191
});
9292
});
93-
let successMessage : string = `Congratulations! Your new webpack configuration file has been created!\n`
93+
let successMessage: string = `Congratulations! Your new webpack configuration file has been created!\n`;
9494
if (initActionNotDefined && transformConfig.config.item) {
9595
successMessage = `Congratulations! ${
9696
transformConfig.config.item
97-
} has been ${action}ed!\n`
97+
} has been ${action}ed!\n`;
9898
}
9999
process.stdout.write(
100100
"\n" +
101101
chalk.green(
102-
successMessage
103-
)
102+
successMessage,
103+
),
104104
);
105105
}

0 commit comments

Comments
 (0)
Please sign in to comment.