Conversation
Codecov Report
@@ Coverage Diff @@
## master #507 +/- ##
=======================================
Coverage 83.26% 83.26%
=======================================
Files 34 34
Lines 2539 2539
Branches 908 908
=======================================
Hits 2114 2114
Misses 254 254
Partials 171 171Continue to review full report at Codecov.
|
|
What do you think of using |
.eslintrc.js
Outdated
| "no-cond-assign": OFF, | ||
| "no-case-declarations": OFF | ||
| "no-case-declarations": OFF, | ||
| "no-console": ["error", { allow: ["error"] }] |
There was a problem hiding this comment.
for console.error from fs errors.
There was a problem hiding this comment.
process.stderr.write() ?
packages/babili/src/cli.js
Outdated
| } | ||
| }); | ||
|
|
||
| const files = argv["_"]; |
There was a problem hiding this comment.
only validation i would do extra is to validate the files and check if they are present.. did we need to do anything extra? @boopathi
There was a problem hiding this comment.
fs.readFile will already throw if the file is either not present or not read-able. So, I'm not sure if that needs to be separately verified.
There was a problem hiding this comment.
Yeah and I did also check ignore the file if it isn't present https://github.com/babel/babili/blob/2b1b16ac05596e65ec77c56a1e3e1b7882991341/packages/babili/src/fs.js#L29
f9a118d to
2b1b16a
Compare
2b1b16a to
9357bd3
Compare
packages/babili/src/cli.js
Outdated
|
|
||
| Options: | ||
| --out-file, -o Output to a specific file | ||
|
|
There was a problem hiding this comment.
we should keep a minimal list for the help command.. thoughts? @boopathi
| "roots": [ | ||
| "packages" | ||
| ], | ||
| "transformIgnorePatterns": [ |
There was a problem hiding this comment.
not required. default is node_modules
3ea64d8 to
fc633c8
Compare
fc633c8 to
ac9fe06
Compare
packages/babili/src/fs.js
Outdated
| if (outFile === void 0) { | ||
| process.stdout.write(code + "\n"); | ||
| } else { | ||
| fs.writeFileSync(path.resolve(outFile), code, "utf-8"); |
There was a problem hiding this comment.
should be changed to outputFileSync
97e5388 to
2d77c32
Compare
0e2648f to
b9b4844
Compare
| expect(spawn(source, "--mangle.topLevel").stdout).toMatchSnapshot(); | ||
| }); | ||
|
|
||
| xit("should handle input file and --out-file option", () => { |
There was a problem hiding this comment.
there is issue with validation options, need to fix it first.
4025eab to
4727cb4
Compare
update Add yargs-parser Add key not exist case in options parser Remove deadcode Cleanup options parser Improve filtering input CLI options
cli options and fs add out-file, out-dir and accept alias add small validation for cli set up cli tests and help option add help options and fix stdin fix test cases Add tests for cli file/dir and help option add eslintrc for tests ignore fixtures in test suite update package deps small changes for stdin
Format jest snapshots Fix yarn deps
Remove outFile and outDir from options passed to babili Update snapshot
Update package.json
babili --versionshows babel-cli version instead of babili version #418