This repository has been archived by the owner on Jul 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new: Copy info files during build. (#9)
- Loading branch information
Showing
20 changed files
with
242 additions
and
10 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
use starbase_sandbox::{create_command_with_name, create_sandbox}; | ||
|
||
mod build { | ||
use super::*; | ||
|
||
#[test] | ||
fn builds_polyrepo() { | ||
let sandbox = create_sandbox("polyrepo"); | ||
|
||
create_command_with_name(sandbox.path(), "espm") | ||
.args(["build", "--target", "es2015"]) | ||
.assert(); | ||
|
||
assert!(sandbox.path().join(".espm/es2015").exists()); | ||
} | ||
|
||
#[test] | ||
fn builds_all_in_monorepo() { | ||
let sandbox = create_sandbox("monorepo"); | ||
|
||
create_command_with_name(sandbox.path(), "espm") | ||
.args(["build", "--target", "es2016", "--workspace"]) | ||
.assert(); | ||
|
||
assert!(sandbox.path().join("packages/bar/.espm/es2016").exists()); | ||
assert!(sandbox.path().join("packages/baz/.espm/es2016").exists()); | ||
assert!(sandbox.path().join("packages/foo/.espm/es2016").exists()); | ||
} | ||
|
||
#[test] | ||
fn builds_selected_in_monorepo() { | ||
let sandbox = create_sandbox("monorepo"); | ||
|
||
create_command_with_name(sandbox.path(), "espm") | ||
.args(["build", "--target", "es2017", "--package", "mono/baz"]) | ||
.assert(); | ||
|
||
assert!(!sandbox.path().join("packages/bar/.espm/es2017").exists()); | ||
assert!(sandbox.path().join("packages/baz/.espm/es2017").exists()); | ||
assert!(!sandbox.path().join("packages/foo/.espm/es2017").exists()); | ||
} | ||
|
||
#[test] | ||
fn copies_info_files_for_each_package() { | ||
let sandbox = create_sandbox("monorepo"); | ||
|
||
create_command_with_name(sandbox.path(), "espm") | ||
.args(["build", "--target", "es2018", "--workspace"]) | ||
.assert(); | ||
|
||
assert!(sandbox | ||
.path() | ||
.join("packages/bar/.espm/es2018/CHANGELOG.md") | ||
.exists()); | ||
assert!(sandbox | ||
.path() | ||
.join("packages/baz/.espm/es2018/README.md") | ||
.exists()); | ||
assert!(sandbox | ||
.path() | ||
.join("packages/foo/.espm/es2018/LICENSE") | ||
.exists()); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[package] | ||
name = "ns/common" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[workspace] | ||
packages = ["packages/*"] |
Empty file.
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 @@ | ||
[package] | ||
name = "mono/bar" |
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 @@ | ||
export type Package = 'bar'; |
Empty file.
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 @@ | ||
[package] | ||
name = "mono/baz" |
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 @@ | ||
export type Package = 'baz'; |
Empty file.
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 @@ | ||
[package] | ||
name = "mono/foo" |
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 @@ | ||
export type Package = 'foo'; |
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 @@ | ||
[package] | ||
name = "poly/root" |
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 @@ | ||
export type Poly = true; |