diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml
index f33b5d5ed..15b028d9a 100644
--- a/.github/workflows/validate.yml
+++ b/.github/workflows/validate.yml
@@ -32,6 +32,10 @@ jobs:
working-directory: spx-gui
run: npm install
+ - name: Install spx
+ working-directory: spx-gui
+ run: ./install-spx.sh
+
- name: Run Vue TSC
working-directory: spx-gui
run: npm run type-check
@@ -40,23 +44,14 @@ jobs:
working-directory: spx-gui
run: npm run lint
- - name: Setup Go 1.21.3
- uses: actions/setup-go@v4
- with:
- go-version: 1.21.3
-
- - name: Build WASM
- working-directory: spx-gui
- run: npm run build-wasm
-
- - name: Setup Go 1.23.4
+ - name: Setup Go
uses: actions/setup-go@v4
with:
go-version: 1.23.4
- - name: Build WASM for spxls
+ - name: Build WASM
working-directory: spx-gui
- run: npm run build-spxls
+ run: ./build-wasm.sh
- name: Run Vitest
working-directory: spx-gui
diff --git a/Dockerfile b/Dockerfile
index 5aa9defb4..c121e8ceb 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -16,12 +16,6 @@ COPY spx-backend ./spx-backend
ARG GOPROXY
-# Build WASM
-WORKDIR /app/tools/fmt
-RUN ./build.sh
-WORKDIR /app/tools/ispx
-RUN ./build.sh
-
# Build backend
WORKDIR /app/spx-backend
RUN gop build -trimpath -o spx-backend ./cmd/spx-backend
@@ -30,15 +24,17 @@ RUN gop build -trimpath -o spx-backend ./cmd/spx-backend
FROM ${GO_BASE_IMAGE} AS go-builder
-WORKDIR /app
+ARG GOPROXY
+# Pre-install Go toolchain for 1.21.3, which will be used by tools/fmt & tools/ispx
+RUN GOTOOLCHAIN=go1.21.3 go version
+WORKDIR /app
COPY tools ./tools
+COPY spx-gui ./spx-gui
-ARG GOPROXY
-
-# Build WASM for spxls
-WORKDIR /app/tools/spxls
-RUN ./build.sh
+# Build WASM
+WORKDIR /app/spx-gui
+RUN ./build-wasm.sh
################################################################################
@@ -46,18 +42,19 @@ FROM ${NODE_BASE_IMAGE} AS frontend-builder
WORKDIR /app/spx-gui
-COPY spx-gui/package.json spx-gui/package-lock.json ./
-
+COPY spx-gui/package.json spx-gui/package-lock.json .
ARG NPM_CONFIG_REGISTRY
-
RUN npm install
+COPY spx-gui/public ./public
+COPY spx-gui/install-spx.sh .
+RUN ./install-spx.sh
+
COPY spx-gui .
COPY docs ../docs
COPY tools ../tools
-COPY --from=gop-builder /app/tools/fmt/static/main.wasm /app/spx-gui/src/assets/format.wasm
-COPY --from=gop-builder /app/tools/ispx/main.wasm /app/spx-gui/src/assets/ispx/main.wasm
-COPY --from=go-builder /app/tools/spxls/spxls.wasm /app/spx-gui/src/assets/spxls.wasm
+# Copy assets (with wasm)
+COPY --from=go-builder /app/spx-gui/src/assets /app/spx-gui/src/assets
ARG NODE_ENV
diff --git a/docs/develop/index.md b/docs/develop/index.md
index a6de9e6da..58ed29d65 100644
--- a/docs/develop/index.md
+++ b/docs/develop/index.md
@@ -8,6 +8,11 @@
- **`/tools`**: Other independent tools that Go+ Builder depends on.
- **`/scripts`**: Scripts for building, deploying, or other automation tasks.
-### Architecture design
+### Environment Requirements
+
+- **Node.js**: >= 20.11.1
+- **Go**: >= 1.23.4
+
+### Architecture Design
TODO.
diff --git a/spx-backend/README.md b/spx-backend/README.md
index 61bc9589c..6bf0e5e08 100644
--- a/spx-backend/README.md
+++ b/spx-backend/README.md
@@ -17,5 +17,5 @@ Run
```sh
cp .env.dev .env
-gop run ./cmd/spx-backend
+GOTOOLCHAIN=go1.21.3 gop run ./cmd/spx-backend
```
diff --git a/spx-gui/.env b/spx-gui/.env
index 92b4ff402..16a5f8f84 100644
--- a/spx-gui/.env
+++ b/spx-gui/.env
@@ -26,3 +26,6 @@ VITE_CASDOOR_ORGANIZATION_NAME=""
#
# Optional as they have default values.
VITE_DISABLE_AIGC="false"
+
+# Version of spx, keep in sync with the version in `spx-install.sh`.
+VITE_SPX_VERSION=2.0.1
diff --git a/spx-gui/README.md b/spx-gui/README.md
index fd1001874..d4479b35d 100644
--- a/spx-gui/README.md
+++ b/spx-gui/README.md
@@ -1,23 +1,24 @@
# spx-gui
+## Environment Requirements
+
+- **Node.js**: >= 20.11.1
+- **Go**: >= 1.23.4
+
## Install Dependencies
```bash
npm install
+./install-spx.sh
```
## Run the Project in Development Mode
```bash
+./build-wasm.sh
npm run dev
```
-> [!NOTE]
-> To help you quickly get started with development, we have symbolically linked `.env.development` to `.env.staging`.
-> Feel free to override any environment settings by creating a `.env.development.local` file. For example, if you need
-> to use your local `spx-backend` server, simply append something like `VITE_API_BASE_URL="http://localhost:8080"` to
-> the file, adjusting the URL as needed.
-
## Development Standards
### Code Styles
@@ -52,164 +53,3 @@ npm run dev
3. Use the Composition API for coding
4. defineProps should use type declaration
5. Child components that are tightly coupled with the parent component should be prefixed with the parent component's name, e.g., SpriteList, SpriteListItem, SpriteListItemButton
-
-#### Examples
-
-Here is a complete example of a component named SpriteList:
-
-```vue
-
-
>>=y=v>>>24,p-=y,!(16&(y=v>>>16&255))){if(0==(64&y)){v=_[(65535&v)+(d&(1<