Skip to content

Commit b1b0b1c

Browse files
committed
Switch to subtree
1 parent f4a1eee commit b1b0b1c

8 files changed

Lines changed: 21 additions & 392 deletions

File tree

.gitattributes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
v2/examples/**/* linguist-documentation
2-
setup.sh linguist-vendored
3-
setup.ps1 linguist-vendored
2+
v2/webui/**/* linguist-vendored

.github/workflows/ci.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424
with:
25-
submodules: true
2625
path: go-webui
2726
- uses: maxim-lobanov/setup-xcode@v1
2827
if: runner.os == 'macOS'
@@ -37,11 +36,10 @@ jobs:
3736
mkdir $TEST_PROJECT && cd $TEST_PROJECT
3837
go mod init $TEST_PROJECT && ls -lh
3938
cp ../go-webui/examples/call_go_from_js.go ./main.go
40-
- name: Setup WebUI library
41-
run: |
42-
cd $TEST_PROJECT
43-
sh ../go-webui/setup.sh
44-
sh ../go-webui/setup.sh # TODO: investigate why a second execution is required here.
39+
# The WebUI C library ships inside the go-webui module (v2/webui subtree),
40+
# so consuming the checkout is all the setup that is needed.
41+
go mod edit -replace=github.com/webui-dev/go-webui/v2=../go-webui/v2
42+
go mod tidy
4543
- name: Build
4644
run: |
4745
cd $TEST_PROJECT
@@ -57,8 +55,6 @@ jobs:
5755
TEST_PROJECT: 'go-webui-project'
5856
steps:
5957
- uses: actions/checkout@v4
60-
with:
61-
submodules: true
6258
- uses: maxim-lobanov/setup-xcode@v1
6359
if: runner.os == 'macOS'
6460
with:

README.md

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -48,32 +48,15 @@
4848
> [!NOTE]
4949
> Until the next stable release it is recommended to use go-webui's latest development version.
5050
51-
- ### As Go module
52-
53-
> [!NOTE]
54-
> Always verify what will be run before using either of these methods.
55-
56-
Run this command to get the latest `go-webui` module version, and to sync the WebUI C library that it is using.
57-
58-
```sh
59-
go run github.com/webui-dev/go-webui/v2/sync-webui@main
60-
```
61-
62-
Alternatively, use the `setup.sh` or `setup.bat` script to do the same thing.
63-
64-
- Windows
51+
The WebUI C library is vendored into this repository at [`v2/webui/`](https://github.com/webui-dev/go-webui/tree/main/v2/webui) as a git subtree, so it ships with the Go module. There is no extra setup step and no submodule to initialize — a plain `go get` is enough.
6552

66-
```sh
67-
sh -c "$(curl -fsSL https://raw.githubusercontent.com/webui-dev/go-webui/main/setup.bat)"
68-
```
69-
70-
- Linux / macOS
53+
- ### As Go module
7154

7255
```sh
73-
sh -c "$(curl -fsSL https://raw.githubusercontent.com/webui-dev/go-webui/main/setup.sh)"
56+
go get github.com/webui-dev/go-webui/v2@main
7457
```
7558

76-
- ### As submodule
59+
- ### As git submodule of your project
7760

7861
The instructions below set up go-webui in a `modules` subdirectory of a go project.
7962

@@ -92,24 +75,31 @@
9275
```
9376

9477
```sh
95-
git submodule update --init --filter=blob:none --recursive
78+
git submodule update --init --filter=blob:none
9679
```
9780

98-
`replace` the path accordingly in the `g.mod` file.
81+
`replace` the path accordingly in the `go.mod` file.
9982

10083
```
10184
require github.com/webui-dev/go-webui/v2 v2.5.1
10285
103-
replace github.com/webui-dev/go-webui/v2 v2.5.1 => ./modules/go-webui
86+
replace github.com/webui-dev/go-webui/v2 v2.5.1 => ./modules/go-webui/v2
10487
```
10588

10689
- ### As git clone - for development and contribution purposes
10790

10891
The command below retrieves go-webui as a lightweight, filtered clone.
10992

11093
```sh
111-
git clone --recursive --shallow-submodules --filter=blob:none --also-filter-submodules \
112-
https://github.com/webui-dev/go-webui.git
94+
git clone --filter=blob:none https://github.com/webui-dev/go-webui.git
95+
```
96+
97+
- ### Updating the vendored WebUI C library
98+
99+
Maintainers pull the latest WebUI nightly into the subtree with:
100+
101+
```sh
102+
git subtree pull --prefix=v2/webui https://github.com/webui-dev/webui.git nightly --squash -m "Update WebUI to nightly"
113103
```
114104

115105
## Usage

setup.bat

Lines changed: 0 additions & 77 deletions
This file was deleted.

setup.sh

Lines changed: 0 additions & 50 deletions
This file was deleted.

v2/sync-webui/gotools.go

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)