-
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.
- Loading branch information
Showing
10 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion
2
typeshare2/typeshare-main/Cargo.toml → typeshare2/typeshare-driver/Cargo.toml
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[package] | ||
name = "typeshare-main" | ||
name = "typeshare-driver" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
|
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,18 @@ | ||
# typeshare-driver | ||
|
||
This crate contains a macro generating all the glue code necessary to create a typeshare binary. The idea is that person wanting a typeshare binary supporting | ||
certain languages would be able to write something as simple as: | ||
|
||
```rust | ||
use typeshare_swift::Swift; | ||
use typeshare_typescript::Typescript; | ||
use typeshare_driver::generate_typeshare_cli | ||
|
||
generate_typeshare_cli!(Swift, Typescript) | ||
``` | ||
|
||
This would create a `fn main` that uses these languages, plus `typeshare-engine`, that implements a full typeshare CLI. | ||
|
||
This crate is among the last things I want to work on, because making it sufficiently configurable might be tricky. | ||
|
||
Theoretically, if (for example) `typeshare-python` wanted to export a full `typeshare-python` binary, it could depend on both `typeshare-model` (for the implementation) and `typeshare-main` for the binary, exposing the latter probably as a cargo feature. |
File renamed without changes.
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,17 @@ | ||
# typeshare-engine | ||
|
||
This crate includes all of the actual implmenentations of typeshare functionality. It should be a dependency of anyone trying to USE typeshare as a library. It depends ONLY on typeshare-model, not on any language crates. It exports functions that make use of the traits in typeshare-model, so that callers can do something like this (this is just an example, not my real intended API) | ||
|
||
```rust | ||
use std::env::current_dir; | ||
use typeshare_engine::run; | ||
use typeshare_swift::Swift; | ||
|
||
fn main() { | ||
let working_dir = current_dir(); | ||
let source_dir = working_dir.join("src"); | ||
let out_dir = working_dir.join("output"); | ||
|
||
run(source_dir, working_dir, Swift); | ||
} | ||
``` |
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.