@teambit/bundler 0.0.549 → 0.0.555
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-tar/teambit-bundler-0.0.555.tgz +0 -0
- package/package.json +11 -11
- package/tsconfig.json +0 -1
- package/package-tar/teambit-bundler-0.0.549.tgz +0 -0
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
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/bundler",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.555",
|
|
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.555"
|
|
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.555",
|
|
19
|
+
"@teambit/cli": "0.0.386",
|
|
20
|
+
"@teambit/component": "0.0.555",
|
|
21
|
+
"@teambit/graphql": "0.0.555",
|
|
22
|
+
"@teambit/pubsub": "0.0.555",
|
|
23
|
+
"@teambit/builder": "0.0.555",
|
|
24
|
+
"@teambit/toolbox.network.get-port": "0.0.90"
|
|
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.172",
|
|
38
38
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
39
39
|
"react": "^16.8.0 || ^17.0.0"
|
|
40
40
|
},
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"react": "-"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@teambit/legacy": "1.0.
|
|
65
|
+
"@teambit/legacy": "1.0.172",
|
|
66
66
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
67
67
|
"react": "^16.8.0 || ^17.0.0"
|
|
68
68
|
}
|
package/tsconfig.json
CHANGED
|
Binary file
|