@teambit/watcher 1.0.1186 → 1.0.1188
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.
|
@@ -4,6 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.WatcherMain = void 0;
|
|
7
|
+
function _harmonyModules() {
|
|
8
|
+
const data = require("@teambit/harmony.modules.runtimes");
|
|
9
|
+
_harmonyModules = function () {
|
|
10
|
+
return data;
|
|
11
|
+
};
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
7
14
|
function _cli() {
|
|
8
15
|
const data = require("@teambit/cli");
|
|
9
16
|
_cli = function () {
|
|
@@ -151,7 +158,7 @@ class WatcherMain {
|
|
|
151
158
|
exports.WatcherMain = WatcherMain;
|
|
152
159
|
_defineProperty(WatcherMain, "slots", [_harmony().Slot.withType()]);
|
|
153
160
|
_defineProperty(WatcherMain, "dependencies", [_cli().CLIAspect, _workspace().WorkspaceAspect, _scope().ScopeAspect, _pubsub().PubsubAspect, _logger().LoggerAspect, _ipcEvents().IpcEventsAspect, _configStore().ConfigStoreAspect]);
|
|
154
|
-
_defineProperty(WatcherMain, "runtime",
|
|
161
|
+
_defineProperty(WatcherMain, "runtime", _harmonyModules().MainRuntime);
|
|
155
162
|
_watcher2().WatcherAspect.addRuntime(WatcherMain);
|
|
156
163
|
var _default = exports.default = WatcherMain;
|
|
157
164
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_harmonyModules","data","require","_cli","_harmony","_scope","_ipcEvents","_logger","_pubsub","_legacy","_workspace","_pMapSeries","_interopRequireDefault","_watch","_watcher","_watcher2","_configStore","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","WatcherMain","constructor","workspace","scope","pubsub","onPreWatchSlot","ipcEvents","logger","configStore","watch","opts","msgs","OutsideWorkspaceError","preImport","importObjectsIfOutdatedAgainstBitmap","watcher","Watcher","getChokidarWatchOptions","usePollingConf","getConfig","CFG_WATCH_USE_POLLING","usePolling","ignoreInitial","persistent","watchScopeInternalFiles","additionalPaths","onAdditionalFileChange","chokidarOpts","triggerOnPreWatch","componentIds","watchOpts","preWatchFunctions","values","pMapSeries","func","registerOnPreWatch","onPreWatchFunc","register","provider","cli","loggerMain","_","createLogger","WatcherAspect","id","watcherMain","watchCmd","WatchCommand","exports","Slot","withType","CLIAspect","WorkspaceAspect","ScopeAspect","PubsubAspect","LoggerAspect","IpcEventsAspect","ConfigStoreAspect","MainRuntime","addRuntime","_default"],"sources":["watcher.main.runtime.ts"],"sourcesContent":["import type { CLIMain } from '@teambit/cli';\nimport { MainRuntime } from '@teambit/harmony.modules.runtimes';\nimport { CLIAspect } from '@teambit/cli';\nimport type { WatchOptions as ChokidarWatchOptions } from 'chokidar';\nimport type { SlotRegistry } from '@teambit/harmony';\nimport { Slot } from '@teambit/harmony';\nimport type { ScopeMain } from '@teambit/scope';\nimport { ScopeAspect } from '@teambit/scope';\nimport type { ComponentID } from '@teambit/component-id';\nimport type { IpcEventsMain } from '@teambit/ipc-events';\nimport { IpcEventsAspect } from '@teambit/ipc-events';\nimport type { Logger, LoggerMain } from '@teambit/logger';\nimport { LoggerAspect } from '@teambit/logger';\nimport type { PubsubMain } from '@teambit/pubsub';\nimport { PubsubAspect } from '@teambit/pubsub';\nimport { CFG_WATCH_USE_POLLING } from '@teambit/legacy.constants';\nimport type { Workspace } from '@teambit/workspace';\nimport { WorkspaceAspect, OutsideWorkspaceError } from '@teambit/workspace';\nimport pMapSeries from 'p-map-series';\nimport { WatchCommand } from './watch.cmd';\nimport type { EventMessages, WatchOptions } from './watcher';\nimport { Watcher } from './watcher';\nimport { WatcherAspect } from './watcher.aspect';\nimport type { ConfigStoreMain } from '@teambit/config-store';\nimport { ConfigStoreAspect } from '@teambit/config-store';\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 readonly configStore: ConfigStoreMain\n ) {}\n\n async watch(opts: WatchOptions, msgs?: EventMessages) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n if (opts.preImport) {\n await this.workspace.importObjectsIfOutdatedAgainstBitmap();\n }\n const watcher = new Watcher(this.workspace, this.pubsub, this, opts, msgs);\n await watcher.watch();\n }\n\n async getChokidarWatchOptions(): Promise<ChokidarWatchOptions> {\n const usePollingConf = this.configStore.getConfig(CFG_WATCH_USE_POLLING);\n const usePolling = usePollingConf === 'true';\n return {\n ignoreInitial: true,\n persistent: true,\n usePolling,\n };\n }\n\n async watchScopeInternalFiles(\n additionalPaths?: string[],\n onAdditionalFileChange?: (filePath: string) => Promise<void>\n ) {\n const chokidarOpts = await this.getChokidarWatchOptions();\n await this.scope.watchScopeInternalFiles(chokidarOpts, additionalPaths, onAdditionalFileChange);\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 = [\n CLIAspect,\n WorkspaceAspect,\n ScopeAspect,\n PubsubAspect,\n LoggerAspect,\n IpcEventsAspect,\n ConfigStoreAspect,\n ];\n static runtime = MainRuntime;\n\n static async provider(\n [cli, workspace, scope, pubsub, loggerMain, ipcEvents, configStore]: [\n CLIMain,\n Workspace,\n ScopeMain,\n PubsubMain,\n LoggerMain,\n IpcEventsMain,\n ConfigStoreMain,\n ],\n _,\n [onPreWatchSlot]: [OnPreWatchSlot]\n ) {\n const logger = loggerMain.createLogger(WatcherAspect.id);\n const watcherMain = new WatcherMain(workspace, scope, pubsub, onPreWatchSlot, ipcEvents, logger, configStore);\n const watchCmd = new WatchCommand(logger, watcherMain);\n cli.register(watchCmd);\n return watcherMain;\n }\n}\n\nWatcherAspect.addRuntime(WatcherMain);\n\nexport default WatcherMain;\n"],"mappings":";;;;;;AACA,SAAAA,gBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,eAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,KAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,IAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAG,SAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,QAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,OAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,WAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,UAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,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AAEC,KAAK,EAAEC,MAAM,EAAEC,cAAc,EAAEC,SAAS,EAAEC,MAAM,EAAEC,WAAW,CAAC;IAC7G,MAAMsC,QAAQ,GAAG,KAAIC,qBAAY,EAACxC,MAAM,EAAEsC,WAAW,CAAC;IACtDN,GAAG,CAACF,QAAQ,CAACS,QAAQ,CAAC;IACtB,OAAOD,WAAW;EACpB;AACF;AAACG,OAAA,CAAAhD,WAAA,GAAAA,WAAA;AAAAlB,eAAA,CAjFYkB,WAAW,WAkDP,CAACiD,eAAI,CAACC,QAAQ,CAAa,CAAC,CAAC;AAAApE,eAAA,CAlDjCkB,WAAW,kBAmDA,CACpBmD,gBAAS,EACTC,4BAAe,EACfC,oBAAW,EACXC,sBAAY,EACZC,sBAAY,EACZC,4BAAe,EACfC,gCAAiB,CAClB;AAAA3E,eAAA,CA3DUkB,WAAW,aA4DL0D,6BAAW;AAuB9Bf,yBAAa,CAACgB,UAAU,CAAC3D,WAAW,CAAC;AAAC,IAAA4D,QAAA,GAAAZ,OAAA,CAAAnE,OAAA,GAEvBmB,WAAW","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/watcher",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1188",
|
|
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": "1.0.
|
|
9
|
+
"version": "1.0.1188"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"chalk": "4.1.2",
|
|
@@ -21,18 +21,19 @@
|
|
|
21
21
|
"@teambit/component-id": "1.2.4",
|
|
22
22
|
"@teambit/harmony": "0.4.12",
|
|
23
23
|
"@teambit/harmony.modules.send-server-sent-events": "0.0.31",
|
|
24
|
+
"@teambit/legacy.bit-map": "0.0.228",
|
|
25
|
+
"@teambit/legacy.consumer": "0.0.171",
|
|
24
26
|
"@teambit/legacy.logger": "0.0.63",
|
|
27
|
+
"@teambit/legacy.scope": "0.0.171",
|
|
25
28
|
"@teambit/legacy.utils": "0.0.52",
|
|
26
|
-
"@teambit/logger": "0.0.
|
|
27
|
-
"@teambit/workspace": "1.0.
|
|
28
|
-
"@teambit/cli": "0.0.
|
|
29
|
-
"@teambit/config-store": "0.0.
|
|
30
|
-
"@teambit/
|
|
31
|
-
"@teambit/
|
|
32
|
-
"@teambit/
|
|
33
|
-
"@teambit/
|
|
34
|
-
"@teambit/legacy.consumer": "0.0.170",
|
|
35
|
-
"@teambit/legacy.scope": "0.0.170"
|
|
29
|
+
"@teambit/logger": "0.0.1494",
|
|
30
|
+
"@teambit/workspace": "1.0.1188",
|
|
31
|
+
"@teambit/cli": "0.0.1401",
|
|
32
|
+
"@teambit/config-store": "0.0.282",
|
|
33
|
+
"@teambit/harmony.modules.runtimes": "0.0.1",
|
|
34
|
+
"@teambit/ipc-events": "1.0.1188",
|
|
35
|
+
"@teambit/pubsub": "1.0.1188",
|
|
36
|
+
"@teambit/scope": "1.0.1188"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@types/lodash": "4.14.165",
|
|
File without changes
|