Skip to content

Commit ec8fa8a

Browse files
nakasyouCopilotCopilot
authored
feat: add @hikkaku/gobox (#142)
* feat(gobox): add runtime package, example, and publish flow * fix * Update packages/gobox/package.json Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(gobox): add `files` field to package.json (#143) * Initial plan * fix(gobox): add "files" field to package.json for publish Co-authored-by: nakasyou <79000684+nakasyou@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: nakasyou <79000684+nakasyou@users.noreply.github.com> * returning * fix * fix * fix * aa * fix * fix * fix * fix --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
1 parent 2aa1e0c commit ec8fa8a

57 files changed

Lines changed: 5518 additions & 387 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
bun run --cwd packages/testing test -- --coverage
5454
bun run --cwd packages/hikkaku test -- --coverage
5555
bun run --cwd packages/moonscratch test -- --coverage
56+
bun run --cwd packages/gobox test -- --coverage
5657
5758
- name: Upload coverage reports to Codecov
5859
uses: codecov/codecov-action@v5
@@ -64,4 +65,5 @@ jobs:
6465
packages/hikkaku/coverage/lcov.info
6566
packages/testing/coverage/lcov.info
6667
packages/moonscratch/coverage/lcov.info
68+
packages/gobox/coverage/lcov.info
6769
fail_ci_if_error: false

.github/workflows/publish.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
- vite-plugin-turbowarp-packager
1414
- moonscratch
1515
- testing
16+
- gobox
1617
release_type:
1718
description: 'Version bump type'
1819
required: true
@@ -90,7 +91,7 @@ jobs:
9091
package="$PACKAGE_NAME"
9192
release_type="$INPUT_RELEASE_TYPE"
9293
93-
if ! [[ "$package" =~ ^(hikkaku|create-hikkaku|vite-plugin-turbowarp-packager|moonscratch|testing)$ ]]; then
94+
if ! [[ "$package" =~ ^(hikkaku|create-hikkaku|vite-plugin-turbowarp-packager|moonscratch|testing|gobox)$ ]]; then
9495
echo "Unsupported package: $package"
9596
exit 1
9697
fi
@@ -114,6 +115,12 @@ jobs:
114115
exit 1
115116
fi
116117
118+
has_repository="$(node -e "const fs=require('fs');const pkg=JSON.parse(fs.readFileSync(process.argv[1],'utf8'));const repo=pkg.repository;const ok=(typeof repo==='string'&&repo.trim()!=='')||(repo&&typeof repo==='object'&&typeof repo.url==='string'&&repo.url.trim()!=='');process.stdout.write(ok?'yes':'no')" "$package_json_path")"
119+
if [ "$has_repository" != "yes" ]; then
120+
echo "package.json must contain a non-empty repository field: $package_json_path"
121+
exit 1
122+
fi
123+
117124
if ! current_version="$(npm view "$package_name" version 2>/dev/null | tr -d '\r\n')"; then
118125
current_version="$(node -e "const fs=require('fs');const pkg=JSON.parse(fs.readFileSync(process.argv[1],'utf8'));process.stdout.write(typeof pkg.version==='string'?pkg.version.trim():'')" "$package_json_path")"
119126
if [ -z "$current_version" ]; then
@@ -199,6 +206,10 @@ jobs:
199206
if: steps.metadata.outputs.package == 'testing'
200207
run: bun run --cwd packages/testing build
201208

209+
- name: Build gobox
210+
if: steps.metadata.outputs.package == 'gobox'
211+
run: bun run --cwd packages/gobox build
212+
202213
- name: Build gpts zip
203214
if: steps.metadata.outputs.package == 'hikkaku'
204215
run: bun run --filter gpts-zip build
@@ -223,6 +234,9 @@ jobs:
223234
testing)
224235
dir='packages/testing'
225236
;;
237+
gobox)
238+
dir='packages/gobox'
239+
;;
226240
*)
227241
echo "Unsupported package: ${{ steps.metadata.outputs.package }}"
228242
exit 1

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Project Structure & Module Organization
44
- `packages/hikkaku/` is the main library package. Source lives in `packages/hikkaku/src/` (e.g., `blocks/`, `core/`, `client/`, `vite/`, `utils/`).
5+
- `packages/gobox/` provides high-level typed value/signal/function abstractions on top of `hikkaku`.
56
- `packages/skill/` contains skill docs and guides (`guides/`, `practices/`).
67
- `packages/testing/` provides Vitest-oriented Hikkaku + MoonScratch test helpers.
78
- `examples/example1/` is the dev playground app for running the library with Vite.

