@teambit/worker 0.0.1143 → 0.0.1145
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/preview/teambit_harmony_worker-preview.js +1 -0
- package/dist/harmony-worker.d.ts +5 -5
- package/dist/harmony-worker.js +3 -6
- package/dist/harmony-worker.js.map +1 -1
- package/dist/{preview-1703505948637.js → preview-1703698405864.js} +2 -2
- package/dist/worker.composition.d.ts +2 -2
- package/dist/worker.main.runtime.d.ts +3 -3
- package/package.json +12 -19
- package/tsconfig.json +16 -21
- package/types/asset.d.ts +15 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["teambit.harmony/worker-preview"]=t():e["teambit.harmony/worker-preview"]=t()}(self,(()=>(()=>{"use strict";var e={52655:(e,t,o)=>{var r={id:"teambit.harmony/worker@0.0.1145",homepage:"https://bit.cloud/teambit/harmony/worker",exported:!0};function n(){const e=i(o(87363));return n=function(){return e},e}function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0,n.__bit_component=r,i.__bit_component=r;const a=()=>n().default.createElement("div",{style:{height:"100%",display:"flex",justifyContent:"center"}},n().default.createElement("img",{style:{width:70},src:"https://static.bit.dev/extensions-icons/worker.svg"}));a.__bit_component=r,t.Logo=a},87363:e=>{e.exports=React}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{o.r(r),o.d(r,{compositions:()=>u,compositions_metadata:()=>l,overview:()=>f});var e={};o.r(e),o.d(e,{default:()=>d});var t=o(52655);o(87363);const n=MdxJsReact,i=TeambitMdxUiMdxScopeContext;var a=["components"];function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},p.apply(this,arguments)}var c={},s="wrapper";function d(e){var t=e.components,o=function(e,t){if(null==e)return{};var o,r,n=function(e,t){if(null==e)return{};var o,r,n={},i=Object.keys(e);for(r=0;r<i.length;r++)o=i[r],t.indexOf(o)>=0||(n[o]=e[o]);return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}(e,a);return(0,n.mdx)(s,p({},c,o,{components:t,mdxType:"MDXLayout"}),(0,n.mdx)(i.MDXScopeProvider,{components:{},mdxType:"MDXScopeProvider"}))}d.isMDXComponent=!0;const u=[t],f=[e],l={compositions:[{displayName:"Logo",identifier:"Logo"}]}})(),r})()));
|
package/dist/harmony-worker.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Remote } from 'comlink';
|
|
3
|
-
export
|
|
3
|
+
export type InitOptions = {
|
|
4
4
|
/**
|
|
5
5
|
* Determines whether stdout should be piped into the parent process.
|
|
6
6
|
* If this is set to true, then worker.stdout is NOT automatically piped through to process.stdout in the parent.
|
|
@@ -24,11 +24,11 @@ export declare class HarmonyWorker<T> {
|
|
|
24
24
|
constructor(name: string, workerPath: string);
|
|
25
25
|
private remoteWorker;
|
|
26
26
|
private worker;
|
|
27
|
-
get stdout(): import("stream").Readable
|
|
28
|
-
get stderr(): import("stream").Readable
|
|
29
|
-
get stdin(): import("stream").Writable
|
|
27
|
+
get stdout(): import("stream").Readable;
|
|
28
|
+
get stderr(): import("stream").Readable;
|
|
29
|
+
get stdin(): import("stream").Writable;
|
|
30
30
|
private getOptions;
|
|
31
31
|
initiate(options: Partial<InitOptions>): Remote<T>;
|
|
32
|
-
get(): Remote<T
|
|
32
|
+
get(): Remote<T>;
|
|
33
33
|
terminate(): Promise<void>;
|
|
34
34
|
}
|
package/dist/harmony-worker.js
CHANGED
|
@@ -37,16 +37,13 @@ class HarmonyWorker {
|
|
|
37
37
|
_defineProperty(this, "worker", void 0);
|
|
38
38
|
}
|
|
39
39
|
get stdout() {
|
|
40
|
-
|
|
41
|
-
return (_this$worker = this.worker) === null || _this$worker === void 0 ? void 0 : _this$worker.stdout;
|
|
40
|
+
return this.worker?.stdout;
|
|
42
41
|
}
|
|
43
42
|
get stderr() {
|
|
44
|
-
|
|
45
|
-
return (_this$worker2 = this.worker) === null || _this$worker2 === void 0 ? void 0 : _this$worker2.stderr;
|
|
43
|
+
return this.worker?.stderr;
|
|
46
44
|
}
|
|
47
45
|
get stdin() {
|
|
48
|
-
|
|
49
|
-
return (_this$worker3 = this.worker) === null || _this$worker3 === void 0 ? void 0 : _this$worker3.stdin;
|
|
46
|
+
return this.worker?.stdin;
|
|
50
47
|
}
|
|
51
48
|
getOptions(targetOptions) {
|
|
52
49
|
const defaultOptions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_worker_threads","data","require","_comlink","_nodeEndpoint","_interopRequireDefault","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","Number","HarmonyWorker","constructor","name","workerPath","stdout","
|
|
1
|
+
{"version":3,"names":["_worker_threads","data","require","_comlink","_nodeEndpoint","_interopRequireDefault","obj","__esModule","default","_defineProperty","key","value","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","t","i","_toPrimitive","String","r","e","Symbol","toPrimitive","call","TypeError","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(readonly name: string, readonly workerPath: string) {}\n\n private remoteWorker: undefined | Remote<T>;\n\n private 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":";;;;;;AACA,SAAAA,gBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,eAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAA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AAA,KAAWC,UAAkB,GAAlBA,UAAkB;IAAAvB,eAAA;IAAAA,eAAA;EAAG;EAMjE,IAAIwB,MAAMA,CAAA,EAAG;IACX,OAAO,IAAI,CAACC,MAAM,EAAED,MAAM;EAC5B;EAEA,IAAIE,MAAMA,CAAA,EAAG;IACX,OAAO,IAAI,CAACD,MAAM,EAAEC,MAAM;EAC5B;EAEA,IAAIC,KAAKA,CAAA,EAAG;IACV,OAAO,IAAI,CAACF,MAAM,EAAEE,KAAK;EAC3B;EAEQC,UAAUA,CAACC,aAAmC,EAAE;IACtD,MAAMC,cAAc,GAAG;MACrBN,MAAM,EAAE,IAAI;MACZE,MAAM,EAAE,IAAI;MACZC,KAAK,EAAE;IACT,CAAC;IAED,OAAOvB,MAAM,CAAC2B,MAAM,CAACD,cAAc,EAAED,aAAa,CAAC;EACrD;EAEAG,QAAQA,CAACC,OAA6B,EAAa;IACjD,MAAMR,MAAM,GAAG,KAAIS,wBAAM,EAAC,IAAI,CAACX,UAAU,EAAE,IAAI,CAACK,UAAU,CAACK,OAAO,CAAC,CAAC;IACpE,IAAI,CAACR,MAAM,GAAGA,MAAM;IACpB,MAAMU,YAAY,GAAG,IAAAC,eAAI,EAAI,IAAAC,uBAAY,EAACZ,MAAM,CAAC,CAAC;IAClD,IAAI,CAACU,YAAY,GAAGA,YAAY;IAChC,OAAOA,YAAY;EACrB;EAEAG,GAAGA,CAAA,EAAG;IACJ,OAAO,IAAI,CAACH,YAAY;EAC1B;EAEA,MAAMI,SAASA,CAAA,EAAG;IAChB,IAAI,CAAC,IAAI,CAACd,MAAM,EAAE;IAClB,MAAM,IAAI,CAACA,MAAM,CAACc,SAAS,CAAC,CAAC;EAC/B;AACF;AAACC,OAAA,CAAApB,aAAA,GAAAA,aAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_worker@0.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_worker@0.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_worker@0.0.1145/dist/worker.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.harmony_worker@0.0.1145/dist/worker.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const Logo: () =>
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Logo: () => JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SlotRegistry } from '@teambit/harmony';
|
|
2
2
|
import { HarmonyWorker } from './harmony-worker';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type WorkerSlot = SlotRegistry<HarmonyWorker<unknown>>;
|
|
4
|
+
export type WorkerNameSlot = SlotRegistry<string>;
|
|
5
5
|
export declare class WorkerMain {
|
|
6
6
|
private workerSlot;
|
|
7
7
|
private workerNameSlot;
|
|
@@ -14,6 +14,6 @@ export declare class WorkerMain {
|
|
|
14
14
|
declareWorker<T>(name: string, path: string): HarmonyWorker<T>;
|
|
15
15
|
getWorker<T>(id: string): HarmonyWorker<T>;
|
|
16
16
|
static slots: (((registerFn: () => string) => SlotRegistry<HarmonyWorker<unknown>>) | ((registerFn: () => string) => SlotRegistry<string>))[];
|
|
17
|
-
static dependencies:
|
|
17
|
+
static dependencies: any[];
|
|
18
18
|
static provider(_deps: any, _config: any, [workerSlot, workerNameSlot]: [WorkerSlot, WorkerNameSlot]): Promise<WorkerMain>;
|
|
19
19
|
}
|
package/package.json
CHANGED
|
@@ -1,32 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/worker",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1145",
|
|
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.
|
|
9
|
+
"version": "0.0.1145"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"comlink": "4.3.0",
|
|
13
|
-
"core-js": "^3.0.0",
|
|
14
|
-
"@babel/runtime": "7.20.0",
|
|
15
13
|
"@teambit/harmony": "0.4.6",
|
|
16
|
-
"@teambit/cli": "0.0.
|
|
14
|
+
"@teambit/cli": "0.0.841"
|
|
17
15
|
},
|
|
18
16
|
"devDependencies": {
|
|
19
|
-
"@types/react": "^17.0.8",
|
|
20
17
|
"@types/mocha": "9.1.0",
|
|
21
|
-
"@types/
|
|
22
|
-
"@types/
|
|
23
|
-
"@
|
|
24
|
-
"@types/testing-library__jest-dom": "5.9.5"
|
|
18
|
+
"@types/jest": "^29.2.2",
|
|
19
|
+
"@types/testing-library__jest-dom": "^5.9.5",
|
|
20
|
+
"@teambit/harmony.envs.core-aspect-env": "0.0.14"
|
|
25
21
|
},
|
|
26
22
|
"peerDependencies": {
|
|
27
|
-
"
|
|
28
|
-
"react": "^
|
|
29
|
-
"
|
|
23
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
24
|
+
"@types/react": "^18.2.12",
|
|
25
|
+
"@teambit/legacy": "1.0.624"
|
|
30
26
|
},
|
|
31
27
|
"license": "Apache-2.0",
|
|
32
28
|
"optionalDependencies": {},
|
|
@@ -40,7 +36,7 @@
|
|
|
40
36
|
},
|
|
41
37
|
"private": false,
|
|
42
38
|
"engines": {
|
|
43
|
-
"node": ">=
|
|
39
|
+
"node": ">=16.0.0"
|
|
44
40
|
},
|
|
45
41
|
"repository": {
|
|
46
42
|
"type": "git",
|
|
@@ -49,12 +45,9 @@
|
|
|
49
45
|
"keywords": [
|
|
50
46
|
"bit",
|
|
51
47
|
"bit-aspect",
|
|
48
|
+
"bit-core-aspect",
|
|
52
49
|
"components",
|
|
53
50
|
"collaboration",
|
|
54
|
-
"web"
|
|
55
|
-
"react",
|
|
56
|
-
"react-components",
|
|
57
|
-
"angular",
|
|
58
|
-
"angular-components"
|
|
51
|
+
"web"
|
|
59
52
|
]
|
|
60
53
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,38 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"lib": [
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"DOM.Iterable",
|
|
8
|
-
"ScriptHost"
|
|
4
|
+
"esnext",
|
|
5
|
+
"dom",
|
|
6
|
+
"dom.Iterable"
|
|
9
7
|
],
|
|
10
|
-
"target": "
|
|
11
|
-
"module": "
|
|
12
|
-
"jsx": "react",
|
|
13
|
-
"allowJs": true,
|
|
14
|
-
"composite": true,
|
|
8
|
+
"target": "es2020",
|
|
9
|
+
"module": "es2020",
|
|
10
|
+
"jsx": "react-jsx",
|
|
15
11
|
"declaration": true,
|
|
16
12
|
"sourceMap": true,
|
|
17
|
-
"skipLibCheck": true,
|
|
18
13
|
"experimentalDecorators": true,
|
|
19
|
-
"
|
|
14
|
+
"skipLibCheck": true,
|
|
20
15
|
"moduleResolution": "node",
|
|
21
16
|
"esModuleInterop": true,
|
|
22
|
-
"rootDir": ".",
|
|
23
17
|
"resolveJsonModule": true,
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"strictPropertyInitialization": false,
|
|
28
|
-
"strict": true,
|
|
29
|
-
"noImplicitAny": false,
|
|
30
|
-
"preserveConstEnums": true
|
|
18
|
+
"allowJs": true,
|
|
19
|
+
"outDir": "dist",
|
|
20
|
+
"emitDeclarationOnly": true
|
|
31
21
|
},
|
|
32
22
|
"exclude": [
|
|
23
|
+
"artifacts",
|
|
24
|
+
"public",
|
|
33
25
|
"dist",
|
|
26
|
+
"node_modules",
|
|
27
|
+
"package.json",
|
|
34
28
|
"esm.mjs",
|
|
35
|
-
"
|
|
29
|
+
"**/*.cjs",
|
|
30
|
+
"./dist"
|
|
36
31
|
],
|
|
37
32
|
"include": [
|
|
38
33
|
"**/*",
|
package/types/asset.d.ts
CHANGED
|
@@ -5,12 +5,12 @@ declare module '*.png' {
|
|
|
5
5
|
declare module '*.svg' {
|
|
6
6
|
import type { FunctionComponent, SVGProps } from 'react';
|
|
7
7
|
|
|
8
|
-
export const ReactComponent: FunctionComponent<
|
|
8
|
+
export const ReactComponent: FunctionComponent<
|
|
9
|
+
SVGProps<SVGSVGElement> & { title?: string }
|
|
10
|
+
>;
|
|
9
11
|
const src: string;
|
|
10
12
|
export default src;
|
|
11
13
|
}
|
|
12
|
-
|
|
13
|
-
// @TODO Gilad
|
|
14
14
|
declare module '*.jpg' {
|
|
15
15
|
const value: any;
|
|
16
16
|
export = value;
|
|
@@ -27,3 +27,15 @@ declare module '*.bmp' {
|
|
|
27
27
|
const value: any;
|
|
28
28
|
export = value;
|
|
29
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
|
+
}
|