@teambit/watcher 1.0.587 → 1.0.590
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/watch.cmd.d.ts +1 -1
- package/dist/watch.cmd.js +2 -4
- package/dist/watch.cmd.js.map +1 -1
- package/dist/watcher.d.ts +12 -5
- package/dist/watcher.js +83 -24
- package/dist/watcher.js.map +1 -1
- package/dist/watcher.main.runtime.d.ts +2 -2
- package/dist/watcher.main.runtime.js +2 -2
- package/dist/watcher.main.runtime.js.map +1 -1
- package/package.json +11 -10
- /package/dist/{preview-1744168729194.js → preview-1744364829202.js} +0 -0
package/dist/watch.cmd.d.ts
CHANGED
@@ -46,6 +46,6 @@ export declare class WatchCommand implements Command {
|
|
46
46
|
watcher: WatcherMain);
|
47
47
|
private registerToEvents;
|
48
48
|
private eventsListener;
|
49
|
-
|
49
|
+
wait(cliArgs: [], watchCmdOpts: WatchCmdOpts): Promise<void>;
|
50
50
|
}
|
51
51
|
export {};
|
package/dist/watch.cmd.js
CHANGED
@@ -88,7 +88,7 @@ if this doesn't work well for you, run "bit config set watch_use_polling true" t
|
|
88
88
|
registerToEvents() {
|
89
89
|
this.pubsub.sub(_compiler().CompilerAspect.id, this.eventsListener);
|
90
90
|
}
|
91
|
-
async
|
91
|
+
async wait(cliArgs, watchCmdOpts) {
|
92
92
|
const {
|
93
93
|
verbose,
|
94
94
|
checkTypes,
|
@@ -115,7 +115,6 @@ if this doesn't work well for you, run "bit config set watch_use_polling true" t
|
|
115
115
|
}
|
116
116
|
};
|
117
117
|
const watchOpts = {
|
118
|
-
msgs: getMessages(this.logger),
|
119
118
|
verbose,
|
120
119
|
compile: true,
|
121
120
|
preCompile: !watchCmdOpts.skipPreCompilation,
|
@@ -126,8 +125,7 @@ if this doesn't work well for you, run "bit config set watch_use_polling true" t
|
|
126
125
|
trigger: trigger ? _componentId().ComponentID.fromString(trigger) : undefined,
|
127
126
|
generateTypes: watchCmdOpts.generateTypes
|
128
127
|
};
|
129
|
-
await this.watcher.watch(watchOpts);
|
130
|
-
return 'watcher terminated';
|
128
|
+
await this.watcher.watch(watchOpts, getMessages(this.logger));
|
131
129
|
}
|
132
130
|
}
|
133
131
|
exports.WatchCommand = WatchCommand;
|
package/dist/watch.cmd.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_moment","_componentId","_compiler","_outputFormatter","_checkTypes","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","WatchCommand","constructor","pubsub","logger","watcher","event","type","CompilerErrorEvent","TYPE","console","error","registerToEvents","sub","CompilerAspect","id","eventsListener","report","cliArgs","watchCmdOpts","verbose","checkTypes","import","importIfNeeded","skipImport","trigger","consoleWarning","getCheckTypesEnum","undefined","CheckTypes","None","EntireProject","ChangedFile","Error","watchOpts","msgs","getMessages","compile","preCompile","skipPreCompilation","spawnTSServer","Boolean","ComponentID","fromString","generateTypes","watch","exports","onAll","path","onStart","onReady","workspace","watchPathsSortByComponent","clearOutdatedData","formatWatchPathsSortByComponent","chalk","yellow","name","moment","format","onChange","args","printOnFileEvent","onAdd","onUnlink","onError","err","eventMsgPlaceholder","filePaths","buildResults","duration","failureMsg","files","join","length","formatCompileResults","process","stdout","write"],"sources":["watch.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport moment from 'moment';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport type { Logger } from '@teambit/logger';\nimport type { BitBaseEvent, PubsubMain } from '@teambit/pubsub';\nimport { OnComponentEventResult, Workspace } from '@teambit/workspace';\nimport { ComponentID } from '@teambit/component-id';\nimport { CompilerAspect, CompilerErrorEvent } from '@teambit/compiler';\nimport { EventMessages, RootDirs, WatchOptions } from './watcher';\nimport { formatCompileResults, formatWatchPathsSortByComponent } from './output-formatter';\nimport { CheckTypes } from './check-types';\nimport { WatcherMain } from './watcher.main.runtime';\n\ntype WatchCmdOpts = {\n verbose?: boolean;\n skipPreCompilation?: boolean;\n checkTypes?: string | boolean;\n import?: boolean;\n skipImport?: boolean;\n generateTypes?: boolean;\n trigger?: string;\n};\n\nexport class WatchCommand implements Command {\n name = 'watch';\n description = 'automatically recompile modified components (on save)';\n extendedDescription = `by default, the watcher doesn't use polling, to keep the CPU idle.\nif this doesn't work well for you, run \"bit config set watch_use_polling true\" to use polling.`;\n helpUrl = 'reference/compiling/compiler-overview';\n alias = '';\n group = 'development';\n options = [\n ['v', 'verbose', 'show all watch events and compiler verbose output'],\n ['', 'skip-pre-compilation', 'skip compilation step before starting to watch'],\n [\n 't',\n 'check-types [string]',\n 'show errors/warnings for types. options are [file, project] to investigate only changed file or entire project. defaults to project',\n ],\n [\n 'i',\n 'import',\n 'DEPRECATED. it is now the default. helpful when using git. import component objects if .bitmap changed not by bit',\n ],\n ['', 'skip-import', 'do not import component objects if .bitmap changed not by bit'],\n ['', 'generate-types', 'EXPERIMENTAL. generate d.ts files for typescript components (hurts performance)'],\n [\n '',\n 'trigger <comp-id>',\n 'trigger recompilation of the specified component regardless of what changed. helpful when this comp-id must be a bundle',\n ],\n ] as CommandOptions;\n\n constructor(\n /**\n * logger extension.\n */\n private pubsub: PubsubMain,\n\n /**\n * logger extension.\n */\n private logger: Logger,\n\n /**\n * watcher extension.\n */\n private watcher: WatcherMain\n ) {\n this.registerToEvents();\n }\n\n private registerToEvents() {\n this.pubsub.sub(CompilerAspect.id, this.eventsListener);\n }\n\n private eventsListener = (event: BitBaseEvent<any>) => {\n switch (event.type) {\n case CompilerErrorEvent.TYPE:\n this.logger.console(`Watcher error ${event.data.error}, 'error'`);\n break;\n default:\n }\n };\n\n async report(cliArgs: [], watchCmdOpts: WatchCmdOpts) {\n const { verbose, checkTypes, import: importIfNeeded, skipImport, trigger } = watchCmdOpts;\n if (importIfNeeded) {\n this.logger.consoleWarning('the \"--import\" flag is deprecated and is now the default behavior');\n }\n const getCheckTypesEnum = () => {\n switch (checkTypes) {\n case undefined:\n case false:\n return CheckTypes.None;\n case 'project':\n case true: // project is the default\n return CheckTypes.EntireProject;\n case 'file':\n return CheckTypes.ChangedFile;\n default:\n throw new Error(`check-types can be either \"file\" or \"project\". got \"${checkTypes}\"`);\n }\n };\n const watchOpts: WatchOptions = {\n msgs: getMessages(this.logger),\n verbose,\n compile: true,\n preCompile: !watchCmdOpts.skipPreCompilation,\n spawnTSServer: Boolean(checkTypes), // if check-types is enabled, it must spawn the tsserver.\n checkTypes: getCheckTypesEnum(),\n import: !skipImport,\n trigger: trigger ? ComponentID.fromString(trigger) : undefined,\n generateTypes: watchCmdOpts.generateTypes,\n };\n await this.watcher.watch(watchOpts);\n return 'watcher terminated';\n }\n}\n\nfunction getMessages(logger: Logger): EventMessages {\n return {\n onAll: (event: string, path: string) => logger.console(`Event: \"${event}\". Path: ${path}`),\n onStart: () => {},\n onReady: (workspace: Workspace, watchPathsSortByComponent: RootDirs, verbose?: boolean) => {\n clearOutdatedData();\n if (verbose) {\n logger.console(formatWatchPathsSortByComponent(watchPathsSortByComponent));\n }\n logger.console(\n chalk.yellow(\n `Watching for component changes in workspace ${workspace.name} (${moment().format('HH:mm:ss')})...\\n`\n )\n );\n },\n onChange: (...args) => {\n printOnFileEvent(logger, 'changed', ...args);\n },\n onAdd: (...args) => {\n printOnFileEvent(logger, 'added', ...args);\n },\n onUnlink: (...args) => {\n printOnFileEvent(logger, 'removed', ...args);\n },\n onError: (err) => {\n logger.console(`Watcher error ${err}`);\n },\n };\n}\n\nfunction printOnFileEvent(\n logger: Logger,\n eventMsgPlaceholder: 'changed' | 'added' | 'removed',\n filePaths: string[],\n buildResults: OnComponentEventResult[],\n verbose: boolean,\n duration: number,\n failureMsg?: string\n) {\n const files = filePaths.join(', ');\n if (!buildResults.length) {\n if (!failureMsg) {\n if (verbose) logger.console(`The files ${files} have been ${eventMsgPlaceholder}, but nothing to compile\\n\\n`);\n return;\n }\n logger.console(`${failureMsg}\\n\\n`);\n return;\n }\n logger.console(`The file(s) ${files} have been ${eventMsgPlaceholder}.\\n`);\n logger.console(formatCompileResults(buildResults));\n logger.console(`Finished (${duration}ms).`);\n logger.console(chalk.yellow(`Watching for component changes (${moment().format('HH:mm:ss')})...`));\n}\n\n/**\n * with console.clear() all history is deleted from the console. this function preserver the history.\n */\nfunction clearOutdatedData() {\n process.stdout.write('\\x1Bc');\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;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,iBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,gBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,YAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,WAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2C,SAAAC,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAA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A,SAASN,iBAAiBA,CAAA,EAAG;EAC3BuB,OAAO,CAACC,MAAM,CAACC,KAAK,CAAC,OAAO,CAAC;AAC/B","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_chalk","data","_interopRequireDefault","require","_moment","_componentId","_compiler","_outputFormatter","_checkTypes","e","__esModule","default","_defineProperty","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","WatchCommand","constructor","pubsub","logger","watcher","event","type","CompilerErrorEvent","TYPE","console","error","registerToEvents","sub","CompilerAspect","id","eventsListener","wait","cliArgs","watchCmdOpts","verbose","checkTypes","import","importIfNeeded","skipImport","trigger","consoleWarning","getCheckTypesEnum","undefined","CheckTypes","None","EntireProject","ChangedFile","Error","watchOpts","compile","preCompile","skipPreCompilation","spawnTSServer","Boolean","ComponentID","fromString","generateTypes","watch","getMessages","exports","onAll","path","onStart","onReady","workspace","watchPathsSortByComponent","clearOutdatedData","formatWatchPathsSortByComponent","chalk","yellow","name","moment","format","onChange","args","printOnFileEvent","onAdd","onUnlink","onError","err","eventMsgPlaceholder","filePaths","buildResults","duration","failureMsg","files","join","length","formatCompileResults","process","stdout","write"],"sources":["watch.cmd.ts"],"sourcesContent":["import chalk from 'chalk';\nimport moment from 'moment';\nimport { Command, CommandOptions } from '@teambit/cli';\nimport type { Logger } from '@teambit/logger';\nimport type { BitBaseEvent, PubsubMain } from '@teambit/pubsub';\nimport { OnComponentEventResult, Workspace } from '@teambit/workspace';\nimport { ComponentID } from '@teambit/component-id';\nimport { CompilerAspect, CompilerErrorEvent } from '@teambit/compiler';\nimport { EventMessages, RootDirs, WatchOptions } from './watcher';\nimport { formatCompileResults, formatWatchPathsSortByComponent } from './output-formatter';\nimport { CheckTypes } from './check-types';\nimport { WatcherMain } from './watcher.main.runtime';\n\ntype WatchCmdOpts = {\n verbose?: boolean;\n skipPreCompilation?: boolean;\n checkTypes?: string | boolean;\n import?: boolean;\n skipImport?: boolean;\n generateTypes?: boolean;\n trigger?: string;\n};\n\nexport class WatchCommand implements Command {\n name = 'watch';\n description = 'automatically recompile modified components (on save)';\n extendedDescription = `by default, the watcher doesn't use polling, to keep the CPU idle.\nif this doesn't work well for you, run \"bit config set watch_use_polling true\" to use polling.`;\n helpUrl = 'reference/compiling/compiler-overview';\n alias = '';\n group = 'development';\n options = [\n ['v', 'verbose', 'show all watch events and compiler verbose output'],\n ['', 'skip-pre-compilation', 'skip compilation step before starting to watch'],\n [\n 't',\n 'check-types [string]',\n 'show errors/warnings for types. options are [file, project] to investigate only changed file or entire project. defaults to project',\n ],\n [\n 'i',\n 'import',\n 'DEPRECATED. it is now the default. helpful when using git. import component objects if .bitmap changed not by bit',\n ],\n ['', 'skip-import', 'do not import component objects if .bitmap changed not by bit'],\n ['', 'generate-types', 'EXPERIMENTAL. generate d.ts files for typescript components (hurts performance)'],\n [\n '',\n 'trigger <comp-id>',\n 'trigger recompilation of the specified component regardless of what changed. helpful when this comp-id must be a bundle',\n ],\n ] as CommandOptions;\n\n constructor(\n /**\n * logger extension.\n */\n private pubsub: PubsubMain,\n\n /**\n * logger extension.\n */\n private logger: Logger,\n\n /**\n * watcher extension.\n */\n private watcher: WatcherMain\n ) {\n this.registerToEvents();\n }\n\n private registerToEvents() {\n this.pubsub.sub(CompilerAspect.id, this.eventsListener);\n }\n\n private eventsListener = (event: BitBaseEvent<any>) => {\n switch (event.type) {\n case CompilerErrorEvent.TYPE:\n this.logger.console(`Watcher error ${event.data.error}, 'error'`);\n break;\n default:\n }\n };\n\n async wait(cliArgs: [], watchCmdOpts: WatchCmdOpts) {\n const { verbose, checkTypes, import: importIfNeeded, skipImport, trigger } = watchCmdOpts;\n if (importIfNeeded) {\n this.logger.consoleWarning('the \"--import\" flag is deprecated and is now the default behavior');\n }\n const getCheckTypesEnum = () => {\n switch (checkTypes) {\n case undefined:\n case false:\n return CheckTypes.None;\n case 'project':\n case true: // project is the default\n return CheckTypes.EntireProject;\n case 'file':\n return CheckTypes.ChangedFile;\n default:\n throw new Error(`check-types can be either \"file\" or \"project\". got \"${checkTypes}\"`);\n }\n };\n const watchOpts: WatchOptions = {\n verbose,\n compile: true,\n preCompile: !watchCmdOpts.skipPreCompilation,\n spawnTSServer: Boolean(checkTypes), // if check-types is enabled, it must spawn the tsserver.\n checkTypes: getCheckTypesEnum(),\n import: !skipImport,\n trigger: trigger ? ComponentID.fromString(trigger) : undefined,\n generateTypes: watchCmdOpts.generateTypes,\n };\n await this.watcher.watch(watchOpts, getMessages(this.logger));\n }\n}\n\nfunction getMessages(logger: Logger): EventMessages {\n return {\n onAll: (event: string, path: string) => logger.console(`Event: \"${event}\". Path: ${path}`),\n onStart: () => {},\n onReady: (workspace: Workspace, watchPathsSortByComponent: RootDirs, verbose?: boolean) => {\n clearOutdatedData();\n if (verbose) {\n logger.console(formatWatchPathsSortByComponent(watchPathsSortByComponent));\n }\n logger.console(\n chalk.yellow(\n `Watching for component changes in workspace ${workspace.name} (${moment().format('HH:mm:ss')})...\\n`\n )\n );\n },\n onChange: (...args) => {\n printOnFileEvent(logger, 'changed', ...args);\n },\n onAdd: (...args) => {\n printOnFileEvent(logger, 'added', ...args);\n },\n onUnlink: (...args) => {\n printOnFileEvent(logger, 'removed', ...args);\n },\n onError: (err) => {\n logger.console(`Watcher error ${err}`);\n },\n };\n}\n\nfunction printOnFileEvent(\n logger: Logger,\n eventMsgPlaceholder: 'changed' | 'added' | 'removed',\n filePaths: string[],\n buildResults: OnComponentEventResult[],\n verbose: boolean,\n duration: number,\n failureMsg?: string\n) {\n const files = filePaths.join(', ');\n if (!buildResults.length) {\n if (!failureMsg) {\n if (verbose) logger.console(`The files ${files} have been ${eventMsgPlaceholder}, but nothing to compile\\n\\n`);\n return;\n }\n logger.console(`${failureMsg}\\n\\n`);\n return;\n }\n logger.console(`The file(s) ${files} have been ${eventMsgPlaceholder}.\\n`);\n logger.console(formatCompileResults(buildResults));\n logger.console(`Finished (${duration}ms).`);\n logger.console(chalk.yellow(`Watching for component changes (${moment().format('HH:mm:ss')})...`));\n}\n\n/**\n * with console.clear() all history is deleted from the console. this function preserver the history.\n */\nfunction clearOutdatedData() {\n process.stdout.write('\\x1Bc');\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;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAKA,SAAAI,aAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,YAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,iBAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,gBAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,YAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,WAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2C,SAAAC,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,gBAAAH,CAAA,EAAAI,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAJ,CAAA,GAAAO,MAAA,CAAAC,cAAA,CAAAR,CAAA,EAAAI,CAAA,IAAAK,KAAA,E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{
|
|
22
22
|
};
|
23
23
|
export type OnFileEventFunc = (filePaths: string[], buildResults: OnComponentEventResult[], verbose: boolean, duration: number, failureMsg?: string) => void;
|
24
24
|
export type WatchOptions = {
|
25
|
-
msgs?: EventMessages;
|
26
25
|
initiator?: CompilationInitiator;
|
27
26
|
verbose?: boolean;
|
28
27
|
spawnTSServer?: boolean;
|
@@ -42,7 +41,9 @@ export declare class Watcher {
|
|
42
41
|
private pubsub;
|
43
42
|
private watcherMain;
|
44
43
|
private options;
|
45
|
-
private
|
44
|
+
private msgs?;
|
45
|
+
private watcherType;
|
46
|
+
private chokidarWatcher;
|
46
47
|
private changedFilesPerComponent;
|
47
48
|
private watchQueue;
|
48
49
|
private bitMapChangesInProgress;
|
@@ -51,9 +52,12 @@ export declare class Watcher {
|
|
51
52
|
private verbose;
|
52
53
|
private multipleWatchers;
|
53
54
|
private logger;
|
54
|
-
|
55
|
+
private workspacePathLinux;
|
56
|
+
constructor(workspace: Workspace, pubsub: PubsubMain, watcherMain: WatcherMain, options: WatchOptions, msgs?: EventMessages | undefined);
|
55
57
|
get consumer(): Consumer;
|
56
|
-
watch(): Promise<
|
58
|
+
watch(): Promise<void>;
|
59
|
+
private watchParcel;
|
60
|
+
private watchChokidar;
|
57
61
|
/**
|
58
62
|
* *** DEBOUNCING ***
|
59
63
|
* some actions trigger multiple files changes at (almost) the same time. e.g. "git pull".
|
@@ -116,7 +120,10 @@ export declare class Watcher {
|
|
116
120
|
private getComponentIdByPath;
|
117
121
|
private getRelativePathLinux;
|
118
122
|
private findRootDirByFilePathRecursively;
|
119
|
-
private
|
123
|
+
private shouldIgnoreFromLocalScopeChokidar;
|
124
|
+
private shouldIgnoreFromLocalScopeParcel;
|
125
|
+
private createChokidarWatcher;
|
126
|
+
private onParcelWatch;
|
120
127
|
private setRootDirs;
|
121
128
|
}
|
122
129
|
export {};
|
package/dist/watcher.js
CHANGED
@@ -88,6 +88,13 @@ function _watchQueue() {
|
|
88
88
|
};
|
89
89
|
return data;
|
90
90
|
}
|
91
|
+
function _watcher() {
|
92
|
+
const data = _interopRequireDefault(require("@parcel/watcher"));
|
93
|
+
_watcher = function () {
|
94
|
+
return data;
|
95
|
+
};
|
96
|
+
return data;
|
97
|
+
}
|
91
98
|
function _harmonyModules() {
|
92
99
|
const data = require("@teambit/harmony.modules.send-server-sent-events");
|
93
100
|
_harmonyModules = function () {
|
@@ -95,12 +102,9 @@ function _harmonyModules() {
|
|
95
102
|
};
|
96
103
|
return data;
|
97
104
|
}
|
98
|
-
const _excluded = ["msgs"];
|
99
105
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
100
106
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
101
107
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
102
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
103
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
104
108
|
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; }
|
105
109
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
106
110
|
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); }
|
@@ -108,12 +112,14 @@ const DEBOUNCE_WAIT_MS = 100;
|
|
108
112
|
// ts fails when importing it from @teambit/legacy/dist/utils/path.
|
109
113
|
|
110
114
|
class Watcher {
|
111
|
-
constructor(workspace, pubsub, watcherMain, options) {
|
115
|
+
constructor(workspace, pubsub, watcherMain, options, msgs) {
|
112
116
|
this.workspace = workspace;
|
113
117
|
this.pubsub = pubsub;
|
114
118
|
this.watcherMain = watcherMain;
|
115
119
|
this.options = options;
|
116
|
-
|
120
|
+
this.msgs = msgs;
|
121
|
+
_defineProperty(this, "watcherType", 'parcel');
|
122
|
+
_defineProperty(this, "chokidarWatcher", void 0);
|
117
123
|
_defineProperty(this, "changedFilesPerComponent", {});
|
118
124
|
_defineProperty(this, "watchQueue", new (_watchQueue().WatchQueue)());
|
119
125
|
_defineProperty(this, "bitMapChangesInProgress", false);
|
@@ -122,35 +128,56 @@ class Watcher {
|
|
122
128
|
_defineProperty(this, "verbose", false);
|
123
129
|
_defineProperty(this, "multipleWatchers", []);
|
124
130
|
_defineProperty(this, "logger", void 0);
|
131
|
+
_defineProperty(this, "workspacePathLinux", void 0);
|
125
132
|
this.ipcEventsDir = this.watcherMain.ipcEvents.eventsDir;
|
126
133
|
this.verbose = this.options.verbose || false;
|
127
134
|
this.logger = this.watcherMain.logger;
|
135
|
+
this.workspacePathLinux = (0, _legacy3().pathNormalizeToLinux)(this.workspace.path);
|
136
|
+
if (process.env.BIT_WATCHER_USE_CHOKIDAR === 'true' || process.env.BIT_WATCHER_USE_CHOKIDAR === '1') {
|
137
|
+
this.watcherType = 'chokidar';
|
138
|
+
}
|
128
139
|
}
|
129
140
|
get consumer() {
|
130
141
|
return this.workspace.consumer;
|
131
142
|
}
|
132
143
|
async watch() {
|
133
|
-
const _this$options = this.options,
|
134
|
-
{
|
135
|
-
msgs
|
136
|
-
} = _this$options,
|
137
|
-
watchOpts = _objectWithoutProperties(_this$options, _excluded);
|
138
144
|
await this.setRootDirs();
|
139
145
|
const componentIds = Object.values(this.rootDirs);
|
140
|
-
await this.watcherMain.triggerOnPreWatch(componentIds,
|
146
|
+
await this.watcherMain.triggerOnPreWatch(componentIds, this.options);
|
141
147
|
await this.watcherMain.watchScopeInternalFiles();
|
142
|
-
await this.
|
143
|
-
|
148
|
+
this.watcherType === 'parcel' ? await this.watchParcel() : await this.watchChokidar();
|
149
|
+
}
|
150
|
+
async watchParcel() {
|
151
|
+
this.msgs?.onStart(this.workspace);
|
152
|
+
try {
|
153
|
+
await _watcher().default.subscribe(this.workspace.path, this.onParcelWatch.bind(this), {
|
154
|
+
ignore: ['**/node_modules/**', '**/package.json']
|
155
|
+
});
|
156
|
+
} catch (err) {
|
157
|
+
if (err.message.includes('Error starting FSEvents stream')) {
|
158
|
+
throw new Error(`failed to start the watcher: ${err.message}.
|
159
|
+
try rerunning the command. if that doesn't help, please refer to this Watchman troubleshooting guide:
|
160
|
+
https://facebook.github.io/watchman/docs/troubleshooting#fseventstreamstart-register_with_server-error-f2d_register_rpc--null--21`);
|
161
|
+
}
|
162
|
+
throw err;
|
163
|
+
}
|
164
|
+
this.msgs?.onReady(this.workspace, this.rootDirs, this.verbose);
|
165
|
+
this.logger.clearStatusLine();
|
166
|
+
}
|
167
|
+
async watchChokidar() {
|
168
|
+
await this.createChokidarWatcher();
|
169
|
+
const watcher = this.chokidarWatcher;
|
170
|
+
const msgs = this.msgs;
|
144
171
|
msgs?.onStart(this.workspace);
|
145
172
|
return new Promise((resolve, reject) => {
|
146
173
|
if (this.verbose) {
|
147
174
|
// @ts-ignore
|
148
|
-
if (msgs?.onAll) watcher.on('all', msgs
|
175
|
+
if (msgs?.onAll) watcher.on('all', msgs.onAll);
|
149
176
|
}
|
150
177
|
watcher.on('ready', () => {
|
151
178
|
msgs?.onReady(this.workspace, this.rootDirs, this.verbose);
|
152
179
|
if (this.verbose) {
|
153
|
-
const watched = this.
|
180
|
+
const watched = this.chokidarWatcher.getWatched();
|
154
181
|
const totalWatched = Object.values(watched).flat().length;
|
155
182
|
_legacy2().logger.console(`${_chalk().default.bold('the following files are being watched:')}\n${JSON.stringify(watched, null, 2)}`);
|
156
183
|
_legacy2().logger.console(`\nTotal files being watched: ${_chalk().default.bold(totalWatched.toString())}`);
|
@@ -462,20 +489,52 @@ class Watcher {
|
|
462
489
|
if (parentDir === filePath) return null;
|
463
490
|
return this.findRootDirByFilePathRecursively(parentDir);
|
464
491
|
}
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
492
|
+
shouldIgnoreFromLocalScopeChokidar(pathToCheck) {
|
493
|
+
if (pathToCheck.startsWith(this.ipcEventsDir) || pathToCheck.endsWith(_legacy4().UNMERGED_FILENAME)) return false;
|
494
|
+
return pathToCheck.startsWith(`${this.workspacePathLinux}/.git/`) || pathToCheck.startsWith(`${this.workspacePathLinux}/.bit/`);
|
495
|
+
}
|
496
|
+
shouldIgnoreFromLocalScopeParcel(pathToCheck) {
|
497
|
+
if (pathToCheck.startsWith(this.ipcEventsDir) || pathToCheck.endsWith(_legacy4().UNMERGED_FILENAME)) return false;
|
498
|
+
return pathToCheck.startsWith((0, _path().join)(this.workspace.path, '.git') + _path().sep) || pathToCheck.startsWith((0, _path().join)(this.workspace.path, '.bit') + _path().sep);
|
499
|
+
}
|
500
|
+
async createChokidarWatcher() {
|
471
501
|
const chokidarOpts = await this.watcherMain.getChokidarWatchOptions();
|
472
502
|
// `chokidar` matchers have Bash-parity, so Windows-style backslashes are not supported as separators.
|
473
503
|
// (windows-style backslashes are converted to forward slashes)
|
474
|
-
chokidarOpts.ignored = ['**/node_modules/**', '**/package.json',
|
475
|
-
this.
|
504
|
+
chokidarOpts.ignored = ['**/node_modules/**', '**/package.json', this.shouldIgnoreFromLocalScopeChokidar.bind(this)];
|
505
|
+
this.chokidarWatcher = _chokidar().default.watch(this.workspace.path, chokidarOpts);
|
506
|
+
if (this.verbose) {
|
507
|
+
_legacy2().logger.console(`${_chalk().default.bold('chokidar.options:\n')} ${JSON.stringify(this.chokidarWatcher.options, undefined, 2)}`);
|
508
|
+
}
|
509
|
+
}
|
510
|
+
async onParcelWatch(err, allEvents) {
|
511
|
+
const events = allEvents.filter(event => !this.shouldIgnoreFromLocalScopeParcel(event.path));
|
512
|
+
if (!events.length) {
|
513
|
+
return;
|
514
|
+
}
|
515
|
+
const msgs = this.msgs;
|
476
516
|
if (this.verbose) {
|
477
|
-
|
517
|
+
if (msgs?.onAll) events.forEach(event => msgs.onAll(event.type, event.path));
|
518
|
+
}
|
519
|
+
if (err) {
|
520
|
+
msgs?.onError(err);
|
521
|
+
throw err;
|
478
522
|
}
|
523
|
+
const startTime = new Date().getTime();
|
524
|
+
await (0, _pMapSeries().default)(events, async event => {
|
525
|
+
const {
|
526
|
+
files,
|
527
|
+
results,
|
528
|
+
debounced,
|
529
|
+
irrelevant,
|
530
|
+
failureMsg
|
531
|
+
} = await this.handleChange(event.path);
|
532
|
+
if (debounced || irrelevant) {
|
533
|
+
return;
|
534
|
+
}
|
535
|
+
const duration = new Date().getTime() - startTime;
|
536
|
+
msgs?.onChange(files, results, this.verbose, duration, failureMsg);
|
537
|
+
});
|
479
538
|
}
|
480
539
|
async setRootDirs() {
|
481
540
|
this.rootDirs = {};
|
package/dist/watcher.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_path","_lodash","_legacy","_legacy2","_legacy3","_pMapSeries","_chalk","_legacy4","_chokidar","_workspace","_watchQueue","_harmonyModules","_excluded","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_objectWithoutProperties","i","_objectWithoutPropertiesLoose","n","indexOf","propertyIsEnumerable","call","hasOwnProperty","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","DEBOUNCE_WAIT_MS","Watcher","constructor","workspace","pubsub","watcherMain","options","WatchQueue","ipcEventsDir","ipcEvents","eventsDir","verbose","logger","consumer","watch","_this$options","msgs","watchOpts","setRootDirs","componentIds","values","rootDirs","triggerOnPreWatch","watchScopeInternalFiles","createWatcher","watcher","fsWatcher","onStart","Promise","resolve","reject","onAll","on","onReady","watched","getWatched","totalWatched","flat","console","chalk","bold","JSON","stringify","toString","clearStatusLine","event","filePath","startTime","Date","getTime","files","results","debounced","irrelevant","failureMsg","handleChange","duration","onChange","err","onError","endsWith","BIT_MAP","bitMapChangesInProgress","buildResults","watchQueue","add","handleBitmapChanges","onIdle","dirname","eventName","basename","content","fs","readFile","debug","parsed","parse","sendEventsToClients","triggerGotEvent","WORKSPACE_JSONC","triggerOnWorkspaceConfigChange","UNMERGED_FILENAME","clearCache","componentId","getComponentIdByPath","compIdStr","changedFilesPerComponent","sleep","triggerCompChanges","undefined","join","msg","error","message","ms","setTimeout","updatedComponentId","hasId","ids","listIds","find","id","isEqual","ignoreVersion","clearComponentCache","component","get","componentMap","state","_consumer","Error","compFilesRelativeToWorkspace","getFilesRelativeToConsumer","compFiles","nonCompFiles","partition","relativeFile","getRelativePathLinux","Boolean","p","removedFiles","compact","all","map","pathExists","toStringWithoutVersion","bitMap","updateComponentPaths","f","getPathRelativeToConsumer","executeWatchOperationsOnComponent","trigger","triggerOnComponentChange","previewsRootDirs","previewsIds","getAllBitIds","_reloadConsumer","importObjectsIfNeeded","triggerOnBitmapChange","newDirs","difference","removedDirs","addResults","mapSeries","dir","executeWatchOperationsOnRemove","import","currentIds","hasVersionChanges","prevId","searchWithoutVersion","version","existsInScope","scope","isComponentInScope","useCache","lane","getCurrentLaneObject","pub","WorkspaceAspect","createOnComponentRemovedEvent","triggerOnComponentRemove","isChange","isComponentWatchedExternally","idStr","createOnComponentChangeEvent","createOnComponentAddEvent","triggerOnComponentAdd","OnComponentRemovedEvent","now","hook","OnComponentChangeEvent","OnComponentAddEvent","watcherData","multipleWatchers","m","compilerId","rootDir","findRootDirByFilePathRecursively","pathNormalizeToLinux","parentDir","workspacePathLinux","path","ignoreLocalScope","pathToCheck","startsWith","chokidarOpts","getChokidarWatchOptions","ignored","chokidar","componentsFromBitMap","getAllComponents","getRootDir","exports"],"sources":["watcher.ts"],"sourcesContent":["import { PubsubMain } from '@teambit/pubsub';\nimport fs from 'fs-extra';\nimport { dirname, basename } from 'path';\nimport { compact, difference, partition } from 'lodash';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { BIT_MAP, WORKSPACE_JSONC } from '@teambit/legacy.constants';\nimport { Consumer } from '@teambit/legacy.consumer';\nimport { logger } from '@teambit/legacy.logger';\nimport { pathNormalizeToLinux, PathOsBasedAbsolute } from '@teambit/legacy.utils';\nimport mapSeries from 'p-map-series';\nimport chalk from 'chalk';\nimport { ChildProcess } from 'child_process';\nimport { UNMERGED_FILENAME } from '@teambit/legacy.scope';\nimport chokidar, { FSWatcher } from 'chokidar';\nimport { ComponentMap } from '@teambit/legacy.bit-map';\nimport { CompilationInitiator } from '@teambit/compiler';\nimport {\n WorkspaceAspect,\n Workspace,\n OnComponentEventResult,\n OnComponentChangeEvent,\n OnComponentAddEvent,\n OnComponentRemovedEvent,\n} from '@teambit/workspace';\nimport { CheckTypes } from './check-types';\nimport { WatcherMain } from './watcher.main.runtime';\nimport { WatchQueue } from './watch-queue';\nimport { Logger } from '@teambit/logger';\nimport { sendEventsToClients } from '@teambit/harmony.modules.send-server-sent-events';\n\nexport type WatcherProcessData = { watchProcess: ChildProcess; compilerId: ComponentID; componentIds: ComponentID[] };\n\nexport type EventMessages = {\n onAll: Function;\n onStart: Function;\n onReady: Function;\n onChange: OnFileEventFunc;\n onAdd: OnFileEventFunc;\n onUnlink: OnFileEventFunc;\n onError: Function;\n};\n\nexport type OnFileEventFunc = (\n filePaths: string[],\n buildResults: OnComponentEventResult[],\n verbose: boolean,\n duration: number,\n failureMsg?: string\n) => void;\n\nexport type WatchOptions = {\n msgs?: EventMessages;\n initiator?: CompilationInitiator;\n verbose?: boolean; // print watch events to the console. (also ts-server events if spawnTSServer is true)\n spawnTSServer?: boolean; // needed for check types and extract API/docs.\n checkTypes?: CheckTypes; // if enabled, the spawnTSServer becomes true.\n preCompile?: boolean; // whether compile all components before start watching\n compile?: boolean; // whether compile modified/added components during watch process\n import?: boolean; // whether import objects when .bitmap got version changes\n generateTypes?: boolean; // whether generate d.ts files for typescript files during watch process (hurts performance)\n trigger?: ComponentID; // trigger onComponentChange for the specified component-id. helpful when this comp must be a bundle, and needs to be recompile on any dep change.\n};\n\nexport type RootDirs = { [dir: PathLinux]: ComponentID };\n\nconst DEBOUNCE_WAIT_MS = 100;\ntype PathLinux = string; // ts fails when importing it from @teambit/legacy/dist/utils/path.\n\nexport class Watcher {\n private fsWatcher: FSWatcher;\n private changedFilesPerComponent: { [componentId: string]: string[] } = {};\n private watchQueue = new WatchQueue();\n private bitMapChangesInProgress = false;\n private ipcEventsDir: string;\n private rootDirs: RootDirs = {};\n private verbose = false;\n private multipleWatchers: WatcherProcessData[] = [];\n private logger: Logger;\n constructor(\n private workspace: Workspace,\n private pubsub: PubsubMain,\n private watcherMain: WatcherMain,\n private options: WatchOptions\n ) {\n this.ipcEventsDir = this.watcherMain.ipcEvents.eventsDir;\n this.verbose = this.options.verbose || false;\n this.logger = this.watcherMain.logger;\n }\n\n get consumer(): Consumer {\n return this.workspace.consumer;\n }\n\n async watch() {\n const { msgs, ...watchOpts } = this.options;\n await this.setRootDirs();\n const componentIds = Object.values(this.rootDirs);\n await this.watcherMain.triggerOnPreWatch(componentIds, watchOpts);\n await this.watcherMain.watchScopeInternalFiles();\n\n await this.createWatcher();\n const watcher = this.fsWatcher;\n msgs?.onStart(this.workspace);\n\n return new Promise((resolve, reject) => {\n if (this.verbose) {\n // @ts-ignore\n if (msgs?.onAll) watcher.on('all', msgs?.onAll);\n }\n watcher.on('ready', () => {\n msgs?.onReady(this.workspace, this.rootDirs, this.verbose);\n if (this.verbose) {\n const watched = this.fsWatcher.getWatched();\n const totalWatched = Object.values(watched).flat().length;\n logger.console(\n `${chalk.bold('the following files are being watched:')}\\n${JSON.stringify(watched, null, 2)}`\n );\n logger.console(`\\nTotal files being watched: ${chalk.bold(totalWatched.toString())}`);\n }\n\n this.logger.clearStatusLine();\n });\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n watcher.on('all', async (event, filePath) => {\n if (event !== 'change' && event !== 'add' && event !== 'unlink') return;\n const startTime = new Date().getTime();\n const { files, results, debounced, irrelevant, failureMsg } = await this.handleChange(filePath);\n if (debounced || irrelevant) {\n return;\n }\n const duration = new Date().getTime() - startTime;\n msgs?.onChange(files, results, this.verbose, duration, failureMsg);\n });\n watcher.on('error', (err) => {\n msgs?.onError(err);\n reject(err);\n });\n });\n }\n\n /**\n * *** DEBOUNCING ***\n * some actions trigger multiple files changes at (almost) the same time. e.g. \"git pull\".\n * this causes some performance and instability issues. a debouncing mechanism was implemented to help with this.\n * the way how it works is that the first file of the same component starts the execution with a delay (e.g. 200ms).\n * if, in the meanwhile, another file of the same component was changed, it won't start a new execution, instead,\n * it'll only add the file to `this.changedFilesPerComponent` prop.\n * once the execution starts, it'll delete this component-id from the `this.changedFilesPerComponent` array,\n * indicating the next file-change to start a new execution.\n *\n * implementation wise, `lodash.debounce` doesn't help here, because:\n * A) it doesn't return the results, unless \"leading\" option is true. here, it must be false, otherwise, it'll start\n * the execution immediately.\n * B) it debounces the method regardless the param passes to it. so it'll disregard the component-id and will delay\n * other components undesirably.\n *\n * *** QUEUE ***\n * the debouncing helps to not execute the same component multiple times concurrently. however, multiple components\n * and .bitmap changes execution can still be processed concurrently.\n * the following example explains why this is an issue.\n * compA is changed in the .bitmap file from version 0.0.1 to 0.0.2. its files were changed as well.\n * all these changes get pulled at the same time by \"git pull\", as a result, the execution of compA and the .bitmap\n * happen at the same time.\n * during the execution of compA, the component id is parsed as compA@0.0.1, later, it asks for the Workspace for this\n * id. while the workspace is looking for this id, the .bitmap execution reloaded the consumer and changed all versions.\n * after this change, the workspace doesn't have this id anymore, which will trigger an error.\n * to ensure this won't happen, we keep a flag to indicate whether the .bitmap execution is running, and if so, all\n * other executions are paused until the queue is empty (this is done by awaiting for queue.onIdle).\n * once the queue is empty, we know the .bitmap process was done and the workspace has all new ids.\n * in the example above, at this stage, the id will be resolved to compA@0.0.2.\n * one more thing, the queue is configured to have concurrency of 1. to make sure two components are not processed at\n * the same time. (the same way is done when loading all components from the filesystem/scope).\n * this way we can also ensure that if compA was started before the .bitmap execution, it will complete before the\n * .bitmap execution starts.\n */\n private async handleChange(filePath: string): Promise<{\n results: OnComponentEventResult[];\n files: string[];\n failureMsg?: string;\n debounced?: boolean;\n irrelevant?: boolean; // file/dir is not part of any component\n }> {\n try {\n if (filePath.endsWith(BIT_MAP)) {\n this.bitMapChangesInProgress = true;\n const buildResults = await this.watchQueue.add(() => this.handleBitmapChanges());\n this.bitMapChangesInProgress = false;\n this.logger.clearStatusLine();\n return { results: buildResults, files: [filePath] };\n }\n if (this.bitMapChangesInProgress) {\n await this.watchQueue.onIdle();\n }\n if (dirname(filePath) === this.ipcEventsDir) {\n const eventName = basename(filePath);\n if (eventName === 'onNotifySSE') {\n const content = await fs.readFile(filePath, 'utf8');\n this.logger.debug(`Watcher, onNotifySSE ${content}`);\n const parsed = JSON.parse(content);\n sendEventsToClients(parsed.event, parsed);\n } else {\n await this.watcherMain.ipcEvents.triggerGotEvent(eventName as any);\n }\n return { results: [], files: [filePath] };\n }\n if (filePath.endsWith(WORKSPACE_JSONC)) {\n await this.workspace.triggerOnWorkspaceConfigChange();\n return { results: [], files: [filePath] };\n }\n if (filePath.endsWith(UNMERGED_FILENAME)) {\n await this.workspace.clearCache();\n return { results: [], files: [filePath] };\n }\n const componentId = this.getComponentIdByPath(filePath);\n if (!componentId) {\n this.logger.clearStatusLine();\n return { results: [], files: [], irrelevant: true };\n }\n const compIdStr = componentId.toString();\n if (this.changedFilesPerComponent[compIdStr]) {\n this.changedFilesPerComponent[compIdStr].push(filePath);\n this.logger.clearStatusLine();\n return { results: [], files: [], debounced: true };\n }\n this.changedFilesPerComponent[compIdStr] = [filePath];\n await this.sleep(DEBOUNCE_WAIT_MS);\n const files = this.changedFilesPerComponent[compIdStr];\n delete this.changedFilesPerComponent[compIdStr];\n\n const buildResults = await this.watchQueue.add(() => this.triggerCompChanges(componentId, files));\n const failureMsg = buildResults.length\n ? undefined\n : `files ${files.join(', ')} are inside the component ${compIdStr} but configured to be ignored`;\n this.logger.clearStatusLine();\n return { results: buildResults, files, failureMsg };\n } catch (err: any) {\n const msg = `watcher found an error while handling ${filePath}`;\n logger.error(msg, err);\n logger.console(`${msg}, ${err.message}`);\n this.logger.clearStatusLine();\n return { results: [], files: [filePath], failureMsg: err.message };\n }\n }\n\n private async sleep(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n }\n\n private async triggerCompChanges(\n componentId: ComponentID,\n files: PathOsBasedAbsolute[]\n ): Promise<OnComponentEventResult[]> {\n let updatedComponentId: ComponentID | undefined = componentId;\n if (!this.workspace.hasId(componentId)) {\n // bitmap has changed meanwhile, which triggered `handleBitmapChanges`, which re-loaded consumer and updated versions\n // so the original componentId might not be in the workspace now, and we need to find the updated one\n const ids = this.workspace.listIds();\n updatedComponentId = ids.find((id) => id.isEqual(componentId, { ignoreVersion: true }));\n if (!updatedComponentId) {\n logger.debug(`triggerCompChanges, the component ${componentId.toString()} was probably removed from .bitmap`);\n return [];\n }\n }\n this.workspace.clearComponentCache(updatedComponentId);\n const component = await this.workspace.get(updatedComponentId);\n const componentMap: ComponentMap = component.state._consumer.componentMap;\n if (!componentMap) {\n throw new Error(\n `unable to find componentMap for ${updatedComponentId.toString()}, make sure this component is in .bitmap`\n );\n }\n const compFilesRelativeToWorkspace = componentMap.getFilesRelativeToConsumer();\n const [compFiles, nonCompFiles] = partition(files, (filePath) => {\n const relativeFile = this.getRelativePathLinux(filePath);\n return Boolean(compFilesRelativeToWorkspace.find((p) => p === relativeFile));\n });\n // nonCompFiles are either, files that were removed from the filesystem or existing files that are ignored.\n // the compiler takes care of removedFiles differently, e.g. removes dists dir and old symlinks.\n const removedFiles = compact(\n await Promise.all(nonCompFiles.map(async (filePath) => ((await fs.pathExists(filePath)) ? null : filePath)))\n );\n\n if (!compFiles.length && !removedFiles.length) {\n logger.debug(\n `the following files are part of the component ${componentId.toStringWithoutVersion()} but configured to be ignored:\\n${files.join(\n '\\n'\n )}'`\n );\n return [];\n }\n this.consumer.bitMap.updateComponentPaths(\n componentId,\n compFiles.map((f) => this.consumer.getPathRelativeToConsumer(f)),\n removedFiles.map((f) => this.consumer.getPathRelativeToConsumer(f))\n );\n const buildResults = await this.executeWatchOperationsOnComponent(\n updatedComponentId,\n compFiles,\n removedFiles,\n true\n );\n if (this.options.trigger && !updatedComponentId.isEqual(this.options.trigger)) {\n await this.workspace.triggerOnComponentChange(this.options.trigger, [], [], this.options);\n }\n\n return buildResults;\n }\n\n /**\n * if .bitmap changed, it's possible that a new component has been added. trigger onComponentAdd.\n */\n private async handleBitmapChanges(): Promise<OnComponentEventResult[]> {\n const previewsRootDirs = { ...this.rootDirs };\n const previewsIds = this.consumer.bitMap.getAllBitIds();\n await this.workspace._reloadConsumer();\n await this.setRootDirs();\n await this.importObjectsIfNeeded(previewsIds);\n await this.workspace.triggerOnBitmapChange();\n const newDirs: string[] = difference(Object.keys(this.rootDirs), Object.keys(previewsRootDirs));\n const removedDirs: string[] = difference(Object.keys(previewsRootDirs), Object.keys(this.rootDirs));\n const results: OnComponentEventResult[] = [];\n if (newDirs.length) {\n const addResults = await mapSeries(newDirs, async (dir) =>\n this.executeWatchOperationsOnComponent(this.rootDirs[dir], [], [], false)\n );\n results.push(...addResults.flat());\n }\n if (removedDirs.length) {\n await mapSeries(removedDirs, (dir) => this.executeWatchOperationsOnRemove(previewsRootDirs[dir]));\n }\n\n return results;\n }\n\n /**\n * needed when using git.\n * it resolves the following issue - a user is running `git pull` which updates the components and the .bitmap file.\n * because the objects locally are not updated, the .bitmap has new versions that don't exist in the local scope.\n * as soon as the watcher gets an event about a file change, it loads the component which throws\n * ComponentsPendingImport error.\n * to resolve this, we import the new objects as soon as the .bitmap file changes.\n * for performance reasons, we import only when: 1) the .bitmap file has version changes and 2) this new version is\n * not already in the scope.\n */\n private async importObjectsIfNeeded(previewsIds: ComponentIdList) {\n if (!this.options.import) {\n return;\n }\n const currentIds = this.consumer.bitMap.getAllBitIds();\n const hasVersionChanges = currentIds.find((id) => {\n const prevId = previewsIds.searchWithoutVersion(id);\n return prevId && prevId.version !== id.version;\n });\n if (!hasVersionChanges) {\n return;\n }\n const existsInScope = await this.workspace.scope.isComponentInScope(hasVersionChanges);\n if (existsInScope) {\n // the .bitmap change was probably a result of tag/snap/merge, no need to import.\n return;\n }\n if (this.options.verbose) {\n logger.console(\n `Watcher: .bitmap has changed with new versions which do not exist locally, importing the objects...`\n );\n }\n await this.workspace.scope.import(currentIds, {\n useCache: true,\n lane: await this.workspace.getCurrentLaneObject(),\n });\n }\n\n private async executeWatchOperationsOnRemove(componentId: ComponentID) {\n logger.debug(`running OnComponentRemove hook for ${chalk.bold(componentId.toString())}`);\n this.pubsub.pub(WorkspaceAspect.id, this.createOnComponentRemovedEvent(componentId.toString()));\n await this.workspace.triggerOnComponentRemove(componentId);\n }\n\n private async executeWatchOperationsOnComponent(\n componentId: ComponentID,\n files: PathOsBasedAbsolute[],\n removedFiles: PathOsBasedAbsolute[] = [],\n isChange = true\n ): Promise<OnComponentEventResult[]> {\n if (this.isComponentWatchedExternally(componentId)) {\n // update capsule, once done, it automatically triggers the external watcher\n await this.workspace.get(componentId);\n return [];\n }\n const idStr = componentId.toString();\n\n if (isChange) {\n logger.debug(`running OnComponentChange hook for ${chalk.bold(idStr)}`);\n this.pubsub.pub(WorkspaceAspect.id, this.createOnComponentChangeEvent(idStr, 'OnComponentChange'));\n } else {\n logger.debug(`running OnComponentAdd hook for ${chalk.bold(idStr)}`);\n this.pubsub.pub(WorkspaceAspect.id, this.createOnComponentAddEvent(idStr, 'OnComponentAdd'));\n }\n\n const buildResults = isChange\n ? await this.workspace.triggerOnComponentChange(componentId, files, removedFiles, this.options)\n : await this.workspace.triggerOnComponentAdd(componentId, this.options);\n\n return buildResults;\n }\n\n private createOnComponentRemovedEvent(idStr) {\n return new OnComponentRemovedEvent(Date.now(), idStr);\n }\n\n private createOnComponentChangeEvent(idStr, hook) {\n return new OnComponentChangeEvent(Date.now(), idStr, hook);\n }\n\n private createOnComponentAddEvent(idStr, hook) {\n return new OnComponentAddEvent(Date.now(), idStr, hook);\n }\n\n private isComponentWatchedExternally(componentId: ComponentID) {\n const watcherData = this.multipleWatchers.find((m) => m.componentIds.find((id) => id.isEqual(componentId)));\n if (watcherData) {\n logger.debug(`${componentId.toString()} is watched by ${watcherData.compilerId.toString()}`);\n return true;\n }\n return false;\n }\n\n private getComponentIdByPath(filePath: string): ComponentID | null {\n const relativeFile = this.getRelativePathLinux(filePath);\n const rootDir = this.findRootDirByFilePathRecursively(relativeFile);\n if (!rootDir) {\n // the file is not part of any component. If it was a new component, or a new file of\n // existing component, then, handleBitmapChanges() should deal with it.\n return null;\n }\n return this.rootDirs[rootDir];\n }\n\n private getRelativePathLinux(filePath: string) {\n return pathNormalizeToLinux(this.consumer.getPathRelativeToConsumer(filePath));\n }\n\n private findRootDirByFilePathRecursively(filePath: string): string | null {\n if (this.rootDirs[filePath]) return filePath;\n const parentDir = dirname(filePath);\n if (parentDir === filePath) return null;\n return this.findRootDirByFilePathRecursively(parentDir);\n }\n\n private async createWatcher() {\n const workspacePathLinux = pathNormalizeToLinux(this.workspace.path);\n const ignoreLocalScope = (pathToCheck: string) => {\n if (pathToCheck.startsWith(this.ipcEventsDir) || pathToCheck.endsWith(UNMERGED_FILENAME)) return false;\n return (\n pathToCheck.startsWith(`${workspacePathLinux}/.git/`) || pathToCheck.startsWith(`${workspacePathLinux}/.bit/`)\n );\n };\n const chokidarOpts = await this.watcherMain.getChokidarWatchOptions();\n // `chokidar` matchers have Bash-parity, so Windows-style backslashes are not supported as separators.\n // (windows-style backslashes are converted to forward slashes)\n chokidarOpts.ignored = ['**/node_modules/**', '**/package.json', ignoreLocalScope];\n this.fsWatcher = chokidar.watch(this.workspace.path, chokidarOpts);\n if (this.verbose) {\n logger.console(`${chalk.bold('chokidar.options:\\n')} ${JSON.stringify(this.fsWatcher.options, undefined, 2)}`);\n }\n }\n\n private async setRootDirs() {\n this.rootDirs = {};\n const componentsFromBitMap = this.consumer.bitMap.getAllComponents();\n componentsFromBitMap.map((componentMap) => {\n const componentId = componentMap.id;\n const rootDir = componentMap.getRootDir();\n this.rootDirs[rootDir] = componentId;\n });\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,KAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,SAAA;EAAA,MAAAN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C,CAAC,CAAC;EACJ;AACF;AAAC8G,OAAA,CAAAhM,OAAA,GAAAA,OAAA","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_fsExtra","data","_interopRequireDefault","require","_path","_lodash","_legacy","_legacy2","_legacy3","_pMapSeries","_chalk","_legacy4","_chokidar","_workspace","_watchQueue","_watcher","_harmonyModules","e","__esModule","default","ownKeys","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","DEBOUNCE_WAIT_MS","Watcher","constructor","workspace","pubsub","watcherMain","options","msgs","WatchQueue","ipcEventsDir","ipcEvents","eventsDir","verbose","logger","workspacePathLinux","pathNormalizeToLinux","path","process","env","BIT_WATCHER_USE_CHOKIDAR","watcherType","consumer","watch","setRootDirs","componentIds","values","rootDirs","triggerOnPreWatch","watchScopeInternalFiles","watchParcel","watchChokidar","onStart","ParcelWatcher","subscribe","onParcelWatch","bind","ignore","err","message","includes","Error","onReady","clearStatusLine","createChokidarWatcher","watcher","chokidarWatcher","Promise","resolve","reject","onAll","on","watched","getWatched","totalWatched","flat","console","chalk","bold","JSON","stringify","toString","event","filePath","startTime","Date","getTime","files","results","debounced","irrelevant","failureMsg","handleChange","duration","onChange","onError","endsWith","BIT_MAP","bitMapChangesInProgress","buildResults","watchQueue","add","handleBitmapChanges","onIdle","dirname","eventName","basename","content","fs","readFile","debug","parsed","parse","sendEventsToClients","triggerGotEvent","WORKSPACE_JSONC","triggerOnWorkspaceConfigChange","UNMERGED_FILENAME","clearCache","componentId","getComponentIdByPath","compIdStr","changedFilesPerComponent","sleep","triggerCompChanges","undefined","join","msg","error","ms","setTimeout","updatedComponentId","hasId","ids","listIds","find","id","isEqual","ignoreVersion","clearComponentCache","component","get","componentMap","state","_consumer","compFilesRelativeToWorkspace","getFilesRelativeToConsumer","compFiles","nonCompFiles","partition","relativeFile","getRelativePathLinux","Boolean","p","removedFiles","compact","all","map","pathExists","toStringWithoutVersion","bitMap","updateComponentPaths","f","getPathRelativeToConsumer","executeWatchOperationsOnComponent","trigger","triggerOnComponentChange","previewsRootDirs","previewsIds","getAllBitIds","_reloadConsumer","importObjectsIfNeeded","triggerOnBitmapChange","newDirs","difference","removedDirs","addResults","mapSeries","dir","executeWatchOperationsOnRemove","import","currentIds","hasVersionChanges","prevId","searchWithoutVersion","version","existsInScope","scope","isComponentInScope","useCache","lane","getCurrentLaneObject","pub","WorkspaceAspect","createOnComponentRemovedEvent","triggerOnComponentRemove","isChange","isComponentWatchedExternally","idStr","createOnComponentChangeEvent","createOnComponentAddEvent","triggerOnComponentAdd","OnComponentRemovedEvent","now","hook","OnComponentChangeEvent","OnComponentAddEvent","watcherData","multipleWatchers","m","compilerId","rootDir","findRootDirByFilePathRecursively","parentDir","shouldIgnoreFromLocalScopeChokidar","pathToCheck","startsWith","shouldIgnoreFromLocalScopeParcel","sep","chokidarOpts","getChokidarWatchOptions","ignored","chokidar","allEvents","events","type","componentsFromBitMap","getAllComponents","getRootDir","exports"],"sources":["watcher.ts"],"sourcesContent":["import { PubsubMain } from '@teambit/pubsub';\nimport fs from 'fs-extra';\nimport { dirname, basename, join, sep } from 'path';\nimport { compact, difference, partition } from 'lodash';\nimport { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport { BIT_MAP, WORKSPACE_JSONC } from '@teambit/legacy.constants';\nimport { Consumer } from '@teambit/legacy.consumer';\nimport { logger } from '@teambit/legacy.logger';\nimport { pathNormalizeToLinux, PathOsBasedAbsolute } from '@teambit/legacy.utils';\nimport mapSeries from 'p-map-series';\nimport chalk from 'chalk';\nimport { ChildProcess } from 'child_process';\nimport { UNMERGED_FILENAME } from '@teambit/legacy.scope';\nimport chokidar, { FSWatcher } from 'chokidar';\nimport { ComponentMap } from '@teambit/legacy.bit-map';\nimport { CompilationInitiator } from '@teambit/compiler';\nimport {\n WorkspaceAspect,\n Workspace,\n OnComponentEventResult,\n OnComponentChangeEvent,\n OnComponentAddEvent,\n OnComponentRemovedEvent,\n} from '@teambit/workspace';\nimport { CheckTypes } from './check-types';\nimport { WatcherMain } from './watcher.main.runtime';\nimport { WatchQueue } from './watch-queue';\nimport { Logger } from '@teambit/logger';\nimport ParcelWatcher, { Event } from '@parcel/watcher';\nimport { sendEventsToClients } from '@teambit/harmony.modules.send-server-sent-events';\n\nexport type WatcherProcessData = { watchProcess: ChildProcess; compilerId: ComponentID; componentIds: ComponentID[] };\n\nexport type EventMessages = {\n onAll: Function;\n onStart: Function;\n onReady: Function;\n onChange: OnFileEventFunc;\n onAdd: OnFileEventFunc;\n onUnlink: OnFileEventFunc;\n onError: Function;\n};\n\nexport type OnFileEventFunc = (\n filePaths: string[],\n buildResults: OnComponentEventResult[],\n verbose: boolean,\n duration: number,\n failureMsg?: string\n) => void;\n\nexport type WatchOptions = {\n initiator?: CompilationInitiator;\n verbose?: boolean; // print watch events to the console. (also ts-server events if spawnTSServer is true)\n spawnTSServer?: boolean; // needed for check types and extract API/docs.\n checkTypes?: CheckTypes; // if enabled, the spawnTSServer becomes true.\n preCompile?: boolean; // whether compile all components before start watching\n compile?: boolean; // whether compile modified/added components during watch process\n import?: boolean; // whether import objects when .bitmap got version changes\n generateTypes?: boolean; // whether generate d.ts files for typescript files during watch process (hurts performance)\n trigger?: ComponentID; // trigger onComponentChange for the specified component-id. helpful when this comp must be a bundle, and needs to be recompile on any dep change.\n};\n\nexport type RootDirs = { [dir: PathLinux]: ComponentID };\n\ntype WatcherType = 'chokidar' | 'parcel';\n\nconst DEBOUNCE_WAIT_MS = 100;\ntype PathLinux = string; // ts fails when importing it from @teambit/legacy/dist/utils/path.\n\nexport class Watcher {\n private watcherType: WatcherType = 'parcel';\n private chokidarWatcher: FSWatcher;\n private changedFilesPerComponent: { [componentId: string]: string[] } = {};\n private watchQueue = new WatchQueue();\n private bitMapChangesInProgress = false;\n private ipcEventsDir: PathOsBasedAbsolute;\n private rootDirs: RootDirs = {};\n private verbose = false;\n private multipleWatchers: WatcherProcessData[] = [];\n private logger: Logger;\n private workspacePathLinux: string;\n constructor(\n private workspace: Workspace,\n private pubsub: PubsubMain,\n private watcherMain: WatcherMain,\n private options: WatchOptions,\n private msgs?: EventMessages\n ) {\n this.ipcEventsDir = this.watcherMain.ipcEvents.eventsDir;\n this.verbose = this.options.verbose || false;\n this.logger = this.watcherMain.logger;\n this.workspacePathLinux = pathNormalizeToLinux(this.workspace.path);\n\n if (process.env.BIT_WATCHER_USE_CHOKIDAR === 'true' || process.env.BIT_WATCHER_USE_CHOKIDAR === '1') {\n this.watcherType = 'chokidar';\n }\n }\n\n get consumer(): Consumer {\n return this.workspace.consumer;\n }\n\n async watch() {\n await this.setRootDirs();\n const componentIds = Object.values(this.rootDirs);\n await this.watcherMain.triggerOnPreWatch(componentIds, this.options);\n await this.watcherMain.watchScopeInternalFiles();\n this.watcherType === 'parcel' ? await this.watchParcel() : await this.watchChokidar();\n }\n\n private async watchParcel() {\n this.msgs?.onStart(this.workspace);\n try {\n await ParcelWatcher.subscribe(this.workspace.path, this.onParcelWatch.bind(this), {\n ignore: ['**/node_modules/**', '**/package.json'],\n });\n } catch (err: any) {\n if (err.message.includes('Error starting FSEvents stream')) {\n throw new Error(`failed to start the watcher: ${err.message}.\ntry rerunning the command. if that doesn't help, please refer to this Watchman troubleshooting guide:\nhttps://facebook.github.io/watchman/docs/troubleshooting#fseventstreamstart-register_with_server-error-f2d_register_rpc--null--21`);\n }\n throw err;\n }\n\n this.msgs?.onReady(this.workspace, this.rootDirs, this.verbose);\n this.logger.clearStatusLine();\n }\n\n private async watchChokidar() {\n await this.createChokidarWatcher();\n const watcher = this.chokidarWatcher;\n const msgs = this.msgs;\n msgs?.onStart(this.workspace);\n\n return new Promise((resolve, reject) => {\n if (this.verbose) {\n // @ts-ignore\n if (msgs?.onAll) watcher.on('all', msgs.onAll);\n }\n watcher.on('ready', () => {\n msgs?.onReady(this.workspace, this.rootDirs, this.verbose);\n if (this.verbose) {\n const watched = this.chokidarWatcher.getWatched();\n const totalWatched = Object.values(watched).flat().length;\n logger.console(\n `${chalk.bold('the following files are being watched:')}\\n${JSON.stringify(watched, null, 2)}`\n );\n logger.console(`\\nTotal files being watched: ${chalk.bold(totalWatched.toString())}`);\n }\n\n this.logger.clearStatusLine();\n });\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n watcher.on('all', async (event, filePath) => {\n if (event !== 'change' && event !== 'add' && event !== 'unlink') return;\n const startTime = new Date().getTime();\n const { files, results, debounced, irrelevant, failureMsg } = await this.handleChange(filePath);\n if (debounced || irrelevant) {\n return;\n }\n const duration = new Date().getTime() - startTime;\n msgs?.onChange(files, results, this.verbose, duration, failureMsg);\n });\n watcher.on('error', (err) => {\n msgs?.onError(err);\n reject(err);\n });\n });\n }\n\n /**\n * *** DEBOUNCING ***\n * some actions trigger multiple files changes at (almost) the same time. e.g. \"git pull\".\n * this causes some performance and instability issues. a debouncing mechanism was implemented to help with this.\n * the way how it works is that the first file of the same component starts the execution with a delay (e.g. 200ms).\n * if, in the meanwhile, another file of the same component was changed, it won't start a new execution, instead,\n * it'll only add the file to `this.changedFilesPerComponent` prop.\n * once the execution starts, it'll delete this component-id from the `this.changedFilesPerComponent` array,\n * indicating the next file-change to start a new execution.\n *\n * implementation wise, `lodash.debounce` doesn't help here, because:\n * A) it doesn't return the results, unless \"leading\" option is true. here, it must be false, otherwise, it'll start\n * the execution immediately.\n * B) it debounces the method regardless the param passes to it. so it'll disregard the component-id and will delay\n * other components undesirably.\n *\n * *** QUEUE ***\n * the debouncing helps to not execute the same component multiple times concurrently. however, multiple components\n * and .bitmap changes execution can still be processed concurrently.\n * the following example explains why this is an issue.\n * compA is changed in the .bitmap file from version 0.0.1 to 0.0.2. its files were changed as well.\n * all these changes get pulled at the same time by \"git pull\", as a result, the execution of compA and the .bitmap\n * happen at the same time.\n * during the execution of compA, the component id is parsed as compA@0.0.1, later, it asks for the Workspace for this\n * id. while the workspace is looking for this id, the .bitmap execution reloaded the consumer and changed all versions.\n * after this change, the workspace doesn't have this id anymore, which will trigger an error.\n * to ensure this won't happen, we keep a flag to indicate whether the .bitmap execution is running, and if so, all\n * other executions are paused until the queue is empty (this is done by awaiting for queue.onIdle).\n * once the queue is empty, we know the .bitmap process was done and the workspace has all new ids.\n * in the example above, at this stage, the id will be resolved to compA@0.0.2.\n * one more thing, the queue is configured to have concurrency of 1. to make sure two components are not processed at\n * the same time. (the same way is done when loading all components from the filesystem/scope).\n * this way we can also ensure that if compA was started before the .bitmap execution, it will complete before the\n * .bitmap execution starts.\n */\n private async handleChange(filePath: string): Promise<{\n results: OnComponentEventResult[];\n files: string[];\n failureMsg?: string;\n debounced?: boolean;\n irrelevant?: boolean; // file/dir is not part of any component\n }> {\n try {\n if (filePath.endsWith(BIT_MAP)) {\n this.bitMapChangesInProgress = true;\n const buildResults = await this.watchQueue.add(() => this.handleBitmapChanges());\n this.bitMapChangesInProgress = false;\n this.logger.clearStatusLine();\n return { results: buildResults, files: [filePath] };\n }\n if (this.bitMapChangesInProgress) {\n await this.watchQueue.onIdle();\n }\n if (dirname(filePath) === this.ipcEventsDir) {\n const eventName = basename(filePath);\n if (eventName === 'onNotifySSE') {\n const content = await fs.readFile(filePath, 'utf8');\n this.logger.debug(`Watcher, onNotifySSE ${content}`);\n const parsed = JSON.parse(content);\n sendEventsToClients(parsed.event, parsed);\n } else {\n await this.watcherMain.ipcEvents.triggerGotEvent(eventName as any);\n }\n return { results: [], files: [filePath] };\n }\n if (filePath.endsWith(WORKSPACE_JSONC)) {\n await this.workspace.triggerOnWorkspaceConfigChange();\n return { results: [], files: [filePath] };\n }\n if (filePath.endsWith(UNMERGED_FILENAME)) {\n await this.workspace.clearCache();\n return { results: [], files: [filePath] };\n }\n const componentId = this.getComponentIdByPath(filePath);\n if (!componentId) {\n this.logger.clearStatusLine();\n return { results: [], files: [], irrelevant: true };\n }\n const compIdStr = componentId.toString();\n if (this.changedFilesPerComponent[compIdStr]) {\n this.changedFilesPerComponent[compIdStr].push(filePath);\n this.logger.clearStatusLine();\n return { results: [], files: [], debounced: true };\n }\n this.changedFilesPerComponent[compIdStr] = [filePath];\n await this.sleep(DEBOUNCE_WAIT_MS);\n const files = this.changedFilesPerComponent[compIdStr];\n delete this.changedFilesPerComponent[compIdStr];\n\n const buildResults = await this.watchQueue.add(() => this.triggerCompChanges(componentId, files));\n const failureMsg = buildResults.length\n ? undefined\n : `files ${files.join(', ')} are inside the component ${compIdStr} but configured to be ignored`;\n this.logger.clearStatusLine();\n return { results: buildResults, files, failureMsg };\n } catch (err: any) {\n const msg = `watcher found an error while handling ${filePath}`;\n logger.error(msg, err);\n logger.console(`${msg}, ${err.message}`);\n this.logger.clearStatusLine();\n return { results: [], files: [filePath], failureMsg: err.message };\n }\n }\n\n private async sleep(ms: number) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n }\n\n private async triggerCompChanges(\n componentId: ComponentID,\n files: PathOsBasedAbsolute[]\n ): Promise<OnComponentEventResult[]> {\n let updatedComponentId: ComponentID | undefined = componentId;\n if (!this.workspace.hasId(componentId)) {\n // bitmap has changed meanwhile, which triggered `handleBitmapChanges`, which re-loaded consumer and updated versions\n // so the original componentId might not be in the workspace now, and we need to find the updated one\n const ids = this.workspace.listIds();\n updatedComponentId = ids.find((id) => id.isEqual(componentId, { ignoreVersion: true }));\n if (!updatedComponentId) {\n logger.debug(`triggerCompChanges, the component ${componentId.toString()} was probably removed from .bitmap`);\n return [];\n }\n }\n this.workspace.clearComponentCache(updatedComponentId);\n const component = await this.workspace.get(updatedComponentId);\n const componentMap: ComponentMap = component.state._consumer.componentMap;\n if (!componentMap) {\n throw new Error(\n `unable to find componentMap for ${updatedComponentId.toString()}, make sure this component is in .bitmap`\n );\n }\n const compFilesRelativeToWorkspace = componentMap.getFilesRelativeToConsumer();\n const [compFiles, nonCompFiles] = partition(files, (filePath) => {\n const relativeFile = this.getRelativePathLinux(filePath);\n return Boolean(compFilesRelativeToWorkspace.find((p) => p === relativeFile));\n });\n // nonCompFiles are either, files that were removed from the filesystem or existing files that are ignored.\n // the compiler takes care of removedFiles differently, e.g. removes dists dir and old symlinks.\n const removedFiles = compact(\n await Promise.all(nonCompFiles.map(async (filePath) => ((await fs.pathExists(filePath)) ? null : filePath)))\n );\n\n if (!compFiles.length && !removedFiles.length) {\n logger.debug(\n `the following files are part of the component ${componentId.toStringWithoutVersion()} but configured to be ignored:\\n${files.join(\n '\\n'\n )}'`\n );\n return [];\n }\n this.consumer.bitMap.updateComponentPaths(\n componentId,\n compFiles.map((f) => this.consumer.getPathRelativeToConsumer(f)),\n removedFiles.map((f) => this.consumer.getPathRelativeToConsumer(f))\n );\n const buildResults = await this.executeWatchOperationsOnComponent(\n updatedComponentId,\n compFiles,\n removedFiles,\n true\n );\n if (this.options.trigger && !updatedComponentId.isEqual(this.options.trigger)) {\n await this.workspace.triggerOnComponentChange(this.options.trigger, [], [], this.options);\n }\n\n return buildResults;\n }\n\n /**\n * if .bitmap changed, it's possible that a new component has been added. trigger onComponentAdd.\n */\n private async handleBitmapChanges(): Promise<OnComponentEventResult[]> {\n const previewsRootDirs = { ...this.rootDirs };\n const previewsIds = this.consumer.bitMap.getAllBitIds();\n await this.workspace._reloadConsumer();\n await this.setRootDirs();\n await this.importObjectsIfNeeded(previewsIds);\n await this.workspace.triggerOnBitmapChange();\n const newDirs: string[] = difference(Object.keys(this.rootDirs), Object.keys(previewsRootDirs));\n const removedDirs: string[] = difference(Object.keys(previewsRootDirs), Object.keys(this.rootDirs));\n const results: OnComponentEventResult[] = [];\n if (newDirs.length) {\n const addResults = await mapSeries(newDirs, async (dir) =>\n this.executeWatchOperationsOnComponent(this.rootDirs[dir], [], [], false)\n );\n results.push(...addResults.flat());\n }\n if (removedDirs.length) {\n await mapSeries(removedDirs, (dir) => this.executeWatchOperationsOnRemove(previewsRootDirs[dir]));\n }\n\n return results;\n }\n\n /**\n * needed when using git.\n * it resolves the following issue - a user is running `git pull` which updates the components and the .bitmap file.\n * because the objects locally are not updated, the .bitmap has new versions that don't exist in the local scope.\n * as soon as the watcher gets an event about a file change, it loads the component which throws\n * ComponentsPendingImport error.\n * to resolve this, we import the new objects as soon as the .bitmap file changes.\n * for performance reasons, we import only when: 1) the .bitmap file has version changes and 2) this new version is\n * not already in the scope.\n */\n private async importObjectsIfNeeded(previewsIds: ComponentIdList) {\n if (!this.options.import) {\n return;\n }\n const currentIds = this.consumer.bitMap.getAllBitIds();\n const hasVersionChanges = currentIds.find((id) => {\n const prevId = previewsIds.searchWithoutVersion(id);\n return prevId && prevId.version !== id.version;\n });\n if (!hasVersionChanges) {\n return;\n }\n const existsInScope = await this.workspace.scope.isComponentInScope(hasVersionChanges);\n if (existsInScope) {\n // the .bitmap change was probably a result of tag/snap/merge, no need to import.\n return;\n }\n if (this.options.verbose) {\n logger.console(\n `Watcher: .bitmap has changed with new versions which do not exist locally, importing the objects...`\n );\n }\n await this.workspace.scope.import(currentIds, {\n useCache: true,\n lane: await this.workspace.getCurrentLaneObject(),\n });\n }\n\n private async executeWatchOperationsOnRemove(componentId: ComponentID) {\n logger.debug(`running OnComponentRemove hook for ${chalk.bold(componentId.toString())}`);\n this.pubsub.pub(WorkspaceAspect.id, this.createOnComponentRemovedEvent(componentId.toString()));\n await this.workspace.triggerOnComponentRemove(componentId);\n }\n\n private async executeWatchOperationsOnComponent(\n componentId: ComponentID,\n files: PathOsBasedAbsolute[],\n removedFiles: PathOsBasedAbsolute[] = [],\n isChange = true\n ): Promise<OnComponentEventResult[]> {\n if (this.isComponentWatchedExternally(componentId)) {\n // update capsule, once done, it automatically triggers the external watcher\n await this.workspace.get(componentId);\n return [];\n }\n const idStr = componentId.toString();\n\n if (isChange) {\n logger.debug(`running OnComponentChange hook for ${chalk.bold(idStr)}`);\n this.pubsub.pub(WorkspaceAspect.id, this.createOnComponentChangeEvent(idStr, 'OnComponentChange'));\n } else {\n logger.debug(`running OnComponentAdd hook for ${chalk.bold(idStr)}`);\n this.pubsub.pub(WorkspaceAspect.id, this.createOnComponentAddEvent(idStr, 'OnComponentAdd'));\n }\n\n const buildResults = isChange\n ? await this.workspace.triggerOnComponentChange(componentId, files, removedFiles, this.options)\n : await this.workspace.triggerOnComponentAdd(componentId, this.options);\n\n return buildResults;\n }\n\n private createOnComponentRemovedEvent(idStr) {\n return new OnComponentRemovedEvent(Date.now(), idStr);\n }\n\n private createOnComponentChangeEvent(idStr, hook) {\n return new OnComponentChangeEvent(Date.now(), idStr, hook);\n }\n\n private createOnComponentAddEvent(idStr, hook) {\n return new OnComponentAddEvent(Date.now(), idStr, hook);\n }\n\n private isComponentWatchedExternally(componentId: ComponentID) {\n const watcherData = this.multipleWatchers.find((m) => m.componentIds.find((id) => id.isEqual(componentId)));\n if (watcherData) {\n logger.debug(`${componentId.toString()} is watched by ${watcherData.compilerId.toString()}`);\n return true;\n }\n return false;\n }\n\n private getComponentIdByPath(filePath: string): ComponentID | null {\n const relativeFile = this.getRelativePathLinux(filePath);\n const rootDir = this.findRootDirByFilePathRecursively(relativeFile);\n if (!rootDir) {\n // the file is not part of any component. If it was a new component, or a new file of\n // existing component, then, handleBitmapChanges() should deal with it.\n return null;\n }\n return this.rootDirs[rootDir];\n }\n\n private getRelativePathLinux(filePath: string) {\n return pathNormalizeToLinux(this.consumer.getPathRelativeToConsumer(filePath));\n }\n\n private findRootDirByFilePathRecursively(filePath: string): string | null {\n if (this.rootDirs[filePath]) return filePath;\n const parentDir = dirname(filePath);\n if (parentDir === filePath) return null;\n return this.findRootDirByFilePathRecursively(parentDir);\n }\n\n private shouldIgnoreFromLocalScopeChokidar(pathToCheck: string) {\n if (pathToCheck.startsWith(this.ipcEventsDir) || pathToCheck.endsWith(UNMERGED_FILENAME)) return false;\n return (\n pathToCheck.startsWith(`${this.workspacePathLinux}/.git/`) || pathToCheck.startsWith(`${this.workspacePathLinux}/.bit/`)\n );\n }\n\n private shouldIgnoreFromLocalScopeParcel(pathToCheck: string) {\n if (pathToCheck.startsWith(this.ipcEventsDir) || pathToCheck.endsWith(UNMERGED_FILENAME)) return false;\n return pathToCheck.startsWith(join(this.workspace.path, '.git') + sep)\n || pathToCheck.startsWith(join(this.workspace.path, '.bit') + sep);\n }\n\n private async createChokidarWatcher() {\n const chokidarOpts = await this.watcherMain.getChokidarWatchOptions();\n // `chokidar` matchers have Bash-parity, so Windows-style backslashes are not supported as separators.\n // (windows-style backslashes are converted to forward slashes)\n chokidarOpts.ignored = ['**/node_modules/**', '**/package.json', this.shouldIgnoreFromLocalScopeChokidar.bind(this)];\n this.chokidarWatcher = chokidar.watch(this.workspace.path, chokidarOpts);\n if (this.verbose) {\n logger.console(`${chalk.bold('chokidar.options:\\n')} ${JSON.stringify(this.chokidarWatcher.options, undefined, 2)}`);\n }\n }\n\n private async onParcelWatch(err: Error | null, allEvents: Event[]) {\n const events = allEvents.filter((event) => !this.shouldIgnoreFromLocalScopeParcel(event.path));\n if (!events.length) {\n return;\n }\n\n const msgs = this.msgs;\n if (this.verbose) {\n if (msgs?.onAll) events.forEach((event) => msgs.onAll(event.type, event.path));\n }\n if (err) {\n msgs?.onError(err);\n throw err;\n }\n const startTime = new Date().getTime();\n await mapSeries(events, async (event) => {\n const { files, results, debounced, irrelevant, failureMsg } = await this.handleChange(event.path);\n if (debounced || irrelevant) {\n return;\n }\n const duration = new Date().getTime() - startTime;\n msgs?.onChange(files, results, this.verbose, duration, failureMsg);\n });\n }\n\n private async setRootDirs() {\n this.rootDirs = {};\n const componentsFromBitMap = this.consumer.bitMap.getAllComponents();\n componentsFromBitMap.map((componentMap) => {\n const componentId = componentMap.id;\n const rootDir = componentMap.getRootDir();\n this.rootDirs[rootDir] = componentId;\n });\n }\n}\n"],"mappings":";;;;;;AACA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAA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C,GAAG5F,WAAW;IACtC,CAAC,CAAC;EACJ;AACF;AAAC8G,OAAA,CAAA/M,OAAA,GAAAA,OAAA","ignoreList":[]}
|
@@ -7,7 +7,7 @@ import { IpcEventsMain } from '@teambit/ipc-events';
|
|
7
7
|
import { Logger, LoggerMain } from '@teambit/logger';
|
8
8
|
import { PubsubMain } from '@teambit/pubsub';
|
9
9
|
import { Workspace } from '@teambit/workspace';
|
10
|
-
import { WatchOptions } from './watcher';
|
10
|
+
import { EventMessages, WatchOptions } from './watcher';
|
11
11
|
import { ConfigStoreMain } from '@teambit/config-store';
|
12
12
|
export type OnPreWatch = (componentIds: ComponentID[], watchOpts: WatchOptions) => Promise<void>;
|
13
13
|
export type OnPreWatchSlot = SlotRegistry<OnPreWatch>;
|
@@ -20,7 +20,7 @@ export declare class WatcherMain {
|
|
20
20
|
readonly logger: Logger;
|
21
21
|
readonly configStore: ConfigStoreMain;
|
22
22
|
constructor(workspace: Workspace, scope: ScopeMain, pubsub: PubsubMain, onPreWatchSlot: OnPreWatchSlot, ipcEvents: IpcEventsMain, logger: Logger, configStore: ConfigStoreMain);
|
23
|
-
watch(opts: WatchOptions): Promise<void>;
|
23
|
+
watch(opts: WatchOptions, msgs?: EventMessages): Promise<void>;
|
24
24
|
getChokidarWatchOptions(): Promise<ChokidarWatchOptions>;
|
25
25
|
watchScopeInternalFiles(): Promise<void>;
|
26
26
|
triggerOnPreWatch(componentIds: ComponentID[], watchOpts: WatchOptions): Promise<void>;
|
@@ -109,9 +109,9 @@ class WatcherMain {
|
|
109
109
|
this.logger = logger;
|
110
110
|
this.configStore = configStore;
|
111
111
|
}
|
112
|
-
async watch(opts) {
|
112
|
+
async watch(opts, msgs) {
|
113
113
|
if (!this.workspace) throw new (_workspace().OutsideWorkspaceError)();
|
114
|
-
const watcher = new (_watcher().Watcher)(this.workspace, this.pubsub, this, opts);
|
114
|
+
const watcher = new (_watcher().Watcher)(this.workspace, this.pubsub, this, opts, msgs);
|
115
115
|
await watcher.watch();
|
116
116
|
}
|
117
117
|
async getChokidarWatchOptions() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_cli","data","require","_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","OutsideWorkspaceError","watcher","Watcher","getChokidarWatchOptions","usePollingConf","getConfig","CFG_WATCH_USE_POLLING","usePolling","ignoreInitial","persistent","watchScopeInternalFiles","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 { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { WatchOptions as ChokidarWatchOptions } from 'chokidar';\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 { CFG_WATCH_USE_POLLING } from '@teambit/legacy.constants';\nimport { WorkspaceAspect, Workspace, OutsideWorkspaceError } from '@teambit/workspace';\nimport pMapSeries from 'p-map-series';\nimport { WatchCommand } from './watch.cmd';\nimport { Watcher, WatchOptions } from './watcher';\nimport { WatcherAspect } from './watcher.aspect';\nimport { ConfigStoreAspect, ConfigStoreMain } 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) {\n if (!this.workspace) throw new OutsideWorkspaceError();\n const watcher = new Watcher(this.workspace, this.pubsub, this, opts);\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 const chokidarOpts = await this.getChokidarWatchOptions();\n await this.scope.watchScopeInternalFiles(chokidarOpts);\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(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;AAEA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,MAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,QAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,OAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,QAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAC,OAAA;EAAAM,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,WAAA;EAAA,MAAAR,IAAA,GAAAC,OAAA;EAAAO,UAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;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AA,KAAAA,CAAA,SAAAA,CAAA,MAAAL,CAAA,GAAAK,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAhB,CAAA,QAAAa,CAAA,GAAAb,CAAA,CAAAiB,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAKpE,MAAMgB,WAAW,CAAC;EACvBC,WAAWA,CACDC,SAAoB,EACpBC,KAAgB,EAChBC,MAAkB,EAClBC,cAA8B,EAC7BC,SAAwB,EACxBC,MAAc,EACdC,WAA4B,EACrC;IAAA,KAPQN,SAAoB,GAApBA,SAAoB;IAAA,KACpBC,KAAgB,GAAhBA,KAAgB;IAAA,KAChBC,MAAkB,GAAlBA,MAAkB;IAAA,KAClBC,cAA8B,GAA9BA,cAA8B;IAAA,KAC7BC,SAAwB,GAAxBA,SAAwB;IAAA,KACxBC,MAAc,GAAdA,MAAc;IAAA,KACdC,WAA4B,GAA5BA,WAA4B;EACpC;EAEH,MAAMC,KAAKA,CAACC,IAAkB,EAAE;
|
1
|
+
{"version":3,"names":["_cli","data","require","_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","watcher","Watcher","getChokidarWatchOptions","usePollingConf","getConfig","CFG_WATCH_USE_POLLING","usePolling","ignoreInitial","persistent","watchScopeInternalFiles","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 { CLIAspect, CLIMain, MainRuntime } from '@teambit/cli';\nimport { WatchOptions as ChokidarWatchOptions } from 'chokidar';\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 { CFG_WATCH_USE_POLLING } from '@teambit/legacy.constants';\nimport { WorkspaceAspect, Workspace, OutsideWorkspaceError } from '@teambit/workspace';\nimport pMapSeries from 'p-map-series';\nimport { WatchCommand } from './watch.cmd';\nimport { EventMessages, Watcher, WatchOptions } from './watcher';\nimport { WatcherAspect } from './watcher.aspect';\nimport { ConfigStoreAspect, ConfigStoreMain } 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 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 const chokidarOpts = await this.getChokidarWatchOptions();\n await this.scope.watchScopeInternalFiles(chokidarOpts);\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(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;AAEA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,OAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,MAAA,YAAAA,CA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aE,QAAQA,CACnB,CAACC,GAAG,EAAEjC,SAAS,EAAEC,KAAK,EAAEC,MAAM,EAAEgC,UAAU,EAAE9B,SAAS,EAAEE,WAAW,CAQjE,EACD6B,CAAC,EACD,CAAChC,cAAc,CAAmB,EAClC;IACA,MAAME,MAAM,GAAG6B,UAAU,CAACE,YAAY,CAACC,yBAAa,CAACC,EAAE,CAAC;IACxD,MAAMC,WAAW,GAAG,IAAIzC,WAAW,CAACE,SAAS,EAAEC,KAAK,EAAEC,MAAM,EAAEC,cAAc,EAAEC,SAAS,EAAEC,MAAM,EAAEC,WAAW,CAAC;IAC7G,MAAMkC,QAAQ,GAAG,KAAIC,qBAAY,EAACvC,MAAM,EAAEG,MAAM,EAAEkC,WAAW,CAAC;IAC9DN,GAAG,CAACF,QAAQ,CAACS,QAAQ,CAAC;IACtB,OAAOD,WAAW;EACpB;AACF;AAACG,OAAA,CAAA5C,WAAA,GAAAA,WAAA;AAAAlB,eAAA,CA3EYkB,WAAW,WA4CP,CAAC6C,eAAI,CAACC,QAAQ,CAAa,CAAC,CAAC;AAAAhE,eAAA,CA5CjCkB,WAAW,kBA6CA,CACpB+C,gBAAS,EACTC,4BAAe,EACfC,oBAAW,EACXC,sBAAY,EACZC,sBAAY,EACZC,4BAAe,EACfC,gCAAiB,CAClB;AAAAvE,eAAA,CArDUkB,WAAW,aAsDLsD,kBAAW;AAuB9Bf,yBAAa,CAACgB,UAAU,CAACvD,WAAW,CAAC;AAAC,IAAAwD,QAAA,GAAAZ,OAAA,CAAA/D,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.590",
|
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.590"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"chalk": "4.1.2",
|
@@ -15,18 +15,19 @@
|
|
15
15
|
"moment": "2.29.4",
|
16
16
|
"chokidar": "3.6.0",
|
17
17
|
"p-map-series": "2.1.0",
|
18
|
+
"@parcel/watcher": "^2.5.1",
|
18
19
|
"fs-extra": "10.0.0",
|
19
20
|
"@teambit/component-id": "1.2.3",
|
20
21
|
"@teambit/harmony": "0.4.7",
|
21
|
-
"@teambit/compiler": "1.0.
|
22
|
-
"@teambit/logger": "0.0.
|
23
|
-
"@teambit/workspace": "1.0.
|
24
|
-
"@teambit/cli": "0.0.
|
25
|
-
"@teambit/pubsub": "1.0.
|
26
|
-
"@teambit/config-store": "0.0.
|
27
|
-
"@teambit/ipc-events": "1.0.
|
22
|
+
"@teambit/compiler": "1.0.590",
|
23
|
+
"@teambit/logger": "0.0.1260",
|
24
|
+
"@teambit/workspace": "1.0.590",
|
25
|
+
"@teambit/cli": "0.0.1167",
|
26
|
+
"@teambit/pubsub": "1.0.590",
|
27
|
+
"@teambit/config-store": "0.0.47",
|
28
|
+
"@teambit/ipc-events": "1.0.590",
|
28
29
|
"@teambit/legacy.constants": "0.0.11",
|
29
|
-
"@teambit/scope": "1.0.
|
30
|
+
"@teambit/scope": "1.0.590",
|
30
31
|
"@teambit/harmony.modules.send-server-sent-events": "0.0.7",
|
31
32
|
"@teambit/legacy.bit-map": "0.0.104",
|
32
33
|
"@teambit/legacy.consumer": "0.0.47",
|
File without changes
|