@teambit/watcher 0.0.127 → 0.0.128
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/.bit-capsule-ready +0 -0
- package/dist/watcher.main.runtime.d.ts +1 -2
- package/dist/watcher.main.runtime.js +1 -2
- package/dist/watcher.main.runtime.js.map +1 -1
- package/package-tar/teambit-watcher-0.0.128.tgz +0 -0
- package/package.json +11 -11
- package/package-tar/teambit-watcher-0.0.127.tgz +0 -0
- /package/dist/{preview-1690254961496.js → preview-1690296596827.js} +0 -0
|
File without changes
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { CLIMain } from '@teambit/cli';
|
|
2
2
|
import { SlotRegistry } from '@teambit/harmony';
|
|
3
3
|
import { ScopeMain } from '@teambit/scope';
|
|
4
|
-
import { Component } from '@teambit/component';
|
|
5
4
|
import { ComponentID } from '@teambit/component-id';
|
|
6
5
|
import { IpcEventsMain } from '@teambit/ipc-events';
|
|
7
6
|
import { Logger, LoggerMain } from '@teambit/logger';
|
|
8
7
|
import { PubsubMain } from '@teambit/pubsub';
|
|
9
8
|
import { Workspace } from '@teambit/workspace';
|
|
10
9
|
import { WatchOptions } from './watcher';
|
|
11
|
-
export declare type OnPreWatch = (
|
|
10
|
+
export declare type OnPreWatch = (componentIds: ComponentID[], watchOpts: WatchOptions) => Promise<void>;
|
|
12
11
|
export declare type OnPreWatchSlot = SlotRegistry<OnPreWatch>;
|
|
13
12
|
export declare class WatcherMain {
|
|
14
13
|
private workspace;
|
|
@@ -108,10 +108,9 @@ class WatcherMain {
|
|
|
108
108
|
await this.scope.watchScopeInternalFiles();
|
|
109
109
|
}
|
|
110
110
|
async triggerOnPreWatch(componentIds, watchOpts) {
|
|
111
|
-
const components = await this.workspace.getMany(componentIds);
|
|
112
111
|
const preWatchFunctions = this.onPreWatchSlot.values();
|
|
113
112
|
await (0, _pMapSeries().default)(preWatchFunctions, async func => {
|
|
114
|
-
await func(
|
|
113
|
+
await func(componentIds, watchOpts);
|
|
115
114
|
});
|
|
116
115
|
}
|
|
117
116
|
registerOnPreWatch(onPreWatchFunc) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_harmony","_scope","_interopRequireDefault","_ipcEvents","_logger","_pubsub","_workspace","_pMapSeries","_watch","_watcher","_watcher2","WatcherMain","constructor","workspace","scope","pubsub","onPreWatchSlot","ipcEvents","logger","watch","opts","watcher","Watcher","watchAll","watchScopeInternalFiles","triggerOnPreWatch","componentIds","watchOpts","
|
|
1
|
+
{"version":3,"names":["_cli","data","require","_harmony","_scope","_interopRequireDefault","_ipcEvents","_logger","_pubsub","_workspace","_pMapSeries","_watch","_watcher","_watcher2","WatcherMain","constructor","workspace","scope","pubsub","onPreWatchSlot","ipcEvents","logger","watch","opts","watcher","Watcher","watchAll","watchScopeInternalFiles","triggerOnPreWatch","componentIds","watchOpts","preWatchFunctions","values","pMapSeries","func","registerOnPreWatch","onPreWatchFunc","register","provider","cli","loggerMain","_","createLogger","WatcherAspect","id","watcherMain","watchCmd","WatchCommand","exports","_defineProperty2","default","Slot","withType","CLIAspect","WorkspaceAspect","ScopeAspect","PubsubAspect","LoggerAspect","IpcEventsAspect","MainRuntime","addRuntime","_default"],"sources":["watcher.main.runtime.ts"],"sourcesContent":["import { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { SlotRegistry, Slot } from '@teambit/harmony';\nimport ScopeAspect, { ScopeMain } from '@teambit/scope';\nimport { ComponentID } from '@teambit/component-id';\nimport IpcEventsAspect, { IpcEventsMain } from '@teambit/ipc-events';\nimport { Logger, LoggerAspect, LoggerMain } from '@teambit/logger';\nimport { PubsubAspect, PubsubMain } from '@teambit/pubsub';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport pMapSeries from 'p-map-series';\nimport { WatchCommand } from './watch.cmd';\nimport { Watcher, WatchOptions } from './watcher';\nimport { WatcherAspect } from './watcher.aspect';\n\nexport type OnPreWatch = (componentIds: ComponentID[], watchOpts: WatchOptions) => Promise<void>;\nexport type OnPreWatchSlot = SlotRegistry<OnPreWatch>;\n\nexport class WatcherMain {\n constructor(\n private workspace: Workspace,\n private scope: ScopeMain,\n private pubsub: PubsubMain,\n private onPreWatchSlot: OnPreWatchSlot,\n readonly ipcEvents: IpcEventsMain,\n readonly logger: Logger\n ) {}\n\n async watch(opts: WatchOptions) {\n const watcher = new Watcher(this.workspace, this.pubsub, this);\n await watcher.watchAll(opts);\n }\n\n async watchScopeInternalFiles() {\n await this.scope.watchScopeInternalFiles();\n }\n\n async triggerOnPreWatch(componentIds: ComponentID[], watchOpts: WatchOptions) {\n const preWatchFunctions = this.onPreWatchSlot.values();\n await pMapSeries(preWatchFunctions, async (func) => {\n await func(componentIds, watchOpts);\n });\n }\n\n registerOnPreWatch(onPreWatchFunc: OnPreWatch) {\n this.onPreWatchSlot.register(onPreWatchFunc);\n return this;\n }\n\n static slots = [Slot.withType<OnPreWatch>()];\n static dependencies = [CLIAspect, WorkspaceAspect, ScopeAspect, PubsubAspect, LoggerAspect, IpcEventsAspect];\n static runtime = MainRuntime;\n\n static async provider(\n [cli, workspace, scope, pubsub, loggerMain, ipcEvents]: [\n CLIMain,\n Workspace,\n ScopeMain,\n PubsubMain,\n LoggerMain,\n IpcEventsMain\n ],\n _,\n [onPreWatchSlot]: [OnPreWatchSlot]\n ) {\n const logger = loggerMain.createLogger(WatcherAspect.id);\n const watcherMain = new WatcherMain(workspace, scope, pubsub, onPreWatchSlot, ipcEvents, logger);\n const watchCmd = new WatchCommand(pubsub, logger, watcherMain);\n cli.register(watchCmd);\n return watcherMain;\n }\n}\n\nWatcherAspect.addRuntime(WatcherMain);\n\nexport default WatcherMain;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,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EAAEpB,SAAS,CAOpD,EACDqB,CAAC,EACD,CAACtB,cAAc,CAAmB,EAClC;IACA,MAAME,MAAM,GAAGmB,UAAU,CAACE,YAAY,CAACC,yBAAa,CAACC,EAAE,CAAC;IACxD,MAAMC,WAAW,GAAG,IAAI/B,WAAW,CAACE,SAAS,EAAEC,KAAK,EAAEC,MAAM,EAAEC,cAAc,EAAEC,SAAS,EAAEC,MAAM,CAAC;IAChG,MAAMyB,QAAQ,GAAG,KAAIC,qBAAY,EAAC7B,MAAM,EAAEG,MAAM,EAAEwB,WAAW,CAAC;IAC9DN,GAAG,CAACF,QAAQ,CAACS,QAAQ,CAAC;IACtB,OAAOD,WAAW;EACpB;AACF;AAACG,OAAA,CAAAlC,WAAA,GAAAA,WAAA;AAAA,IAAAmC,gBAAA,GAAAC,OAAA,EArDYpC,WAAW,WA+BP,CAACqC,eAAI,CAACC,QAAQ,CAAa,CAAC,CAAC;AAAA,IAAAH,gBAAA,GAAAC,OAAA,EA/BjCpC,WAAW,kBAgCA,CAACuC,gBAAS,EAAEC,oBAAe,EAAEC,gBAAW,EAAEC,sBAAY,EAAEC,sBAAY,EAAEC,oBAAe,CAAC;AAAA,IAAAT,gBAAA,GAAAC,OAAA,EAhCjGpC,WAAW,aAiCL6C,kBAAW;AAsB9BhB,yBAAa,CAACiB,UAAU,CAAC9C,WAAW,CAAC;AAAC,IAAA+C,QAAA,GAEvB/C,WAAW;AAAAkC,OAAA,CAAAE,OAAA,GAAAW,QAAA"}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/watcher",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.128",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/workspace/watcher",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.workspace",
|
|
8
8
|
"name": "watcher",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.128"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "2.4.2",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"@teambit/harmony": "0.4.6",
|
|
22
22
|
"@teambit/component-id": "0.0.427",
|
|
23
23
|
"@teambit/legacy-bit-id": "0.0.423",
|
|
24
|
-
"@teambit/workspace": "0.0.
|
|
25
|
-
"@teambit/cli": "0.0.
|
|
26
|
-
"@teambit/compiler": "0.0.
|
|
27
|
-
"@teambit/logger": "0.0.
|
|
28
|
-
"@teambit/pubsub": "0.0.
|
|
29
|
-
"@teambit/
|
|
30
|
-
"@teambit/
|
|
31
|
-
"@teambit/
|
|
24
|
+
"@teambit/workspace": "0.0.1116",
|
|
25
|
+
"@teambit/cli": "0.0.748",
|
|
26
|
+
"@teambit/compiler": "0.0.1116",
|
|
27
|
+
"@teambit/logger": "0.0.841",
|
|
28
|
+
"@teambit/pubsub": "0.0.1116",
|
|
29
|
+
"@teambit/ipc-events": "0.0.6",
|
|
30
|
+
"@teambit/scope": "0.0.1116",
|
|
31
|
+
"@teambit/component": "0.0.1116"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/fs-extra": "9.0.7",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@types/testing-library__jest-dom": "5.9.5"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@teambit/legacy": "1.0.
|
|
44
|
+
"@teambit/legacy": "1.0.527",
|
|
45
45
|
"react": "^16.8.0 || ^17.0.0",
|
|
46
46
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
47
47
|
},
|
|
Binary file
|
|
File without changes
|