Skip to content

webrpc update from head#11

Open
kipply wants to merge 264 commits intocohere-ai:masterfrom
webrpc:master
Open

webrpc update from head#11
kipply wants to merge 264 commits intocohere-ai:masterfrom
webrpc:master

Conversation

@kipply
Copy link

@kipply kipply commented Apr 23, 2021

No description provided.

@CLAassistant
Copy link

CLAassistant commented Oct 11, 2022

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 5 committers have signed the CLA.

❌ VojtechVitek
❌ LukasJenicek
❌ pkieltyka
❌ klaidliadon
❌ austinmilt
You have signed the CLA already but the status is still pending? Let us recheck it.

VojtechVitek and others added 29 commits October 25, 2022 14:22
* Exploring Templates functions API

* Implement "dict", "set" and "get" dictionary funcs for templates

This will help us define type mapping in templates

* Re-add some v0.6.0 functions for now

* Refactor dict function, so we can pass it down to sub-templates

* Add type helper funcmaps

* Implement isBaseType function

* Bring back some obsolete functions to keep generators v0.6.0 working

* make diff

* Fix the tests for now

* Fix go.mod after git cherry-pick

* Pass variables to templates via CLI -Flags, add error/fatal funcmaps

* Remove gofmt/goimports for now

* Implement printfStderr and exit funcs

* Move VERSION to gen/ package, expose it as {{.WebrpcGenVersion}}

* Expose {{.WebrpcTarget}} and {{.WebrpcGenCLI}}

* Remove generator specific tests

Each generator repo should be testing the schema/output on its own

* Improve and document the template variables

* Support old -client, -server and -pkg flags

* Remove bunch of golang-specific funcmaps

* Fix tests

* Remove go-specific funcmaps for method inputs/outputs/arguments

* Resolve rebase

* Print "custom" target in case of local dir

* Remove more go-specific funcmaps; rename "first" to "coalesce"

* Gen: Remove all Go-spefific funcmaps/code

* Remove last go-specific funcmaps

* README: Table of generators

* Remove "indent" and rename "stderrPrintf"

* webrpc-gen: Return early when writing to stdout

* webrpc-gen: Print fatal errors to stderr

Otherwise the errors potentially ended up in the generated output file.

* Execute "main" template as the required generator entrypoint

* Add documentation about generator templates

* Generator docs: Document schema object and add TOC

* Document template functions

* Implement minVersion function

* Markdown: Escape column character in a table row

* Document requiring webrpc-gen version from templates

* Improve error message by naming the template after its target

* Collect flags in its own function

* Implement "default" function

* Add "in" function, remove "str" function and gofmt

* Implement ternary, split, first, last functions

* Remove JavaScript-specific template functions

* Finalize template functions for webrpc schema types

* Remove last generic or TS-specific template functions

* Update template functions docs

* Update README & examples with new webrpc-gen targets

* Bring back goimport/gofmt for golang targets

* PR feedback: Use Go 1.16+

* webrpc-gen CLI: Use v0.7.0 as an example target

* Use os.WriteFile() instead of ioutil.WriteFile()

* Improve isGolangTarget() so it works with local templates too

* webrpc-gen -fmt=false: disable automatic code formatting

* Lowercase all template option CLI flags, print target -help

* Lowercase all generator options, update docs

* Regenerate examples: Apply new DO NOT EDIT comment
This allows external tools like https://github.com/golang-cz/go2webrpc to build full webrpc schema.
* Upgrade golang-basics example to chi v4

* Create Go module for golang-basic example
This proves #74 is not caused by TypeScript generator
* Run CI tests against Go 1.16 and 1.19

* Downgrade golang.org/x/sys to support Go 1.16

* Replace strings.Cut(), which was added in Go 1.18
We can't enforce the golang.org/x/sys version with the go.mod "replace"
directive, as it breaks the `go install` command.

See golang/go#44840

$ go install github.com/webrpc/webrpc/cmd/webrpc-gen@v0.7.2
go: downloading github.com/webrpc/webrpc v0.7.2
go install github.com/webrpc/webrpc/cmd/webrpc-gen@v0.7.2: github.com/webrpc/webrpc@v0.7.2
	The go.mod file for the module providing named packages contains one or
	more replace directives. It must not contain directives that would cause
	it to be interpreted differently than if it were the main module.
