This repository was archived by the owner on Feb 1, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +25
-6
lines changed
crates/generate-bindings/src Expand file tree Collapse file tree 3 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -37,15 +37,15 @@ DOCKER_USER_NAME ?= achimcc
37
37
# ###############################################################################
38
38
39
39
generate-bindings :
40
- cargo run -p generate-bindings -- --target ../.. /packages/_generated/commontypes/src
40
+ cargo run -p generate-bindings -- --target ./packages/_generated/commontypes/src
41
41
42
42
generate-change-json :
43
43
cargo run --package crate-extractor -- create \
44
44
-m crates/contract/Cargo.toml \
45
45
-o packages/_generated/change/src/change.json
46
46
47
47
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
49
49
50
50
generate : generate-rust-analyzer
51
51
generate : generate-bindings
Original file line number Diff line number Diff line change @@ -39,13 +39,13 @@ use backend::services::{
39
39
} ,
40
40
} ;
41
41
use clap:: Parser ;
42
- use std:: fs:: File ;
42
+ use std:: { fs:: File , path :: Path } ;
43
43
use typescript_type_def:: write_definition_file;
44
44
45
45
fn main ( ) -> std:: io:: Result < ( ) > {
46
46
let opts: Cli = Cli :: parse ( ) ;
47
47
let target = opts. target . unwrap ( ) ;
48
- let target = format ! ( "{:? }/index.d.ts" , & target) ;
48
+ let target = format ! ( "{:}/index.d.ts" , target) ;
49
49
50
50
type Api = (
51
51
CompilationResult ,
@@ -61,9 +61,11 @@ fn main() -> std::io::Result<()> {
61
61
GistCreateResponse ,
62
62
) ;
63
63
64
- let buffer = File :: create ( & target) ? ;
64
+ let path = Path :: new ( & target) ;
65
65
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 ( ) ;
67
69
68
70
Ok ( ( ) )
69
71
}
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments