-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
--copy-ignored flag added to CLI (#10887)
* prevent ignored files in out dir * added includeIgnore cli option * Help text change * Update packages/babel-cli/src/babel/options.js Copy review. Co-Authored-By: Brian Ng <[email protected]> * review comments * throw error if copyIgnored is used without ignore flag * check for ignored files * duplicate pathToPattern fn in babel/cli * change implementation * removed ignore option from cliOption * added test case with ignore in config * added test case with ignore in config * review Co-authored-by: Brian Ng <[email protected]>
- Loading branch information
1 parent
3af02f6
commit 8415065
Showing
70 changed files
with
165 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...l-cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/.babelrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"ignore": ["src/foo"] | ||
} |
Empty file.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
...i/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"args": [ | ||
"src", | ||
"--out-dir", | ||
"lib", | ||
"--copy-files", | ||
"--include-dotfiles", | ||
"--verbose" | ||
] | ||
} |
Empty file.
Empty file.
3 changes: 3 additions & 0 deletions
3
...tures/babel/--copy-files --include-dotfiles with ignore in babelrc/out-files/lib/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"use strict"; | ||
|
||
index; |
2 changes: 2 additions & 0 deletions
2
...cli/test/fixtures/babel/--copy-files --include-dotfiles with ignore in babelrc/stdout.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/index.js -> lib/index.js | ||
Successfully compiled 1 file with Babel. |
1 change: 1 addition & 0 deletions
1
.../test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/.babelignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/foo |
Empty file.
Empty file.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
.../test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"args": [ | ||
"src", | ||
"--out-dir", | ||
"lib", | ||
"--copy-files", | ||
"--copy-ignored", | ||
"--verbose" | ||
] | ||
} |
Empty file.
1 change: 1 addition & 0 deletions
1
...es/babel/--copy-files with ignore and copyIgnored in babelignore/out-files/lib/foo/bar.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bar; |
3 changes: 3 additions & 0 deletions
3
...ures/babel/--copy-files with ignore and copyIgnored in babelignore/out-files/lib/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"use strict"; | ||
|
||
index; |
2 changes: 2 additions & 0 deletions
2
...li/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelignore/stdout.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/index.js -> lib/index.js | ||
Successfully compiled 1 file with Babel. |
3 changes: 3 additions & 0 deletions
3
...abel-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/.babelrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"ignore": ["src/foo"] | ||
} |
Empty file.
Empty file.
1 change: 1 addition & 0 deletions
1
...ixtures/babel/--copy-files with ignore and copyIgnored in babelrc/in-files/src/foo/bar.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bar; |
1 change: 1 addition & 0 deletions
1
.../fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/in-files/src/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
index; |
10 changes: 10 additions & 0 deletions
10
...-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"args": [ | ||
"src", | ||
"--out-dir", | ||
"lib", | ||
"--copy-files", | ||
"--copy-ignored", | ||
"--verbose" | ||
] | ||
} |
Empty file.
1 change: 1 addition & 0 deletions
1
...xtures/babel/--copy-files with ignore and copyIgnored in babelrc/out-files/lib/foo/bar.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bar; |
3 changes: 3 additions & 0 deletions
3
...fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/out-files/lib/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"use strict"; | ||
|
||
index; |
2 changes: 2 additions & 0 deletions
2
...el-cli/test/fixtures/babel/--copy-files with ignore and copyIgnored in babelrc/stdout.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/index.js -> lib/index.js | ||
Successfully compiled 1 file with Babel. |
1 change: 1 addition & 0 deletions
1
packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/.babelignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
src/foo |
Empty file.
Empty file.
1 change: 1 addition & 0 deletions
1
...l-cli/test/fixtures/babel/--copy-files with ignore in babelignore/in-files/src/foo/bar.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bar; |
1 change: 1 addition & 0 deletions
1
...bel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/in-files/src/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
index; |
9 changes: 9 additions & 0 deletions
9
packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"args": [ | ||
"src", | ||
"--out-dir", | ||
"lib", | ||
"--copy-files", | ||
"--verbose" | ||
] | ||
} |
Empty file.
3 changes: 3 additions & 0 deletions
3
...el-cli/test/fixtures/babel/--copy-files with ignore in babelignore/out-files/lib/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"use strict"; | ||
|
||
index; |
2 changes: 2 additions & 0 deletions
2
packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelignore/stdout.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/index.js -> lib/index.js | ||
Successfully compiled 1 file with Babel. |
3 changes: 3 additions & 0 deletions
3
packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/.babelrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"ignore": ["src/foo"] | ||
} |
Empty file.
Empty file.
1 change: 1 addition & 0 deletions
1
...babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/in-files/src/foo/bar.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bar; |
1 change: 1 addition & 0 deletions
1
...s/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/in-files/src/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
index; |
9 changes: 9 additions & 0 deletions
9
packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"args": [ | ||
"src", | ||
"--out-dir", | ||
"lib", | ||
"--copy-files", | ||
"--verbose" | ||
] | ||
} |
Empty file.
3 changes: 3 additions & 0 deletions
3
.../babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/out-files/lib/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"use strict"; | ||
|
||
index; |
2 changes: 2 additions & 0 deletions
2
packages/babel-cli/test/fixtures/babel/--copy-files with ignore in babelrc/stdout.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/index.js -> lib/index.js | ||
Successfully compiled 1 file with Babel. |
Empty file.
Empty file.
1 change: 1 addition & 0 deletions
1
...cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/in-files/src/foo/bar.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bar; |
1 change: 1 addition & 0 deletions
1
...l-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/in-files/src/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
index; |
12 changes: 12 additions & 0 deletions
12
...ages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"args": [ | ||
"src", | ||
"--out-dir", | ||
"lib", | ||
"--copy-files", | ||
"--ignore", | ||
"src/foo", | ||
"--copy-ignored", | ||
"--verbose" | ||
] | ||
} |
Empty file.
1 change: 1 addition & 0 deletions
1
...li/test/fixtures/babel/--copy-files with ignore with copyIgnored/out-files/lib/foo/bar.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bar; |
3 changes: 3 additions & 0 deletions
3
...-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/out-files/lib/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"use strict"; | ||
|
||
index; |
2 changes: 2 additions & 0 deletions
2
packages/babel-cli/test/fixtures/babel/--copy-files with ignore with copyIgnored/stdout.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/index.js -> lib/index.js | ||
Successfully compiled 1 file with Babel. |
Empty file.
Empty file.
1 change: 1 addition & 0 deletions
1
...l-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/in-files/src/foo/bar.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
bar; |
1 change: 1 addition & 0 deletions
1
...bel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/in-files/src/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
index; |
12 changes: 12 additions & 0 deletions
12
packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"args": [ | ||
"src", | ||
"--out-dir", | ||
"lib", | ||
"--copy-files", | ||
"--only", | ||
"src/foo/*", | ||
"--copy-ignored", | ||
"--verbose" | ||
] | ||
} |
Empty file.
3 changes: 3 additions & 0 deletions
3
...-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/out-files/lib/foo/bar.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"use strict"; | ||
|
||
bar; |
1 change: 1 addition & 0 deletions
1
...el-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/out-files/lib/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
index; |
2 changes: 2 additions & 0 deletions
2
packages/babel-cli/test/fixtures/babel/--copy-files with only copy copyIgnored/stdout.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
src/foo/bar.js -> lib/foo/bar.js | ||
Successfully compiled 1 file with Babel. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters