Skip to content

Commit

Permalink
Fix(core): Semantic Import Versioning for v2 (hybridgroup#921)
Browse files Browse the repository at this point in the history
  • Loading branch information
gen2thomas authored May 20, 2023
1 parent fcdf286 commit 949392d
Show file tree
Hide file tree
Showing 659 changed files with 2,675 additions and 2,071 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The basics are as follows:

2. `go get` the upstream repo and set it up as the `upstream` remote and your own repo as the `origin` remote:

`go get gobot.io/x/gobot`
`go get gobot.io/x/gobot/v2`
`cd $GOPATH/src/gobot.io/x/gobot`
`git remote rename origin upstream`
`git remote add origin [email protected]/YOUR_GITHUB_NAME/gobot`
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Gobot](https://raw.githubusercontent.com/hybridgroup/gobot-site/master/source/images/elements/gobot-logo-small.png)](http://gobot.io/)

[![GoDoc](https://godoc.org/gobot.io/x/gobot?status.svg)](https://godoc.org/gobot.io/x/gobot)
[![GoDoc](https://godoc.org/gobot.io/x/gobot/v2?status.svg)](https://godoc.org/gobot.io/x/gobot/v2)
[![CircleCI Build status](https://circleci.com/gh/hybridgroup/gobot/tree/dev.svg?style=svg)](https://circleci.com/gh/hybridgroup/gobot/tree/dev)
[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/ix29evnbdrhkr7ud/branch/dev?svg=true)](https://ci.appveyor.com/project/deadprogram/gobot/branch/dev)
[![codecov](https://codecov.io/gh/hybridgroup/gobot/branch/dev/graph/badge.svg)](https://codecov.io/gh/hybridgroup/gobot)
Expand All @@ -17,7 +17,7 @@ Want to run Go directly on microcontrollers? Check out our sister project TinyGo

## Getting Started

Get the Gobot package by running this command: `go get -d -u gobot.io/x/gobot`
Get the Gobot package by running this command: `go get -d -u gobot.io/x/gobot/v2`

## Examples

Expand All @@ -29,9 +29,9 @@ package main
import (
"time"

"gobot.io/x/gobot"
"gobot.io/x/gobot/drivers/gpio"
"gobot.io/x/gobot/platforms/firmata"
"gobot.io/x/gobot/v2"
"gobot.io/x/gobot/v2/drivers/gpio"
"gobot.io/x/gobot/v2/platforms/firmata"
)

func main() {
Expand Down Expand Up @@ -63,8 +63,8 @@ import (
"fmt"
"time"

"gobot.io/x/gobot"
"gobot.io/x/gobot/platforms/sphero"
"gobot.io/x/gobot/v2"
"gobot.io/x/gobot/v2/platforms/sphero"
)

func main() {
Expand Down Expand Up @@ -96,8 +96,8 @@ the various Gobot packages to control hardware with nothing but pure idiomatic G
package main

import (
"gobot.io/x/gobot/drivers/gpio"
"gobot.io/x/gobot/platforms/intel-iot/edison"
"gobot.io/x/gobot/v2/drivers/gpio"
"gobot.io/x/gobot/v2/platforms/intel-iot/edison"
"time"
)

Expand Down Expand Up @@ -127,9 +127,9 @@ import (
"fmt"
"time"

"gobot.io/x/gobot"
"gobot.io/x/gobot/api"
"gobot.io/x/gobot/platforms/sphero"
"gobot.io/x/gobot/v2"
"gobot.io/x/gobot/v2/api"
"gobot.io/x/gobot/v2/platforms/sphero"
)

func NewSwarmBot(port string) *gobot.Robot {
Expand Down Expand Up @@ -329,7 +329,7 @@ More platforms and drivers are coming soon...
Gobot includes a RESTful API to query the status of any robot running within a group, including the connection and
device status, and execute device commands.

To activate the API, import the `gobot.io/x/gobot/api` package and instantiate the `API` like this:
To activate the API, import the `gobot.io/x/gobot/v2/api` package and instantiate the `API` like this:

```go
master := gobot.NewMaster()
Expand Down
4 changes: 2 additions & 2 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"strings"

"github.com/bmizerany/pat"
"gobot.io/x/gobot"
"gobot.io/x/gobot/api/robeaux"
"gobot.io/x/gobot/v2"
"gobot.io/x/gobot/v2/api/robeaux"
)

// API represents an API server
Expand Down
4 changes: 2 additions & 2 deletions api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"testing"
"time"

"gobot.io/x/gobot"
"gobot.io/x/gobot/gobottest"
"gobot.io/x/gobot/v2"
"gobot.io/x/gobot/v2/gobottest"
)

func initTestAPI() *API {
Expand Down
2 changes: 1 addition & 1 deletion api/basic_auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http/httptest"
"testing"

"gobot.io/x/gobot/gobottest"
"gobot.io/x/gobot/v2/gobottest"
)

func TestBasicAuth(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion api/cors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"net/http/httptest"
"testing"

"gobot.io/x/gobot/gobottest"
"gobot.io/x/gobot/v2/gobottest"
)

func TestCORSIsOriginAllowed(t *testing.T) {
Expand Down
42 changes: 21 additions & 21 deletions api/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@ Package api provides a webserver to interact with your Gobot program over the ne
Example:
package main
package main
import (
"fmt"
import (
"fmt"
"gobot.io/x/gobot"
"gobot.io/x/gobot/api"
)
"gobot.io/x/gobot/v2"
"gobot.io/x/gobot/v2/api"
)
func main() {
gbot := gobot.NewMaster()
func main() {
gbot := gobot.NewMaster()
// Starts the API server on default port 3000
api.NewAPI(gbot).Start()
// Starts the API server on default port 3000
api.NewAPI(gbot).Start()
// Accessible via http://localhost:3000/api/commands/say_hello
gbot.AddCommand("say_hello", func(params map[string]interface{}) interface{} {
return "Master says hello!"
})
// Accessible via http://localhost:3000/api/commands/say_hello
gbot.AddCommand("say_hello", func(params map[string]interface{}) interface{} {
return "Master says hello!"
})
hello := gbot.AddRobot(gobot.NewRobot("Eve"))
hello := gbot.AddRobot(gobot.NewRobot("Eve"))
// Accessible via http://localhost:3000/api/robots/Eve/commands/say_hello
hello.AddCommand("say_hello", func(params map[string]interface{}) interface{} {
return fmt.Sprintf("%v says hello!", hello.Name)
})
// Accessible via http://localhost:3000/api/robots/Eve/commands/say_hello
hello.AddCommand("say_hello", func(params map[string]interface{}) interface{} {
return fmt.Sprintf("%v says hello!", hello.Name)
})
gbot.Start()
}
gbot.Start()
}
It follows Common Protocol for Programming Physical Input and Output (CPPP-IO) spec:
https://gobot.io/x/cppp-io
Expand Down
2 changes: 1 addition & 1 deletion api/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package api
import (
"fmt"

"gobot.io/x/gobot"
"gobot.io/x/gobot/v2"
)

type NullReadWriteCloser struct{}
Expand Down
14 changes: 7 additions & 7 deletions cli/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func driver() string {
import (
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/v2"
)
const Hello string = "hello"
Expand Down Expand Up @@ -274,7 +274,7 @@ import (
"fmt"
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/v2"
)
func main() {
Expand Down Expand Up @@ -313,8 +313,8 @@ import (
"testing"
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/gobottest"
"gobot.io/x/gobot/v2"
"gobot.io/x/gobot/v2/gobottest"
)
var _ gobot.Driver = (*{{.UpperName}}Driver)(nil)
Expand Down Expand Up @@ -368,8 +368,8 @@ func adaptorTest() string {
import (
"testing"
"gobot.io/x/gobot"
"gobot.io/x/gobot/gobottest"
"gobot.io/x/gobot/v2"
"gobot.io/x/gobot/v2/gobottest"
)
var _ gobot.Adaptor = (*{{.UpperName}}Adaptor)(nil)
Expand Down Expand Up @@ -398,7 +398,7 @@ Gobot (http://gobot.io/) is a framework for robotics and physical computing usin
This repository contains the Gobot adaptor and driver for {{.Package}}.
For more information about Gobot, check out the github repo at
https://gobot.io/x/gobot
https://gobot.io/x/gobot/v2
## Installing
` + "```bash\ngo get path/to/repo/{{.Package}}\n```" + `
Expand Down
4 changes: 2 additions & 2 deletions cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import (
"os"

"github.com/urfave/cli"
"gobot.io/x/gobot"
"gobot.io/x/gobot/v2"
)

func main() {
app := cli.NewApp()
app.Name = "gobot"
app.Author = "The Gobot team"
app.Email = "https://gobot.io/x/gobot"
app.Email = "https://gobot.io/x/gobot/v2"
app.Version = gobot.Version()
app.Usage = "Command Line Utility for generating new Gobot adaptors, drivers, and platforms"
app.Commands = []cli.Command{
Expand Down
2 changes: 1 addition & 1 deletion commander_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package gobot
import (
"testing"

"gobot.io/x/gobot/gobottest"
"gobot.io/x/gobot/v2/gobottest"
)

func TestCommaner(t *testing.T) {
Expand Down
Loading

0 comments on commit 949392d

Please sign in to comment.