@teambit/worker 0.0.0-180c1142f9fc5290b5e7fa06a1c964098f030d40

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/esm.mjs ADDED
@@ -0,0 +1,7 @@
1
+ // eslint-disable-next-line import/no-unresolved
2
+ import cjsModule from './index.js';
3
+
4
+ export const WorkerAspect = cjsModule.WorkerAspect;
5
+ export const expose = cjsModule.expose;
6
+
7
+ export default cjsModule;
@@ -0,0 +1,2 @@
1
+ export declare function setFunctionHandlers(): void;
2
+ export declare function expose(object: any): void;
package/dist/expose.js ADDED
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.expose = expose;
7
+ exports.setFunctionHandlers = setFunctionHandlers;
8
+ function _worker_threads() {
9
+ const data = require("worker_threads");
10
+ _worker_threads = function () {
11
+ return data;
12
+ };
13
+ return data;
14
+ }
15
+ function _comlink() {
16
+ const data = require("comlink");
17
+ _comlink = function () {
18
+ return data;
19
+ };
20
+ return data;
21
+ }
22
+ function _nodeEndpoint() {
23
+ const data = _interopRequireDefault(require("./node-endpoint"));
24
+ _nodeEndpoint = function () {
25
+ return data;
26
+ };
27
+ return data;
28
+ }
29
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
30
+ // eslint-disable-next-line import/no-unresolved
31
+
32
+ function setFunctionHandlers() {
33
+ // Override comlink's default proxy handler to use Node endpoints
34
+ _comlink().transferHandlers.set('proxy', {
35
+ canHandle: obj => obj && obj[_comlink().proxyMarker],
36
+ serialize: obj => {
37
+ const {
38
+ port1,
39
+ port2
40
+ } = new (_worker_threads().MessageChannel)();
41
+ (0, _comlink().expose)(obj, (0, _nodeEndpoint().default)(port1));
42
+ return [port2, [port2]];
43
+ },
44
+ deserialize: port => {
45
+ port = (0, _nodeEndpoint().default)(port);
46
+ port.start();
47
+ return (0, _comlink().wrap)(port);
48
+ }
49
+ });
50
+ }
51
+ setFunctionHandlers();
52
+ function expose(object) {
53
+ return (0, _comlink().expose)(object, (0, _nodeEndpoint().default)(_worker_threads().parentPort));
54
+ }
55
+
56
+ //# sourceMappingURL=expose.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_worker_threads","data","require","_comlink","_nodeEndpoint","_interopRequireDefault","e","__esModule","default","setFunctionHandlers","transferHandlers","set","canHandle","obj","proxyMarker","serialize","port1","port2","MessageChannel","comlinkExpose","nodeEndpoint","deserialize","port","start","wrap","expose","object","parentPort"],"sources":["expose.ts"],"sourcesContent":["// eslint-disable-next-line import/no-unresolved\nimport { parentPort, MessageChannel } from 'worker_threads';\nimport { expose as comlinkExpose, proxyMarker, wrap, transferHandlers } from 'comlink';\nimport nodeEndpoint from './node-endpoint';\n\nexport function setFunctionHandlers() {\n // Override comlink's default proxy handler to use Node endpoints\n transferHandlers.set('proxy', {\n canHandle: (obj) => obj && obj[proxyMarker],\n serialize: (obj) => {\n const { port1, port2 } = new MessageChannel();\n comlinkExpose(obj, nodeEndpoint(port1));\n return [port2, [port2]];\n },\n deserialize: (port: any) => {\n port = nodeEndpoint(port);\n port.start();\n return wrap(port);\n },\n } as any);\n}\n\nsetFunctionHandlers();\n\nexport function expose(object: any) {\n return comlinkExpose(object, nodeEndpoint(parentPort));\n}\n"],"mappings":";;;;;;;AACA,SAAAA,gBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,eAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,cAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAH,OAAA;EAAAE,aAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2C,SAAAI,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAH3C;;AAKO,SAASG,mBAAmBA,CAAA,EAAG;EACpC;EACAC,2BAAgB,CAACC,GAAG,CAAC,OAAO,EAAE;IAC5BC,SAAS,EAAGC,GAAG,IAAKA,GAAG,IAAIA,GAAG,CAACC,sBAAW,CAAC;IAC3CC,SAAS,EAAGF,GAAG,IAAK;MAClB,MAAM;QAAEG,KAAK;QAAEC;MAAM,CAAC,GAAG,KAAIC,gCAAc,EAAC,CAAC;MAC7C,IAAAC,iBAAa,EAACN,GAAG,EAAE,IAAAO,uBAAY,EAACJ,KAAK,CAAC,CAAC;MACvC,OAAO,CAACC,KAAK,EAAE,CAACA,KAAK,CAAC,CAAC;IACzB,CAAC;IACDI,WAAW,EAAGC,IAAS,IAAK;MAC1BA,IAAI,GAAG,IAAAF,uBAAY,EAACE,IAAI,CAAC;MACzBA,IAAI,CAACC,KAAK,CAAC,CAAC;MACZ,OAAO,IAAAC,eAAI,EAACF,IAAI,CAAC;IACnB;EACF,CAAQ,CAAC;AACX;AAEAb,mBAAmB,CAAC,CAAC;AAEd,SAASgB,MAAMA,CAACC,MAAW,EAAE;EAClC,OAAO,IAAAP,iBAAa,EAACO,MAAM,EAAE,IAAAN,uBAAY,EAACO,4BAAU,CAAC,CAAC;AACxD","ignoreList":[]}
@@ -0,0 +1,34 @@
1
+ import { Worker } from 'worker_threads';
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
+ protected remoteWorker: undefined | Remote<T>;
26
+ protected worker: Worker | undefined;
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,73 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.HarmonyWorker = void 0;
7
+ function _worker_threads() {
8
+ const data = require("worker_threads");
9
+ _worker_threads = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _comlink() {
15
+ const data = require("comlink");
16
+ _comlink = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _nodeEndpoint() {
22
+ const data = _interopRequireDefault(require("./node-endpoint"));
23
+ _nodeEndpoint = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
29
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
30
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
31
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // eslint-disable-next-line import/no-unresolved
32
+ class HarmonyWorker {
33
+ constructor(name, workerPath) {
34
+ this.name = name;
35
+ this.workerPath = workerPath;
36
+ _defineProperty(this, "remoteWorker", void 0);
37
+ _defineProperty(this, "worker", void 0);
38
+ }
39
+ get stdout() {
40
+ return this.worker?.stdout;
41
+ }
42
+ get stderr() {
43
+ return this.worker?.stderr;
44
+ }
45
+ get stdin() {
46
+ return this.worker?.stdin;
47
+ }
48
+ getOptions(targetOptions) {
49
+ const defaultOptions = {
50
+ stdout: true,
51
+ stderr: true,
52
+ stdin: true
53
+ };
54
+ return Object.assign(defaultOptions, targetOptions);
55
+ }
56
+ initiate(options) {
57
+ const worker = new (_worker_threads().Worker)(this.workerPath, this.getOptions(options));
58
+ this.worker = worker;
59
+ const remoteWorker = (0, _comlink().wrap)((0, _nodeEndpoint().default)(worker));
60
+ this.remoteWorker = remoteWorker;
61
+ return remoteWorker;
62
+ }
63
+ get() {
64
+ return this.remoteWorker;
65
+ }
66
+ async terminate() {
67
+ if (!this.worker) return;
68
+ await this.worker.terminate();
69
+ }
70
+ }
71
+ exports.HarmonyWorker = HarmonyWorker;
72
+
73
+ //# sourceMappingURL=harmony-worker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_worker_threads","data","require","_comlink","_nodeEndpoint","_interopRequireDefault","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","HarmonyWorker","constructor","name","workerPath","stdout","worker","stderr","stdin","getOptions","targetOptions","defaultOptions","assign","initiate","options","Worker","remoteWorker","wrap","nodeEndpoint","get","terminate","exports"],"sources":["harmony-worker.ts"],"sourcesContent":["// eslint-disable-next-line import/no-unresolved\nimport { Worker } from 'worker_threads';\nimport { wrap, Remote } from 'comlink';\nimport nodeEndpoint from './node-endpoint';\n\nexport type InitOptions = {\n /**\n * Determines whether stdout should be piped into the parent process.\n * If this is set to true, then worker.stdout is NOT automatically piped through to process.stdout in the parent.\n */\n stdout: boolean;\n\n /**\n * Determines whether stderr should be piped into the parent process.\n * If this is set to true, then worker.stderr is NOT automatically piped through to process.stderr in the parent.\n */\n stderr: boolean;\n\n /**\n * Determines whether stdin should be piped into the parent process.\n * If this is set to true, then worker.stdin provides a writable stream whose contents appear as process.stdin inside\n * the Worker. By default, no data is provided.\n */\n stdin: boolean;\n};\n\nexport class HarmonyWorker<T> {\n constructor(\n readonly name: string,\n readonly workerPath: string\n ) {}\n\n protected remoteWorker: undefined | Remote<T>;\n\n protected worker: Worker | undefined;\n\n get stdout() {\n return this.worker?.stdout;\n }\n\n get stderr() {\n return this.worker?.stderr;\n }\n\n get stdin() {\n return this.worker?.stdin;\n }\n\n private getOptions(targetOptions: Partial<InitOptions>) {\n const defaultOptions = {\n stdout: true,\n stderr: true,\n stdin: true,\n };\n\n return Object.assign(defaultOptions, targetOptions);\n }\n\n initiate(options: Partial<InitOptions>): Remote<T> {\n const worker = new Worker(this.workerPath, this.getOptions(options));\n this.worker = worker;\n const remoteWorker = wrap<T>(nodeEndpoint(worker));\n this.remoteWorker = remoteWorker;\n return remoteWorker;\n }\n\n get() {\n return this.remoteWorker;\n }\n\n async terminate() {\n if (!this.worker) return;\n await this.worker.terminate();\n }\n}\n"],"mappings":"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","ignoreList":[]}
@@ -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;
package/dist/index.js ADDED
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "WorkerAspect", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _worker().WorkerAspect;
10
+ }
11
+ });
12
+ exports.default = void 0;
13
+ Object.defineProperty(exports, "expose", {
14
+ enumerable: true,
15
+ get: function () {
16
+ return _expose().expose;
17
+ }
18
+ });
19
+ function _worker() {
20
+ const data = require("./worker.aspect");
21
+ _worker = function () {
22
+ return data;
23
+ };
24
+ return data;
25
+ }
26
+ function _expose() {
27
+ const data = require("./expose");
28
+ _expose = function () {
29
+ return data;
30
+ };
31
+ return data;
32
+ }
33
+ (0, _expose().setFunctionHandlers)();
34
+ var _default = exports.default = _worker().WorkerAspect;
35
+
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_worker","data","require","_expose","setFunctionHandlers","_default","exports","default","WorkerAspect"],"sources":["index.ts"],"sourcesContent":["import { WorkerAspect } from './worker.aspect';\nimport { setFunctionHandlers } from './expose';\n\nsetFunctionHandlers();\n\nexport { WorkerAspect };\nexport type { WorkerMain } from './worker.main.runtime';\nexport type { HarmonyWorker } from './harmony-worker';\nexport { expose } from './expose';\nexport default WorkerAspect;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,QAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,IAAAG,6BAAmB,EAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAMPC,sBAAY","ignoreList":[]}
@@ -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;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ function nodeEndpoint(nep) {
8
+ const listeners = new WeakMap();
9
+ return {
10
+ postMessage: nep.postMessage.bind(nep),
11
+ addEventListener: (_, eh) => {
12
+ const l = data => {
13
+ if ('handleEvent' in eh) {
14
+ eh.handleEvent({
15
+ data
16
+ });
17
+ } else {
18
+ eh({
19
+ data
20
+ });
21
+ }
22
+ };
23
+ nep.on('message', l);
24
+ listeners.set(eh, l);
25
+ },
26
+ removeEventListener: (_, eh) => {
27
+ const l = listeners.get(eh);
28
+ if (!l) {
29
+ return;
30
+ }
31
+ nep.off('message', l);
32
+ listeners.delete(eh);
33
+ },
34
+ start: nep.start && nep.start.bind(nep)
35
+ };
36
+ }
37
+ var _default = exports.default = nodeEndpoint;
38
+
39
+ //# sourceMappingURL=node-endpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["nodeEndpoint","nep","listeners","WeakMap","postMessage","bind","addEventListener","_","eh","l","data","handleEvent","on","set","removeEventListener","get","off","delete","start","_default","exports","default"],"sources":["node-endpoint.ts"],"sourcesContent":["function nodeEndpoint(nep) {\n const listeners = new WeakMap();\n return {\n postMessage: nep.postMessage.bind(nep),\n addEventListener: (_, eh) => {\n const l = (data) => {\n if ('handleEvent' in eh) {\n eh.handleEvent({ data });\n } else {\n eh({ data });\n }\n };\n nep.on('message', l);\n listeners.set(eh, l);\n },\n removeEventListener: (_, eh) => {\n const l = listeners.get(eh);\n if (!l) {\n return;\n }\n nep.off('message', l);\n listeners.delete(eh);\n },\n start: nep.start && nep.start.bind(nep),\n };\n}\n\nexport default nodeEndpoint;\n"],"mappings":";;;;;;AAAA,SAASA,YAAYA,CAACC,GAAG,EAAE;EACzB,MAAMC,SAAS,GAAG,IAAIC,OAAO,CAAC,CAAC;EAC/B,OAAO;IACLC,WAAW,EAAEH,GAAG,CAACG,WAAW,CAACC,IAAI,CAACJ,GAAG,CAAC;IACtCK,gBAAgB,EAAEA,CAACC,CAAC,EAAEC,EAAE,KAAK;MAC3B,MAAMC,CAAC,GAAIC,IAAI,IAAK;QAClB,IAAI,aAAa,IAAIF,EAAE,EAAE;UACvBA,EAAE,CAACG,WAAW,CAAC;YAAED;UAAK,CAAC,CAAC;QAC1B,CAAC,MAAM;UACLF,EAAE,CAAC;YAAEE;UAAK,CAAC,CAAC;QACd;MACF,CAAC;MACDT,GAAG,CAACW,EAAE,CAAC,SAAS,EAAEH,CAAC,CAAC;MACpBP,SAAS,CAACW,GAAG,CAACL,EAAE,EAAEC,CAAC,CAAC;IACtB,CAAC;IACDK,mBAAmB,EAAEA,CAACP,CAAC,EAAEC,EAAE,KAAK;MAC9B,MAAMC,CAAC,GAAGP,SAAS,CAACa,GAAG,CAACP,EAAE,CAAC;MAC3B,IAAI,CAACC,CAAC,EAAE;QACN;MACF;MACAR,GAAG,CAACe,GAAG,CAAC,SAAS,EAAEP,CAAC,CAAC;MACrBP,SAAS,CAACe,MAAM,CAACT,EAAE,CAAC;IACtB,CAAC;IACDU,KAAK,EAAEjB,GAAG,CAACiB,KAAK,IAAIjB,GAAG,CAACiB,KAAK,CAACb,IAAI,CAACJ,GAAG;EACxC,CAAC;AACH;AAAC,IAAAkB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcrB,YAAY","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_worker@180c1142f9fc5290b5e7fa06a1c964098f030d40/dist/worker.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.harmony_worker@180c1142f9fc5290b5e7fa06a1c964098f030d40/dist/worker.docs.mdx';
3
+
4
+ export const compositions = [compositions_0];
5
+ export const overview = [overview_0];
6
+
7
+ export const compositions_metadata = {"compositions":[{"displayName":"Logo","identifier":"Logo"}]};
@@ -0,0 +1,6 @@
1
+ export interface WorkerManifest {
2
+ /**
3
+ * name of the worker.
4
+ */
5
+ name: string;
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+
3
+ //# sourceMappingURL=worker-manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["worker-manifest.ts"],"sourcesContent":["export interface WorkerManifest {\n /**\n * name of the worker.\n */\n name: string;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import { Aspect } from '@teambit/harmony';
2
+ export declare const WorkerAspect: Aspect;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.WorkerAspect = void 0;
7
+ function _harmony() {
8
+ const data = require("@teambit/harmony");
9
+ _harmony = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ const WorkerAspect = exports.WorkerAspect = _harmony().Aspect.create({
15
+ id: 'teambit.harmony/worker'
16
+ });
17
+
18
+ //# sourceMappingURL=worker.aspect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_harmony","data","require","WorkerAspect","exports","Aspect","create","id"],"sources":["worker.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const WorkerAspect = Aspect.create({\n id: 'teambit.harmony/worker',\n});\n"],"mappings":";;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,MAAME,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAGE,iBAAM,CAACC,MAAM,CAAC;EACxCC,EAAE,EAAE;AACN,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export declare const Logo: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Logo = void 0;
7
+ function _react() {
8
+ const data = _interopRequireDefault(require("react"));
9
+ _react = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
+ const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
16
+ style: {
17
+ height: '100%',
18
+ display: 'flex',
19
+ justifyContent: 'center'
20
+ }
21
+ }, /*#__PURE__*/_react().default.createElement("img", {
22
+ style: {
23
+ width: 70
24
+ },
25
+ src: "https://static.bit.dev/extensions-icons/worker.svg"
26
+ }));
27
+ exports.Logo = Logo;
28
+
29
+ //# sourceMappingURL=worker.composition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","data","_interopRequireDefault","require","e","__esModule","default","Logo","createElement","style","height","display","justifyContent","width","src","exports"],"sources":["worker.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/worker.svg\" />\n </div>\n);\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnB,MAAMG,IAAI,GAAGA,CAAA,kBAClBP,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxEZ,MAAA,GAAAM,OAAA,CAAAE,aAAA;EAAKC,KAAK,EAAE;IAAEI,KAAK,EAAE;EAAG,CAAE;EAACC,GAAG,EAAC;AAAoD,CAAE,CAClF,CACN;AAACC,OAAA,CAAAR,IAAA,GAAAA,IAAA","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ ---
2
+ description: Manages Workers for Bit aspects.
3
+ labels: ['core aspect', 'workers', 'threads']
4
+ ---
@@ -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<string>) | ((registerFn: () => string) => SlotRegistry<HarmonyWorker<unknown>>))[];
17
+ static dependencies: never[];
18
+ static provider(_deps: any, _config: any, [workerSlot, workerNameSlot]: [WorkerSlot, WorkerNameSlot]): Promise<WorkerMain>;
19
+ }
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.WorkerMain = void 0;
7
+ function _cli() {
8
+ const data = require("@teambit/cli");
9
+ _cli = function () {
10
+ return data;
11
+ };
12
+ return data;
13
+ }
14
+ function _harmony() {
15
+ const data = require("@teambit/harmony");
16
+ _harmony = function () {
17
+ return data;
18
+ };
19
+ return data;
20
+ }
21
+ function _worker() {
22
+ const data = require("./worker.aspect");
23
+ _worker = function () {
24
+ return data;
25
+ };
26
+ return data;
27
+ }
28
+ function _harmonyWorker() {
29
+ const data = require("./harmony-worker");
30
+ _harmonyWorker = function () {
31
+ return data;
32
+ };
33
+ return data;
34
+ }
35
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
36
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
37
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
38
+ class WorkerMain {
39
+ constructor(workerSlot, workerNameSlot) {
40
+ this.workerSlot = workerSlot;
41
+ this.workerNameSlot = workerNameSlot;
42
+ }
43
+ listWorkers() {
44
+ return this.workerSlot.values();
45
+ }
46
+
47
+ /**
48
+ * create a new worker.
49
+ */
50
+ declareWorker(name, path) {
51
+ this.workerNameSlot.register(name);
52
+ const maybeAspectId = this.workerNameSlot.toArray().find(([, workerName]) => {
53
+ return workerName === name;
54
+ });
55
+ if (!maybeAspectId) throw new Error(`could not create a worker ${name}`);
56
+ // const scriptPath = path || await this.resolveWorkerScript(name, aspectId);
57
+ const scriptPath = path;
58
+ const systemWorker = new (_harmonyWorker().HarmonyWorker)(name, scriptPath);
59
+ this.workerSlot.register(systemWorker);
60
+ return systemWorker;
61
+ }
62
+
63
+ // private async resolveWorkerScript(name: string, aspectId: string): Promise<string> {
64
+ // const host = this.componentAspect.getHost();
65
+ // const id = await host.resolveComponentId(aspectId);
66
+ // const component = await host.get(id);
67
+ // if (!component) throw new Error(`[worker] could not resolve component for aspect ID: ${aspectId}`);
68
+ // const packageName = this.pkg.getPackageName(component);
69
+ // // const workerFile = component.state.filesystem.files.find((file) => file.relative.includes(`${name}.worker`));
70
+ // // if (!workerFile) throw new Error(`[worker] aspect declaring a worker must contain a ${name}.worker. file`);
71
+ // return require.resolve(join(packageName, 'dist', `${name}.worker.js`));
72
+ // }
73
+
74
+ getWorker(id) {
75
+ return this.workerSlot.get(id);
76
+ }
77
+ static async provider(_deps, _config, [workerSlot, workerNameSlot]) {
78
+ return new WorkerMain(workerSlot, workerNameSlot);
79
+ }
80
+ }
81
+ exports.WorkerMain = WorkerMain;
82
+ _defineProperty(WorkerMain, "runtime", _cli().MainRuntime);
83
+ _defineProperty(WorkerMain, "slots", [_harmony().Slot.withType(), _harmony().Slot.withType()]);
84
+ _defineProperty(WorkerMain, "dependencies", []);
85
+ _worker().WorkerAspect.addRuntime(WorkerMain);
86
+
87
+ //# sourceMappingURL=worker.main.runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_cli","data","require","_harmony","_worker","_harmonyWorker","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","WorkerMain","constructor","workerSlot","workerNameSlot","listWorkers","values","declareWorker","name","path","register","maybeAspectId","toArray","find","workerName","Error","scriptPath","systemWorker","HarmonyWorker","getWorker","id","get","provider","_deps","_config","exports","MainRuntime","Slot","withType","WorkerAspect","addRuntime"],"sources":["worker.main.runtime.ts"],"sourcesContent":["import { MainRuntime } from '@teambit/cli';\nimport { Slot, SlotRegistry } from '@teambit/harmony';\nimport { WorkerAspect } from './worker.aspect';\nimport { HarmonyWorker } from './harmony-worker';\n\nexport type WorkerSlot = SlotRegistry<HarmonyWorker<unknown>>;\n\nexport type WorkerNameSlot = SlotRegistry<string>;\n\nexport class WorkerMain {\n constructor(\n private workerSlot: WorkerSlot,\n private workerNameSlot: WorkerNameSlot\n ) {}\n\n static runtime = MainRuntime;\n\n listWorkers(): HarmonyWorker<any>[] {\n return this.workerSlot.values();\n }\n\n /**\n * create a new worker.\n */\n declareWorker<T>(name: string, path: string): HarmonyWorker<T> {\n this.workerNameSlot.register(name);\n\n const maybeAspectId = this.workerNameSlot.toArray().find(([, workerName]) => {\n return workerName === name;\n });\n\n if (!maybeAspectId) throw new Error(`could not create a worker ${name}`);\n // const scriptPath = path || await this.resolveWorkerScript(name, aspectId);\n const scriptPath = path;\n const systemWorker = new HarmonyWorker<T>(name, scriptPath);\n this.workerSlot.register(systemWorker);\n\n return systemWorker;\n }\n\n // private async resolveWorkerScript(name: string, aspectId: string): Promise<string> {\n // const host = this.componentAspect.getHost();\n // const id = await host.resolveComponentId(aspectId);\n // const component = await host.get(id);\n // if (!component) throw new Error(`[worker] could not resolve component for aspect ID: ${aspectId}`);\n // const packageName = this.pkg.getPackageName(component);\n // // const workerFile = component.state.filesystem.files.find((file) => file.relative.includes(`${name}.worker`));\n // // if (!workerFile) throw new Error(`[worker] aspect declaring a worker must contain a ${name}.worker. file`);\n // return require.resolve(join(packageName, 'dist', `${name}.worker.js`));\n // }\n\n getWorker<T>(id: string): HarmonyWorker<T> {\n return this.workerSlot.get(id) as HarmonyWorker<T>;\n }\n\n static slots = [Slot.withType<HarmonyWorker<unknown>>(), Slot.withType<string>()];\n\n static dependencies = [];\n\n static async provider(_deps, _config, [workerSlot, workerNameSlot]: [WorkerSlot, WorkerNameSlot]) {\n return new WorkerMain(workerSlot, workerNameSlot);\n }\n}\n\nWorkerAspect.addRuntime(WorkerMain);\n"],"mappings":"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","ignoreList":[]}
package/esm.mjs ADDED
@@ -0,0 +1,7 @@
1
+ // eslint-disable-next-line import/no-unresolved
2
+ import cjsModule from './index.js';
3
+
4
+ export const WorkerAspect = cjsModule.WorkerAspect;
5
+ export const expose = cjsModule.expose;
6
+
7
+ export default cjsModule;
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@teambit/worker",
3
+ "version": "0.0.0-180c1142f9fc5290b5e7fa06a1c964098f030d40",
4
+ "homepage": "https://bit.cloud/teambit/harmony/worker",
5
+ "main": "dist/index.js",
6
+ "componentId": {
7
+ "scope": "teambit.harmony",
8
+ "name": "worker",
9
+ "version": "180c1142f9fc5290b5e7fa06a1c964098f030d40"
10
+ },
11
+ "dependencies": {
12
+ "comlink": "4.3.0",
13
+ "@teambit/harmony": "0.4.7",
14
+ "@teambit/cli": "0.0.0-488f076a7c57433b94373d42c763e18868925950"
15
+ },
16
+ "devDependencies": {
17
+ "@types/mocha": "9.1.0",
18
+ "@teambit/harmony.envs.core-aspect-env": "0.0.69"
19
+ },
20
+ "peerDependencies": {
21
+ "react": "^17.0.0 || ^18.0.0",
22
+ "@types/react": "^17.0.73"
23
+ },
24
+ "license": "Apache-2.0",
25
+ "optionalDependencies": {},
26
+ "peerDependenciesMeta": {},
27
+ "exports": {
28
+ ".": {
29
+ "node": {
30
+ "require": "./dist/index.js",
31
+ "import": "./dist/esm.mjs"
32
+ },
33
+ "default": "./dist/index.js"
34
+ },
35
+ "./dist/*": "./dist/*",
36
+ "./artifacts/*": "./artifacts/*",
37
+ "./*": "./*.ts"
38
+ },
39
+ "private": false,
40
+ "engines": {
41
+ "node": ">=16.0.0"
42
+ },
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "https://github.com/teambit/bit"
46
+ },
47
+ "keywords": [
48
+ "bit",
49
+ "bit-aspect",
50
+ "bit-core-aspect",
51
+ "components",
52
+ "collaboration",
53
+ "web"
54
+ ]
55
+ }
@@ -0,0 +1,41 @@
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<
9
+ SVGProps<SVGSVGElement> & { title?: string }
10
+ >;
11
+ const src: string;
12
+ export default src;
13
+ }
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
+ }
30
+ declare module '*.otf' {
31
+ const value: any;
32
+ export = value;
33
+ }
34
+ declare module '*.woff' {
35
+ const value: any;
36
+ export = value;
37
+ }
38
+ declare module '*.woff2' {
39
+ const value: any;
40
+ export = value;
41
+ }
@@ -0,0 +1,42 @@
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
+ }
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+
3
+ export const Logo = () => (
4
+ <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>
5
+ <img style={{ width: 70 }} src="https://static.bit.dev/extensions-icons/worker.svg" />
6
+ </div>
7
+ );
@@ -0,0 +1,4 @@
1
+ ---
2
+ description: Manages Workers for Bit aspects.
3
+ labels: ['core aspect', 'workers', 'threads']
4
+ ---