@kubohiroya/turbowarp-react-islands 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +16 -3
- package/README.md +16 -3
- package/dist/turbowarp-react-islands.js +6 -6
- package/docs/index.html +1 -1
- package/package.json +18 -11
package/README.ja.md
CHANGED
|
@@ -2,10 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
<img src="assets/block-icon.svg" alt="" width="48" height="48">
|
|
4
4
|
|
|
5
|
-
[English](README.md)
|
|
5
|
+
[English](README.md) | 日本語
|
|
6
6
|
|
|
7
7
|
`turbowarp-http-server` と `turbowarp-html` で作るHTMLレスポンスの一部に、Reactコンポーネントを island として埋め込むためのTurboWarp拡張とTypeScriptヘルパーです。
|
|
8
8
|
|
|
9
|
+
## 実行できるサンプル
|
|
10
|
+
|
|
11
|
+
[**TurboWarp Editorでデモを開く**](https://turbowarp.org/editor?project_url=https%3A%2F%2Fkubohiroya.github.io%2Fturbowarp-react-islands%2Fsamples%2Fdescribe-counter-island.sb3) · [SB3をダウンロード](https://kubohiroya.github.io/turbowarp-react-islands/samples/describe-counter-island.sb3)
|
|
12
|
+
|
|
13
|
+
**Allow**で許可し、緑の旗を押します。
|
|
14
|
+
3つの確認結果がtrueになります。変数一覧には実際のJSON descriptor・HTML・registry全文も保持します。宣言生成のみのデモでReactの描画やhydrationは行いません。Counterのmoduleパスは登録する文字列であり、このデモでは取得しません。React本体・HTTPホスト・外部bundleは不要です。
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
元データと期待結果: [`samples/README.md`](samples/README.md).
|
|
19
|
+
`pnpm run samples:build` / `pnpm run samples:check` / `pnpm run pages:build`
|
|
20
|
+
|
|
9
21
|
## 位置づけ
|
|
10
22
|
|
|
11
23
|
このパッケージでは、Reactをアプリ全体の記述言語ではなく「リッチなGUI部品」として扱います。想定する役割分担は次の通りです。
|
|
@@ -21,7 +33,7 @@ MVPでは、TurboWarp内でReactを実行しきることはしません。まず
|
|
|
21
33
|
## インストール
|
|
22
34
|
|
|
23
35
|
```bash
|
|
24
|
-
pnpm add --save-exact @kubohiroya/turbowarp-react-islands@0.
|
|
36
|
+
pnpm add --save-exact @kubohiroya/turbowarp-react-islands@0.6.0
|
|
25
37
|
```
|
|
26
38
|
|
|
27
39
|
## できること
|
|
@@ -34,7 +46,7 @@ pnpm add --save-exact @kubohiroya/turbowarp-react-islands@0.4.0
|
|
|
34
46
|
|
|
35
47
|
## 要件と注意
|
|
36
48
|
|
|
37
|
-
- Node.js
|
|
49
|
+
- Node.js 24以上
|
|
38
50
|
- Corepack経由のpnpm
|
|
39
51
|
- TurboWarp
|
|
40
52
|
- HTTP/HTML合成に使う `turbowarp-http-server` と `turbowarp-html`
|
|
@@ -45,6 +57,7 @@ propsはJSONに限定します。関数、class instance、DOM node、hooksの
|
|
|
45
57
|
## 開発
|
|
46
58
|
|
|
47
59
|
```bash
|
|
60
|
+
npm install --global corepack@latest
|
|
48
61
|
corepack enable
|
|
49
62
|
pnpm install --frozen-lockfile
|
|
50
63
|
pnpm run check
|
package/README.md
CHANGED
|
@@ -2,11 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
<img src="assets/block-icon.svg" alt="" width="48" height="48">
|
|
4
4
|
|
|
5
|
-
[日本語](README.ja.md)
|
|
5
|
+
English | [日本語](README.ja.md)
|
|
6
6
|
|
|
7
7
|
TurboWarp extension and TypeScript helpers for describing React islands inside
|
|
8
8
|
HTML responses produced by `turbowarp-http-server` and `turbowarp-html`.
|
|
9
9
|
|
|
10
|
+
## Runnable sample
|
|
11
|
+
|
|
12
|
+
[**Open the demo in TurboWarp Editor**](https://turbowarp.org/editor?project_url=https%3A%2F%2Fkubohiroya.github.io%2Fturbowarp-react-islands%2Fsamples%2Fdescribe-counter-island.sb3) · [Download the SB3](https://kubohiroya.github.io/turbowarp-react-islands/samples/describe-counter-island.sb3)
|
|
13
|
+
|
|
14
|
+
Choose **Allow** and click the green flag.
|
|
15
|
+
Three checks become true; full JSON and HTML remain in variables. This demo generates declarations only; it does not render or hydrate React. The module path is a registration string and is not fetched. No React runtime, HTTP host, or external bundle is required.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
Editable sources and expected results: [`samples/README.md`](samples/README.md).
|
|
20
|
+
`pnpm run samples:build` / `pnpm run samples:check` / `pnpm run pages:build`
|
|
21
|
+
|
|
10
22
|
## Positioning
|
|
11
23
|
|
|
12
24
|
This package treats React as a rich GUI part, not as the whole programming
|
|
@@ -24,7 +36,7 @@ descriptors and HTML fragments that a later build step can consume.
|
|
|
24
36
|
## Installation
|
|
25
37
|
|
|
26
38
|
```bash
|
|
27
|
-
pnpm add --save-exact @kubohiroya/turbowarp-react-islands@0.
|
|
39
|
+
pnpm add --save-exact @kubohiroya/turbowarp-react-islands@0.6.0
|
|
28
40
|
```
|
|
29
41
|
|
|
30
42
|
## What it does
|
|
@@ -37,7 +49,7 @@ pnpm add --save-exact @kubohiroya/turbowarp-react-islands@0.4.0
|
|
|
37
49
|
|
|
38
50
|
## Requirements and safety
|
|
39
51
|
|
|
40
|
-
- Node.js
|
|
52
|
+
- Node.js 24 or newer;
|
|
41
53
|
- pnpm through Corepack;
|
|
42
54
|
- TurboWarp;
|
|
43
55
|
- `turbowarp-http-server` and `turbowarp-html` for HTTP/HTML composition;
|
|
@@ -49,6 +61,7 @@ state are intentionally outside the block contract.
|
|
|
49
61
|
## Development
|
|
50
62
|
|
|
51
63
|
```bash
|
|
64
|
+
npm install --global corepack@latest
|
|
52
65
|
corepack enable
|
|
53
66
|
pnpm install --frozen-lockfile
|
|
54
67
|
```
|
|
@@ -7263,7 +7263,7 @@ var require__2020 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
7263
7263
|
});
|
|
7264
7264
|
}));
|
|
7265
7265
|
//#endregion
|
|
7266
|
-
//#region node_modules/.pnpm/ajv-formats@2.1.
|
|
7266
|
+
//#region node_modules/.pnpm/ajv-formats@2.1.1/node_modules/ajv-formats/dist/formats.js
|
|
7267
7267
|
var require_formats = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
7268
7268
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7269
7269
|
exports.formatNames = exports.fastFormats = exports.fullFormats = void 0;
|
|
@@ -7421,7 +7421,7 @@ var require_formats = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
7421
7421
|
}
|
|
7422
7422
|
}));
|
|
7423
7423
|
//#endregion
|
|
7424
|
-
//#region node_modules/.pnpm/ajv-formats@2.1.
|
|
7424
|
+
//#region node_modules/.pnpm/ajv-formats@2.1.1/node_modules/ajv-formats/dist/limit.js
|
|
7425
7425
|
var require_limit = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
7426
7426
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7427
7427
|
exports.formatLimitDefinition = void 0;
|
|
@@ -7499,7 +7499,7 @@ var require_limit = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
7499
7499
|
exports.default = formatLimitPlugin;
|
|
7500
7500
|
}));
|
|
7501
7501
|
//#endregion
|
|
7502
|
-
//#region node_modules/.pnpm/ajv-formats@2.1.
|
|
7502
|
+
//#region node_modules/.pnpm/ajv-formats@2.1.1/node_modules/ajv-formats/dist/index.js
|
|
7503
7503
|
var require_dist = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
7504
7504
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7505
7505
|
var formats_1 = require_formats();
|
|
@@ -8805,7 +8805,7 @@ var require_fast_uri = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
8805
8805
|
module.exports.fastUri = fastUri;
|
|
8806
8806
|
}));
|
|
8807
8807
|
//#endregion
|
|
8808
|
-
//#region node_modules/.pnpm/@kubohiroya+turbowarp-extension-data-editor@0.
|
|
8808
|
+
//#region node_modules/.pnpm/@kubohiroya+turbowarp-extension-data-editor@0.5.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@kubohiroya/turbowarp-extension-data-editor/dist/schema-json.js
|
|
8809
8809
|
var JsonSnapshotError = class extends Error {
|
|
8810
8810
|
constructor(kind, dataPath) {
|
|
8811
8811
|
super("JSON snapshot failed.");
|
|
@@ -8867,7 +8867,7 @@ function isJsonRecord(value) {
|
|
|
8867
8867
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
8868
8868
|
}
|
|
8869
8869
|
//#endregion
|
|
8870
|
-
//#region node_modules/.pnpm/@kubohiroya+turbowarp-extension-data-editor@0.
|
|
8870
|
+
//#region node_modules/.pnpm/@kubohiroya+turbowarp-extension-data-editor@0.5.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@kubohiroya/turbowarp-extension-data-editor/dist/schema-engine.js
|
|
8871
8871
|
var import_ajv = require_ajv();
|
|
8872
8872
|
var import__2020 = require__2020();
|
|
8873
8873
|
var import_dist = /* @__PURE__ */ __toESM(require_dist(), 1);
|
|
@@ -9213,7 +9213,7 @@ function compileSchemaBundle(input) {
|
|
|
9213
9213
|
}
|
|
9214
9214
|
}
|
|
9215
9215
|
//#endregion
|
|
9216
|
-
//#region node_modules/.pnpm/@kubohiroya+turbowarp-extension-data-editor@0.
|
|
9216
|
+
//#region node_modules/.pnpm/@kubohiroya+turbowarp-extension-data-editor@0.5.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@kubohiroya/turbowarp-extension-data-editor/dist/schema-compose.js
|
|
9217
9217
|
function deepFreeze(value) {
|
|
9218
9218
|
if (value !== null && typeof value === "object") {
|
|
9219
9219
|
Object.values(value).forEach(deepFreeze);
|
package/docs/index.html
CHANGED
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
page in a shadow root, so it cannot disturb the styles below. -->
|
|
62
62
|
<script type="module"
|
|
63
63
|
src="https://kubohiroya.github.io/turbowarp-plus-site-header/dist/auto.js"></script>
|
|
64
|
-
</body>
|
|
64
|
+
<section id="runnable-sample"><h2>Runnable sample / 実行できるサンプル</h2><p><a href="https://turbowarp.org/editor?project_url=https%3A%2F%2Fkubohiroya.github.io%2Fturbowarp-react-islands%2Fsamples%2Fdescribe-counter-island.sb3">Open in TurboWarp Editor</a> · <a href="https://kubohiroya.github.io/turbowarp-react-islands/samples/describe-counter-island.sb3">Download SB3</a></p><p>Three checks become true; full JSON and HTML remain in variables.</p></section></body>
|
|
65
65
|
</html>
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubohiroya/turbowarp-react-islands",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "TurboWarp extension and helpers for describing React islands in turbowarp-http-server HTML responses.",
|
|
5
|
-
"author":
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Hiroya Kubo",
|
|
7
|
+
"email": "hiroya@cuc.ac.jp",
|
|
8
|
+
"url": "https://github.com/kubohiroya"
|
|
9
|
+
},
|
|
6
10
|
"license": "MPL-2.0",
|
|
7
11
|
"homepage": "https://github.com/kubohiroya/turbowarp-react-islands#readme",
|
|
8
12
|
"repository": {
|
|
@@ -44,9 +48,9 @@
|
|
|
44
48
|
"access": "public",
|
|
45
49
|
"registry": "https://registry.npmjs.org/"
|
|
46
50
|
},
|
|
47
|
-
"packageManager": "pnpm@11.
|
|
51
|
+
"packageManager": "pnpm@11.28.8",
|
|
48
52
|
"engines": {
|
|
49
|
-
"node": ">=
|
|
53
|
+
"node": ">=24"
|
|
50
54
|
},
|
|
51
55
|
"scripts": {
|
|
52
56
|
"dev": "vite build --watch",
|
|
@@ -58,13 +62,16 @@
|
|
|
58
62
|
"docs:check": "pnpm run docs && git diff --exit-code -- README.md",
|
|
59
63
|
"repo:check": "node scripts/check-repo.ts",
|
|
60
64
|
"pack:check": "npm pack --dry-run --ignore-scripts",
|
|
61
|
-
"check": "pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run docs:check && pnpm run check:dist && pnpm run repo:check && pnpm run pack:check",
|
|
62
|
-
"check:dist": "pnpm run build && node scripts/check-dist.ts"
|
|
65
|
+
"check": "pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run docs:check && pnpm run check:dist && pnpm run repo:check && pnpm run pack:check && pnpm run samples:check",
|
|
66
|
+
"check:dist": "pnpm run build && node scripts/check-dist.ts",
|
|
67
|
+
"samples:build": "node scripts/build-samples.mjs",
|
|
68
|
+
"samples:check": "node scripts/build-samples.mjs --check && node --test scripts/verify-samples.mjs",
|
|
69
|
+
"pages:build": "node scripts/prepare-pages.mjs"
|
|
63
70
|
},
|
|
64
71
|
"devDependencies": {
|
|
65
72
|
"@eslint/js": "^9.39.5",
|
|
66
|
-
"@kubohiroya/turbowarp-extension-manifest": "^0.
|
|
67
|
-
"@kubohiroya/vite-plugin-turbowarp-extension": "^0.
|
|
73
|
+
"@kubohiroya/turbowarp-extension-manifest": "^0.5.0",
|
|
74
|
+
"@kubohiroya/vite-plugin-turbowarp-extension": "^0.10.0",
|
|
68
75
|
"@types/node": "^24.13.3",
|
|
69
76
|
"eslint": "^9.39.5",
|
|
70
77
|
"typescript": "^5.9.3",
|
|
@@ -74,11 +81,11 @@
|
|
|
74
81
|
"react-dom": "18.3.1"
|
|
75
82
|
},
|
|
76
83
|
"dependencies": {
|
|
77
|
-
"@kubohiroya/turbowarp-extension-data-editor": "^0.
|
|
84
|
+
"@kubohiroya/turbowarp-extension-data-editor": "^0.5.0"
|
|
78
85
|
},
|
|
79
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "78570baedc751aa5d6e1494eb13abb61eed8bc99",
|
|
80
87
|
"x-turbowarp-source": {
|
|
81
|
-
"revision": "
|
|
88
|
+
"revision": "78570baedc751aa5d6e1494eb13abb61eed8bc99",
|
|
82
89
|
"revisionRole": "base-commit",
|
|
83
90
|
"sourceState": "local-release-overlay"
|
|
84
91
|
}
|