@teambit/bundler 0.0.553 → 0.0.557
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/dist/bundler.d.ts +6 -0
- package/dist/bundler.main.runtime.d.ts +50 -1
- package/dist/component-server.d.ts +35 -1
- package/dist/dev-server-context.d.ts +21 -0
- package/dist/dev-server.d.ts +24 -0
- package/dist/dev-server.service.d.ts +30 -1
- package/dist/get-entry.d.ts +3 -0
- package/dist/select-port.d.ts +3 -0
- package/package.json +19 -11
- package/tsconfig.json +1 -2
- package/browser-runtime.ts +0 -5
- package/bundle.ts +0 -3
- package/bundler.aspect.ts +0 -5
- package/bundler.main.runtime.ts +0 -138
- package/bundler.ts +0 -26
- package/component-server.ts +0 -93
- package/dedup-envs.ts +0 -26
- package/dev-server-context.ts +0 -48
- package/dev-server.graphql.ts +0 -34
- package/dev-server.service.tsx +0 -150
- package/dev-server.ts +0 -41
- package/events/components-server-started-event.ts +0 -20
- package/events/index.ts +0 -1
- package/exceptions/bind-error.ts +0 -1
- package/exceptions/index.ts +0 -1
- package/get-entry.ts +0 -31
- package/index.ts +0 -8
- package/package-tar/teambit-bundler-0.0.553.tgz +0 -0
- package/select-port.ts +0 -8
- package/types/asset.d.ts +0 -29
- package/types/style.d.ts +0 -42
package/dist/bundler.d.ts
CHANGED
|
@@ -6,7 +6,13 @@ export declare type BundlerResult = {
|
|
|
6
6
|
errors: Error[];
|
|
7
7
|
warnings: string[];
|
|
8
8
|
components: Component[];
|
|
9
|
+
/**
|
|
10
|
+
* timestamp in milliseconds when the task started
|
|
11
|
+
*/
|
|
9
12
|
startTime?: number;
|
|
13
|
+
/**
|
|
14
|
+
* timestamp in milliseconds when the task ended
|
|
15
|
+
*/
|
|
10
16
|
endTime?: number;
|
|
11
17
|
};
|
|
12
18
|
export interface Bundler {
|
|
@@ -11,17 +11,66 @@ export declare type BrowserRuntimeSlot = SlotRegistry<BrowserRuntime>;
|
|
|
11
11
|
export declare type BundlerConfig = {
|
|
12
12
|
dedicatedEnvDevServers: string[];
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* bundler extension.
|
|
16
|
+
*/
|
|
14
17
|
export declare class BundlerMain {
|
|
15
18
|
readonly config: BundlerConfig;
|
|
19
|
+
/**
|
|
20
|
+
* Pubsub extension.
|
|
21
|
+
*/
|
|
16
22
|
private pubsub;
|
|
23
|
+
/**
|
|
24
|
+
* environments extension.
|
|
25
|
+
*/
|
|
17
26
|
private envs;
|
|
27
|
+
/**
|
|
28
|
+
* dev server service.
|
|
29
|
+
*/
|
|
18
30
|
private devService;
|
|
31
|
+
/**
|
|
32
|
+
* browser runtime slot.
|
|
33
|
+
*/
|
|
19
34
|
private runtimeSlot;
|
|
20
|
-
constructor(config: BundlerConfig,
|
|
35
|
+
constructor(config: BundlerConfig,
|
|
36
|
+
/**
|
|
37
|
+
* Pubsub extension.
|
|
38
|
+
*/
|
|
39
|
+
pubsub: PubsubMain,
|
|
40
|
+
/**
|
|
41
|
+
* environments extension.
|
|
42
|
+
*/
|
|
43
|
+
envs: EnvsMain,
|
|
44
|
+
/**
|
|
45
|
+
* dev server service.
|
|
46
|
+
*/
|
|
47
|
+
devService: DevServerService,
|
|
48
|
+
/**
|
|
49
|
+
* browser runtime slot.
|
|
50
|
+
*/
|
|
51
|
+
runtimeSlot: BrowserRuntimeSlot);
|
|
52
|
+
/**
|
|
53
|
+
* load all given components in corresponding dev servers.
|
|
54
|
+
* @param components defaults to all components in the workspace.
|
|
55
|
+
*/
|
|
21
56
|
devServer(components: Component[]): Promise<ComponentServer[]>;
|
|
57
|
+
/**
|
|
58
|
+
* get a dev server instance containing a component.
|
|
59
|
+
* @param component
|
|
60
|
+
*/
|
|
22
61
|
getComponentServer(component: Component): undefined | ComponentServer;
|
|
62
|
+
/**
|
|
63
|
+
* compute entry files for bundling components in a given execution context.
|
|
64
|
+
*/
|
|
23
65
|
computeEntries(context: BundlerContext): Promise<string[]>;
|
|
66
|
+
/**
|
|
67
|
+
* register a new browser runtime environment.
|
|
68
|
+
* @param browserRuntime
|
|
69
|
+
*/
|
|
24
70
|
registerTarget(browserRuntime: BrowserRuntime[]): this;
|
|
71
|
+
/**
|
|
72
|
+
* component servers.
|
|
73
|
+
*/
|
|
25
74
|
private _componentServers;
|
|
26
75
|
private indexByComponent;
|
|
27
76
|
static slots: ((registerFn: () => string) => SlotRegistry<BrowserRuntime>)[];
|
|
@@ -3,13 +3,44 @@ import { ExecutionContext } from '@teambit/envs';
|
|
|
3
3
|
import { PubsubMain } from '@teambit/pubsub';
|
|
4
4
|
import { DevServer } from './dev-server';
|
|
5
5
|
export declare class ComponentServer {
|
|
6
|
+
/**
|
|
7
|
+
* browser runtime slot
|
|
8
|
+
*/
|
|
6
9
|
private pubsub;
|
|
10
|
+
/**
|
|
11
|
+
* components contained in the existing component server.
|
|
12
|
+
*/
|
|
7
13
|
readonly context: ExecutionContext;
|
|
14
|
+
/**
|
|
15
|
+
* port range of the component server.
|
|
16
|
+
*/
|
|
8
17
|
readonly portRange: number[];
|
|
18
|
+
/**
|
|
19
|
+
* env dev server.
|
|
20
|
+
*/
|
|
9
21
|
readonly devServer: DevServer;
|
|
10
22
|
errors?: Error[];
|
|
11
|
-
constructor(
|
|
23
|
+
constructor(
|
|
24
|
+
/**
|
|
25
|
+
* browser runtime slot
|
|
26
|
+
*/
|
|
27
|
+
pubsub: PubsubMain,
|
|
28
|
+
/**
|
|
29
|
+
* components contained in the existing component server.
|
|
30
|
+
*/
|
|
31
|
+
context: ExecutionContext,
|
|
32
|
+
/**
|
|
33
|
+
* port range of the component server.
|
|
34
|
+
*/
|
|
35
|
+
portRange: number[],
|
|
36
|
+
/**
|
|
37
|
+
* env dev server.
|
|
38
|
+
*/
|
|
39
|
+
devServer: DevServer);
|
|
12
40
|
hostname: string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* determine whether component server contains a component.
|
|
43
|
+
*/
|
|
13
44
|
hasComponent(component: Component): Component | undefined;
|
|
14
45
|
get port(): number;
|
|
15
46
|
_port: number;
|
|
@@ -17,5 +48,8 @@ export declare class ComponentServer {
|
|
|
17
48
|
private getHostname;
|
|
18
49
|
private onChange;
|
|
19
50
|
private createComponentsServerStartedEvent;
|
|
51
|
+
/**
|
|
52
|
+
* get the url of the component server.
|
|
53
|
+
*/
|
|
20
54
|
get url(): string;
|
|
21
55
|
}
|
|
@@ -2,8 +2,17 @@ import { Component } from '@teambit/component';
|
|
|
2
2
|
import { BuildContext } from '@teambit/builder';
|
|
3
3
|
import { ExecutionContext } from '@teambit/envs';
|
|
4
4
|
export declare type Target = {
|
|
5
|
+
/**
|
|
6
|
+
* entries of the target.
|
|
7
|
+
*/
|
|
5
8
|
entries: string[];
|
|
9
|
+
/**
|
|
10
|
+
* array of components included in the target.
|
|
11
|
+
*/
|
|
6
12
|
components: Component[];
|
|
13
|
+
/**
|
|
14
|
+
* output path of the target
|
|
15
|
+
*/
|
|
7
16
|
outputPath: string;
|
|
8
17
|
};
|
|
9
18
|
export interface BundlerContext extends BuildContext {
|
|
@@ -12,8 +21,20 @@ export interface BundlerContext extends BuildContext {
|
|
|
12
21
|
rootPath?: string;
|
|
13
22
|
}
|
|
14
23
|
export interface DevServerContext extends ExecutionContext {
|
|
24
|
+
/**
|
|
25
|
+
* array of files to include.
|
|
26
|
+
*/
|
|
15
27
|
entry: string[];
|
|
28
|
+
/**
|
|
29
|
+
* public path.
|
|
30
|
+
*/
|
|
16
31
|
publicPath: string;
|
|
32
|
+
/**
|
|
33
|
+
* root path of the workspace.
|
|
34
|
+
*/
|
|
17
35
|
rootPath: string;
|
|
36
|
+
/**
|
|
37
|
+
* title of the page.
|
|
38
|
+
*/
|
|
18
39
|
title?: string;
|
|
19
40
|
}
|
package/dist/dev-server.d.ts
CHANGED
|
@@ -1,11 +1,35 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Server } from 'http';
|
|
3
|
+
/**
|
|
4
|
+
* interface for implementing dev servers.
|
|
5
|
+
*/
|
|
3
6
|
export interface DevServer {
|
|
7
|
+
/**
|
|
8
|
+
* attach to given port and start an http server
|
|
9
|
+
*/
|
|
4
10
|
listen(port: number): Server | Promise<Server>;
|
|
11
|
+
/**
|
|
12
|
+
* display name of the tester.
|
|
13
|
+
*/
|
|
5
14
|
displayName?: string;
|
|
15
|
+
/**
|
|
16
|
+
* icon of the tester.
|
|
17
|
+
*/
|
|
6
18
|
icon?: string;
|
|
19
|
+
/**
|
|
20
|
+
* serialized config of the tester.
|
|
21
|
+
*/
|
|
7
22
|
displayConfig?(): string;
|
|
23
|
+
/**
|
|
24
|
+
* path to the config in the filesystem.
|
|
25
|
+
*/
|
|
8
26
|
configPath?: string;
|
|
27
|
+
/**
|
|
28
|
+
* id of the tester.
|
|
29
|
+
*/
|
|
9
30
|
id: string;
|
|
31
|
+
/**
|
|
32
|
+
* return the tester version.
|
|
33
|
+
*/
|
|
10
34
|
version?(): string;
|
|
11
35
|
}
|
|
@@ -6,21 +6,50 @@ export declare type DevServerServiceOptions = {
|
|
|
6
6
|
dedicatedEnvDevServers?: string[];
|
|
7
7
|
};
|
|
8
8
|
export declare type DevServerDescriptor = {
|
|
9
|
+
/**
|
|
10
|
+
* id of the dev server (e.g. jest/mocha)
|
|
11
|
+
*/
|
|
9
12
|
id: string;
|
|
13
|
+
/**
|
|
14
|
+
* display name of the dev server (e.g. Jest / Mocha)
|
|
15
|
+
*/
|
|
10
16
|
displayName: string;
|
|
17
|
+
/**
|
|
18
|
+
* icon of the configured dev server.
|
|
19
|
+
*/
|
|
11
20
|
icon: string;
|
|
21
|
+
/**
|
|
22
|
+
* string containing the config for display.
|
|
23
|
+
*/
|
|
12
24
|
config: string;
|
|
13
25
|
version?: string;
|
|
14
26
|
};
|
|
15
27
|
export declare class DevServerService implements EnvService<ComponentServer, DevServerDescriptor> {
|
|
28
|
+
/**
|
|
29
|
+
* browser runtime slot
|
|
30
|
+
*/
|
|
16
31
|
private pubsub;
|
|
32
|
+
/**
|
|
33
|
+
* browser runtime slot
|
|
34
|
+
*/
|
|
17
35
|
private runtimeSlot;
|
|
18
36
|
name: string;
|
|
19
|
-
constructor(
|
|
37
|
+
constructor(
|
|
38
|
+
/**
|
|
39
|
+
* browser runtime slot
|
|
40
|
+
*/
|
|
41
|
+
pubsub: PubsubMain,
|
|
42
|
+
/**
|
|
43
|
+
* browser runtime slot
|
|
44
|
+
*/
|
|
45
|
+
runtimeSlot: BrowserRuntimeSlot);
|
|
20
46
|
render(env: EnvDefinition, context: ExecutionContext[]): Promise<JSX.Element>;
|
|
21
47
|
getDescriptor(environment: EnvDefinition, context?: ExecutionContext[]): Promise<DevServerDescriptor | undefined>;
|
|
22
48
|
runOnce(contexts: ExecutionContext[], { dedicatedEnvDevServers }: DevServerServiceOptions): Promise<ComponentServer[]>;
|
|
23
49
|
mergeContext(): void;
|
|
24
50
|
private getComponentsFromContexts;
|
|
51
|
+
/**
|
|
52
|
+
* builds the execution context for the dev server.
|
|
53
|
+
*/
|
|
25
54
|
private buildContext;
|
|
26
55
|
}
|
package/dist/get-entry.d.ts
CHANGED
package/dist/select-port.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/bundler",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.557",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/compilation/bundler",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.compilation",
|
|
8
8
|
"name": "bundler",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.557"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@teambit/harmony": "0.2.11",
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"lodash": "4.17.21",
|
|
16
16
|
"@babel/runtime": "7.12.18",
|
|
17
17
|
"core-js": "^3.0.0",
|
|
18
|
-
"@teambit/envs": "0.0.
|
|
19
|
-
"@teambit/cli": "0.0.
|
|
20
|
-
"@teambit/component": "0.0.
|
|
21
|
-
"@teambit/graphql": "0.0.
|
|
22
|
-
"@teambit/pubsub": "0.0.
|
|
23
|
-
"@teambit/builder": "0.0.
|
|
24
|
-
"@teambit/toolbox.network.get-port": "0.0.
|
|
18
|
+
"@teambit/envs": "0.0.557",
|
|
19
|
+
"@teambit/cli": "0.0.388",
|
|
20
|
+
"@teambit/component": "0.0.557",
|
|
21
|
+
"@teambit/graphql": "0.0.557",
|
|
22
|
+
"@teambit/pubsub": "0.0.557",
|
|
23
|
+
"@teambit/builder": "0.0.557",
|
|
24
|
+
"@teambit/toolbox.network.get-port": "0.0.92"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/lodash": "4.14.165",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@apollo/client": "^3.0.0",
|
|
37
|
-
"@teambit/legacy": "1.0.
|
|
37
|
+
"@teambit/legacy": "1.0.174",
|
|
38
38
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
39
39
|
"react": "^16.8.0 || ^17.0.0"
|
|
40
40
|
},
|
|
@@ -62,12 +62,20 @@
|
|
|
62
62
|
"react": "-"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@teambit/legacy": "1.0.
|
|
65
|
+
"@teambit/legacy": "1.0.174",
|
|
66
66
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
67
67
|
"react": "^16.8.0 || ^17.0.0"
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
+
"files": [
|
|
72
|
+
"dist",
|
|
73
|
+
"!dist/tsconfig.tsbuildinfo",
|
|
74
|
+
"README.md",
|
|
75
|
+
"README.mdx",
|
|
76
|
+
"*.js",
|
|
77
|
+
"*.json"
|
|
78
|
+
],
|
|
71
79
|
"private": false,
|
|
72
80
|
"engines": {
|
|
73
81
|
"node": ">=12.22.0"
|
package/tsconfig.json
CHANGED
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"skipLibCheck": true,
|
|
16
16
|
"moduleResolution": "node",
|
|
17
17
|
"esModuleInterop": true,
|
|
18
|
-
"outDir": "dist",
|
|
19
18
|
"composite": true,
|
|
20
19
|
"emitDeclarationOnly": true,
|
|
20
|
+
"outDir": "dist",
|
|
21
21
|
"experimentalDecorators": true,
|
|
22
22
|
"emitDecoratorMetadata": true,
|
|
23
23
|
"allowSyntheticDefaultImports": true,
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
"strict": true,
|
|
26
26
|
"noImplicitAny": false,
|
|
27
27
|
"rootDir": ".",
|
|
28
|
-
"removeComments": true,
|
|
29
28
|
"preserveConstEnums": true,
|
|
30
29
|
"resolveJsonModule": true
|
|
31
30
|
},
|
package/browser-runtime.ts
DELETED
package/bundle.ts
DELETED
package/bundler.aspect.ts
DELETED
package/bundler.main.runtime.ts
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import PubsubAspect, { PubsubMain } from '@teambit/pubsub';
|
|
2
|
-
import { MainRuntime } from '@teambit/cli';
|
|
3
|
-
import { Component, ComponentAspect } from '@teambit/component';
|
|
4
|
-
import { EnvsAspect, EnvsMain } from '@teambit/envs';
|
|
5
|
-
import { GraphqlAspect, GraphqlMain } from '@teambit/graphql';
|
|
6
|
-
import { Slot, SlotRegistry } from '@teambit/harmony';
|
|
7
|
-
import { BrowserRuntime } from './browser-runtime';
|
|
8
|
-
import { BundlerAspect } from './bundler.aspect';
|
|
9
|
-
import { ComponentServer } from './component-server';
|
|
10
|
-
import { BundlerContext } from './dev-server-context';
|
|
11
|
-
import { devServerSchema } from './dev-server.graphql';
|
|
12
|
-
import { DevServerService } from './dev-server.service';
|
|
13
|
-
|
|
14
|
-
export type BrowserRuntimeSlot = SlotRegistry<BrowserRuntime>;
|
|
15
|
-
|
|
16
|
-
export type BundlerConfig = {
|
|
17
|
-
dedicatedEnvDevServers: string[];
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* bundler extension.
|
|
22
|
-
*/
|
|
23
|
-
export class BundlerMain {
|
|
24
|
-
constructor(
|
|
25
|
-
readonly config: BundlerConfig,
|
|
26
|
-
/**
|
|
27
|
-
* Pubsub extension.
|
|
28
|
-
*/
|
|
29
|
-
private pubsub: PubsubMain,
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* environments extension.
|
|
33
|
-
*/
|
|
34
|
-
private envs: EnvsMain,
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* dev server service.
|
|
38
|
-
*/
|
|
39
|
-
private devService: DevServerService,
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* browser runtime slot.
|
|
43
|
-
*/
|
|
44
|
-
private runtimeSlot: BrowserRuntimeSlot
|
|
45
|
-
) {}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* load all given components in corresponding dev servers.
|
|
49
|
-
* @param components defaults to all components in the workspace.
|
|
50
|
-
*/
|
|
51
|
-
async devServer(components: Component[]): Promise<ComponentServer[]> {
|
|
52
|
-
const envRuntime = await this.envs.createEnvironment(components);
|
|
53
|
-
// TODO: this must be refactored away from here. this logic should be in the Preview.
|
|
54
|
-
const servers: ComponentServer[] = await envRuntime.runOnce<ComponentServer[]>(this.devService, {
|
|
55
|
-
dedicatedEnvDevServers: this.config.dedicatedEnvDevServers,
|
|
56
|
-
});
|
|
57
|
-
this._componentServers = servers;
|
|
58
|
-
|
|
59
|
-
this.indexByComponent();
|
|
60
|
-
|
|
61
|
-
return this._componentServers;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* get a dev server instance containing a component.
|
|
66
|
-
* @param component
|
|
67
|
-
*/
|
|
68
|
-
getComponentServer(component: Component): undefined | ComponentServer {
|
|
69
|
-
if (!this._componentServers) return undefined;
|
|
70
|
-
const envId = this.envs.getEnvId(component);
|
|
71
|
-
const server = this._componentServers.find(
|
|
72
|
-
(componentServer) =>
|
|
73
|
-
componentServer.context.relatedContexts.includes(envId) || componentServer.context.id === envId
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
return server;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* compute entry files for bundling components in a given execution context.
|
|
81
|
-
*/
|
|
82
|
-
async computeEntries(context: BundlerContext) {
|
|
83
|
-
const slotEntries = await Promise.all(
|
|
84
|
-
this.runtimeSlot.values().map(async (browserRuntime) => browserRuntime.entry(context))
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
const slotPaths = slotEntries.reduce((acc, current) => {
|
|
88
|
-
acc = acc.concat(current);
|
|
89
|
-
return acc;
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
return slotPaths;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* register a new browser runtime environment.
|
|
97
|
-
* @param browserRuntime
|
|
98
|
-
*/
|
|
99
|
-
registerTarget(browserRuntime: BrowserRuntime[]) {
|
|
100
|
-
browserRuntime.map((runtime) => {
|
|
101
|
-
return this.runtimeSlot.register(runtime);
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
return this;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* component servers.
|
|
109
|
-
*/
|
|
110
|
-
private _componentServers: null | ComponentServer[];
|
|
111
|
-
|
|
112
|
-
private indexByComponent() {}
|
|
113
|
-
|
|
114
|
-
static slots = [Slot.withType<BrowserRuntime>()];
|
|
115
|
-
|
|
116
|
-
static runtime = MainRuntime;
|
|
117
|
-
static dependencies = [PubsubAspect, EnvsAspect, GraphqlAspect, ComponentAspect];
|
|
118
|
-
|
|
119
|
-
static defaultConfig = {
|
|
120
|
-
dedicatedEnvDevServers: [],
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
static async provider(
|
|
124
|
-
[pubsub, envs, graphql]: [PubsubMain, EnvsMain, GraphqlMain],
|
|
125
|
-
config,
|
|
126
|
-
[runtimeSlot]: [BrowserRuntimeSlot]
|
|
127
|
-
) {
|
|
128
|
-
const devServerService = new DevServerService(pubsub, runtimeSlot);
|
|
129
|
-
const bundler = new BundlerMain(config, pubsub, envs, devServerService, runtimeSlot);
|
|
130
|
-
envs.registerService(devServerService);
|
|
131
|
-
|
|
132
|
-
graphql.register(devServerSchema(bundler));
|
|
133
|
-
|
|
134
|
-
return bundler;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
BundlerAspect.addRuntime(BundlerMain);
|
package/bundler.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Component } from '@teambit/component';
|
|
2
|
-
|
|
3
|
-
export interface DevServer {
|
|
4
|
-
start(): void;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export type BundlerResult = {
|
|
8
|
-
errors: Error[];
|
|
9
|
-
warnings: string[];
|
|
10
|
-
components: Component[];
|
|
11
|
-
/**
|
|
12
|
-
* timestamp in milliseconds when the task started
|
|
13
|
-
*/
|
|
14
|
-
startTime?: number;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* timestamp in milliseconds when the task ended
|
|
18
|
-
*/
|
|
19
|
-
endTime?: number;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export interface Bundler {
|
|
23
|
-
run(): Promise<BundlerResult[]>;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export type BundlerMode = 'dev' | 'prod';
|
package/component-server.ts
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { Component } from '@teambit/component';
|
|
2
|
-
import { ExecutionContext } from '@teambit/envs';
|
|
3
|
-
import { PubsubMain } from '@teambit/pubsub';
|
|
4
|
-
|
|
5
|
-
import { AddressInfo } from 'net';
|
|
6
|
-
|
|
7
|
-
import { DevServer } from './dev-server';
|
|
8
|
-
import { BindError } from './exceptions';
|
|
9
|
-
import { ComponentsServerStartedEvent } from './events';
|
|
10
|
-
import { BundlerAspect } from './bundler.aspect';
|
|
11
|
-
import { selectPort } from './select-port';
|
|
12
|
-
|
|
13
|
-
export class ComponentServer {
|
|
14
|
-
// why is this here
|
|
15
|
-
errors?: Error[];
|
|
16
|
-
constructor(
|
|
17
|
-
/**
|
|
18
|
-
* browser runtime slot
|
|
19
|
-
*/
|
|
20
|
-
private pubsub: PubsubMain,
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* components contained in the existing component server.
|
|
24
|
-
*/
|
|
25
|
-
readonly context: ExecutionContext,
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* port range of the component server.
|
|
29
|
-
*/
|
|
30
|
-
readonly portRange: number[],
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* env dev server.
|
|
34
|
-
*/
|
|
35
|
-
readonly devServer: DevServer
|
|
36
|
-
) {}
|
|
37
|
-
|
|
38
|
-
hostname: string | undefined;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* determine whether component server contains a component.
|
|
42
|
-
*/
|
|
43
|
-
hasComponent(component: Component) {
|
|
44
|
-
return this.context.components.find((contextComponent) => contextComponent.equals(component));
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
get port() {
|
|
48
|
-
return this._port;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
_port: number;
|
|
52
|
-
async listen() {
|
|
53
|
-
const port = await selectPort(this.portRange);
|
|
54
|
-
this._port = port;
|
|
55
|
-
const server = await this.devServer.listen(port);
|
|
56
|
-
const address = server.address();
|
|
57
|
-
const hostname = this.getHostname(address);
|
|
58
|
-
if (!address) throw new BindError();
|
|
59
|
-
this.hostname = hostname;
|
|
60
|
-
|
|
61
|
-
this.pubsub.pub(BundlerAspect.id, this.createComponentsServerStartedEvent(server, this.context, hostname, port));
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
private getHostname(address: string | AddressInfo | null) {
|
|
65
|
-
if (address === null) throw new BindError();
|
|
66
|
-
if (typeof address === 'string') return address;
|
|
67
|
-
|
|
68
|
-
let hostname = address.address;
|
|
69
|
-
if (hostname === '::') {
|
|
70
|
-
hostname = 'localhost';
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return hostname;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
private onChange() {}
|
|
77
|
-
|
|
78
|
-
private createComponentsServerStartedEvent: (
|
|
79
|
-
DevServer,
|
|
80
|
-
ExecutionContext,
|
|
81
|
-
string,
|
|
82
|
-
number
|
|
83
|
-
) => ComponentsServerStartedEvent = (componentsServer, context, hostname, port) => {
|
|
84
|
-
return new ComponentsServerStartedEvent(Date.now(), componentsServer, context, hostname, port);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* get the url of the component server.
|
|
89
|
-
*/
|
|
90
|
-
get url() {
|
|
91
|
-
return `/preview/${this.context.envRuntime.id}`;
|
|
92
|
-
}
|
|
93
|
-
}
|
package/dedup-envs.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ExecutionContext } from '@teambit/envs';
|
|
2
|
-
|
|
3
|
-
// de-duping dev servers by the amount of type the dev server configuration was overridden by envs.
|
|
4
|
-
export function dedupEnvs(contexts: ExecutionContext[], dedicatedEnvDevServers?: string[]) {
|
|
5
|
-
const groupedEnvs: Record<string, ExecutionContext[]> = {};
|
|
6
|
-
|
|
7
|
-
contexts.forEach((context) => {
|
|
8
|
-
const envId = getEnvId(context, dedicatedEnvDevServers);
|
|
9
|
-
if (!envId) return;
|
|
10
|
-
if (!(envId in groupedEnvs)) groupedEnvs[envId] = [];
|
|
11
|
-
|
|
12
|
-
groupedEnvs[envId].push(context);
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
return groupedEnvs;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function getEnvId(context: ExecutionContext, dedicatedServers?: string[]): string | undefined {
|
|
19
|
-
const id = context.id.split('@')[0];
|
|
20
|
-
|
|
21
|
-
if (dedicatedServers?.includes(id)) {
|
|
22
|
-
return context.id;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return context.env?.getDevEnvId(context);
|
|
26
|
-
}
|
package/dev-server-context.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Component } from '@teambit/component';
|
|
2
|
-
import { BuildContext } from '@teambit/builder';
|
|
3
|
-
import { ExecutionContext } from '@teambit/envs';
|
|
4
|
-
|
|
5
|
-
export type Target = {
|
|
6
|
-
/**
|
|
7
|
-
* entries of the target.
|
|
8
|
-
*/
|
|
9
|
-
entries: string[];
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* array of components included in the target.
|
|
13
|
-
*/
|
|
14
|
-
components: Component[];
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* output path of the target
|
|
18
|
-
*/
|
|
19
|
-
outputPath: string;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export interface BundlerContext extends BuildContext {
|
|
23
|
-
targets: Target[];
|
|
24
|
-
publicPath?: string;
|
|
25
|
-
rootPath?: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface DevServerContext extends ExecutionContext {
|
|
29
|
-
/**
|
|
30
|
-
* array of files to include.
|
|
31
|
-
*/
|
|
32
|
-
entry: string[];
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* public path.
|
|
36
|
-
*/
|
|
37
|
-
publicPath: string;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* root path of the workspace.
|
|
41
|
-
*/
|
|
42
|
-
rootPath: string;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* title of the page.
|
|
46
|
-
*/
|
|
47
|
-
title?: string;
|
|
48
|
-
}
|
package/dev-server.graphql.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Component } from '@teambit/component';
|
|
2
|
-
import { Schema } from '@teambit/graphql';
|
|
3
|
-
import { gql } from '@apollo/client';
|
|
4
|
-
|
|
5
|
-
import { BundlerMain } from './bundler.main.runtime';
|
|
6
|
-
|
|
7
|
-
// TODO: this has to be refactored to the Preview aspect. with the entire preview logic here.
|
|
8
|
-
export function devServerSchema(bundler: BundlerMain): Schema {
|
|
9
|
-
return {
|
|
10
|
-
typeDefs: gql`
|
|
11
|
-
extend type Component {
|
|
12
|
-
server: ComponentServer
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
type ComponentServer {
|
|
16
|
-
env: String
|
|
17
|
-
url: String
|
|
18
|
-
}
|
|
19
|
-
`,
|
|
20
|
-
resolvers: {
|
|
21
|
-
Component: {
|
|
22
|
-
server: (component: Component) => {
|
|
23
|
-
const componentServer = bundler.getComponentServer(component);
|
|
24
|
-
if (!componentServer) return {};
|
|
25
|
-
|
|
26
|
-
return {
|
|
27
|
-
env: componentServer.context.envRuntime.id,
|
|
28
|
-
url: componentServer.url,
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
}
|
package/dev-server.service.tsx
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { EnvService, ExecutionContext, EnvDefinition } from '@teambit/envs';
|
|
2
|
-
import { PubsubMain } from '@teambit/pubsub';
|
|
3
|
-
import { flatten } from 'lodash';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { Text, Newline } from 'ink';
|
|
6
|
-
import highlight from 'cli-highlight';
|
|
7
|
-
import { BrowserRuntimeSlot } from './bundler.main.runtime';
|
|
8
|
-
import { ComponentServer } from './component-server';
|
|
9
|
-
import { dedupEnvs } from './dedup-envs';
|
|
10
|
-
import { DevServer } from './dev-server';
|
|
11
|
-
import { DevServerContext } from './dev-server-context';
|
|
12
|
-
import { getEntry } from './get-entry';
|
|
13
|
-
|
|
14
|
-
export type DevServerServiceOptions = { dedicatedEnvDevServers?: string[] };
|
|
15
|
-
|
|
16
|
-
export type DevServerDescriptor = {
|
|
17
|
-
/**
|
|
18
|
-
* id of the dev server (e.g. jest/mocha)
|
|
19
|
-
*/
|
|
20
|
-
id: string;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* display name of the dev server (e.g. Jest / Mocha)
|
|
24
|
-
*/
|
|
25
|
-
displayName: string;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* icon of the configured dev server.
|
|
29
|
-
*/
|
|
30
|
-
icon: string;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* string containing the config for display.
|
|
34
|
-
*/
|
|
35
|
-
config: string;
|
|
36
|
-
|
|
37
|
-
version?: string;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export class DevServerService implements EnvService<ComponentServer, DevServerDescriptor> {
|
|
41
|
-
name = 'dev server';
|
|
42
|
-
|
|
43
|
-
constructor(
|
|
44
|
-
/**
|
|
45
|
-
* browser runtime slot
|
|
46
|
-
*/
|
|
47
|
-
private pubsub: PubsubMain,
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* browser runtime slot
|
|
51
|
-
*/
|
|
52
|
-
private runtimeSlot: BrowserRuntimeSlot
|
|
53
|
-
) {}
|
|
54
|
-
|
|
55
|
-
async render(env: EnvDefinition, context: ExecutionContext[]) {
|
|
56
|
-
const descriptor = await this.getDescriptor(env, context);
|
|
57
|
-
return (
|
|
58
|
-
<Text key={descriptor?.id}>
|
|
59
|
-
<Text color="cyan">configured dev server: </Text>
|
|
60
|
-
<Text>
|
|
61
|
-
{descriptor?.id} ({descriptor?.displayName} @ {descriptor?.version})
|
|
62
|
-
</Text>
|
|
63
|
-
<Newline />
|
|
64
|
-
<Text underline color="cyan">
|
|
65
|
-
dev server config:
|
|
66
|
-
</Text>
|
|
67
|
-
<Newline />
|
|
68
|
-
<Text>
|
|
69
|
-
{/* refactor a separate component which highlights for cli */}
|
|
70
|
-
{highlight(descriptor?.config || '', { language: 'javascript', ignoreIllegals: true })}
|
|
71
|
-
</Text>
|
|
72
|
-
<Newline />
|
|
73
|
-
</Text>
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
async getDescriptor(
|
|
78
|
-
environment: EnvDefinition,
|
|
79
|
-
context?: ExecutionContext[]
|
|
80
|
-
): Promise<DevServerDescriptor | undefined> {
|
|
81
|
-
if (!environment.env.getDevServer || !context) return undefined;
|
|
82
|
-
const mergedContext = await this.buildContext(context[0], []);
|
|
83
|
-
const devServer: DevServer = environment.env.getDevServer(mergedContext);
|
|
84
|
-
|
|
85
|
-
return {
|
|
86
|
-
id: devServer.id || '',
|
|
87
|
-
displayName: devServer.displayName || '',
|
|
88
|
-
icon: devServer.icon || '',
|
|
89
|
-
config: devServer.displayConfig ? devServer.displayConfig() : '',
|
|
90
|
-
version: devServer.version ? devServer.version() : '?',
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// async run(context: ExecutionContext): Promise<ComponentServer[]> {
|
|
95
|
-
// const devServerContext = await this.buildContext(context);
|
|
96
|
-
// const devServer: DevServer = context.env.getDevServer(devServerContext);
|
|
97
|
-
// const port = await selectPort();
|
|
98
|
-
// // TODO: refactor to replace with a component server instance.
|
|
99
|
-
// return new ComponentServer(this.pubsub, context, port, devServer);
|
|
100
|
-
// }
|
|
101
|
-
|
|
102
|
-
async runOnce(
|
|
103
|
-
contexts: ExecutionContext[],
|
|
104
|
-
{ dedicatedEnvDevServers }: DevServerServiceOptions
|
|
105
|
-
): Promise<ComponentServer[]> {
|
|
106
|
-
const groupedEnvs = dedupEnvs(contexts, dedicatedEnvDevServers);
|
|
107
|
-
|
|
108
|
-
const servers = await Promise.all(
|
|
109
|
-
Object.entries(groupedEnvs).map(async ([id, contextList]) => {
|
|
110
|
-
const mainContext = contextList.find((context) => context.envDefinition.id === id) || contextList[0];
|
|
111
|
-
const additionalContexts = contextList.filter((context) => context.envDefinition.id !== id);
|
|
112
|
-
|
|
113
|
-
const devServerContext = await this.buildContext(mainContext, additionalContexts);
|
|
114
|
-
const devServer: DevServer = await devServerContext.envRuntime.env.getDevServer(devServerContext);
|
|
115
|
-
|
|
116
|
-
return new ComponentServer(this.pubsub, devServerContext, [3300, 3400], devServer);
|
|
117
|
-
})
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
return servers;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
mergeContext() {}
|
|
124
|
-
|
|
125
|
-
private getComponentsFromContexts(contexts: ExecutionContext[]) {
|
|
126
|
-
return flatten(
|
|
127
|
-
contexts.map((context) => {
|
|
128
|
-
return context.components;
|
|
129
|
-
})
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* builds the execution context for the dev server.
|
|
135
|
-
*/
|
|
136
|
-
private async buildContext(
|
|
137
|
-
context: ExecutionContext,
|
|
138
|
-
additionalContexts: ExecutionContext[] = []
|
|
139
|
-
): Promise<DevServerContext> {
|
|
140
|
-
context.relatedContexts = additionalContexts.map((ctx) => ctx.envDefinition.id);
|
|
141
|
-
context.components = context.components.concat(this.getComponentsFromContexts(additionalContexts));
|
|
142
|
-
|
|
143
|
-
return Object.assign(context, {
|
|
144
|
-
entry: await getEntry(context, this.runtimeSlot),
|
|
145
|
-
// don't start with a leading "/" because it generates errors on Windows
|
|
146
|
-
rootPath: `preview/${context.envRuntime.id}`,
|
|
147
|
-
publicPath: `/public`,
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
}
|
package/dev-server.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Server } from 'http';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* interface for implementing dev servers.
|
|
5
|
-
*/
|
|
6
|
-
export interface DevServer {
|
|
7
|
-
/**
|
|
8
|
-
* attach to given port and start an http server
|
|
9
|
-
*/
|
|
10
|
-
listen(port: number): Server | Promise<Server>;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* display name of the tester.
|
|
14
|
-
*/
|
|
15
|
-
displayName?: string;
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* icon of the tester.
|
|
19
|
-
*/
|
|
20
|
-
icon?: string;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* serialized config of the tester.
|
|
24
|
-
*/
|
|
25
|
-
displayConfig?(): string;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* path to the config in the filesystem.
|
|
29
|
-
*/
|
|
30
|
-
configPath?: string;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* id of the tester.
|
|
34
|
-
*/
|
|
35
|
-
id: string;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* return the tester version.
|
|
39
|
-
*/
|
|
40
|
-
version?(): string;
|
|
41
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-classes-per-file */
|
|
2
|
-
|
|
3
|
-
import { BitBaseEvent } from '@teambit/pubsub';
|
|
4
|
-
|
|
5
|
-
class ComponentsServerStartedEventData {
|
|
6
|
-
constructor(readonly componentsServer, readonly context, readonly hostname, readonly port) {}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export class ComponentsServerStartedEvent extends BitBaseEvent<ComponentsServerStartedEventData> {
|
|
10
|
-
static readonly TYPE = 'components-server-started';
|
|
11
|
-
|
|
12
|
-
constructor(readonly timestamp, readonly componentsServer, readonly context, readonly hostname, readonly port) {
|
|
13
|
-
super(
|
|
14
|
-
ComponentsServerStartedEvent.TYPE,
|
|
15
|
-
'0.0.1',
|
|
16
|
-
timestamp,
|
|
17
|
-
new ComponentsServerStartedEventData(componentsServer, context, hostname, port)
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
}
|
package/events/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components-server-started-event';
|
package/exceptions/bind-error.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export class BindError extends Error {}
|
package/exceptions/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { BindError } from './bind-error';
|
package/get-entry.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ComponentID } from '@teambit/component';
|
|
2
|
-
import { ExecutionContext } from '@teambit/envs';
|
|
3
|
-
import { GetBitMapComponentOptions } from '@teambit/legacy/dist/consumer/bit-map/bit-map';
|
|
4
|
-
import { PathOsBased } from '@teambit/legacy/dist/utils/path';
|
|
5
|
-
|
|
6
|
-
import { BrowserRuntimeSlot } from './bundler.main.runtime';
|
|
7
|
-
|
|
8
|
-
export type ComponentDir = {
|
|
9
|
-
componentDir?: (
|
|
10
|
-
componentId: ComponentID,
|
|
11
|
-
bitMapOptions?: GetBitMapComponentOptions,
|
|
12
|
-
options?: { relative: boolean }
|
|
13
|
-
) => PathOsBased | undefined;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* computes the bundler entry.
|
|
18
|
-
*/
|
|
19
|
-
export async function getEntry(context: ExecutionContext, runtimeSlot: BrowserRuntimeSlot): Promise<string[]> {
|
|
20
|
-
// TODO: refactor this away from here and use computePaths instead
|
|
21
|
-
const slotEntries = await Promise.all(
|
|
22
|
-
runtimeSlot.values().map(async (browserRuntime) => browserRuntime.entry(context))
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
const slotPaths = slotEntries.reduce((acc, current) => {
|
|
26
|
-
acc = acc.concat(current);
|
|
27
|
-
return acc;
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
return slotPaths;
|
|
31
|
-
}
|
package/index.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { DevServer } from './dev-server';
|
|
2
|
-
export { BundlerContext, Target, DevServerContext } from './dev-server-context';
|
|
3
|
-
export { Bundler, BundlerResult, BundlerMode } from './bundler';
|
|
4
|
-
export type { BundlerMain } from './bundler.main.runtime';
|
|
5
|
-
export { BundlerAspect } from './bundler.aspect';
|
|
6
|
-
export { ComponentDir } from './get-entry';
|
|
7
|
-
export { ComponentServer } from './component-server';
|
|
8
|
-
export * from './events';
|
|
Binary file
|
package/select-port.ts
DELETED
package/types/asset.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
declare module '*.png' {
|
|
2
|
-
const value: any;
|
|
3
|
-
export = value;
|
|
4
|
-
}
|
|
5
|
-
declare module '*.svg' {
|
|
6
|
-
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
|
-
|
|
8
|
-
export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
|
|
9
|
-
const src: string;
|
|
10
|
-
export default src;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// @TODO Gilad
|
|
14
|
-
declare module '*.jpg' {
|
|
15
|
-
const value: any;
|
|
16
|
-
export = value;
|
|
17
|
-
}
|
|
18
|
-
declare module '*.jpeg' {
|
|
19
|
-
const value: any;
|
|
20
|
-
export = value;
|
|
21
|
-
}
|
|
22
|
-
declare module '*.gif' {
|
|
23
|
-
const value: any;
|
|
24
|
-
export = value;
|
|
25
|
-
}
|
|
26
|
-
declare module '*.bmp' {
|
|
27
|
-
const value: any;
|
|
28
|
-
export = value;
|
|
29
|
-
}
|
package/types/style.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
declare module '*.module.css' {
|
|
2
|
-
const classes: { readonly [key: string]: string };
|
|
3
|
-
export default classes;
|
|
4
|
-
}
|
|
5
|
-
declare module '*.module.scss' {
|
|
6
|
-
const classes: { readonly [key: string]: string };
|
|
7
|
-
export default classes;
|
|
8
|
-
}
|
|
9
|
-
declare module '*.module.sass' {
|
|
10
|
-
const classes: { readonly [key: string]: string };
|
|
11
|
-
export default classes;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
declare module '*.module.less' {
|
|
15
|
-
const classes: { readonly [key: string]: string };
|
|
16
|
-
export default classes;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
declare module '*.less' {
|
|
20
|
-
const classes: { readonly [key: string]: string };
|
|
21
|
-
export default classes;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
declare module '*.css' {
|
|
25
|
-
const classes: { readonly [key: string]: string };
|
|
26
|
-
export default classes;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
declare module '*.sass' {
|
|
30
|
-
const classes: { readonly [key: string]: string };
|
|
31
|
-
export default classes;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
declare module '*.scss' {
|
|
35
|
-
const classes: { readonly [key: string]: string };
|
|
36
|
-
export default classes;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
declare module '*.mdx' {
|
|
40
|
-
const component: any;
|
|
41
|
-
export default component;
|
|
42
|
-
}
|