Build webrpc-gen binary for multiple OS/archs.
Create a Github release with changelog & attach the binaries.
Build and publish webrpc-gen Docker image on new git tag
…146)

* Fix -version flag value built in CI

* README: Add Install steps & improve Getting started

* Goreleaser: Add Install steps to release notes
…tions (#147)

* Add trimPrefix and trimSuffix template functions

* Implement sort template function, add documentation

* Bump webrpc-gen minor version because of template API change

* Re-generate examples
* Split Template API functions to logical groups; Update docs

* Implement array and append template functions

* Add tests for array functions
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Commits](isaacs/minimatch@v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
pkieltyka and others added 30 commits October 20, 2025 22:55
* upgrade gen-golang dep

* [AUTOMATED] make generate

---------

Co-authored-by: pkieltyka <18831+pkieltyka@users.noreply.github.com>
* Update to gen-typescript@v0.22.3 and gen-openapi@v0.16.4

* [AUTOMATED] make generate
* Update to gen-typescript@v0.22.4 to hotfix Webrpc header key

* [AUTOMATED] make generate
* Update to gen-typescript@v0.22.5

* [AUTOMATED] make generate
Support $WEBRPC_SCHEMA_VERSION env var too, it's very useful when using  webrpc-gen from within //go:generate directives.
Bumps [hono](https://github.com/honojs/hono) from 4.10.1 to 4.10.3.
- [Release notes](https://github.com/honojs/hono/releases)
- [Commits](honojs/hono@v4.10.1...v4.10.3)

---
updated-dependencies:
- dependency-name: hono
  dependency-version: 4.10.3
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Update to gen-golang@v0.23.2

* Update to gen-golang@v0.23.2

* make generate
* add -methodTreeShake flag

* update
* Update to gen-golang@v0.24.0 and gen-openapi@v0.16.5

* make generate

* Simplify make generate command

* Update README

* Simplify example makefiles; use local webrpc-gen bin
…-ts/server-go (#419)

Bump github.com/go-chi/chi/v5 in /_examples/node-ts/server-go

Bumps [github.com/go-chi/chi/v5](https://github.com/go-chi/chi) from 5.0.12 to 5.2.2.
- [Release notes](https://github.com/go-chi/chi/releases)
- [Changelog](https://github.com/go-chi/chi/blob/master/CHANGELOG.md)
- [Commits](go-chi/chi@v5.0.12...v5.2.2)

---
updated-dependencies:
- dependency-name: github.com/go-chi/chi/v5
  dependency-version: 5.2.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [hono](https://github.com/honojs/hono) from 4.10.3 to 4.11.7.
- [Release notes](https://github.com/honojs/hono/releases)
- [Commits](honojs/hono@v4.10.3...v4.11.7)

---
updated-dependencies:
- dependency-name: hono
  dependency-version: 4.11.7
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…c-streaming (#420)

Bump github.com/go-chi/chi/v5 in /_examples/webrpc-streaming

Bumps [github.com/go-chi/chi/v5](https://github.com/go-chi/chi) from 5.1.0 to 5.2.2.
- [Release notes](https://github.com/go-chi/chi/releases)
- [Changelog](https://github.com/go-chi/chi/blob/master/CHANGELOG.md)
- [Commits](go-chi/chi@v5.1.0...v5.2.2)

---
updated-dependencies:
- dependency-name: github.com/go-chi/chi/v5
  dependency-version: 5.2.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Move service definition to top of RIDL examples

* Fix golden file

* [AUTOMATED] make generate
* Add new "basepath" keyword to define base path for the API routes

This will allow users to
- override the default "/rpc" prefix
- use a custom prefix such as "/v1" to enable schema versioning

If empty, the value defaults to "/rpc" for backward compatibility.
However, "basepath" will be required in the future versions of webrpc.

* Update golden files
* Update golang, typescript, javascript, openapi, dart, kotlin

* Add basepath to README and examples

* make generate

* Update go.mod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.