@teambit/ui 1.0.228 → 1.0.229
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/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_ui_foundation_ui-preview.js +1 -1
- package/artifacts/schema.json +505 -133
- package/artifacts/ui-bundle/scope/public/bit/index.html +1 -1
- package/artifacts/ui-bundle/scope/public/bit/service-worker.js +1 -1
- package/artifacts/ui-bundle/scope/public/bit/ssr/service-worker.js.map +1 -1
- package/dist/bundle-ui.task.d.ts +28 -0
- package/dist/events/index.d.ts +1 -0
- package/dist/events/ui-server-started-event.d.ts +16 -0
- package/dist/exceptions/index.d.ts +2 -0
- package/dist/exceptions/unknown-build-error.d.ts +3 -0
- package/dist/exceptions/unknown-ui.d.ts +6 -0
- package/dist/index.d.ts +23 -0
- package/dist/{preview-1712805335812.js → preview-1712822929999.js} +2 -2
- package/dist/ssr-middleware/index.d.ts +1 -0
- package/dist/ssr-middleware/ssr-middleware.d.ts +10 -0
- package/dist/start-plugin.d.ts +17 -0
- package/dist/start.cmd.d.ts +37 -0
- package/dist/ui/client-context.d.ts +4 -0
- package/dist/ui-build.cmd.d.ts +20 -0
- package/dist/ui-root.d.ts +48 -0
- package/dist/ui-root.ui.d.ts +5 -0
- package/dist/ui-server.d.ts +72 -0
- package/dist/ui.aspect.d.ts +4 -0
- package/dist/ui.cli.rt.d.ts +0 -0
- package/dist/ui.composition.d.ts +1 -0
- package/dist/ui.main.runtime.d.ts +260 -0
- package/dist/ui.runtime.d.ts +0 -0
- package/dist/ui.ui.runtime.d.ts +59 -0
- package/dist/webpack/html.d.ts +2 -0
- package/dist/webpack/postcss.config.d.ts +4 -0
- package/dist/webpack/webpack.base.config.d.ts +2 -0
- package/dist/webpack/webpack.browser.config.d.ts +2 -0
- package/dist/webpack/webpack.dev.config.d.ts +2 -0
- package/dist/webpack/webpack.ssr.config.d.ts +2 -0
- package/package.json +17 -17
- package/tsconfig.json +1 -46
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>bit-local-
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>bit-local-b6c95f5b</title><script>try{window.__REACT_DEVTOOLS_GLOBAL_HOOK__=window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__}catch{}</script><script defer="defer" src="/static/js/runtime-main.43d12281.js"></script><script defer="defer" src="/static/js/763.a900abcd.js"></script><script defer="defer" src="/static/js/main.b43a18be.js"></script><link href="/static/css/763.70948381.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){const e=e=>{"require"!==e&&(e+=".js");let s=Promise.resolve();return r[e]||(s=new Promise((async s=>{if("document"in self){const r=document.createElement("script");r.src=e,document.head.appendChild(r),r.onload=s}else importScripts(e),s()}))),s.then((()=>{if(!r[e])throw new Error(`Module ${e} didn’t register its module`);return r[e]}))},s=(s,r)=>{Promise.all(s.map(e)).then((e=>r(1===e.length?e[0]:e)))},r={require:Promise.resolve(s)};self.define=(s,i,t)=>{r[s]||(r[s]=Promise.resolve().then((()=>{let r={};const n={uri:location.origin+s.slice(1)};return Promise.all(i.map((s=>{switch(s){case"exports":return r;case"module":return n;default:return e(s)}}))).then((e=>{const s=t(...e);return r.default||(r.default=s),r}))})))}}define("./service-worker.js",["./workbox-1bc97e8b"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.clientsClaim(),e.precacheAndRoute([{url:"/index.html",revision:"
|
|
1
|
+
if(!self.define){const e=e=>{"require"!==e&&(e+=".js");let s=Promise.resolve();return r[e]||(s=new Promise((async s=>{if("document"in self){const r=document.createElement("script");r.src=e,document.head.appendChild(r),r.onload=s}else importScripts(e),s()}))),s.then((()=>{if(!r[e])throw new Error(`Module ${e} didn’t register its module`);return r[e]}))},s=(s,r)=>{Promise.all(s.map(e)).then((e=>r(1===e.length?e[0]:e)))},r={require:Promise.resolve(s)};self.define=(s,i,t)=>{r[s]||(r[s]=Promise.resolve().then((()=>{let r={};const n={uri:location.origin+s.slice(1)};return Promise.all(i.map((s=>{switch(s){case"exports":return r;case"module":return n;default:return e(s)}}))).then((e=>{const s=t(...e);return r.default||(r.default=s),r}))})))}}define("./service-worker.js",["./workbox-1bc97e8b"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.clientsClaim(),e.precacheAndRoute([{url:"/index.html",revision:"886d2c3851d330780a57cef51e015bdf"},{url:"/static/css/763.70948381.css",revision:null},{url:"/static/fonts/ade705761eb7e702770d.ttf",revision:null},{url:"/static/js/763.a900abcd.js.LICENSE.txt",revision:"aeb96ab8550d7551961008bf135f0f71"},{url:"/static/js/main.b43a18be.js",revision:null},{url:"/static/js/runtime-main.43d12281.js",revision:null}],{}),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("public/index.html"),{denylist:[/^\/_/,/\/[^/?]+\.[^/]+$/]}))}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-worker.js","sources":["../../../../tmp/
|
|
1
|
+
{"version":3,"file":"service-worker.js","sources":["../../../../tmp/a3e57bc721a40c1487fe63036bc08dd0/service-worker.js"],"sourcesContent":["import {clientsClaim as workbox_core_clientsClaim} from '/home/circleci/bit/bit/node_modules/.pnpm/workbox-core@6.2.4/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/home/circleci/bit/bit/node_modules/.pnpm/workbox-precaching@6.2.4/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {registerRoute as workbox_routing_registerRoute} from '/home/circleci/bit/bit/node_modules/.pnpm/workbox-routing@6.2.4/node_modules/workbox-routing/registerRoute.mjs';\nimport {NavigationRoute as workbox_routing_NavigationRoute} from '/home/circleci/bit/bit/node_modules/.pnpm/workbox-routing@6.2.4/node_modules/workbox-routing/NavigationRoute.mjs';\nimport {createHandlerBoundToURL as workbox_precaching_createHandlerBoundToURL} from '/home/circleci/bit/bit/node_modules/.pnpm/workbox-precaching@6.2.4/node_modules/workbox-precaching/createHandlerBoundToURL.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.addEventListener('message', (event) => {\n if (event.data && event.data.type === 'SKIP_WAITING') {\n self.skipWaiting();\n }\n});\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"/public/ssr/static/css/main.9c3cec1a.css\",\n \"revision\": null\n },\n {\n \"url\": \"/public/ssr/static/fonts/ade705761eb7e702770d.ttf\",\n \"revision\": null\n }\n], {});\n\nworkbox_routing_registerRoute(new workbox_routing_NavigationRoute(workbox_precaching_createHandlerBoundToURL(\"public/index.html\"), {\n \n denylist: [/^\\/_/,/\\/[^/?]+\\.[^/]+$/],\n}));\n\n\n\n\n\n\n"],"names":["self","addEventListener","event","data","type","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","url","revision","workbox","registerRoute","workbox_routing_NavigationRoute","NavigationRoute","workbox_precaching_createHandlerBoundToURL","denylist"],"mappings":"szBAuBAA,KAAKC,iBAAiB,WAAYC,IAC5BA,EAAMC,MAA4B,iBAApBD,EAAMC,KAAKC,MAC3BJ,KAAKK,aACP,IAGFC,EAAAA,eAQAC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,2CACPC,SAAY,MAEd,CACED,IAAO,oDACPC,SAAY,OAEb,CAAE,GAEwBC,EAAAC,cAAC,IAAIC,EAA+BC,gBAACC,0BAA2C,qBAAsB,CAEjIC,SAAU,CAAC,OAAO"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { BuildContext, BuildTask, BuiltTaskResult, TaskLocation } from '@teambit/builder';
|
|
2
|
+
import { Logger } from '@teambit/logger';
|
|
3
|
+
import { UiMain } from './ui.main.runtime';
|
|
4
|
+
export declare const BUNDLE_UI_TASK_NAME = "BundleUI";
|
|
5
|
+
export declare const BUNDLE_UI_DIR = "ui-bundle";
|
|
6
|
+
export declare const UIROOT_ASPECT_IDS: {
|
|
7
|
+
SCOPE: string;
|
|
8
|
+
WORKSPACE: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const BUNDLE_UIROOT_DIR: {
|
|
11
|
+
[x: string]: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const BUNDLE_UI_HASH_FILENAME = ".hash";
|
|
14
|
+
export declare class BundleUiTask implements BuildTask {
|
|
15
|
+
private ui;
|
|
16
|
+
private logger;
|
|
17
|
+
aspectId: string;
|
|
18
|
+
name: string;
|
|
19
|
+
location: TaskLocation;
|
|
20
|
+
constructor(ui: UiMain, logger: Logger);
|
|
21
|
+
execute(context: BuildContext): Promise<BuiltTaskResult>;
|
|
22
|
+
private generateHash;
|
|
23
|
+
static getArtifactDirectory(uiRootAspectId: any): string;
|
|
24
|
+
static getArtifactDef(): {
|
|
25
|
+
name: string;
|
|
26
|
+
globPatterns: string[];
|
|
27
|
+
}[];
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ui-server-started-event';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BitBaseEvent } from '@teambit/pubsub';
|
|
2
|
+
declare class UiServerStartedEventData {
|
|
3
|
+
readonly targetHost: any;
|
|
4
|
+
readonly targetPort: any;
|
|
5
|
+
readonly uiRoot: any;
|
|
6
|
+
constructor(targetHost: any, targetPort: any, uiRoot: any);
|
|
7
|
+
}
|
|
8
|
+
export declare class UiServerStartedEvent extends BitBaseEvent<UiServerStartedEventData> {
|
|
9
|
+
readonly timestamp: any;
|
|
10
|
+
readonly targetHost: any;
|
|
11
|
+
readonly targetPort: any;
|
|
12
|
+
readonly uiRoot: any;
|
|
13
|
+
static readonly TYPE = "ui-server-started";
|
|
14
|
+
constructor(timestamp: any, targetHost: any, targetPort: any, uiRoot: any);
|
|
15
|
+
}
|
|
16
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type * as SSR from '@teambit/react.rendering.ssr';
|
|
2
|
+
export { UIAspect, UIRuntime, UIAspect as default } from './ui.aspect';
|
|
3
|
+
export * from './events';
|
|
4
|
+
export type { UIRoot, PostStartOptions, ProxyEntry } from './ui-root';
|
|
5
|
+
export type { UiMain, PreStartOpts } from './ui.main.runtime';
|
|
6
|
+
export type { UiUI } from './ui.ui.runtime';
|
|
7
|
+
export type { StartPlugin, StartPluginOptions } from './start-plugin';
|
|
8
|
+
export type { SSR };
|
|
9
|
+
export type { UIRootUI, UIRootFactory } from './ui-root.ui';
|
|
10
|
+
export type { UIServer } from './ui-server';
|
|
11
|
+
export { BUNDLE_UI_DIR, BundleUiTask } from './bundle-ui.task';
|
|
12
|
+
export type { DataQueryResult } from '@teambit/ui-foundation.ui.hooks.use-data-query';
|
|
13
|
+
export { useDataQuery } from '@teambit/ui-foundation.ui.hooks.use-data-query';
|
|
14
|
+
export { useMutation } from '@apollo/client';
|
|
15
|
+
export type {
|
|
16
|
+
/** @deprecated - use SSR.BrowserData */
|
|
17
|
+
BrowserData,
|
|
18
|
+
/** @deprecated - use SSR.RenderPlugin */
|
|
19
|
+
RenderPlugin,
|
|
20
|
+
/** @deprecated use SSR.RenderPlugin */
|
|
21
|
+
RenderPlugin as RenderPlugins,
|
|
22
|
+
/** @deprecated use SSR..RenderPlugin */
|
|
23
|
+
RenderPlugin as RenderLifecycle, } from '@teambit/react.rendering.ssr';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_ui@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_ui@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_ui@1.0.229/dist/ui.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.ui-foundation_ui@1.0.229/dist/ui.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createSsrMiddleware } from './ssr-middleware';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Logger } from '@teambit/logger';
|
|
2
|
+
import type { Request, Response, NextFunction } from 'express';
|
|
3
|
+
type ssrRenderProps = {
|
|
4
|
+
root: string;
|
|
5
|
+
port: number;
|
|
6
|
+
title: string;
|
|
7
|
+
logger: Logger;
|
|
8
|
+
};
|
|
9
|
+
export declare function createSsrMiddleware({ root, port, title, logger }: ssrRenderProps): Promise<((request: Request, response: Response, next: NextFunction) => Promise<void>) | undefined>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ProxyEntry } from './ui-root';
|
|
2
|
+
export type StartPluginOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* indicates whether the start in on verbose mode.
|
|
5
|
+
*/
|
|
6
|
+
verbose?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* component pattern it applies on.
|
|
9
|
+
*/
|
|
10
|
+
pattern?: string;
|
|
11
|
+
};
|
|
12
|
+
export interface StartPlugin {
|
|
13
|
+
initiate(startOptions: StartPluginOptions): void;
|
|
14
|
+
getProxy?(): ProxyEntry[];
|
|
15
|
+
/** promise that resolves when the plugin completed initiation */
|
|
16
|
+
readonly whenReady: Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Command, CommandOptions } from '@teambit/cli';
|
|
2
|
+
import { Logger } from '@teambit/logger';
|
|
3
|
+
import type { UiMain } from './ui.main.runtime';
|
|
4
|
+
type StartArgs = [userPattern: string];
|
|
5
|
+
type StartFlags = {
|
|
6
|
+
dev: boolean;
|
|
7
|
+
port: string;
|
|
8
|
+
rebuild: boolean;
|
|
9
|
+
verbose: boolean;
|
|
10
|
+
noBrowser: boolean;
|
|
11
|
+
skipCompilation: boolean;
|
|
12
|
+
skipUiBuild: boolean;
|
|
13
|
+
uiRootName: string;
|
|
14
|
+
};
|
|
15
|
+
export declare class StartCmd implements Command {
|
|
16
|
+
/**
|
|
17
|
+
* access to the extension instance.
|
|
18
|
+
*/
|
|
19
|
+
private ui;
|
|
20
|
+
private logger;
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
arguments: {
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
}[];
|
|
27
|
+
alias: string;
|
|
28
|
+
group: string;
|
|
29
|
+
options: CommandOptions;
|
|
30
|
+
constructor(
|
|
31
|
+
/**
|
|
32
|
+
* access to the extension instance.
|
|
33
|
+
*/
|
|
34
|
+
ui: UiMain, logger: Logger);
|
|
35
|
+
wait([userPattern]: StartArgs, { dev, port, rebuild, verbose, noBrowser, skipCompilation, skipUiBuild, uiRootName: uiRootAspectIdOrName, }: StartFlags): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Command } from '@teambit/cli';
|
|
2
|
+
import { UiMain } from './ui.main.runtime';
|
|
3
|
+
export declare class UIBuildCmd implements Command {
|
|
4
|
+
/**
|
|
5
|
+
* access to the extension instance.
|
|
6
|
+
*/
|
|
7
|
+
private ui;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
10
|
+
alias: string;
|
|
11
|
+
group: string;
|
|
12
|
+
options: never[];
|
|
13
|
+
private: boolean;
|
|
14
|
+
constructor(
|
|
15
|
+
/**
|
|
16
|
+
* access to the extension instance.
|
|
17
|
+
*/
|
|
18
|
+
ui: UiMain);
|
|
19
|
+
report([type]: [string]): Promise<string>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { AspectDefinition } from '@teambit/aspect-loader';
|
|
2
|
+
import { ComponentDir } from '@teambit/bundler';
|
|
3
|
+
import { Component, ComponentID, ResolveAspectsOptions } from '@teambit/component';
|
|
4
|
+
import { ProxyConfigArrayItem } from 'webpack-dev-server';
|
|
5
|
+
export interface UIRoot extends ComponentDir {
|
|
6
|
+
/**
|
|
7
|
+
* unique name of the ui.
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* path of the ui root.
|
|
12
|
+
*/
|
|
13
|
+
path: string;
|
|
14
|
+
/**
|
|
15
|
+
* name of the UI root config file.
|
|
16
|
+
*/
|
|
17
|
+
configFile: string;
|
|
18
|
+
buildOptions?: {
|
|
19
|
+
ssr?: boolean;
|
|
20
|
+
launchBrowserOnStart?: boolean;
|
|
21
|
+
prebundle?: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* resolve aspects in the UI root. (resolve all if componentIds not provided)
|
|
25
|
+
*/
|
|
26
|
+
resolveAspects(runtimeName: string, componentIds?: ComponentID[], opts?: ResolveAspectsOptions): Promise<AspectDefinition[]>;
|
|
27
|
+
/**
|
|
28
|
+
* resolve components from a given pattern.
|
|
29
|
+
*/
|
|
30
|
+
resolvePattern?(pattern: string): Promise<Component[]>;
|
|
31
|
+
/**
|
|
32
|
+
* listener for when the dev server starts. can be used for running the watcher.
|
|
33
|
+
*/
|
|
34
|
+
postStart?(options: PostStartOptions): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* determine whether UI should get a priority.
|
|
37
|
+
*/
|
|
38
|
+
priority?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export type ProxyEntry = ProxyConfigArrayItem & {
|
|
41
|
+
context: string[];
|
|
42
|
+
};
|
|
43
|
+
export type PostStartOptions = {
|
|
44
|
+
/**
|
|
45
|
+
* pattern for selecting components in the container.
|
|
46
|
+
*/
|
|
47
|
+
pattern?: string;
|
|
48
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ExpressMain } from '@teambit/express';
|
|
2
|
+
import { GraphqlMain } from '@teambit/graphql';
|
|
3
|
+
import { Logger } from '@teambit/logger';
|
|
4
|
+
import WebpackDevServer from 'webpack-dev-server';
|
|
5
|
+
import { StartPlugin } from './start-plugin';
|
|
6
|
+
import { UIRoot } from './ui-root';
|
|
7
|
+
import { UiMain } from './ui.main.runtime';
|
|
8
|
+
export type UIServerProps = {
|
|
9
|
+
graphql: GraphqlMain;
|
|
10
|
+
express: ExpressMain;
|
|
11
|
+
ui: UiMain;
|
|
12
|
+
uiRoot: UIRoot;
|
|
13
|
+
uiRootExtension: string;
|
|
14
|
+
logger: Logger;
|
|
15
|
+
publicDir: string;
|
|
16
|
+
startPlugins: StartPlugin[];
|
|
17
|
+
};
|
|
18
|
+
export type StartOptions = {
|
|
19
|
+
/**
|
|
20
|
+
* Absolute path to the ui bundle (generated during the bit build).
|
|
21
|
+
*/
|
|
22
|
+
bundleUiRoot?: string;
|
|
23
|
+
/**
|
|
24
|
+
* port range for the UI server to bind. default is a port range of 4000-4200.
|
|
25
|
+
*/
|
|
26
|
+
portRange?: number[] | number;
|
|
27
|
+
};
|
|
28
|
+
export declare class UIServer {
|
|
29
|
+
private graphql;
|
|
30
|
+
private expressExtension;
|
|
31
|
+
private ui;
|
|
32
|
+
private uiRoot;
|
|
33
|
+
private uiRootExtension;
|
|
34
|
+
private logger;
|
|
35
|
+
private publicDir;
|
|
36
|
+
private plugins;
|
|
37
|
+
constructor(graphql: GraphqlMain, expressExtension: ExpressMain, ui: UiMain, uiRoot: UIRoot, uiRootExtension: string, logger: Logger, publicDir: string, plugins: StartPlugin[]);
|
|
38
|
+
getName(): string;
|
|
39
|
+
private _port;
|
|
40
|
+
get port(): number;
|
|
41
|
+
/** the hostname for the server to listen at. Currently statically 'localhost' */
|
|
42
|
+
get host(): string;
|
|
43
|
+
/** the server listens at this url */
|
|
44
|
+
get fullUrl(): string;
|
|
45
|
+
get buildOptions(): {
|
|
46
|
+
ssr?: boolean | undefined;
|
|
47
|
+
launchBrowserOnStart?: boolean | undefined;
|
|
48
|
+
prebundle?: boolean | undefined;
|
|
49
|
+
} | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* get the webpack configuration of the UI server.
|
|
52
|
+
*/
|
|
53
|
+
getDevConfig(): Promise<import("@teambit/webpack").WebpackConfigWithDevServer>;
|
|
54
|
+
private setReady;
|
|
55
|
+
private startPromise;
|
|
56
|
+
get whenReady(): Promise<[void, ...void[]]>;
|
|
57
|
+
/**
|
|
58
|
+
* start a UI server.
|
|
59
|
+
*/
|
|
60
|
+
start({ bundleUiRoot, portRange }?: StartOptions): Promise<void>;
|
|
61
|
+
private setupServerSideRendering;
|
|
62
|
+
private configureProxy;
|
|
63
|
+
/**
|
|
64
|
+
* start a UI dev server.
|
|
65
|
+
*/
|
|
66
|
+
dev({ portRange }?: StartOptions): Promise<WebpackDevServer>;
|
|
67
|
+
private selectPort;
|
|
68
|
+
private getProxyFromPlugins;
|
|
69
|
+
private getProxy;
|
|
70
|
+
private getDevServerConfig;
|
|
71
|
+
static create(props: UIServerProps): UIServer;
|
|
72
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Logo: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import type { AspectMain } from '@teambit/aspect';
|
|
3
|
+
import { AspectDefinition } from '@teambit/aspect-loader';
|
|
4
|
+
import { CacheMain } from '@teambit/cache';
|
|
5
|
+
import { CLIMain } from '@teambit/cli';
|
|
6
|
+
import type { ComponentMain } from '@teambit/component';
|
|
7
|
+
import { ExpressMain } from '@teambit/express';
|
|
8
|
+
import type { GraphqlMain } from '@teambit/graphql';
|
|
9
|
+
import { SlotRegistry, Harmony } from '@teambit/harmony';
|
|
10
|
+
import { Logger, LoggerMain } from '@teambit/logger';
|
|
11
|
+
import { PubsubMain } from '@teambit/pubsub';
|
|
12
|
+
import webpack from 'webpack';
|
|
13
|
+
import { UIRoot } from './ui-root';
|
|
14
|
+
import { UIServer } from './ui-server';
|
|
15
|
+
import { StartPlugin } from './start-plugin';
|
|
16
|
+
export type UIDeps = [PubsubMain, CLIMain, GraphqlMain, ExpressMain, ComponentMain, CacheMain, LoggerMain, AspectMain];
|
|
17
|
+
export type UIRootRegistry = SlotRegistry<UIRoot>;
|
|
18
|
+
export type PreStart = (preStartOpts: PreStartOpts) => Promise<void>;
|
|
19
|
+
export type PreStartOpts = {
|
|
20
|
+
skipCompilation?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type OnStart = () => Promise<undefined | ComponentType<{}>>;
|
|
23
|
+
export type StartPluginSlot = SlotRegistry<StartPlugin>;
|
|
24
|
+
export type PublicDirOverwrite = (uiRoot: UIRoot) => Promise<string | undefined>;
|
|
25
|
+
export type BuildMethodOverwrite = (name: string, uiRoot: UIRoot, rebuild?: boolean) => Promise<string>;
|
|
26
|
+
export type PreStartSlot = SlotRegistry<PreStart>;
|
|
27
|
+
export type OnStartSlot = SlotRegistry<OnStart>;
|
|
28
|
+
export type PublicDirOverwriteSlot = SlotRegistry<PublicDirOverwrite>;
|
|
29
|
+
export type BuildMethodOverwriteSlot = SlotRegistry<BuildMethodOverwrite>;
|
|
30
|
+
export type UIConfig = {
|
|
31
|
+
/**
|
|
32
|
+
* port for the UI root to use.
|
|
33
|
+
*/
|
|
34
|
+
port?: number;
|
|
35
|
+
/**
|
|
36
|
+
* port range for the UI root to use.
|
|
37
|
+
*/
|
|
38
|
+
portRange: [number, number];
|
|
39
|
+
/**
|
|
40
|
+
* host for the UI root
|
|
41
|
+
*/
|
|
42
|
+
host: string;
|
|
43
|
+
/**
|
|
44
|
+
* directory in workspace to use for public assets.
|
|
45
|
+
* always relative to the workspace root directory.
|
|
46
|
+
*/
|
|
47
|
+
publicDir: string;
|
|
48
|
+
/** the url to display when server is listening. Note that bit does not provide proxying to this url */
|
|
49
|
+
publicUrl?: string;
|
|
50
|
+
};
|
|
51
|
+
export type RuntimeOptions = {
|
|
52
|
+
/**
|
|
53
|
+
* determine whether to initiate on verbose mode.
|
|
54
|
+
*/
|
|
55
|
+
verbose?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* name of the UI root to load.
|
|
58
|
+
*/
|
|
59
|
+
uiRootName?: string;
|
|
60
|
+
uiRootAspectIdOrName?: string;
|
|
61
|
+
/**
|
|
62
|
+
* component selector pattern to load.
|
|
63
|
+
*/
|
|
64
|
+
pattern?: string;
|
|
65
|
+
/**
|
|
66
|
+
* determine whether to start a dev server (defaults to false).
|
|
67
|
+
*/
|
|
68
|
+
dev?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* port of the config.
|
|
71
|
+
*/
|
|
72
|
+
port?: number;
|
|
73
|
+
/**
|
|
74
|
+
* determine whether to rebuild the UI before start.
|
|
75
|
+
*/
|
|
76
|
+
rebuild?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* skip build the UI before start
|
|
79
|
+
*/
|
|
80
|
+
skipUiBuild?: boolean;
|
|
81
|
+
};
|
|
82
|
+
export declare class UiMain {
|
|
83
|
+
/**
|
|
84
|
+
* Pubsub extension.
|
|
85
|
+
*/
|
|
86
|
+
private pubsub;
|
|
87
|
+
private config;
|
|
88
|
+
/**
|
|
89
|
+
* graphql extension.
|
|
90
|
+
*/
|
|
91
|
+
private graphql;
|
|
92
|
+
/**
|
|
93
|
+
* slot registry of ui roots.
|
|
94
|
+
*/
|
|
95
|
+
private uiRootSlot;
|
|
96
|
+
/**
|
|
97
|
+
* express extension.
|
|
98
|
+
*/
|
|
99
|
+
private express;
|
|
100
|
+
/**
|
|
101
|
+
* pre-start slot
|
|
102
|
+
*/
|
|
103
|
+
private preStartSlot;
|
|
104
|
+
/**
|
|
105
|
+
* on start slot
|
|
106
|
+
*/
|
|
107
|
+
private onStartSlot;
|
|
108
|
+
/**
|
|
109
|
+
* Overwrite the public dir Slot
|
|
110
|
+
*/
|
|
111
|
+
private publicDirOverwriteSlot;
|
|
112
|
+
/**
|
|
113
|
+
* Overwrite the build ui method
|
|
114
|
+
*/
|
|
115
|
+
private buildMethodOverwriteSlot;
|
|
116
|
+
/**
|
|
117
|
+
* component extension.
|
|
118
|
+
*/
|
|
119
|
+
private componentExtension;
|
|
120
|
+
/**
|
|
121
|
+
* ui logger instance.
|
|
122
|
+
*/
|
|
123
|
+
private cache;
|
|
124
|
+
/**
|
|
125
|
+
* ui logger instance.
|
|
126
|
+
*/
|
|
127
|
+
private logger;
|
|
128
|
+
private harmony;
|
|
129
|
+
private startPluginSlot;
|
|
130
|
+
private _isBundleUiServed;
|
|
131
|
+
constructor(
|
|
132
|
+
/**
|
|
133
|
+
* Pubsub extension.
|
|
134
|
+
*/
|
|
135
|
+
pubsub: PubsubMain, config: UIConfig,
|
|
136
|
+
/**
|
|
137
|
+
* graphql extension.
|
|
138
|
+
*/
|
|
139
|
+
graphql: GraphqlMain,
|
|
140
|
+
/**
|
|
141
|
+
* slot registry of ui roots.
|
|
142
|
+
*/
|
|
143
|
+
uiRootSlot: UIRootRegistry,
|
|
144
|
+
/**
|
|
145
|
+
* express extension.
|
|
146
|
+
*/
|
|
147
|
+
express: ExpressMain,
|
|
148
|
+
/**
|
|
149
|
+
* pre-start slot
|
|
150
|
+
*/
|
|
151
|
+
preStartSlot: PreStartSlot,
|
|
152
|
+
/**
|
|
153
|
+
* on start slot
|
|
154
|
+
*/
|
|
155
|
+
onStartSlot: OnStartSlot,
|
|
156
|
+
/**
|
|
157
|
+
* Overwrite the public dir Slot
|
|
158
|
+
*/
|
|
159
|
+
publicDirOverwriteSlot: PublicDirOverwriteSlot,
|
|
160
|
+
/**
|
|
161
|
+
* Overwrite the build ui method
|
|
162
|
+
*/
|
|
163
|
+
buildMethodOverwriteSlot: BuildMethodOverwriteSlot,
|
|
164
|
+
/**
|
|
165
|
+
* component extension.
|
|
166
|
+
*/
|
|
167
|
+
componentExtension: ComponentMain,
|
|
168
|
+
/**
|
|
169
|
+
* ui logger instance.
|
|
170
|
+
*/
|
|
171
|
+
cache: CacheMain,
|
|
172
|
+
/**
|
|
173
|
+
* ui logger instance.
|
|
174
|
+
*/
|
|
175
|
+
logger: Logger, harmony: Harmony, startPluginSlot: StartPluginSlot);
|
|
176
|
+
publicDir(uiRoot: UIRoot): Promise<string>;
|
|
177
|
+
private getUiByName;
|
|
178
|
+
/**
|
|
179
|
+
* create a build of the given UI root.
|
|
180
|
+
*/
|
|
181
|
+
build(uiRootAspectIdOrName?: string, customOutputPath?: string): Promise<webpack.MultiStats | undefined>;
|
|
182
|
+
registerStartPlugin(startPlugin: StartPlugin): this;
|
|
183
|
+
private initiatePlugins;
|
|
184
|
+
runtimeOptions: RuntimeOptions;
|
|
185
|
+
/**
|
|
186
|
+
* create a Bit UI runtime.
|
|
187
|
+
*/
|
|
188
|
+
createRuntime(runtimeOptions: RuntimeOptions): Promise<UIServer>;
|
|
189
|
+
private addSignalListener;
|
|
190
|
+
getPort(port?: number): Promise<number>;
|
|
191
|
+
/**
|
|
192
|
+
* Events
|
|
193
|
+
*/
|
|
194
|
+
private createUiServerStartedEvent;
|
|
195
|
+
/**
|
|
196
|
+
* pre-start events are triggered and *completed* before the webserver started.
|
|
197
|
+
* (the promise is awaited)
|
|
198
|
+
*/
|
|
199
|
+
registerPreStart(preStartFn: PreStart): void;
|
|
200
|
+
/**
|
|
201
|
+
* bind to ui server start event.
|
|
202
|
+
*/
|
|
203
|
+
registerOnStart(onStartFn: OnStart): this;
|
|
204
|
+
/**
|
|
205
|
+
* overwrite the build ui function
|
|
206
|
+
*/
|
|
207
|
+
registerBuildUIOverwrite(fn: BuildMethodOverwrite): this;
|
|
208
|
+
/**
|
|
209
|
+
* overwrite the build ui function
|
|
210
|
+
*/
|
|
211
|
+
registerPublicDirOverwrite(fn: PublicDirOverwrite): this;
|
|
212
|
+
private getOverwriteBuildFn;
|
|
213
|
+
private getOverwritePublic;
|
|
214
|
+
invokePreStart(preStartOpts: PreStartOpts): Promise<void>;
|
|
215
|
+
invokeOnStart(): Promise<ComponentType[]>;
|
|
216
|
+
/**
|
|
217
|
+
* register a UI slot.
|
|
218
|
+
*/
|
|
219
|
+
registerUiRoot(uiRoot: UIRoot): void;
|
|
220
|
+
/**
|
|
221
|
+
* get a UI runtime instance.
|
|
222
|
+
*/
|
|
223
|
+
getUi(uiRootAspectIdOrName?: string): [string, UIRoot] | undefined;
|
|
224
|
+
isHostAvailable(): boolean;
|
|
225
|
+
getUiName(uiRootAspectIdOrName?: string): string | undefined;
|
|
226
|
+
private possibleUis;
|
|
227
|
+
createLink(aspectDefs: AspectDefinition[], rootExtensionName: string): Promise<string>;
|
|
228
|
+
/**
|
|
229
|
+
* generate the root file of the UI runtime.
|
|
230
|
+
*/
|
|
231
|
+
generateRoot(aspectDefs: AspectDefinition[], rootExtensionName: string, runtimeName?: string, rootAspect?: string, config?: object, path?: string, ignoreVersion?: boolean, addRuntimes?: boolean, harmonyPackage?: string, shouldRun?: boolean): Promise<string>;
|
|
232
|
+
private selectPort;
|
|
233
|
+
private buildUI;
|
|
234
|
+
private shouldServeBundleUi;
|
|
235
|
+
buildIfChanged(uiRootAspectId: string, uiRoot: UIRoot, force: boolean | undefined): Promise<boolean>;
|
|
236
|
+
private createBuildUiHash;
|
|
237
|
+
/**
|
|
238
|
+
* Generate hash for a given root
|
|
239
|
+
* This API is public and used by external users, do not rename this function
|
|
240
|
+
*/
|
|
241
|
+
buildUiHash(uiRoot: UIRoot, runtime?: string): Promise<string>;
|
|
242
|
+
createBundleUiHash(uiRoot: UIRoot, runtime?: string): Promise<string>;
|
|
243
|
+
private readBundleUiHash;
|
|
244
|
+
private getBundleUiPath;
|
|
245
|
+
private buildIfNoBundle;
|
|
246
|
+
clearConsole(): void;
|
|
247
|
+
get publicUrl(): string | undefined;
|
|
248
|
+
static defaultConfig: UIConfig;
|
|
249
|
+
static runtime: import("@teambit/harmony").RuntimeDefinition;
|
|
250
|
+
static dependencies: import("@teambit/harmony").Aspect[];
|
|
251
|
+
static slots: (((registerFn: () => string) => SlotRegistry<UIRoot>) | ((registerFn: () => string) => SlotRegistry<PreStart>) | ((registerFn: () => string) => SlotRegistry<OnStart>) | ((registerFn: () => string) => SlotRegistry<PublicDirOverwriteSlot>) | ((registerFn: () => string) => SlotRegistry<BuildMethodOverwriteSlot>) | ((registerFn: () => string) => SlotRegistry<StartPlugin>))[];
|
|
252
|
+
static provider([pubsub, cli, graphql, express, componentExtension, cache, loggerMain]: UIDeps, config: any, [uiRootSlot, preStartSlot, onStartSlot, publicDirOverwriteSlot, buildMethodOverwriteSlot, proxyGetterSlot]: [
|
|
253
|
+
UIRootRegistry,
|
|
254
|
+
PreStartSlot,
|
|
255
|
+
OnStartSlot,
|
|
256
|
+
PublicDirOverwriteSlot,
|
|
257
|
+
BuildMethodOverwriteSlot,
|
|
258
|
+
StartPluginSlot
|
|
259
|
+
], harmony: Harmony): Promise<UiMain>;
|
|
260
|
+
}
|
|
File without changes
|