@teambit/worker 0.0.1165 → 0.0.1167

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.
@@ -0,0 +1,2 @@
1
+ export declare function setFunctionHandlers(): void;
2
+ export declare function expose(object: any): void;
@@ -0,0 +1,34 @@
1
+ /// <reference types="node" />
2
+ import { Remote } from 'comlink';
3
+ export type InitOptions = {
4
+ /**
5
+ * Determines whether stdout should be piped into the parent process.
6
+ * If this is set to true, then worker.stdout is NOT automatically piped through to process.stdout in the parent.
7
+ */
8
+ stdout: boolean;
9
+ /**
10
+ * Determines whether stderr should be piped into the parent process.
11
+ * If this is set to true, then worker.stderr is NOT automatically piped through to process.stderr in the parent.
12
+ */
13
+ stderr: boolean;
14
+ /**
15
+ * Determines whether stdin should be piped into the parent process.
16
+ * If this is set to true, then worker.stdin provides a writable stream whose contents appear as process.stdin inside
17
+ * the Worker. By default, no data is provided.
18
+ */
19
+ stdin: boolean;
20
+ };
21
+ export declare class HarmonyWorker<T> {
22
+ readonly name: string;
23
+ readonly workerPath: string;
24
+ constructor(name: string, workerPath: string);
25
+ private remoteWorker;
26
+ private worker;
27
+ get stdout(): import("stream").Readable | undefined;
28
+ get stderr(): import("stream").Readable | undefined;
29
+ get stdin(): import("stream").Writable | null | undefined;
30
+ private getOptions;
31
+ initiate(options: Partial<InitOptions>): Remote<T>;
32
+ get(): Remote<T> | undefined;
33
+ terminate(): Promise<void>;
34
+ }
@@ -0,0 +1,6 @@
1
+ import { WorkerAspect } from './worker.aspect';
2
+ export { WorkerAspect };
3
+ export type { WorkerMain } from './worker.main.runtime';
4
+ export type { HarmonyWorker } from './harmony-worker';
5
+ export { expose } from './expose';
6
+ export default WorkerAspect;
@@ -0,0 +1,7 @@
1
+ declare function nodeEndpoint(nep: any): {
2
+ postMessage: any;
3
+ addEventListener: (_: any, eh: any) => void;
4
+ removeEventListener: (_: any, eh: any) => void;
5
+ start: any;
6
+ };
7
+ export default nodeEndpoint;
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_worker@0.0.1165/dist/worker.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_worker@0.0.1165/dist/worker.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_worker@0.0.1167/dist/worker.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_worker@0.0.1167/dist/worker.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -0,0 +1,6 @@
1
+ export interface WorkerManifest {
2
+ /**
3
+ * name of the worker.
4
+ */
5
+ name: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ import { Aspect } from '@teambit/harmony';
2
+ export declare const WorkerAspect: Aspect;
@@ -0,0 +1 @@
1
+ export declare const Logo: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { SlotRegistry } from '@teambit/harmony';
2
+ import { HarmonyWorker } from './harmony-worker';
3
+ export type WorkerSlot = SlotRegistry<HarmonyWorker<unknown>>;
4
+ export type WorkerNameSlot = SlotRegistry<string>;
5
+ export declare class WorkerMain {
6
+ private workerSlot;
7
+ private workerNameSlot;
8
+ constructor(workerSlot: WorkerSlot, workerNameSlot: WorkerNameSlot);
9
+ static runtime: import("@teambit/harmony").RuntimeDefinition;
10
+ listWorkers(): HarmonyWorker<any>[];
11
+ /**
12
+ * create a new worker.
13
+ */
14
+ declareWorker<T>(name: string, path: string): HarmonyWorker<T>;
15
+ getWorker<T>(id: string): HarmonyWorker<T>;
16
+ static slots: (((registerFn: () => string) => SlotRegistry<HarmonyWorker<unknown>>) | ((registerFn: () => string) => SlotRegistry<string>))[];
17
+ static dependencies: never[];
18
+ static provider(_deps: any, _config: any, [workerSlot, workerNameSlot]: [WorkerSlot, WorkerNameSlot]): Promise<WorkerMain>;
19
+ }
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
1
  {
2
2
  "name": "@teambit/worker",
3
- "version": "0.0.1165",
3
+ "version": "0.0.1167",
4
4
  "homepage": "https://bit.cloud/teambit/harmony/worker",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.harmony",
8
8
  "name": "worker",
9
- "version": "0.0.1165"
9
+ "version": "0.0.1167"
10
10
  },
11
11
  "dependencies": {
12
12
  "comlink": "4.3.0",
13
13
  "@teambit/harmony": "0.4.6",
14
- "@teambit/cli": "0.0.861"
14
+ "@teambit/cli": "0.0.863"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/mocha": "9.1.0",
18
18
  "chai": "4.3.0",
19
- "@teambit/harmony.envs.core-aspect-env": "0.0.30"
19
+ "@teambit/harmony.envs.core-aspect-env": "0.0.33"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "react": "^17.0.0 || ^18.0.0",
package/tsconfig.json CHANGED
@@ -20,8 +20,7 @@
20
20
  "emitDeclarationOnly": true,
21
21
  "strict": true,
22
22
  "strictPropertyInitialization": false,
23
- "noImplicitAny": false,
24
- "composite": true
23
+ "noImplicitAny": false
25
24
  },
26
25
  "exclude": [
27
26
  "artifacts",
@@ -36,10 +35,5 @@
36
35
  "include": [
37
36
  "**/*",
38
37
  "**/*.json"
39
- ],
40
- "references": [
41
- {
42
- "path": "/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_cli@0.0.861"
43
- }
44
38
  ]
45
39
  }