Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI initial concept #304

Open
wants to merge 49 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
4570d9e
CLI initial concept
escritorio-gustavo Apr 9, 2024
7c15180
Add --add-features flag, fix feature! macro and bson-uuid-impl
escritorio-gustavo Apr 9, 2024
1518c18
Remove *-impl features from CLI
escritorio-gustavo Apr 10, 2024
257d04e
Gate test generation behind cargo feature
escritorio-gustavo Apr 10, 2024
27669f1
Update Github action
escritorio-gustavo Apr 10, 2024
ca3eb23
Make the --output-directory flag an Option instead of having a defaul…
escritorio-gustavo Apr 10, 2024
7914bea
Initial draft on generating index.ts
escritorio-gustavo Apr 12, 2024
58df89d
Add missing file
escritorio-gustavo Apr 12, 2024
67f9631
Update Github action
escritorio-gustavo Apr 12, 2024
f092001
Check for empty index and emit codegen warning
escritorio-gustavo Apr 12, 2024
7192a8b
Save relative paths in netadata file
escritorio-gustavo Apr 12, 2024
2b09065
Remove unused import
escritorio-gustavo Apr 12, 2024
d18bf79
Remove unused read file access
escritorio-gustavo Apr 12, 2024
af0d6d3
Add naming collision warning
escritorio-gustavo Apr 12, 2024
41cf034
Add imports
escritorio-gustavo Apr 12, 2024
2ea928f
MAke warnings colorful
escritorio-gustavo Apr 12, 2024
9557f9f
Also highlight type names
escritorio-gustavo Apr 12, 2024
4ec1679
Make type names bold
escritorio-gustavo Apr 12, 2024
9c45249
Remove commented dependency
escritorio-gustavo Apr 12, 2024
98b0c01
Print Rust type name in collision warning
escritorio-gustavo Apr 12, 2024
b80f988
Capture cargo test stderr and stdout
escritorio-gustavo Apr 12, 2024
363f7c8
Refactor CLI code
escritorio-gustavo Apr 12, 2024
7894b4b
Commit untracked files
escritorio-gustavo Apr 12, 2024
65524d5
Export all files, not just the first metadata entry
escritorio-gustavo Apr 12, 2024
7560098
Delete metadata file
escritorio-gustavo Apr 12, 2024
770d6ea
Add metadata file to .gitignore
escritorio-gustavo Apr 12, 2024
e52085c
Enable clippy pedantic and nursery
escritorio-gustavo Apr 12, 2024
275b15d
Merge branch 'main' into cli
escritorio-gustavo Apr 15, 2024
b402bdc
Merge branch 'main' into cli
escritorio-gustavo Apr 15, 2024
b1b5cbe
Clippy warning in test
escritorio-gustavo Apr 17, 2024
6790173
Remove duplicated infer_as test file
escritorio-gustavo Apr 17, 2024
50bfc35
Add error message about naming collisions
escritorio-gustavo Apr 17, 2024
88fc140
Gate metadata file behind feature
escritorio-gustavo Apr 17, 2024
66c94dd
No longer capture stderr as that would silence serde warnings
escritorio-gustavo Apr 17, 2024
1461d3f
Remove changes to infer_as test
escritorio-gustavo Apr 17, 2024
b6c5c65
Make --output-directory required
escritorio-gustavo Apr 17, 2024
c8a6b14
Make casing consistent
escritorio-gustavo Apr 17, 2024
fcaa80f
Merge branch 'main' into cli
escritorio-gustavo Apr 18, 2024
c930c0f
Avoid extra collection allocation
escritorio-gustavo Apr 22, 2024
9b19079
Improve parsing of Metadata
escritorio-gustavo Apr 23, 2024
8ff6688
Replace new with try_from for clarity
escritorio-gustavo Apr 23, 2024
f229f92
Add option to export all types to a single file
escritorio-gustavo May 9, 2024
c9b29aa
Missing imports
escritorio-gustavo May 9, 2024
89430eb
Fix Syntax Error
escritorio-gustavo May 9, 2024
147ea87
Merge branch 'main' into cli
escritorio-gustavo May 20, 2024
00f14af
Merge branch 'main' into cli
gustavo-shigueo Jul 24, 2024
7c9643e
Merge branch 'main' into cli
gustavo-shigueo Aug 1, 2024
5d72d97
Merge branch 'main' into cli
gustavo-shigueo Oct 10, 2024
5abdda9
Fix lockfile
gustavo-shigueo Oct 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions cli/src/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ pub fn invoke(args: &Args) -> Result<()> {
} else {
Stdio::piped()
})
.stderr(if args.no_capture {
Stdio::inherit()
} else {
Stdio::piped()
})
escritorio-gustavo marked this conversation as resolved.
Show resolved Hide resolved
.env("TS_RS_EXPORT_DIR", path::absolute(&args.output_directory)?);

feature!(cargo_invocation, args, {
Expand All @@ -46,6 +41,8 @@ pub fn invoke(args: &Args) -> Result<()> {

if args.no_capture {
cargo_invocation.arg("--").arg("--nocapture");
} else {
cargo_invocation.arg("--quiet");
escritorio-gustavo marked this conversation as resolved.
Show resolved Hide resolved
}

cargo_invocation.spawn()?.wait()?;
Expand Down
3 changes: 2 additions & 1 deletion ts-rs/tests/integration/infer_as.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

use ts_rs::TS;

#[derive(TS)]
#[derive(TS, serde::Serialize)]
#[ts(export)]
struct Foo {
#[serde(skip_serializing_if = "std::ops::Not::not")]
#[ts(optional, as = "Option<_>")]
my_optional_bool: bool,
}
Expand Down