Add --include-dotfiles option to babel-cli (#6232)
This commit is contained in:
@@ -0,0 +1 @@
|
||||
a;
|
||||
@@ -0,0 +1 @@
|
||||
bar;
|
||||
@@ -0,0 +1 @@
|
||||
index;
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"args": [
|
||||
"src",
|
||||
"--out-dir", "lib",
|
||||
"--copy-files",
|
||||
"--include-dotfiles",
|
||||
"--ignore", "src/foo"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
a;
|
||||
@@ -0,0 +1 @@
|
||||
bar;
|
||||
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
index;
|
||||
@@ -0,0 +1 @@
|
||||
src/index.js -> lib/index.js
|
||||
@@ -0,0 +1 @@
|
||||
a;
|
||||
@@ -0,0 +1 @@
|
||||
bar;
|
||||
@@ -0,0 +1 @@
|
||||
index;
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"args": [
|
||||
"src",
|
||||
"--out-dir", "lib",
|
||||
"--copy-files",
|
||||
"--include-dotfiles",
|
||||
"--only", "src/foo"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
a;
|
||||
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
bar;
|
||||
@@ -0,0 +1 @@
|
||||
index;
|
||||
2
packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with only/stdout.txt
vendored
Normal file
2
packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles with only/stdout.txt
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
src/foo/.foo.js -> lib/foo/.foo.js
|
||||
src/foo/bar.js -> lib/foo/bar.js
|
||||
1
packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/in-files/src/.foo.js
vendored
Normal file
1
packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/in-files/src/.foo.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
a;
|
||||
0
packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/in-files/src/.foorc
vendored
Normal file
0
packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/in-files/src/.foorc
vendored
Normal file
@@ -0,0 +1 @@
|
||||
bar;
|
||||
3
packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/options.json
vendored
Normal file
3
packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"args": ["src", "--out-dir", "lib", "--copy-files", "--include-dotfiles"]
|
||||
}
|
||||
3
packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/out-files/lib/.foo.js
vendored
Normal file
3
packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/out-files/lib/.foo.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
a;
|
||||
0
packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/out-files/lib/.foorc
vendored
Normal file
0
packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/out-files/lib/.foorc
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
bar;
|
||||
3
packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/stdout.txt
vendored
Normal file
3
packages/babel-cli/test/fixtures/babel/--copy-files --include-dotfiles/stdout.txt
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
src/.foo.js -> lib/.foo.js
|
||||
src/bar/index.js -> lib/bar/index.js
|
||||
src/foo/foo.js -> lib/foo/foo.js
|
||||
0
packages/babel-cli/test/fixtures/babel/--copy-files with ignore/in-files/src/.foorc
vendored
Normal file
0
packages/babel-cli/test/fixtures/babel/--copy-files with ignore/in-files/src/.foorc
vendored
Normal file
0
packages/babel-cli/test/fixtures/babel/--copy-files with only/in-files/src/.foorc
vendored
Normal file
0
packages/babel-cli/test/fixtures/babel/--copy-files with only/in-files/src/.foorc
vendored
Normal file
@@ -88,10 +88,14 @@ const assertTest = function(stdout, stderr, opts) {
|
||||
}
|
||||
|
||||
if (opts.outFiles) {
|
||||
const actualFiles = readDir(path.join(tmpLoc));
|
||||
const actualFiles = readDir(path.join(tmpLoc), fileFilter);
|
||||
|
||||
Object.keys(actualFiles).forEach(function(filename) {
|
||||
if (!opts.inFiles.hasOwnProperty(filename)) {
|
||||
if (
|
||||
// saveInFiles always creates an empty .babelrc, so lets exclude for now
|
||||
filename !== ".babelrc" &&
|
||||
!opts.inFiles.hasOwnProperty(filename)
|
||||
) {
|
||||
const expect = opts.outFiles[filename];
|
||||
const actual = actualFiles[filename];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user