-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hculea/add-python-support-in-typeshare' of github.com:h…
…culea/typeshare into hculea/add-python-support-in-typeshare
- Loading branch information
Showing
8 changed files
with
72 additions
and
5 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
input | ||
out |
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,16 @@ | ||
#[typeshare] | ||
pub struct CustomType {} | ||
|
||
#[typeshare] | ||
pub struct Types { | ||
pub s: String, | ||
pub static_s: &'static str, | ||
pub int8: i8, | ||
pub float: f32, | ||
pub double: f64, | ||
pub array: Vec<String>, | ||
pub fixed_length_array: [String; 4], | ||
pub dictionary: HashMap<String, i32>, | ||
pub optional_dictionary: Option<HashMap<String, i32>>, | ||
pub custom_type: CustomType, | ||
} |
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,19 @@ | ||
determinism_qty := '100' | ||
|
||
all: determinism | ||
|
||
generate-determinism-files: | ||
#!/bin/sh | ||
mkdir -p input | ||
for i in $(seq 1 {{determinism_qty}}); do | ||
cat data/determinism-base.rs | sd '(struct )(\w+)' "\${1}\${2}$i" > "input/input$i.rs" | ||
done | ||
determinism: clean generate-determinism-files | ||
mkdir -p out | ||
cargo run -p typeshare-cli -- -l typescript -o "out/output1.ts" input | ||
cargo run -p typeshare-cli -- -l typescript -o "out/output2.ts" input | ||
diff -q out/*.ts | ||
|
||
clean: | ||
rm -rf out | ||
rm -rf input |