Skip to content

Commit e36efa5

Browse files
authored
Remove the old runtime from integrations, passing entirely into WfP (GitbookIO#67)
1 parent 31a2314 commit e36efa5

Some content is hidden

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

49 files changed

+317
-2936
lines changed

.changeset/config.json

+10-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
{
2-
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3-
"changelog": "@changesets/cli/changelog",
4-
"commit": false,
5-
"fixed": [
6-
["@gitbook/runtime-v8-isolated", "@gitbook/runtime-v8-stdlib"]
7-
],
8-
"linked": [],
9-
"access": "public",
10-
"baseBranch": "main",
11-
"updateInternalDependencies": "patch",
12-
"ignore": []
13-
}
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.changeset/empty-books-think.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@gitbook/runtime': minor
3+
---
4+
5+
Remove old, unused runtime

integrations/contentkit/src/index.tsx

+20-17
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1-
import { createIntegration, createComponent } from "@gitbook/runtime";
1+
import { createIntegration, createComponent } from '@gitbook/runtime';
22

3-
const previewBlock = createComponent<{
4-
content: string;
5-
}, {
6-
action: object
7-
}, object>({
3+
const previewBlock = createComponent<
4+
{
5+
content: string;
6+
},
7+
{
8+
action: object;
9+
},
10+
object
11+
>({
812
componentId: 'preview',
913
initialState: {},
1014
async action(element, action) {
1115
return {
1216
...element,
1317
state: {
1418
action: JSON.stringify(action),
15-
}
16-
}
19+
},
20+
};
1721
},
1822
async render({ props, state }) {
1923
const { content } = props;
@@ -26,7 +30,7 @@ const previewBlock = createComponent<{
2630
<text>No content</text>
2731
</box>
2832
</block>
29-
)
33+
);
3034
}
3135

3236
const parsed = JSON.parse(content);
@@ -40,16 +44,16 @@ const previewBlock = createComponent<{
4044
</box>
4145
<divider />
4246
<spacer />
43-
<box>
44-
{parsed}
45-
</box>
47+
<box>{parsed}</box>
4648
<spacer />
4749
</hstack>
4850
{action ? (
4951
<>
5052
<divider />
5153
<box>
52-
<box><text>action dispatched:</text></box>
54+
<box>
55+
<text>action dispatched:</text>
56+
</box>
5357
<codeblock content={action} syntax="javascript" />
5458
</box>
5559
</>
@@ -58,10 +62,9 @@ const previewBlock = createComponent<{
5862
</box>
5963
</block>
6064
);
61-
}
62-
})
63-
65+
},
66+
});
6467

6568
export default createIntegration({
66-
components: [previewBlock]
69+
components: [previewBlock],
6770
});

integrations/segment/package.json

+19-17
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
{
2-
"name": "@gitbook/integration-segment",
3-
"version": "0.0.0",
4-
"private": true,
5-
"dependencies": {
6-
"@gitbook/api": "*",
7-
"@gitbook/runtime": "*"
8-
},
9-
"devDependencies": {
10-
"@gitbook/cli": "*"
11-
},
12-
"scripts": {
13-
"lint": "eslint ./src/**/*.ts",
14-
"publish-integrations": "gitbook publish .",
15-
"publish-integrations-staging": "gitbook publish .",
16-
"test": "node -r esbuild-register ./tests/index.ts"
17-
}
18-
}
2+
"name": "@gitbook/integration-segment",
3+
"version": "0.0.0",
4+
"private": true,
5+
"dependencies": {
6+
"@gitbook/api": "*",
7+
"@gitbook/runtime": "*"
8+
},
9+
"devDependencies": {
10+
"@gitbook/cli": "*",
11+
"test": "^3.2.1",
12+
"assert": "^2.0.0"
13+
},
14+
"scripts": {
15+
"lint": "eslint ./src/**/*.ts",
16+
"publish-integrations": "gitbook publish .",
17+
"publish-integrations-staging": "gitbook publish .",
18+
"test": "node -r esbuild-register ./tests/index.ts"
19+
}
20+
}

integrations/segment/tests/events.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as assert from 'assert';
2-
import test from 'node:test';
2+
import test from 'test';
33

44
import * as api from '@gitbook/api';
55

0 commit comments

Comments
 (0)