From c65846b2647bb74e3325bbc303134f686e68af6e Mon Sep 17 00:00:00 2001 From: Vojtech Vitek Date: Fri, 21 Jun 2024 12:38:06 +0200 Subject: [PATCH 1/2] Fix -exports=true option --- _examples/hello-webrpc/webapp/client.gen.js | 15 ++++++++------- main.go.tmpl | 6 +++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/_examples/hello-webrpc/webapp/client.gen.js b/_examples/hello-webrpc/webapp/client.gen.js index 81b9705..92a2581 100644 --- a/_examples/hello-webrpc/webapp/client.gen.js +++ b/_examples/hello-webrpc/webapp/client.gen.js @@ -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 @@ -27,7 +27,6 @@ class Empty { constructor(_data) { this._data = {} if (_data) { - } } @@ -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'] } diff --git a/main.go.tmpl b/main.go.tmpl index f51ea9d..a5cbbc9 100644 --- a/main.go.tmpl +++ b/main.go.tmpl @@ -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}} From d856b270f7c38b704883af261667809c9a3e3675 Mon Sep 17 00:00:00 2001 From: Vojtech Vitek Date: Fri, 21 Jun 2024 12:41:04 +0200 Subject: [PATCH 2/2] CI: Update to webrpc@v0.18.6 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6070d95..3aaa448 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v3 - name: Install webrpc-gen run: | - curl -o ./webrpc-gen -fLJO https://github.com/webrpc/webrpc/releases/download/v0.11.3/webrpc-gen.linux-amd64 + curl -o ./webrpc-gen -fLJO https://github.com/webrpc/webrpc/releases/download/v0.18.6/webrpc-gen.linux-amd64 chmod +x ./webrpc-gen echo $PWD >> $GITHUB_PATH