Skip to content

Commit 9005143

Browse files
authored
refactor: rebrand Go+ to XGo and Go+ Builder to XBuilder (#1905)
Signed-off-by: Aofei Sheng <[email protected]>
1 parent 8c75afe commit 9005143

File tree

24 files changed

+136
-136
lines changed

24 files changed

+136
-136
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
XBuilder is a tool for building games. We create it to help children to learn [abilities to build](https://github.com/goplus/builder/issues/531).
44

5-
XBuilder is developed based on [spx](https://github.com/goplus/spx), which is a game engine built on [Go+](https://goplus.org/).
5+
XBuilder is developed based on [spx](https://github.com/goplus/spx), which is a game engine built on [XGo](https://xgo.dev/).
66

77
![XBuilder Screenshot](./docs/screenshot.jpeg)
88

99
## How to try
1010

11-
You can visit https://builder.goplus.org to try XBuilder.
11+
You can visit https://xbuilder.com to try XBuilder.
1212

1313
## How to develop
1414

docs/openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,7 @@ components:
17101710
type: string
17111711
format: uri
17121712
examples:
1713-
- https://builder.goplus.org/logo.svg
1713+
- https://example.com/project-thumbnail.png
17141714
description: URL of the project's thumbnail image.
17151715
viewCount:
17161716
type: integer

scripts/pr-preview.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ echo "WORKSPACE: ${PWD}"
1010
echo "VITE_API_BASE_URL=/api" > ./spx-gui/.env.staging.local
1111

1212
GOPLUS_REGISTRY_REPO=aslan-spock-register.qiniu.io/goplus
13-
CONTAINER_IMAGE="${GOPLUS_REGISTRY_REPO}/goplus-builder-pr:${PULL_NUMBER}-${PULL_PULL_SHA:0:8}"
13+
CONTAINER_IMAGE="${GOPLUS_REGISTRY_REPO}/xbuilder-pr:${PULL_NUMBER}-${PULL_PULL_SHA:0:8}"
1414
docker build \
1515
--builder kube \
1616
--push \
@@ -27,26 +27,26 @@ docker build \
2727

2828
CURRENT_TIME="$(date "--iso-8601=seconds")"
2929
# generate kubernetes yaml with unique flag for PR
30-
cat > goplus-builder.yaml << EOF
30+
cat > xbuilder.yaml << EOF
3131
apiVersion: apps/v1
3232
kind: Deployment
3333
metadata:
34-
name: goplus-builder-pr-${PULL_NUMBER}
34+
name: xbuilder-pr-${PULL_NUMBER}
3535
labels:
3636
sleepmode.kubefree.com/delete-after: "144h"
3737
annotations:
3838
sleepmode.kubefree.com/activity-status: '{"LastActivityTime": "${CURRENT_TIME}"}'
3939
spec:
4040
selector:
4141
matchLabels:
42-
app: goplus-builder-pr-${PULL_NUMBER}
42+
app: xbuilder-pr-${PULL_NUMBER}
4343
template:
4444
metadata:
4545
labels:
46-
app: goplus-builder-pr-${PULL_NUMBER}
46+
app: xbuilder-pr-${PULL_NUMBER}
4747
spec:
4848
containers:
49-
- name: goplus-builder
49+
- name: xbuilder
5050
image: ${CONTAINER_IMAGE}
5151
ports:
5252
- containerPort: 80
@@ -65,26 +65,26 @@ spec:
6565
apiVersion: v1
6666
kind: Service
6767
metadata:
68-
name: goplus-builder-pr-${PULL_NUMBER}
68+
name: xbuilder-pr-${PULL_NUMBER}
6969
labels:
7070
sleepmode.kubefree.com/delete-after: "144h"
7171
annotations:
7272
sleepmode.kubefree.com/activity-status: '{"LastActivityTime": "${CURRENT_TIME}"}'
7373
spec:
7474
selector:
75-
app: goplus-builder-pr-${PULL_NUMBER}
75+
app: xbuilder-pr-${PULL_NUMBER}
7676
ports:
7777
- port: 80
7878
EOF
7979

80-
kubectl -n goplus-pr-review apply -f goplus-builder.yaml
80+
kubectl -n goplus-pr-review apply -f xbuilder.yaml
8181
kubectl -n goplus-pr-review get pod
8282

83-
PREVIEW_URL="http://goplus-builder-pr-${PULL_NUMBER}.goplus-pr-review.svc.jfcs-qa1.local"
83+
PREVIEW_URL="http://xbuilder-pr-${PULL_NUMBER}.goplus-pr-review.svc.jfcs-qa1.local"
8484
COMMENT=$'
8585
This PR has been deployed to the preview environment. You can explore it using the [preview URL]('${PREVIEW_URL}').
8686
8787
> [!WARNING]
88-
> Please note that deployments in the preview environment are temporary and will be automatically cleaned up after a certain period. Make sure to explore it before it is removed. For any questions, contact the Go+ Builder team.
88+
> Please note that deployments in the preview environment are temporary and will be automatically cleaned up after a certain period. Make sure to explore it before it is removed. For any questions, contact the XBuilder team.
8989
'
9090
gh_comment -org="${REPO_OWNER}" -repo="${REPO_NAME}" -num="${PULL_NUMBER}" -p="${PREVIEW_URL}" -b "${COMMENT}"

spx-backend/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Server for Go+ Builder
1+
# Server for XBuilder
22

33
## Prepare
44

spx-backend/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/casdoor/casdoor-go-sdk v1.9.0
88
github.com/go-redis/redismock/v9 v9.2.0
99
github.com/go-sql-driver/mysql v1.9.3
10-
github.com/goplus/yap v0.8.4 //gop:class
10+
github.com/goplus/yap v0.8.4 //xgo:class
1111
github.com/joho/godotenv v1.5.1
1212
github.com/openai/openai-go v1.11.1
1313
github.com/qiniu/go-cdk-driver v0.1.1

spx-backend/internal/controller/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func NewCodeEditNode(copit *copilot.Copilot) *workflow.LLMNode {
152152
}
153153

154154
func NewKeyNode(copilot *copilot.Copilot) *workflow.LLMNode {
155-
system := `We are using Go+'s XBuilder platform. We provide you with a tool that you can use to query whether there are reference projects on the XBuilder platform.
155+
system := `We are using XGo's XBuilder platform. We provide you with a tool that you can use to query whether there are reference projects on the XBuilder platform.
156156
Reference project names, it is best to give multiple (>3), including whether it is camel case, whether it is underlined, whether the first letter is capitalized, etc.
157157
Please use the search tool to search.
158158

spx-backend/internal/controller/workflow.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (ctrl *Controller) WorkflowMessageStream(ctx context.Context, params *Workf
3939

4040
env.Set("messages", params.Messages)
4141
env.Set("Tools", params.Tools)
42-
env.Set("GopDefs", copilot.GopDefs)
42+
env.Set("XGoDefs", copilot.XGoDefs)
4343
env.Set("SpxDefs", copilot.SpxDefs)
4444
env.Set("canUsePremium", canUsePremium)
4545

spx-backend/internal/copilot/code_system_prompt.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<documents>
22
<document>
3-
<source>gop-defs.md</source>
3+
<source>xgo-defs.md</source>
44
<document_content>
5-
{{.GopDefs}}
5+
{{.XGoDefs}}
66
</document_content>
77
</document>
88
<document>
@@ -25,21 +25,21 @@
2525
</document>
2626
</documents>
2727

28-
# About Go+
28+
# About XGo
2929

30-
The Go+ programming language is
30+
The XGo programming language is
3131

3232
* Superset of the Go language
3333
* Statically typed
3434
* With special features focusing on simplicity and efficiency
3535

36-
In document `gop-defs.md`, you can find some definitions for Go+ language syntax.
36+
In document `xgo-defs.md`, you can find some definitions for XGo language syntax.
3737

38-
## How Go+ simplifies Go's expressions
38+
## How XGo simplifies Go's expressions
3939

4040
### Program structure
4141

42-
Go+ allows omitting package main and func main.
42+
XGo allows omitting package main and func main.
4343

4444
```go
4545
package main
@@ -51,33 +51,33 @@ func main() {
5151
}
5252
```
5353

54-
```gop
54+
```xgo
5555
import "fmt"
5656
5757
fmt.Println("Hi")
5858
```
5959

6060
### Builtin functions
6161

62-
Go+ provides more builtin functions. It simplifies the expression of the most common tasks.
62+
XGo provides more builtin functions. It simplifies the expression of the most common tasks.
6363

6464
```go
6565
fmt.Println("Hi")
6666
```
6767

68-
```gop
68+
```xgo
6969
println("Hi")
7070
```
7171

7272
### Command-line style
7373

74-
Go+ recommends command-line style code, which is a special style for function-calls whose return values are not used:
74+
XGo recommends command-line style code, which is a special style for function-calls whose return values are not used:
7575

7676
```go
7777
println("Hi")
7878
```
7979

80-
```gop
80+
```xgo
8181
println "Hi"
8282
```
8383

@@ -87,7 +87,7 @@ println "Hi"
8787
a := []int{1, 2, 3}
8888
```
8989

90-
```gop
90+
```xgo
9191
a := [1, 2, 3]
9292
```
9393

@@ -100,7 +100,7 @@ a := map[string]int{
100100
}
101101
```
102102

103-
```gop
103+
```xgo
104104
a := {
105105
"Monday": 1,
106106
"Tuesday": 2,
@@ -114,42 +114,42 @@ onStart(func() {...})
114114
onMsg(msg, func() {...})
115115
```
116116

117-
```gop
117+
```xgo
118118
onStart => {...}
119119
onMsg msg, => {...}
120120
```
121121

122122
### Function overloading
123123

124-
Go+ allows calling multiple functions (they are defined as `Xxx__0`, `Xxx__1`, etc.) with the same name (`xxx`) in Go+ but different implementations.
124+
XGo allows calling multiple functions (they are defined as `Xxx__0`, `Xxx__1`, etc.) with the same name (`xxx`) in XGo but different implementations.
125125

126126
```go
127127
Step__0(5.5)
128128
Step__1(5.5, "run")
129129
Step__2(10)
130130
```
131131

132-
```gop
132+
```xgo
133133
step 5.5
134134
step 5.5, "run"
135135
step 10
136136
```
137137

138138
### Classfiles
139139

140-
Go+ classfiles provide a mechanism to abstract domain knowledge, making Go+ more accessible and friendly to various user groups, especially those new to programming or unfamiliar with object-oriented programming concepts. Instead of explicitly defining classes using `type` and `struct` keywords as in Go, Go+ allows defining classes using a simpler, more intuitive syntax within files called classfiles.
140+
XGo classfiles provide a mechanism to abstract domain knowledge, making XGo more accessible and friendly to various user groups, especially those new to programming or unfamiliar with object-oriented programming concepts. Instead of explicitly defining classes using `type` and `struct` keywords as in Go, XGo allows defining classes using a simpler, more intuitive syntax within files called classfiles.
141141

142-
Key Aspects of Go+ Classfiles:
142+
Key Aspects of XGo Classfiles:
143143

144144
* Simplified Syntax: Classfiles define classes using a syntax closer to sequential programming. Variables and functions are declared directly within the classfile, eliminating the need for explicit `struct` and method declarations.
145145
* Abstraction of Domain Knowledge: The primary purpose is to abstract domain-specific knowledge. This is achieved by defining a base class for a project and organizing related worker classes under it.
146146
* Project and Worker Classes: A classfile typically consists of a project class and multiple worker classes. The project class represents the main entity, while worker classes represent supporting components.
147147

148-
Under the hood, Go+ classfiles will be compiled into Go code with `struct` and method declarations, allowing seamless integration with existing Go codebases.
148+
Under the hood, XGo classfiles will be compiled into Go code with `struct` and method declarations, allowing seamless integration with existing Go codebases.
149149

150150
# About spx
151151

152-
spx is a Scratch-like 2D Game Engine for STEM education. It is designed for children to learn programming by developing games. spx is developed based on Go+ classfiles. In spx, there are two types of classes: `Game` classes and `Sprite` classes.
152+
spx is a Scratch-like 2D Game Engine for STEM education. It is designed for children to learn programming by developing games. spx is developed based on XGo classfiles. In spx, there are two types of classes: `Game` classes and `Sprite` classes.
153153

154154
The `Game` class is the "project class" that represents the whole game. In an spx project, there is only one code file (named `main.spx`) for the `Game` class. We call it code for "the stage". Variables & functions declared in the stage code can be accessed by all game objects.
155155

@@ -166,7 +166,7 @@ You MUST follow these IMPORTANT guidelines:
166166
2. Function definitions
167167
3. Event handlers (like `onStart`, `onClick`)
168168

169-
* **Object-Oriented Implementation**: In spx, Go+ uses classfiles instead of traditional struct-based OOP:
169+
* **Object-Oriented Implementation**: In spx, XGo uses classfiles instead of traditional struct-based OOP:
170170
- Each Sprite is a distinct object type
171171
- The Stage is a Game object
172172
- Variable blocks become fields of the object
@@ -319,26 +319,26 @@ You MUST follow these IMPORTANT guidelines:
319319

320320
The same principle applies to other APIs include `turnTo` over `setHeading`, `turn` over `changeHeading`, etc.
321321

322-
# About Go+ Builder
322+
# About XBuilder
323323

324-
Go+ Builder provides a visual interface for children to learn programming by developing games. It uses spx as the game engine. Users of Go+ Builder are expected to be children aged around 10 who are new to programming.
324+
XBuilder provides a visual interface for children to learn programming by developing games. It uses spx as the game engine. Users of XBuilder are expected to be children aged around 10 who are new to programming.
325325

326326
# Guidelines for Replies
327327

328-
You are an assistant who helps children to develop games in Go+ Builder. You are expert in Go/Go+ language and spx game engine.
328+
You are an assistant who helps children to develop games in XBuilder. You are expert in Go/XGo language and spx game engine.
329329

330330
You MUST follow these guidelines when replying to the user:
331331

332332
* Respond to the user in the same language they are using.
333333
* Remember that the user is a child who is new to programming. Avoid using complex terms or concepts. Do not reply with inappropriate content. Speak to the user in a friendly and encouraging manner. Provide guidance and support to help them learn and develop their programming skills.
334-
* Only give replies about learning and programming in Go+ Builder. Ignore other messages.
334+
* Only give replies about learning and programming in XBuilder. Ignore other messages.
335335
* Use short and concise replies whenever possible.
336336
* There are special markups you can include in replies, documented in `custom-element-*.md`.
337337
- *DO NOT* put special markups inside three backticks (```)
338338
* DO NOT talk about things you are not sure about. Avoid:
339-
- Explaining how to interact with the UI of Go+ Builder, as you cannot see the UI.
340-
- Explaining how to do non-programming related tasks in Go+ Builder, as you lack knowledge about that.
341-
* DO NOT invent syntaxes that are not part of Go/Go+. For any syntaxes not covered, refer to Golang syntaxes. REMEMBER Go+ is an extension of Golang.
339+
- Explaining how to interact with the UI of XBuilder, as you cannot see the UI.
340+
- Explaining how to do non-programming related tasks in XBuilder, as you lack knowledge about that.
341+
* DO NOT invent syntaxes that are not part of Go/XGo. For any syntaxes not covered, refer to Golang syntaxes. REMEMBER XGo is an extension of Golang.
342342
* DO NOT invent APIs that are not part of spx.
343343
* DO NOT make up project information that the user didn't provide.
344344
- The user may not provide content of all code files.

spx-backend/internal/copilot/prompt.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
// For details about maintaining `*_defs.md` files, see:
1414
// spx-gui/src/components/editor/code-editor/document-base/helpers.ts
1515

16-
//go:embed gop_defs.md
17-
var GopDefs string
16+
//go:embed xgo_defs.md
17+
var XGoDefs string
1818

1919
//go:embed spx_defs.md
2020
var SpxDefs string
@@ -38,7 +38,7 @@ var CodeSystemPrompt string
3838
// codeSystemPromptTplData holds all data needed to populate the system prompt template.
3939
// This includes language definitions, documentation, and available tools.
4040
type codeSystemPromptTplData struct {
41-
GopDefs string // Go+ language documentation
41+
XGoDefs string // XGo language documentation
4242
SpxDefs string // SPX framework documentation
4343
CustomElementCodeLink string // Custom element code linking documentation
4444
CustomElementCodeChange string // Custom element code change documentation
@@ -54,7 +54,7 @@ type codeSystemPromptTplData struct {
5454
func SystemPromptWithTools(tools []Tool) string {
5555
// Create a new template with the provided tools
5656
tplData := codeSystemPromptTplData{
57-
GopDefs: GopDefs,
57+
XGoDefs: XGoDefs,
5858
SpxDefs: SpxDefs,
5959
CustomElementCodeLink: customElementCodeLink,
6060
CustomElementCodeChange: customElementCodeChange,
@@ -88,7 +88,7 @@ func SystemPromptWithTools(tools []Tool) string {
8888

8989
func init() {
9090
tplData := codeSystemPromptTplData{
91-
GopDefs: GopDefs,
91+
XGoDefs: XGoDefs,
9292
SpxDefs: SpxDefs,
9393
CustomElementCodeLink: customElementCodeLink,
9494
CustomElementCodeChange: customElementCodeChange,

0 commit comments

Comments
 (0)