bun.lock

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/public/showcase/manifest.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@
3131
},
3232
"status": "ok"
3333
},
34+
{
35+
"id": "gobox-counter",
36+
"title": "Gobox Counter",
37+
"path": "/showcase/gobox-counter.html",
38+
"sourceUrl": "https://github.com/pnsk-lab/hikkaku/tree/main/examples/gobox-counter",
39+
"status": "error",
40+
"error": "ENOENT: no such file or directory, open '/home/nakasyou/hikkaku/hikkaku1/examples/gobox-counter/dist/project.sb3'"
41+
},
3442
{
3543
"id": "json-parser",
3644
"title": "Json Parser",
@@ -83,8 +91,7 @@
8391
"title": "Simple",
8492
"path": "/showcase/simple.html",
8593
"sourceUrl": "https://github.com/pnsk-lab/hikkaku/tree/main/examples/simple",
86-
"status": "error",
87-
"error": "ENOENT: no such file or directory, open '/root/jet9/hikkaku/examples/simple/dist/project.sb3'"
94+
"status": "ok"
8895
},
8996
{
9097
"id": "tesseract",

docs/reference/blocks/control.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Input: `times`, `handler`.
1616

1717
Output: Scratch statement block definition that is appended to the current script stack.
1818

19-
* `times: PrimitiveSource<number>` - number of iterations
19+
* `times: PrimitiveSource<HikkakuNumber>` - number of iterations
2020
* `handler: () => void` - body of the loop
2121

2222
Example:
@@ -34,7 +34,7 @@ Input: `condition`, `handler`.
3434

3535
Output: Scratch statement block definition that is appended to the current script stack.
3636

37-
* `condition: PrimitiveSource<boolean>`
37+
* `condition: PrimitiveSource<HikkakuBool>`
3838
* `handler: () => void`
3939

4040
Example:
@@ -52,7 +52,7 @@ Input: `condition`, `handler`.
5252

5353
Output: Scratch statement block definition that is appended to the current script stack.
5454

55-
* `condition: PrimitiveSource<boolean>`
55+
* `condition: PrimitiveSource<HikkakuBool>`
5656
* `handler: () => void`
5757

5858
Example:
@@ -71,7 +71,7 @@ Input: `variable`, `value`, `handler`.
7171
Output: Scratch statement block definition that is appended to the current script stack.
7272

7373
* `variable: VariableReference`
74-
* `value: PrimitiveSource<number>` - upper bound
74+
* `value: PrimitiveSource<HikkakuNumber>` - upper bound
7575
* `handler: () => void`
7676

7777
Example:
@@ -106,7 +106,7 @@ Input: `seconds`.
106106

107107
Output: Scratch statement block definition that is appended to the current script stack.
108108

109-
* `seconds: PrimitiveSource<number>`
109+
* `seconds: PrimitiveSource<HikkakuNumber>`
110110

111111
Example:
112112
```ts
@@ -123,7 +123,7 @@ Input: `condition`.
123123

124124
Output: Scratch statement block definition that is appended to the current script stack.
125125

126-
* `condition: PrimitiveSource<boolean>`
126+
* `condition: PrimitiveSource<HikkakuBool>`
127127

128128
Example:
129129
```ts
@@ -140,7 +140,7 @@ Input: `condition`, `handler`.
140140

141141
Output: Scratch statement block definition that is appended to the current script stack.
142142

143-
* `condition: PrimitiveSource<boolean>`
143+
* `condition: PrimitiveSource<HikkakuBool>`
144144
* `handler: () => void`
145145

146146
Example:
@@ -158,7 +158,7 @@ Input: `condition`, `thenHandler`, `elseHandler`.
158158

159159
Output: Scratch statement block definition that is appended to the current script stack.
160160

161-
* `condition: PrimitiveSource<boolean>`
161+
* `condition: PrimitiveSource<HikkakuBool>`
162162
* `thenHandler: () => void`
163163
* `elseHandler: () => void`
164164

@@ -226,7 +226,7 @@ Input: `target`.
226226

227227
Output: Scratch statement block definition that is appended to the current script stack.
228228

229-
* `target: PrimitiveSource<string>` - string
229+
* `target: PrimitiveSource<HikkakuString>` - string
230230

231231
Example:
232232
```ts

docs/reference/blocks/data.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Input: `variable`, `value`.
3434
Output: Scratch statement block definition that is appended to the current script stack.
3535

3636
* `variable: VariableReference`
37-
* `value: PrimitiveSource<number | string>`
37+
* `value: PrimitiveSource<HikkakuNumber | HikkakuString>`
3838

3939
Example:
4040
```ts
@@ -52,7 +52,7 @@ Input: `variable`, `value`.
5252
Output: Scratch statement block definition that is appended to the current script stack.
5353

5454
* `variable: VariableReference`
55-
* `value: PrimitiveSource<number>`
55+
* `value: PrimitiveSource<HikkakuNumber>`
5656

5757
Example:
5858
```ts
@@ -121,7 +121,7 @@ Input: `list`, `item`.
121121
Output: Scratch statement block definition that is appended to the current script stack.
122122

123123
* `list: ListReference`
124-
* `item: PrimitiveSource<string | number>`
124+
* `item: PrimitiveSource<HikkakuString | HikkakuNumber>`
125125

126126
Example:
127127
```ts
@@ -139,7 +139,7 @@ Input: `list`, `index`.
139139
Output: Scratch statement block definition that is appended to the current script stack.
140140

141141
* `list: Input value used by this block`
142-
* `index: ListIndex` - PrimitiveSource<number | string>
142+
* `index: ListIndex` - PrimitiveSource<HikkakuNumber | HikkakuString>
143143

144144
Example:
145145
```ts

docs/reference/blocks/procedures.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ isProcedureArgument: true,
117117
name: 'value',
118118
type: 'stringOrNumber',
119119
id: 'var-id',
120-
getter: () => valueBlock('argument_reporter_string_number', { fields: { VALUE: ['value', null] } }),
120+
getter: () => valueBlock<HikkakuString | HikkakuNumber>('argument_reporter_string_number', { fields: { VALUE: ['value', null] } }),
121121
})
122122
```
123123

@@ -138,6 +138,6 @@ isProcedureArgument: true,
138138
name: 'flag',
139139
type: 'boolean',
140140
id: 'flag-id',
141-
getter: () => valueBlock('argument_reporter_boolean', { fields: { VALUE: ['flag', null] } }),
141+
getter: () => valueBlock<HikkakuBool>('argument_reporter_boolean', { fields: { VALUE: ['flag', null] } }),
142142
})
143143
```

0 commit comments

Comments
 (0)