Skip to content

Commit 002cac7

Browse files
committed
feat: add ts-rs mapping package
1 parent 0062fcc commit 002cac7

File tree

334 files changed

+3130
-40
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

334 files changed

+3130
-40
lines changed

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
"bracketSpacing": true,
99
"bracketSameLine": false,
1010
"arrowParens": "always",
11-
"endOfLine": "lf"
11+
"endOfLine": "auto"
1212
}

Cargo.lock

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ tower = "0.4"
214214
tower-http = { version = "0.3.5", default-features = false }
215215
tower-layer = "0.3"
216216
tracing = "0.1.40"
217+
ts-rs = { version = "7.1", features = [
218+
"chrono-impl",
219+
"no-serde-warnings",
220+
"indexmap-impl",
221+
] }
217222
url = "2.4.1"
218223
wasmer = "2.3.0"
219224
wasmer-middlewares = "2.3.0"

applications/tari_dan_wallet_daemon/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,6 @@ ignored = [
7070
# Want to enable some log4rs features
7171
"log4rs",
7272
]
73+
74+
[features]
75+
ts = [] # this is just for the build script to skip the build

applications/tari_dan_wallet_daemon/build.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@
2020
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
2121
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2222

23-
use std::process::Command;
23+
use std::{env, process::Command};
2424

2525
fn main() -> Result<(), Box<dyn std::error::Error>> {
2626
println!("cargo:rerun-if-changed=../tari_dan_wallet_web_ui/src");
2727
println!("cargo:rerun-if-changed=../tari_dan_wallet_web_ui/public");
28+
29+
if env::var_os("CARGO_FEATURE_TS").is_some() {
30+
println!("cargo:warning=The web ui is not being compiled when we are generating typescript types/interfaces.");
31+
return Ok(());
32+
}
33+
2834
let npm = if cfg!(windows) { "npm.cmd" } else { "npm" };
2935

3036
if let Err(error) = Command::new(npm)

applications/tari_dan_wallet_web_ui/dist/.gitkeep

Whitespace-only changes.

applications/tari_dan_wallet_web_ui/public/.gitkeep

Whitespace-only changes.

applications/tari_indexer/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,6 @@ ignored = [
7474
# Want to enable some log4rs features
7575
"log4rs",
7676
]
77+
78+
[features]
79+
ts = [] # this is just for the build script to skip the build

applications/tari_indexer/build.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@
2020
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
2121
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2222

23-
use std::process::Command;
23+
use std::{env, process::Command};
2424

2525
fn main() -> Result<(), Box<dyn std::error::Error>> {
2626
println!("cargo:rerun-if-changed=../tari_indexer_web_ui/src");
2727
println!("cargo:rerun-if-changed=../tari_indexer_web_ui/public");
28+
29+
if env::var_os("CARGO_FEATURE_TS").is_some() {
30+
println!("cargo:warning=The web ui is not being compiled when we are generating typescript types/interfaces.");
31+
return Ok(());
32+
}
33+
2834
let npm = if cfg!(windows) { "npm.cmd" } else { "npm" };
2935

3036
if let Err(error) = Command::new(npm)

applications/tari_indexer_web_ui/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
/coverage
1010

1111
# production
12-
/build
12+
build/*
13+
!build/.gitkeep
1314

1415
# misc
1516
.DS_Store

0 commit comments

Comments
 (0)