@mochabug/adaptkit 1.0.0-beta.12 → 1.0.0-beta.2
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/assets/build-client.js +22 -83
- package/assets/build.js +10 -17
- package/assets/configurator_react.tsx +21 -2
- package/assets/executor_browser_react.tsx +21 -2
- package/assets/global.d.ts +0 -2
- package/assets/inject.js +7 -0
- package/assets/react_client.tsx +5 -0
- package/bin/index.js +8 -9
- package/bin/index.js.map +4 -4
- package/package.json +11 -8
- package/assets/configurator.main.tsx +0 -19
- package/assets/configurator.ssg.tsx +0 -31
- package/assets/executor.main.tsx +0 -19
- package/assets/executor.ssg.tsx +0 -31
- /package/assets/{configurator.App.tsx → react_app_config.tsx} +0 -0
- /package/assets/{executor.App.tsx → react_app_exec.tsx} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mochabug/adaptkit",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
4
|
"description": "A cmd to create, emulate and publish Mochabug Adapt plugins",
|
|
5
5
|
"main": "bin/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"author": "Mikael Hedberg",
|
|
37
37
|
"license": "Apache-2.0",
|
|
38
38
|
"devDependencies": {
|
|
39
|
+
"@mochabug/adapt-plugin-toolkit": "^0.17.2",
|
|
39
40
|
"@rollup/plugin-commonjs": "^28.0.2",
|
|
40
41
|
"@rollup/plugin-json": "^6.1.0",
|
|
41
42
|
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
@@ -45,28 +46,30 @@
|
|
|
45
46
|
"@types/archiver": "^6.0.3",
|
|
46
47
|
"@types/express": "^5.0.0",
|
|
47
48
|
"@types/figlet": "^1.7.0",
|
|
48
|
-
"@types/node": "^22.
|
|
49
|
+
"@types/node": "^22.10.10",
|
|
49
50
|
"@types/semver": "^7.5.8",
|
|
50
51
|
"@types/update-notifier": "^6.0.8",
|
|
51
|
-
"esbuild": "^0.
|
|
52
|
+
"esbuild": "^0.24.2",
|
|
52
53
|
"typescript": "^5.7.3"
|
|
53
54
|
},
|
|
54
55
|
"dependencies": {
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
56
|
+
"@grpc/grpc-js": "^1.12.5",
|
|
57
|
+
"@inquirer/prompts": "^7.2.3",
|
|
58
|
+
"@protobuf-ts/grpc-transport": "^2.9.4",
|
|
59
|
+
"@protobuf-ts/runtime": "^2.9.4",
|
|
60
|
+
"@protobuf-ts/runtime-rpc": "^2.9.4",
|
|
59
61
|
"archiver": "^7.0.1",
|
|
60
62
|
"chalk": "^5.4.1",
|
|
61
63
|
"commander": "^13.1.0",
|
|
62
64
|
"express": "^4.21.2",
|
|
63
65
|
"fast-glob": "^3.3.3",
|
|
64
66
|
"figlet": "^1.8.0",
|
|
67
|
+
"is-valid-hostname": "^1.0.2",
|
|
65
68
|
"mkdirp": "^3.0.1",
|
|
66
69
|
"node-fetch": "^3.3.2",
|
|
67
70
|
"open": "^10.1.0",
|
|
68
71
|
"pkce-challenge": "^4.1.0",
|
|
69
|
-
"semver": "^7.
|
|
72
|
+
"semver": "^7.6.3",
|
|
70
73
|
"sharp": "^0.33.5",
|
|
71
74
|
"update-notifier": "^7.3.1"
|
|
72
75
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file serves as the main entry point for the React application. It uses
|
|
3
|
-
* `hydrateRoot` from `react-dom/client` to attach the React component tree, starting
|
|
4
|
-
* with the `<App />` component, to the DOM element with the ID of "root".
|
|
5
|
-
*
|
|
6
|
-
* When server-side rendering (SSR) or static site generation (SSG) is used,
|
|
7
|
-
* `hydrateRoot` reuses existing markup on the page, preserving performance and
|
|
8
|
-
* maintaining any server-rendered content. If you are not using SSR, you may see
|
|
9
|
-
* `createRoot` used in a similar manner instead.
|
|
10
|
-
*
|
|
11
|
-
* The `<App />` component is the root component of the application, where all
|
|
12
|
-
* child components are nested. This setup ensures that the React application is
|
|
13
|
-
* rendered and managed within the specified DOM node.
|
|
14
|
-
*/
|
|
15
|
-
import React from 'react';
|
|
16
|
-
import { hydrateRoot } from 'react-dom/client';
|
|
17
|
-
import App from './configurator.App';
|
|
18
|
-
|
|
19
|
-
hydrateRoot(document.getElementById('root')!, <App />);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file demonstrates the generation of HTML from a React application on the server
|
|
3
|
-
* (or ahead of time). It exports a single function that takes a CDN base path as an
|
|
4
|
-
* argument and returns an HTML string. Within that HTML, the `<App>` component is
|
|
5
|
-
* rendered to a string via `renderToString` and injected into the `<div id="root">`.
|
|
6
|
-
*
|
|
7
|
-
* This approach can be used for server-side rendering (SSR) or static site generation
|
|
8
|
-
* (SSG). By pre-rendering the React component, you can improve performance and
|
|
9
|
-
* provide faster initial page loads.
|
|
10
|
-
*/
|
|
11
|
-
import React from 'react';
|
|
12
|
-
import { renderToString } from 'react-dom/server';
|
|
13
|
-
import App from './configurator.App';
|
|
14
|
-
|
|
15
|
-
export default function (js: string, css?: string) {
|
|
16
|
-
return `
|
|
17
|
-
<!DOCTYPE html>
|
|
18
|
-
<html lang="en">
|
|
19
|
-
<head>
|
|
20
|
-
<meta charset="utf-8" />
|
|
21
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
22
|
-
<title>Title</title>
|
|
23
|
-
${css ? `<link rel="stylesheet" href="${css}" />` : ''}
|
|
24
|
-
</head>
|
|
25
|
-
<body>
|
|
26
|
-
<div id="root">${renderToString(<App />)}</div>
|
|
27
|
-
<script type="module" src="${js}"></script>
|
|
28
|
-
</body>
|
|
29
|
-
</html>
|
|
30
|
-
`;
|
|
31
|
-
}
|
package/assets/executor.main.tsx
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file serves as the main entry point for the React application. It uses
|
|
3
|
-
* `hydrateRoot` from `react-dom/client` to attach the React component tree, starting
|
|
4
|
-
* with the `<App />` component, to the DOM element with the ID of "root".
|
|
5
|
-
*
|
|
6
|
-
* When server-side rendering (SSR) or static site generation (SSG) is used,
|
|
7
|
-
* `hydrateRoot` reuses existing markup on the page, preserving performance and
|
|
8
|
-
* maintaining any server-rendered content. If you are not using SSR, you may see
|
|
9
|
-
* `createRoot` used in a similar manner instead.
|
|
10
|
-
*
|
|
11
|
-
* The `<App />` component is the root component of the application, where all
|
|
12
|
-
* child components are nested. This setup ensures that the React application is
|
|
13
|
-
* rendered and managed within the specified DOM node.
|
|
14
|
-
*/
|
|
15
|
-
import React from 'react';
|
|
16
|
-
import { hydrateRoot } from 'react-dom/client';
|
|
17
|
-
import App from './executor.App';
|
|
18
|
-
|
|
19
|
-
hydrateRoot(document.getElementById('root')!, <App />);
|
package/assets/executor.ssg.tsx
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file demonstrates the generation of HTML from a React application on the server
|
|
3
|
-
* (or ahead of time). It exports a single function that takes a CDN base path as an
|
|
4
|
-
* argument and returns an HTML string. Within that HTML, the `<App>` component is
|
|
5
|
-
* rendered to a string via `renderToString` and injected into the `<div id="root">`.
|
|
6
|
-
*
|
|
7
|
-
* This approach can be used for server-side rendering (SSR) or static site generation
|
|
8
|
-
* (SSG). By pre-rendering the React component, you can improve performance and
|
|
9
|
-
* provide faster initial page loads.
|
|
10
|
-
*/
|
|
11
|
-
import React from 'react';
|
|
12
|
-
import { renderToString } from 'react-dom/server';
|
|
13
|
-
import App from './executor.App';
|
|
14
|
-
|
|
15
|
-
export default function (js: string, css?: string) {
|
|
16
|
-
return `
|
|
17
|
-
<!DOCTYPE html>
|
|
18
|
-
<html lang="en">
|
|
19
|
-
<head>
|
|
20
|
-
<meta charset="utf-8" />
|
|
21
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
22
|
-
<title>Title</title>
|
|
23
|
-
${css ? `<link rel="stylesheet" href="${css}" />` : ''}
|
|
24
|
-
</head>
|
|
25
|
-
<body>
|
|
26
|
-
<div id="root">${renderToString(<App />)}</div>
|
|
27
|
-
<script type="module" src="${js}"></script>
|
|
28
|
-
</body>
|
|
29
|
-
</html>
|
|
30
|
-
`;
|
|
31
|
-
}
|
|
File without changes
|
|
File without changes
|