Skip to content

Commit

Permalink
Fix -exports=true option
Browse files Browse the repository at this point in the history
  • Loading branch information
VojtechVitek committed Jun 21, 2024
1 parent c7c8806 commit c65846b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
15 changes: 8 additions & 7 deletions _examples/hello-webrpc/webapp/client.gen.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// hello-webrpc v1.0.0 e7d03ae5c6db914d3d31a21b762b6c3af1af1a07
// hello-webrpc v1.0.0 4fc01b139e8de5a1eb11b0581cd706326a434708
// --
// Code generated by webrpc-gen@v0.11.3 with custom generator. DO NOT EDIT.
// Code generated by webrpc-gen@v0.18.6 with ../../ generator. DO NOT EDIT.
//
// webrpc-gen -schema=hello-api.ridl -target=../../ -exports=false -client -out=./webapp/client.gen.js

// WebRPC description and code-gen version
export const WebRPCVersion = "v1"
const WebRPCVersion = "v1"

// Schema version of your RIDL schema
export const WebRPCSchemaVersion = "v1.0.0"
const WebRPCSchemaVersion = "v1.0.0"

// Schema hash generated from your RIDL schema
export const WebRPCSchemaHash = "e7d03ae5c6db914d3d31a21b762b6c3af1af1a07"
const WebRPCSchemaHash = "4fc01b139e8de5a1eb11b0581cd706326a434708"

//
// Types
Expand All @@ -27,7 +27,6 @@ class Empty {
constructor(_data) {
this._data = {}
if (_data) {

}
}

Expand All @@ -43,21 +42,23 @@ class User {
this._data['id'] = _data['id']
this._data['USERNAME'] = _data['USERNAME']
this._data['created_at'] = _data['created_at']

}
}

get id() {
return this._data['id']
}
set id(value) {
this._data['id'] = value
}

get USERNAME() {
return this._data['USERNAME']
}
set USERNAME(value) {
this._data['USERNAME'] = value
}

get created_at() {
return this._data['created_at']
}
Expand Down
6 changes: 3 additions & 3 deletions main.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@
// {{.WebrpcGenCommand}}

// WebRPC description and code-gen version
export const WebRPCVersion = "{{.WebrpcVersion}}"
{{if $opts.exports}}export {{end}}const WebRPCVersion = "{{.WebrpcVersion}}"

// Schema version of your RIDL schema
export const WebRPCSchemaVersion = "{{.SchemaVersion}}"
{{if $opts.exports}}export {{end}}const WebRPCSchemaVersion = "{{.SchemaVersion}}"

// Schema hash generated from your RIDL schema
export const WebRPCSchemaHash = "{{.SchemaHash}}"
{{if $opts.exports}}export {{end}}const WebRPCSchemaHash = "{{.SchemaHash}}"

{{template "types" dict "Services" .Services "Types" .Types "Opts" $opts}}
{{- if $opts.client}}
Expand Down

0 comments on commit c65846b

Please sign in to comment.