Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit 3fd7d5b

Browse files
author
Achim Schneider
committed
use absolute path
1 parent 6b2affe commit 3fd7d5b

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ DOCKER_USER_NAME ?= achimcc
3737
################################################################################
3838

3939
generate-bindings:
40-
cargo run -p generate-bindings -- --target ../../packages/_generated/commontypes/src
40+
cargo run -p generate-bindings -- --target ./packages/_generated/commontypes/src
4141

4242
generate-change-json:
4343
cargo run --package crate-extractor -- create \
4444
-m crates/contract/Cargo.toml \
4545
-o packages/_generated/change/src/change.json
4646

4747
generate-rust-analyzer:
48-
wasm-pack build crates/rust_analyzer_wasm/ --out-dir ../../packages/ink-editor/pkg --target web
48+
wasm-pack build crates/rust_analyzer_wasm/ --out-dir ./packages/ink-editor/pkg --target web
4949

5050
generate: generate-rust-analyzer
5151
generate: generate-bindings

crates/generate-bindings/src/main.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ use backend::services::{
3939
},
4040
};
4141
use clap::Parser;
42-
use std::fs::File;
42+
use std::{fs::File, path::Path};
4343
use typescript_type_def::write_definition_file;
4444

4545
fn main() -> std::io::Result<()> {
4646
let opts: Cli = Cli::parse();
4747
let target = opts.target.unwrap();
48-
let target = format!("{:?}/index.d.ts", &target);
48+
let target = format!("{:}/index.d.ts", target);
4949

5050
type Api = (
5151
CompilationResult,
@@ -61,9 +61,11 @@ fn main() -> std::io::Result<()> {
6161
GistCreateResponse,
6262
);
6363

64-
let buffer = File::create(&target)?;
64+
let path = Path::new(&target);
6565

66-
write_definition_file::<_, Api>(&buffer, Default::default()).unwrap();
66+
let buffer = File::create(&path)?;
67+
68+
write_definition_file::<_, Api>(buffer, Default::default()).unwrap();
6769

6870
Ok(())
6971
}

output.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// AUTO-GENERATED by typescript-type-def
2+
3+
export default types;
4+
export namespace types{
5+
export type U8=number;
6+
export type CompilationResult=({"type":"SUCCESS";"payload":{"wasm":(types.U8)[];"stdout":string;"stderr":string;};}|{"type":"ERROR";"payload":{"stdout":string;"stderr":string;};});
7+
export type CompilationRequest={"source":string;};
8+
export type TestingRequest={"source":string;};
9+
export type TestingResult=({"type":"SUCCESS";"payload":{"stdout":string;"stderr":string;};}|{"type":"ERROR";"payload":{"stdout":string;"stderr":string;};});
10+
export type FormattingRequest={"source":string;};
11+
export type FormattingResult=({"type":"SUCCESS";"payload":{"source":string;"stderr":string;};}|{"type":"ERROR";"payload":{"stdout":string;"stderr":string;};});
12+
export type Gist={"id":string;"url":string;"code":string;};
13+
export type GistLoadRequest={"id":string;};
14+
export type GistLoadResponse=({"type":"SUCCESS";"payload":types.Gist;}|{"type":"ERROR";"payload":string;});
15+
export type GistCreateRequest={"code":string;};
16+
export type GistCreateResponse=({"type":"SUCCESS";"payload":types.Gist;}|{"type":"ERROR";"payload":string;});
17+
}

0 commit comments

Comments
 (0)