@hesed/webui 0.1.0 → 0.2.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/README.md +2 -2
- package/dist/commands/webui.d.ts +8 -0
- package/dist/commands/webui.js +12 -0
- package/dist/lib/introspect.js +23 -10
- package/dist/lib/server.d.ts +7 -1
- package/dist/lib/server.js +5 -3
- package/dist/web/BUILD_ID +1 -0
- package/{web/.next → dist/web}/app-path-routes-manifest.json +1 -0
- package/dist/web/build-manifest.json +20 -0
- package/dist/web/cache/.previewinfo +1 -0
- package/dist/web/cache/.rscinfo +1 -0
- package/dist/web/cache/.tsbuildinfo +1 -0
- package/dist/web/cache/config.json +7 -0
- package/dist/web/diagnostics/framework.json +1 -0
- package/dist/web/diagnostics/route-bundle-stats.json +27 -0
- package/dist/web/fallback-build-manifest.json +13 -0
- package/{web/.next → dist/web}/images-manifest.json +13 -3
- package/dist/web/next-minimal-server.js.nft.json +1 -0
- package/dist/web/next-server.js.nft.json +1 -0
- package/{web/.next → dist/web}/prerender-manifest.json +27 -3
- package/dist/web/required-server-files.js +333 -0
- package/{web/.next → dist/web}/required-server-files.json +103 -90
- package/{web/.next → dist/web}/routes-manifest.json +12 -2
- package/dist/web/server/app/_global-error/page/app-paths-manifest.json +3 -0
- package/dist/web/server/app/_global-error/page/build-manifest.json +16 -0
- package/dist/web/server/app/_global-error/page/next-font-manifest.json +6 -0
- package/dist/web/server/app/_global-error/page/server-reference-manifest.json +4 -0
- package/dist/web/server/app/_global-error/page.js +9 -0
- package/dist/web/server/app/_global-error/page.js.map +5 -0
- package/dist/web/server/app/_global-error/page.js.nft.json +1 -0
- package/dist/web/server/app/_global-error/page_client-reference-manifest.js +3 -0
- package/dist/web/server/app/_global-error.html +1 -0
- package/dist/web/server/app/_global-error.meta +15 -0
- package/dist/web/server/app/_global-error.rsc +14 -0
- package/dist/web/server/app/_global-error.segments/__PAGE__.segment.rsc +5 -0
- package/dist/web/server/app/_global-error.segments/_full.segment.rsc +14 -0
- package/dist/web/server/app/_global-error.segments/_head.segment.rsc +5 -0
- package/dist/web/server/app/_global-error.segments/_index.segment.rsc +5 -0
- package/dist/web/server/app/_global-error.segments/_tree.segment.rsc +1 -0
- package/dist/web/server/app/_not-found/page/app-paths-manifest.json +3 -0
- package/dist/web/server/app/_not-found/page/build-manifest.json +16 -0
- package/dist/web/server/app/_not-found/page/next-font-manifest.json +6 -0
- package/dist/web/server/app/_not-found/page/server-reference-manifest.json +4 -0
- package/dist/web/server/app/_not-found/page.js +12 -0
- package/dist/web/server/app/_not-found/page.js.map +5 -0
- package/dist/web/server/app/_not-found/page.js.nft.json +1 -0
- package/dist/web/server/app/_not-found/page_client-reference-manifest.js +3 -0
- package/dist/web/server/app/_not-found.html +1 -0
- package/{web/.next → dist/web}/server/app/_not-found.meta +9 -1
- package/dist/web/server/app/_not-found.rsc +16 -0
- package/dist/web/server/app/_not-found.segments/_full.segment.rsc +16 -0
- package/dist/web/server/app/_not-found.segments/_head.segment.rsc +5 -0
- package/dist/web/server/app/_not-found.segments/_index.segment.rsc +6 -0
- package/dist/web/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
- package/dist/web/server/app/_not-found.segments/_not-found.segment.rsc +5 -0
- package/dist/web/server/app/_not-found.segments/_tree.segment.rsc +2 -0
- package/dist/web/server/app/index.html +1 -0
- package/dist/web/server/app/index.meta +14 -0
- package/dist/web/server/app/index.rsc +18 -0
- package/dist/web/server/app/index.segments/__PAGE__.segment.rsc +9 -0
- package/dist/web/server/app/index.segments/_full.segment.rsc +18 -0
- package/dist/web/server/app/index.segments/_head.segment.rsc +5 -0
- package/dist/web/server/app/index.segments/_index.segment.rsc +6 -0
- package/dist/web/server/app/index.segments/_tree.segment.rsc +2 -0
- package/dist/web/server/app/page/app-paths-manifest.json +3 -0
- package/dist/web/server/app/page/build-manifest.json +16 -0
- package/dist/web/server/app/page/next-font-manifest.json +6 -0
- package/dist/web/server/app/page/react-loadable-manifest.json +1 -0
- package/dist/web/server/app/page/server-reference-manifest.json +4 -0
- package/dist/web/server/app/page.js +13 -0
- package/dist/web/server/app/page.js.map +5 -0
- package/dist/web/server/app/page.js.nft.json +1 -0
- package/dist/web/server/app/page_client-reference-manifest.js +3 -0
- package/{web/.next → dist/web}/server/app-paths-manifest.json +1 -0
- package/dist/web/server/chunks/ssr/[root-of-the-server]__0100oqz._.js +19 -0
- package/dist/web/server/chunks/ssr/[root-of-the-server]__0100oqz._.js.map +1 -0
- package/dist/web/server/chunks/ssr/[root-of-the-server]__03bqxv9._.js +33 -0
- package/dist/web/server/chunks/ssr/[root-of-the-server]__03bqxv9._.js.map +1 -0
- package/dist/web/server/chunks/ssr/[root-of-the-server]__10hrvcf._.js +3 -0
- package/dist/web/server/chunks/ssr/[root-of-the-server]__10hrvcf._.js.map +1 -0
- package/dist/web/server/chunks/ssr/[root-of-the-server]__10riywf._.js +3 -0
- package/dist/web/server/chunks/ssr/[root-of-the-server]__10riywf._.js.map +1 -0
- package/dist/web/server/chunks/ssr/[root-of-the-server]__17sw5v1._.js +3 -0
- package/dist/web/server/chunks/ssr/[root-of-the-server]__17sw5v1._.js.map +1 -0
- package/dist/web/server/chunks/ssr/[root-of-the-server]__1my83lt._.js +33 -0
- package/dist/web/server/chunks/ssr/[root-of-the-server]__1my83lt._.js.map +1 -0
- package/dist/web/server/chunks/ssr/[root-of-the-server]__1ujipwi._.js +3 -0
- package/dist/web/server/chunks/ssr/[root-of-the-server]__1ujipwi._.js.map +1 -0
- package/dist/web/server/chunks/ssr/[turbopack]_runtime.js +903 -0
- package/dist/web/server/chunks/ssr/[turbopack]_runtime.js.map +11 -0
- package/dist/web/server/chunks/ssr/node_modules_0h91jdk._.js +33 -0
- package/dist/web/server/chunks/ssr/node_modules_0h91jdk._.js.map +1 -0
- package/dist/web/server/chunks/ssr/node_modules_next_dist_1vgd_ru._.js +6 -0
- package/dist/web/server/chunks/ssr/node_modules_next_dist_1vgd_ru._.js.map +1 -0
- package/dist/web/server/chunks/ssr/node_modules_next_dist_client_components_0wpq8j3._.js +3 -0
- package/dist/web/server/chunks/ssr/node_modules_next_dist_client_components_0wpq8j3._.js.map +1 -0
- package/dist/web/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0symwr9.js +3 -0
- package/dist/web/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0symwr9.js.map +1 -0
- package/dist/web/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0-o-goa.js +3 -0
- package/dist/web/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0-o-goa.js.map +1 -0
- package/dist/web/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0l_sp0x.js +3 -0
- package/dist/web/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0l_sp0x.js.map +1 -0
- package/dist/web/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_13nn6g7.js +4 -0
- package/dist/web/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_13nn6g7.js.map +1 -0
- package/dist/web/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_19--w_z.js +4 -0
- package/dist/web/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_19--w_z.js.map +1 -0
- package/dist/web/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1o7-715.js +4 -0
- package/dist/web/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_1o7-715.js.map +1 -0
- package/dist/web/server/chunks/ssr/web_0iag39l._.js +3 -0
- package/dist/web/server/chunks/ssr/web_0iag39l._.js.map +1 -0
- package/dist/web/server/chunks/ssr/web__next-internal_server_app__global-error_page_actions_0crg1np.js +3 -0
- package/dist/web/server/chunks/ssr/web__next-internal_server_app__global-error_page_actions_0crg1np.js.map +1 -0
- package/dist/web/server/chunks/ssr/web__next-internal_server_app__not-found_page_actions_19z2-pv.js +3 -0
- package/dist/web/server/chunks/ssr/web__next-internal_server_app__not-found_page_actions_19z2-pv.js.map +1 -0
- package/dist/web/server/chunks/ssr/web__next-internal_server_app_page_actions_1xcff7h.js +3 -0
- package/dist/web/server/chunks/ssr/web__next-internal_server_app_page_actions_1xcff7h.js.map +1 -0
- package/dist/web/server/chunks/ssr/web_app_page_tsx_1-p0-hs._.js +3 -0
- package/dist/web/server/chunks/ssr/web_app_page_tsx_1-p0-hs._.js.map +1 -0
- package/dist/web/server/middleware-build-manifest.js +20 -0
- package/dist/web/server/middleware-manifest.json +6 -0
- package/dist/web/server/next-font-manifest.js +1 -0
- package/dist/web/server/next-font-manifest.json +6 -0
- package/dist/web/server/pages/404.html +1 -0
- package/dist/web/server/pages/500.html +1 -0
- package/dist/web/server/pages-manifest.json +4 -0
- package/dist/web/server/prefetch-hints.json +1 -0
- package/dist/web/server/server-reference-manifest.js +1 -0
- package/dist/web/server/server-reference-manifest.json +5 -0
- package/dist/web/static/PDMigBNKG7RenqXyfgiNr/_buildManifest.js +11 -0
- package/dist/web/static/PDMigBNKG7RenqXyfgiNr/_clientMiddlewareManifest.js +1 -0
- package/dist/web/static/chunks/0atut6a2uuyid.js +5 -0
- package/dist/web/static/chunks/158myu8e_yme3.js +1 -0
- package/dist/web/static/chunks/1_v5h-yjbgzno.js +1 -0
- package/dist/web/static/chunks/1bnss_1e9svpl.css +1 -0
- package/dist/web/static/chunks/1jq4o6yq14o4c.js +31 -0
- package/dist/web/static/chunks/28o7f8wux_ygy.js +1 -0
- package/dist/web/static/chunks/2nykiepra7i1k.js +1 -0
- package/dist/web/static/chunks/turbopack-3i0d1wb0b07u8.js +1 -0
- package/dist/web/trace +1 -0
- package/dist/web/trace-build +1 -0
- package/dist/web/turbopack +0 -0
- package/{web/.next → dist/web}/types/cache-life.d.ts +21 -17
- package/{web/.next → dist/web}/types/validator.ts +4 -4
- package/oclif.manifest.json +1 -1
- package/package.json +5 -10
- package/web/next.config.mjs +11 -6
- package/web/.next/BUILD_ID +0 -1
- package/web/.next/app-build-manifest.json +0 -26
- package/web/.next/build-manifest.json +0 -33
- package/web/.next/cache/.previewinfo +0 -1
- package/web/.next/cache/.rscinfo +0 -1
- package/web/.next/cache/.tsbuildinfo +0 -1
- package/web/.next/cache/eslint/.cache_1ki824o +0 -1
- package/web/.next/cache/webpack/client-development/0.pack.gz +0 -0
- package/web/.next/cache/webpack/client-development/1.pack.gz +0 -0
- package/web/.next/cache/webpack/client-development/index.pack.gz +0 -0
- package/web/.next/cache/webpack/client-development/index.pack.gz.old +0 -0
- package/web/.next/cache/webpack/client-production/0.pack +0 -0
- package/web/.next/cache/webpack/client-production/1.pack +0 -0
- package/web/.next/cache/webpack/client-production/2.pack +0 -0
- package/web/.next/cache/webpack/client-production/3.pack +0 -0
- package/web/.next/cache/webpack/client-production/index.pack +0 -0
- package/web/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/web/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/web/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/web/.next/cache/webpack/server-development/0.pack.gz +0 -0
- package/web/.next/cache/webpack/server-development/index.pack.gz +0 -0
- package/web/.next/cache/webpack/server-production/0.pack +0 -0
- package/web/.next/cache/webpack/server-production/1.pack +0 -0
- package/web/.next/cache/webpack/server-production/index.pack +0 -0
- package/web/.next/cache/webpack/server-production/index.pack.old +0 -0
- package/web/.next/diagnostics/framework.json +0 -1
- package/web/.next/next-minimal-server.js.nft.json +0 -1
- package/web/.next/next-server.js.nft.json +0 -1
- package/web/.next/server/app/_not-found/page.js +0 -2
- package/web/.next/server/app/_not-found/page.js.nft.json +0 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +0 -1
- package/web/.next/server/app/_not-found.html +0 -1
- package/web/.next/server/app/_not-found.rsc +0 -16
- package/web/.next/server/app/index.html +0 -1
- package/web/.next/server/app/index.meta +0 -7
- package/web/.next/server/app/index.rsc +0 -20
- package/web/.next/server/app/page.js +0 -2
- package/web/.next/server/app/page.js.nft.json +0 -1
- package/web/.next/server/app/page_client-reference-manifest.js +0 -1
- package/web/.next/server/chunks/157.js +0 -6
- package/web/.next/server/chunks/799.js +0 -30
- package/web/.next/server/middleware-build-manifest.js +0 -1
- package/web/.next/server/middleware-manifest.json +0 -6
- package/web/.next/server/middleware-react-loadable-manifest.js +0 -1
- package/web/.next/server/next-font-manifest.js +0 -1
- package/web/.next/server/next-font-manifest.json +0 -1
- package/web/.next/server/pages/404.html +0 -1
- package/web/.next/server/pages/500.html +0 -1
- package/web/.next/server/pages/_app.js +0 -1
- package/web/.next/server/pages/_app.js.nft.json +0 -1
- package/web/.next/server/pages/_document.js +0 -1
- package/web/.next/server/pages/_document.js.nft.json +0 -1
- package/web/.next/server/pages/_error.js +0 -19
- package/web/.next/server/pages/_error.js.nft.json +0 -1
- package/web/.next/server/pages-manifest.json +0 -6
- package/web/.next/server/server-reference-manifest.js +0 -1
- package/web/.next/server/server-reference-manifest.json +0 -1
- package/web/.next/server/webpack-runtime.js +0 -1
- package/web/.next/static/LEwu5WvMMaoVEbVj3-KGq/_buildManifest.js +0 -1
- package/web/.next/static/chunks/131-a68a87dd22cef82b.js +0 -1
- package/web/.next/static/chunks/app/_not-found/page-784ddbf5f1a9343a.js +0 -1
- package/web/.next/static/chunks/app/layout-4e0fe443358078fc.js +0 -1
- package/web/.next/static/chunks/app/page-d098bd39f1fcec43.js +0 -1
- package/web/.next/static/chunks/c7879cf7-b5ab1053c1d9a2e7.js +0 -1
- package/web/.next/static/chunks/framework-1934959d81242241.js +0 -1
- package/web/.next/static/chunks/main-a8814cf406d931cd.js +0 -1
- package/web/.next/static/chunks/main-app-a3b742ef05fa17a3.js +0 -1
- package/web/.next/static/chunks/pages/_app-930c2e1cfe9b86bc.js +0 -1
- package/web/.next/static/chunks/pages/_error-2a950c2742f550d2.js +0 -1
- package/web/.next/static/chunks/webpack-3046868c425865e4.js +0 -1
- package/web/.next/static/css/48007c73fe98a161.css +0 -1
- package/web/.next/trace +0 -2
- package/web/.next/types/app/layout.ts +0 -84
- package/web/.next/types/app/page.ts +0 -84
- package/web/.next/types/package.json +0 -1
- package/web/app/globals.css +0 -339
- package/web/app/layout.tsx +0 -20
- package/web/app/page.tsx +0 -57
- package/web/components/command-detail.tsx +0 -160
- package/web/components/command-list.tsx +0 -67
- package/web/components/theme-provider.tsx +0 -12
- package/web/components/theme-toggle.tsx +0 -62
- package/web/lib/types.ts +0 -77
- package/web/tsconfig.json +0 -23
- /package/{web/.next → dist/web}/diagnostics/build-diagnostics.json +0 -0
- /package/{web/.next → dist/web}/export-marker.json +0 -0
- /package/{web/.next → dist/web}/package.json +0 -0
- /package/{web/.next → dist/web/server/app/_global-error/page}/react-loadable-manifest.json +0 -0
- /package/{web/.next/cache/next-devtools-config.json → dist/web/server/app/_not-found/page/react-loadable-manifest.json} +0 -0
- /package/{web/.next → dist/web}/server/functions-config-manifest.json +0 -0
- /package/{web/.next → dist/web}/server/interception-route-rewrite-manifest.js +0 -0
- /package/{web/.next/static/LEwu5WvMMaoVEbVj3-KGq → dist/web/static/PDMigBNKG7RenqXyfgiNr}/_ssgManifest.js +0 -0
- /package/{web/.next/static/chunks/polyfills-42372ed130431b0a.js → dist/web/static/chunks/0cz1d0mv5g_q7.js} +0 -0
- /package/{web/.next → dist/web}/types/routes.d.ts +0 -0
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ $ npm install -g @hesed/webui
|
|
|
26
26
|
$ webui COMMAND
|
|
27
27
|
running command...
|
|
28
28
|
$ webui (--version)
|
|
29
|
-
@hesed/webui/0.
|
|
29
|
+
@hesed/webui/0.2.2 linux-x64 node-v24.16.0
|
|
30
30
|
$ webui --help [COMMAND]
|
|
31
31
|
USAGE
|
|
32
32
|
$ webui COMMAND
|
|
@@ -63,5 +63,5 @@ EXAMPLES
|
|
|
63
63
|
$ webui webui --host 0.0.0.0
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
_See code: [src/commands/webui.ts](https://github.com/hesedcasa/webui/blob/v0.
|
|
66
|
+
_See code: [src/commands/webui.ts](https://github.com/hesedcasa/webui/blob/v0.2.2/src/commands/webui.ts)_
|
|
67
67
|
<!-- commandsstop -->
|
package/dist/commands/webui.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Config } from '@oclif/core';
|
|
2
|
+
import type { LoadOptions } from '@oclif/core/interfaces';
|
|
1
3
|
import { Command } from '@oclif/core';
|
|
2
4
|
export default class WebUI extends Command {
|
|
3
5
|
static description: string;
|
|
@@ -7,6 +9,12 @@ export default class WebUI extends Command {
|
|
|
7
9
|
open: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
10
|
port: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* oclif normally reloads a Config when a command comes from a different
|
|
14
|
+
* oclif core installation. Preserve the host CLI's initialized Config so
|
|
15
|
+
* commands registered dynamically by init hooks remain available to the UI.
|
|
16
|
+
*/
|
|
17
|
+
static run<T extends Command>(this: new (argv: string[], config: Config) => T, argv?: string[], options?: LoadOptions): Promise<ReturnType<T['run']>>;
|
|
10
18
|
run(): Promise<void>;
|
|
11
19
|
private openBrowser;
|
|
12
20
|
}
|
package/dist/commands/webui.js
CHANGED
|
@@ -23,6 +23,18 @@ export default class WebUI extends Command {
|
|
|
23
23
|
description: 'Port to listen on.',
|
|
24
24
|
}),
|
|
25
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* oclif normally reloads a Config when a command comes from a different
|
|
28
|
+
* oclif core installation. Preserve the host CLI's initialized Config so
|
|
29
|
+
* commands registered dynamically by init hooks remain available to the UI.
|
|
30
|
+
*/
|
|
31
|
+
static async run(argv = [], options) {
|
|
32
|
+
if (options && typeof options !== 'string' && 'runCommand' in options) {
|
|
33
|
+
const command = new this(argv, options);
|
|
34
|
+
return command._run();
|
|
35
|
+
}
|
|
36
|
+
return super.run(argv, options);
|
|
37
|
+
}
|
|
26
38
|
async run() {
|
|
27
39
|
const { flags } = await this.parse(WebUI);
|
|
28
40
|
this.log(`Starting web UI…`);
|
package/dist/lib/introspect.js
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
function
|
|
1
|
+
function renderMetadataText(value, config, commandId) {
|
|
2
|
+
if (!value)
|
|
3
|
+
return value;
|
|
4
|
+
const replacements = {
|
|
5
|
+
'command.id': commandId,
|
|
6
|
+
'config.bin': config.bin,
|
|
7
|
+
'config.name': config.name,
|
|
8
|
+
'config.version': config.version,
|
|
9
|
+
};
|
|
10
|
+
return value.replaceAll(/<%=\s*(command\.id|config\.(?:bin|name|version))\s*%>/g, (template, key) => replacements[key] ?? template);
|
|
11
|
+
}
|
|
12
|
+
function flagToMeta(name, flag, config, commandId) {
|
|
2
13
|
const isBoolean = flag.type === 'boolean';
|
|
3
14
|
return {
|
|
4
15
|
char: flag.char,
|
|
5
16
|
default: isBoolean ? undefined : flag.default,
|
|
6
|
-
description: flag.summary ?? flag.description,
|
|
17
|
+
description: renderMetadataText(flag.summary ?? flag.description, config, commandId),
|
|
7
18
|
multiple: !isBoolean && Boolean(flag.multiple),
|
|
8
19
|
name,
|
|
9
20
|
options: isBoolean ? undefined : flag.options,
|
|
@@ -11,10 +22,10 @@ function flagToMeta(name, flag) {
|
|
|
11
22
|
type: isBoolean ? 'boolean' : 'option',
|
|
12
23
|
};
|
|
13
24
|
}
|
|
14
|
-
function argToMeta(name, arg) {
|
|
25
|
+
function argToMeta(name, arg, config, commandId) {
|
|
15
26
|
return {
|
|
16
27
|
default: arg.default,
|
|
17
|
-
description: arg.description,
|
|
28
|
+
description: renderMetadataText(arg.description, config, commandId),
|
|
18
29
|
name,
|
|
19
30
|
options: arg.options,
|
|
20
31
|
required: Boolean(arg.required),
|
|
@@ -26,19 +37,21 @@ function argToMeta(name, arg) {
|
|
|
26
37
|
*/
|
|
27
38
|
export function describeCommands(config) {
|
|
28
39
|
return config.commands
|
|
29
|
-
.filter((cmd) => !cmd.hidden)
|
|
40
|
+
.filter((cmd) => !cmd.hidden && !(cmd.id === 'webui' && cmd.pluginName === '@hesed/webui'))
|
|
30
41
|
.map((cmd) => ({
|
|
31
42
|
aliases: cmd.aliases ?? [],
|
|
32
|
-
args: Object.entries(cmd.args ?? {}).map(([name, arg]) => argToMeta(name, arg)),
|
|
33
|
-
description: cmd.description,
|
|
43
|
+
args: Object.entries(cmd.args ?? {}).map(([name, arg]) => argToMeta(name, arg, config, cmd.id)),
|
|
44
|
+
description: renderMetadataText(cmd.description, config, cmd.id),
|
|
34
45
|
flags: Object.entries(cmd.flags ?? {})
|
|
35
46
|
.filter(([, flag]) => !flag.hidden)
|
|
36
|
-
.map(([name, flag]) => flagToMeta(name, flag)),
|
|
47
|
+
.map(([name, flag]) => flagToMeta(name, flag, config, cmd.id)),
|
|
37
48
|
id: cmd.id,
|
|
38
49
|
pluginName: cmd.pluginName,
|
|
39
50
|
pluginType: cmd.pluginType,
|
|
40
|
-
summary: cmd.summary,
|
|
41
|
-
usage: cmd.usage
|
|
51
|
+
summary: renderMetadataText(cmd.summary, config, cmd.id),
|
|
52
|
+
usage: Array.isArray(cmd.usage)
|
|
53
|
+
? cmd.usage.map((usage) => renderMetadataText(usage, config, cmd.id) ?? usage)
|
|
54
|
+
: renderMetadataText(cmd.usage, config, cmd.id),
|
|
42
55
|
}))
|
|
43
56
|
.sort((a, b) => a.id.localeCompare(b.id));
|
|
44
57
|
}
|
package/dist/lib/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Config } from '@oclif/core';
|
|
2
|
-
import type { Server } from 'node:http';
|
|
2
|
+
import type { IncomingMessage, Server, ServerResponse } from 'node:http';
|
|
3
3
|
interface ServerOptions {
|
|
4
4
|
config: Config;
|
|
5
5
|
host: string;
|
|
@@ -9,6 +9,12 @@ interface RunningServer {
|
|
|
9
9
|
server: Server;
|
|
10
10
|
url: string;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Handle the small JSON API the browser app talks to. Returns `true` if the
|
|
14
|
+
* request was an API request (and has been answered), `false` otherwise so the
|
|
15
|
+
* caller can hand it to Next.js.
|
|
16
|
+
*/
|
|
17
|
+
export declare function handleApi(config: Config, req: IncomingMessage, res: ServerResponse): Promise<boolean>;
|
|
12
18
|
/**
|
|
13
19
|
* Start the web UI server: a Next.js app for the front-end plus a JSON API
|
|
14
20
|
* (served from the same origin) that introspects and runs oclif commands.
|
package/dist/lib/server.js
CHANGED
|
@@ -7,6 +7,8 @@ import { describeCommands } from './introspect.js';
|
|
|
7
7
|
const moduleDir = dirname(fileURLToPath(import.meta.url));
|
|
8
8
|
/** The Next.js project lives at `<pluginRoot>/web`; this file is `<pluginRoot>/dist/lib/server.js`. */
|
|
9
9
|
const webDir = join(moduleDir, '..', '..', 'web');
|
|
10
|
+
/** The compiled Next.js build output (distDir: ../dist/web relative to web/). */
|
|
11
|
+
const distWebDir = join(moduleDir, '..', 'web');
|
|
10
12
|
function sendJson(res, status, body) {
|
|
11
13
|
const payload = JSON.stringify(body);
|
|
12
14
|
res.writeHead(status, { 'content-length': Buffer.byteLength(payload), 'content-type': 'application/json' });
|
|
@@ -25,7 +27,7 @@ async function readJsonBody(req) {
|
|
|
25
27
|
* request was an API request (and has been answered), `false` otherwise so the
|
|
26
28
|
* caller can hand it to Next.js.
|
|
27
29
|
*/
|
|
28
|
-
async function handleApi(config, req, res) {
|
|
30
|
+
export async function handleApi(config, req, res) {
|
|
29
31
|
const { pathname } = new URL(req.url ?? '/', 'http://localhost');
|
|
30
32
|
if (!pathname?.startsWith('/api/'))
|
|
31
33
|
return false;
|
|
@@ -68,8 +70,8 @@ async function handleApi(config, req, res) {
|
|
|
68
70
|
*/
|
|
69
71
|
export async function startServer(options) {
|
|
70
72
|
const { config, host, port } = options;
|
|
71
|
-
if (!existsSync(
|
|
72
|
-
throw new Error(`No production build found at ${
|
|
73
|
+
if (!existsSync(distWebDir)) {
|
|
74
|
+
throw new Error(`No production build found at ${distWebDir}.\n` +
|
|
73
75
|
`Run "npm run build:web" in the @hesed/webui plugin.`);
|
|
74
76
|
}
|
|
75
77
|
// Imported lazily and loosely typed so the oclif command can be compiled
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
PDMigBNKG7RenqXyfgiNr
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pages": {
|
|
3
|
+
"/_app": []
|
|
4
|
+
},
|
|
5
|
+
"devFiles": [],
|
|
6
|
+
"polyfillFiles": [
|
|
7
|
+
"static/chunks/0cz1d0mv5g_q7.js"
|
|
8
|
+
],
|
|
9
|
+
"lowPriorityFiles": [
|
|
10
|
+
"static/PDMigBNKG7RenqXyfgiNr/_buildManifest.js",
|
|
11
|
+
"static/PDMigBNKG7RenqXyfgiNr/_ssgManifest.js",
|
|
12
|
+
"static/PDMigBNKG7RenqXyfgiNr/_clientMiddlewareManifest.js"
|
|
13
|
+
],
|
|
14
|
+
"rootMainFiles": [
|
|
15
|
+
"static/chunks/1jq4o6yq14o4c.js",
|
|
16
|
+
"static/chunks/0atut6a2uuyid.js",
|
|
17
|
+
"static/chunks/2nykiepra7i1k.js",
|
|
18
|
+
"static/chunks/turbopack-3i0d1wb0b07u8.js"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"previewModeId":"90a29e4e1089fd04e00b8bda53572f39","previewModeSigningKey":"73045342933677012481a59e3b128d8418629f88be33f3c7b578ab43e6f9a8a3","previewModeEncryptionKey":"0aa21e14ef4df6afc98b2196533fa5ac3c2f84814d97d9106896283038ab0bd3","expireAt":1783167422001}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"encryption.key":"9qErRLYqmtbms3mk/Ewq5HWhixoZHMvzjzO88Fk+XiE=","encryption.expire_at":1783167421864}
|