@teambit/workspace 0.0.750 → 0.0.753
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/capsule.cmd.d.ts +2 -3
- package/dist/capsule.cmd.js +4 -6
- package/dist/capsule.cmd.js.map +1 -1
- package/dist/install.cmd.d.ts +0 -1
- package/dist/install.cmd.js +0 -1
- package/dist/install.cmd.js.map +1 -1
- package/dist/link/link.cmd.d.ts +1 -1
- package/dist/link/link.cmd.js +3 -5
- package/dist/link/link.cmd.js.map +1 -1
- package/dist/uninstall.cmd.d.ts +0 -1
- package/dist/uninstall.cmd.js +0 -1
- package/dist/uninstall.cmd.js.map +1 -1
- package/dist/update.cmd.d.ts +0 -1
- package/dist/update.cmd.js +0 -1
- package/dist/update.cmd.js.map +1 -1
- package/dist/watch/watch.cmd.d.ts +2 -3
- package/dist/watch/watch.cmd.js +15 -6
- package/dist/watch/watch.cmd.js.map +1 -1
- package/dist/watch/watcher.d.ts +27 -8
- package/dist/watch/watcher.js +136 -44
- package/dist/watch/watcher.js.map +1 -1
- package/install.cmd.tsx +0 -1
- package/link/link.cmd.ts +3 -3
- package/package-tar/teambit-workspace-0.0.753.tgz +0 -0
- package/package.json +31 -31
- package/{preview-1654226751250.js → preview-1654572446572.js} +2 -2
- package/uninstall.cmd.tsx +0 -1
- package/update.cmd.tsx +0 -1
- package/watch/watch.cmd.tsx +25 -6
- package/watch/watcher.ts +104 -40
- package/package-tar/teambit-workspace-0.0.750.tgz +0 -0
package/dist/watch/watcher.js
CHANGED
|
@@ -149,6 +149,8 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
149
149
|
|
|
150
150
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2().default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
151
151
|
|
|
152
|
+
const DEBOUNCE_WAIT_MS = 100;
|
|
153
|
+
|
|
152
154
|
class Watcher {
|
|
153
155
|
constructor(workspace, pubsub, trackDirs = {}, verbose = false, multipleWatchers = []) {
|
|
154
156
|
this.workspace = workspace;
|
|
@@ -157,6 +159,7 @@ class Watcher {
|
|
|
157
159
|
this.verbose = verbose;
|
|
158
160
|
this.multipleWatchers = multipleWatchers;
|
|
159
161
|
(0, _defineProperty2().default)(this, "fsWatcher", void 0);
|
|
162
|
+
(0, _defineProperty2().default)(this, "changedFilesPerComponent", {});
|
|
160
163
|
}
|
|
161
164
|
|
|
162
165
|
get consumer() {
|
|
@@ -188,16 +191,36 @@ class Watcher {
|
|
|
188
191
|
|
|
189
192
|
watcher.on('change', async filePath => {
|
|
190
193
|
const startTime = new Date().getTime();
|
|
191
|
-
const
|
|
194
|
+
const {
|
|
195
|
+
files,
|
|
196
|
+
results,
|
|
197
|
+
debounced,
|
|
198
|
+
failureMsg
|
|
199
|
+
} = await this.handleChange(filePath, opts === null || opts === void 0 ? void 0 : opts.initiator);
|
|
200
|
+
|
|
201
|
+
if (debounced) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
|
|
192
205
|
const duration = new Date().getTime() - startTime;
|
|
193
|
-
msgs === null || msgs === void 0 ? void 0 : msgs.onChange(
|
|
206
|
+
msgs === null || msgs === void 0 ? void 0 : msgs.onChange(files, results, this.verbose, duration, failureMsg);
|
|
194
207
|
}); // eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
195
208
|
|
|
196
209
|
watcher.on('add', async filePath => {
|
|
197
210
|
const startTime = new Date().getTime();
|
|
198
|
-
const
|
|
211
|
+
const {
|
|
212
|
+
files,
|
|
213
|
+
results,
|
|
214
|
+
debounced,
|
|
215
|
+
failureMsg
|
|
216
|
+
} = await this.handleChange(filePath, opts === null || opts === void 0 ? void 0 : opts.initiator);
|
|
217
|
+
|
|
218
|
+
if (debounced) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
|
|
199
222
|
const duration = new Date().getTime() - startTime;
|
|
200
|
-
msgs === null || msgs === void 0 ? void 0 : msgs.onAdd(
|
|
223
|
+
msgs === null || msgs === void 0 ? void 0 : msgs.onAdd(files, results, this.verbose, duration, failureMsg);
|
|
201
224
|
}); // eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
202
225
|
|
|
203
226
|
watcher.on('unlink', async p => {
|
|
@@ -210,26 +233,80 @@ class Watcher {
|
|
|
210
233
|
});
|
|
211
234
|
});
|
|
212
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* some actions trigger multiple files changes at (almost) the same time. e.g. "git pull".
|
|
238
|
+
* this causes some performance and instability issues. a debouncing mechanism was implemented to help with this.
|
|
239
|
+
* the way how it works is that the first file of the same component starts the execution with a delay (e.g. 200ms).
|
|
240
|
+
* if, in the meanwhile, another file of the same component was changed, it won't start a new execution, instead,
|
|
241
|
+
* it'll only add the file to `this.changedFilesPerComponent` prop.
|
|
242
|
+
* once the execution starts, it'll delete this component-id from the `this.changedFilesPerComponent` array,
|
|
243
|
+
* indicating the next file-change to start a new execution.
|
|
244
|
+
*
|
|
245
|
+
* implementation wise, `lodash.debounce` doesn't help here, because:
|
|
246
|
+
* A) it doesn't return the results, unless "leading" option is true. here, it must be false, otherwise, it'll start
|
|
247
|
+
* the execution immediately.
|
|
248
|
+
* B) it debounces the method regardless the param passes to it. so it'll disregard the component-id and will delay
|
|
249
|
+
* other components undesirably.
|
|
250
|
+
*
|
|
251
|
+
*/
|
|
252
|
+
|
|
213
253
|
|
|
214
254
|
async handleChange(filePath, initiator) {
|
|
215
255
|
try {
|
|
216
256
|
if (filePath.endsWith(_constants().BIT_MAP)) {
|
|
217
257
|
const buildResults = await this.handleBitmapChanges();
|
|
218
|
-
|
|
219
|
-
|
|
258
|
+
|
|
259
|
+
_loader().default.stop();
|
|
260
|
+
|
|
261
|
+
return {
|
|
262
|
+
results: buildResults,
|
|
263
|
+
files: [filePath]
|
|
264
|
+
};
|
|
220
265
|
}
|
|
221
266
|
|
|
222
|
-
const componentId =
|
|
267
|
+
const componentId = this.getComponentIdByPath(filePath);
|
|
223
268
|
|
|
224
269
|
if (!componentId) {
|
|
225
|
-
|
|
270
|
+
const failureMsg = `file ${filePath} is not part of any component, ignoring it`;
|
|
271
|
+
|
|
272
|
+
_logger().default.debug(failureMsg);
|
|
273
|
+
|
|
274
|
+
_loader().default.stop();
|
|
275
|
+
|
|
276
|
+
return {
|
|
277
|
+
results: [],
|
|
278
|
+
files: [filePath],
|
|
279
|
+
failureMsg
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const compIdStr = componentId.toString();
|
|
226
284
|
|
|
227
|
-
|
|
285
|
+
if (this.changedFilesPerComponent[compIdStr]) {
|
|
286
|
+
this.changedFilesPerComponent[compIdStr].push(filePath);
|
|
287
|
+
|
|
288
|
+
_loader().default.stop();
|
|
289
|
+
|
|
290
|
+
return {
|
|
291
|
+
results: [],
|
|
292
|
+
debounced: true
|
|
293
|
+
};
|
|
228
294
|
}
|
|
229
295
|
|
|
230
|
-
|
|
231
|
-
this.
|
|
232
|
-
|
|
296
|
+
this.changedFilesPerComponent[compIdStr] = [filePath];
|
|
297
|
+
await this.sleep(DEBOUNCE_WAIT_MS);
|
|
298
|
+
const files = this.changedFilesPerComponent[compIdStr];
|
|
299
|
+
delete this.changedFilesPerComponent[compIdStr];
|
|
300
|
+
const buildResults = await this.triggerCompChanges(componentId, files, initiator);
|
|
301
|
+
const failureMsg = buildResults.length ? undefined : `files ${files.join(', ')} are inside the component ${compIdStr} but configured to be ignored`;
|
|
302
|
+
|
|
303
|
+
_loader().default.stop();
|
|
304
|
+
|
|
305
|
+
return {
|
|
306
|
+
results: buildResults,
|
|
307
|
+
files,
|
|
308
|
+
failureMsg
|
|
309
|
+
};
|
|
233
310
|
} catch (err) {
|
|
234
311
|
const msg = `watcher found an error while handling ${filePath}`;
|
|
235
312
|
|
|
@@ -237,8 +314,48 @@ class Watcher {
|
|
|
237
314
|
|
|
238
315
|
_logger().default.console(`${msg}, ${err.message}`);
|
|
239
316
|
|
|
317
|
+
_loader().default.stop();
|
|
318
|
+
|
|
319
|
+
return {
|
|
320
|
+
results: [],
|
|
321
|
+
files: [filePath],
|
|
322
|
+
failureMsg: err.message
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
async sleep(ms) {
|
|
328
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* if a file was added/remove, once the component is loaded, it changes .bitmap, and then the
|
|
332
|
+
* entire cache is invalidated and the consumer is reloaded.
|
|
333
|
+
* when a file just changed, no need to reload the consumer, it is enough to just delete the
|
|
334
|
+
* component from the cache (both, workspace and consumer)
|
|
335
|
+
*/
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
async triggerCompChanges(componentId, files, initiator) {
|
|
339
|
+
this.workspace.clearComponentCache(componentId);
|
|
340
|
+
const component = await this.workspace.get(componentId);
|
|
341
|
+
const componentMap = component.state._consumer.componentMap;
|
|
342
|
+
const compFiles = files.filter(filePath => {
|
|
343
|
+
const relativeFile = this.getRelativePathLinux(filePath);
|
|
344
|
+
const isCompFile = Boolean(componentMap.getFilesRelativeToConsumer().find(p => p === relativeFile));
|
|
345
|
+
|
|
346
|
+
if (!isCompFile) {
|
|
347
|
+
_logger().default.debug(`file ${filePath} is inside the component ${componentId.toString()} but configured to be ignored`);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
return isCompFile;
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
if (!compFiles.length) {
|
|
240
354
|
return [];
|
|
241
355
|
}
|
|
356
|
+
|
|
357
|
+
const buildResults = await this.executeWatchOperationsOnComponent(componentId, compFiles, true, initiator);
|
|
358
|
+
return buildResults;
|
|
242
359
|
}
|
|
243
360
|
/**
|
|
244
361
|
* if .bitmap changed, it's possible that a new component has been added. trigger onComponentAdd.
|
|
@@ -309,13 +426,7 @@ class Watcher {
|
|
|
309
426
|
return [];
|
|
310
427
|
}
|
|
311
428
|
|
|
312
|
-
|
|
313
|
-
return buildResults;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
_logger().default.console(`${idStr} doesn't have a compiler, nothing to build`);
|
|
317
|
-
|
|
318
|
-
return [];
|
|
429
|
+
return buildResults;
|
|
319
430
|
}
|
|
320
431
|
|
|
321
432
|
creatOnComponentRemovedEvent(idStr) {
|
|
@@ -330,12 +441,6 @@ class Watcher {
|
|
|
330
441
|
return new (_events().OnComponentAddEvent)(Date.now(), idStr, hook);
|
|
331
442
|
}
|
|
332
443
|
|
|
333
|
-
completeWatch() {
|
|
334
|
-
_loader().default.stop();
|
|
335
|
-
|
|
336
|
-
return [];
|
|
337
|
-
}
|
|
338
|
-
|
|
339
444
|
isComponentWatchedExternally(componentId) {
|
|
340
445
|
const watcherData = this.multipleWatchers.find(m => m.componentIds.find(id => id.isEqual(componentId._legacy)));
|
|
341
446
|
|
|
@@ -347,16 +452,9 @@ class Watcher {
|
|
|
347
452
|
|
|
348
453
|
return false;
|
|
349
454
|
}
|
|
350
|
-
/**
|
|
351
|
-
* if a file was added/remove, once the component is loaded, it changes .bitmap, and then the
|
|
352
|
-
* entire cache is invalidated and the consumer is reloaded.
|
|
353
|
-
* when a file just changed, no need to reload the consumer, it is enough to just delete the
|
|
354
|
-
* component from the cache (both, workspace and consumer)
|
|
355
|
-
*/
|
|
356
455
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
const relativeFile = (0, _utils().pathNormalizeToLinux)(this.consumer.getPathRelativeToConsumer(filePath));
|
|
456
|
+
getComponentIdByPath(filePath) {
|
|
457
|
+
const relativeFile = this.getRelativePathLinux(filePath);
|
|
360
458
|
const trackDir = this.findTrackDirByFilePathRecursively(relativeFile);
|
|
361
459
|
|
|
362
460
|
if (!trackDir) {
|
|
@@ -365,17 +463,11 @@ class Watcher {
|
|
|
365
463
|
return null;
|
|
366
464
|
}
|
|
367
465
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
const component = await this.workspace.get(componentId);
|
|
371
|
-
const componentMap = component.state._consumer.componentMap;
|
|
372
|
-
|
|
373
|
-
if (componentMap.getFilesRelativeToConsumer().find(p => p === relativeFile)) {
|
|
374
|
-
return componentId;
|
|
375
|
-
} // the file is inside the component dir but it's ignored. (e.g. it's in IGNORE_LIST)
|
|
376
|
-
|
|
466
|
+
return this.trackDirs[trackDir];
|
|
467
|
+
}
|
|
377
468
|
|
|
378
|
-
|
|
469
|
+
getRelativePathLinux(filePath) {
|
|
470
|
+
return (0, _utils().pathNormalizeToLinux)(this.consumer.getPathRelativeToConsumer(filePath));
|
|
379
471
|
}
|
|
380
472
|
|
|
381
473
|
findTrackDirByFilePathRecursively(filePath) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Watcher","constructor","workspace","pubsub","trackDirs","verbose","multipleWatchers","consumer","watchAll","opts","msgs","watchOpts","pathsToWatch","getPathsToWatch","componentIds","Object","values","triggerOnPreWatch","createWatcher","watcher","fsWatcher","onStart","Promise","resolve","reject","process","env","BIT_LOG","onAll","on","onReady","filePath","startTime","Date","getTime","buildResults","handleChange","initiator","duration","onChange","onAdd","p","onUnlink","err","onError","endsWith","BIT_MAP","handleBitmapChanges","completeWatch","componentId","getComponentIdAndClearItsCache","logger","debug","executeWatchOperationsOnComponent","msg","error","console","message","previewsTrackDirs","_reloadConsumer","setTrackDirs","newDirs","difference","keys","removedDirs","results","length","add","addResults","mapSeries","dir","push","flat","unwatch","executeWatchOperationsOnRemove","chalk","bold","toString","pub","WorkspaceAspect","id","creatOnComponentRemovedEvent","triggerOnComponentRemove","files","isChange","isComponentWatchedExternally","get","idStr","creatOnComponentChangeEvent","creatOnComponentAddEvent","triggerOnComponentChange","triggerOnComponentAdd","OnComponentRemovedEvent","now","hook","OnComponentChangeEvent","OnComponentAddEvent","loader","stop","watcherData","find","m","isEqual","_legacy","compilerId","relativeFile","pathNormalizeToLinux","getPathRelativeToConsumer","trackDir","findTrackDirByFilePathRecursively","clearComponentCache","component","componentMap","state","_consumer","getFilesRelativeToConsumer","parentDir","dirname","chokidar","watch","ignoreInitial","ignored","path","includes","sep","persistent","useFsEvents","componentsFromBitMap","bitMap","getAllComponents","COMPONENT_ORIGINS","AUTHORED","IMPORTED","all","map","bitId","getTrackDir","Error","resolveComponentId","paths","pathsAbsolute","toAbsolutePath"],"sources":["watcher.ts"],"sourcesContent":["import { PubsubMain } from '@teambit/pubsub';\nimport { dirname, sep } from 'path';\nimport { difference } from 'lodash';\nimport { ComponentID } from '@teambit/component';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { BIT_MAP, COMPONENT_ORIGINS } from '@teambit/legacy/dist/constants';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport mapSeries from 'p-map-series';\nimport chalk from 'chalk';\nimport { ChildProcess } from 'child_process';\nimport chokidar, { FSWatcher } from 'chokidar';\nimport ComponentMap from '@teambit/legacy/dist/consumer/bit-map/component-map';\nimport { PathLinux, PathOsBasedAbsolute } from '@teambit/legacy/dist/utils/path';\nimport { CompilationInitiator } from '@teambit/compiler';\nimport { WorkspaceAspect } from '../';\nimport { OnComponentChangeEvent, OnComponentAddEvent, OnComponentRemovedEvent } from '../events';\nimport { Workspace } from '../workspace';\nimport { OnComponentEventResult } from '../on-component-events';\nimport { CheckTypes } from './check-types';\n\nexport type WatcherProcessData = { watchProcess: ChildProcess; compilerId: BitId; componentIds: BitId[] };\n\nexport type EventMessages = {\n onAll: Function;\n onStart: Function;\n onReady: Function;\n onChange: Function;\n onAdd: Function;\n onUnlink: Function;\n onError: Function;\n};\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};\n\nexport class Watcher {\n private fsWatcher: FSWatcher;\n constructor(\n private workspace: Workspace,\n private pubsub: PubsubMain,\n private trackDirs: { [dir: PathLinux]: ComponentID } = {},\n private verbose = false,\n private multipleWatchers: WatcherProcessData[] = []\n ) {}\n\n get consumer(): Consumer {\n return this.workspace.consumer;\n }\n\n async watchAll(opts: WatchOptions) {\n const { msgs, ...watchOpts } = opts;\n // TODO: run build in the beginning of process (it's work like this in other envs)\n const pathsToWatch = await this.getPathsToWatch();\n const componentIds = Object.values(this.trackDirs);\n await this.workspace.triggerOnPreWatch(componentIds, watchOpts);\n await this.createWatcher(pathsToWatch);\n const watcher = this.fsWatcher;\n msgs?.onStart(this.workspace);\n\n return new Promise((resolve, reject) => {\n // prefix your command with \"BIT_LOG=*\" to see all watch events\n if (process.env.BIT_LOG) {\n // @ts-ignore\n if (msgs?.onAll) watcher.on('all', msgs?.onAll);\n }\n watcher.on('ready', () => {\n msgs?.onReady(this.workspace, this.trackDirs, this.verbose);\n });\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n watcher.on('change', async (filePath) => {\n const startTime = new Date().getTime();\n const buildResults = (await this.handleChange(filePath, opts?.initiator)) || [];\n const duration = new Date().getTime() - startTime;\n msgs?.onChange(filePath, buildResults, this.verbose, duration);\n });\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n watcher.on('add', async (filePath) => {\n const startTime = new Date().getTime();\n const buildResults = (await this.handleChange(filePath)) || [];\n const duration = new Date().getTime() - startTime;\n msgs?.onAdd(filePath, buildResults, this.verbose, duration);\n });\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n watcher.on('unlink', async (p) => {\n msgs?.onUnlink(p);\n await this.handleChange(p);\n });\n watcher.on('error', (err) => {\n msgs?.onError(err);\n reject(err);\n });\n });\n }\n\n private async handleChange(filePath: string, initiator?: CompilationInitiator): Promise<OnComponentEventResult[]> {\n try {\n if (filePath.endsWith(BIT_MAP)) {\n const buildResults = await this.handleBitmapChanges();\n this.completeWatch();\n return buildResults;\n }\n const componentId = await this.getComponentIdAndClearItsCache(filePath);\n if (!componentId) {\n logger.debug(`file ${filePath} is not part of any component, ignoring it`);\n return this.completeWatch();\n }\n\n const buildResults = await this.executeWatchOperationsOnComponent(componentId, [filePath], true, initiator);\n this.completeWatch();\n return buildResults;\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 return [];\n }\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 previewsTrackDirs = { ...this.trackDirs };\n await this.workspace._reloadConsumer();\n await this.setTrackDirs();\n const newDirs: string[] = difference(Object.keys(this.trackDirs), Object.keys(previewsTrackDirs));\n const removedDirs: string[] = difference(Object.keys(previewsTrackDirs), Object.keys(this.trackDirs));\n const results: OnComponentEventResult[] = [];\n if (newDirs.length) {\n this.fsWatcher.add(newDirs);\n const addResults = await mapSeries(newDirs, async (dir) =>\n this.executeWatchOperationsOnComponent(this.trackDirs[dir], [], false)\n );\n results.push(...addResults.flat());\n }\n if (removedDirs.length) {\n await this.fsWatcher.unwatch(removedDirs);\n await mapSeries(removedDirs, (dir) => this.executeWatchOperationsOnRemove(previewsTrackDirs[dir]));\n }\n return results;\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.creatOnComponentRemovedEvent(componentId.toString()));\n await this.workspace.triggerOnComponentRemove(componentId);\n }\n\n private async executeWatchOperationsOnComponent(\n componentId: ComponentID,\n files: string[],\n isChange = true,\n initiator?: CompilationInitiator\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.creatOnComponentChangeEvent(idStr, 'OnComponentChange'));\n } else {\n logger.debug(`running OnComponentAdd hook for ${chalk.bold(idStr)}`);\n this.pubsub.pub(WorkspaceAspect.id, this.creatOnComponentAddEvent(idStr, 'OnComponentAdd'));\n }\n\n let buildResults: OnComponentEventResult[];\n try {\n buildResults = isChange\n ? await this.workspace.triggerOnComponentChange(componentId, files, initiator)\n : await this.workspace.triggerOnComponentAdd(componentId);\n } catch (err: any) {\n // do not exit the watch process on errors, just print them\n const msg = `found an issue during onComponentChange or onComponentAdd hooks`;\n logger.error(msg, err);\n logger.console(`\\n${msg}: ${err.message || err}`);\n return [];\n }\n if (buildResults && buildResults.length) {\n return buildResults;\n }\n logger.console(`${idStr} doesn't have a compiler, nothing to build`);\n return [];\n }\n\n private creatOnComponentRemovedEvent(idStr) {\n return new OnComponentRemovedEvent(Date.now(), idStr);\n }\n\n private creatOnComponentChangeEvent(idStr, hook) {\n return new OnComponentChangeEvent(Date.now(), idStr, hook);\n }\n\n private creatOnComponentAddEvent(idStr, hook) {\n return new OnComponentAddEvent(Date.now(), idStr, hook);\n }\n\n private completeWatch() {\n loader.stop();\n return [];\n }\n\n private isComponentWatchedExternally(componentId: ComponentID) {\n const watcherData = this.multipleWatchers.find((m) => m.componentIds.find((id) => id.isEqual(componentId._legacy)));\n if (watcherData) {\n logger.debug(`${componentId.toString()} is watched by ${watcherData.compilerId.toString()}`);\n return true;\n }\n return false;\n }\n\n /**\n * if a file was added/remove, once the component is loaded, it changes .bitmap, and then the\n * entire cache is invalidated and the consumer is reloaded.\n * when a file just changed, no need to reload the consumer, it is enough to just delete the\n * component from the cache (both, workspace and consumer)\n */\n private async getComponentIdAndClearItsCache(filePath: string): Promise<ComponentID | null> {\n const relativeFile = pathNormalizeToLinux(this.consumer.getPathRelativeToConsumer(filePath));\n const trackDir = this.findTrackDirByFilePathRecursively(relativeFile);\n if (!trackDir) {\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 const componentId = this.trackDirs[trackDir];\n this.workspace.clearComponentCache(componentId);\n const component = await this.workspace.get(componentId);\n const componentMap: ComponentMap = component.state._consumer.componentMap;\n if (componentMap.getFilesRelativeToConsumer().find((p) => p === relativeFile)) {\n return componentId;\n }\n // the file is inside the component dir but it's ignored. (e.g. it's in IGNORE_LIST)\n return null;\n }\n\n private findTrackDirByFilePathRecursively(filePath: string): string | null {\n if (this.trackDirs[filePath]) return filePath;\n const parentDir = dirname(filePath);\n if (parentDir === filePath) return null;\n return this.findTrackDirByFilePathRecursively(parentDir);\n }\n\n private async createWatcher(pathsToWatch: string[]) {\n this.fsWatcher = chokidar.watch(pathsToWatch, {\n ignoreInitial: true,\n // Using the function way since the regular way not working as expected\n // It might be solved when upgrading to chokidar > 3.0.0\n // See:\n // https://github.com/paulmillr/chokidar/issues/773\n // https://github.com/paulmillr/chokidar/issues/492\n // https://github.com/paulmillr/chokidar/issues/724\n ignored: (path) => {\n // Ignore package.json temporarily since it cerates endless loop since it's re-written after each build\n if (path.includes(`${sep}node_modules${sep}`) || path.includes(`${sep}package.json`)) {\n return true;\n }\n return false;\n },\n persistent: true,\n useFsEvents: false,\n });\n }\n\n async setTrackDirs() {\n this.trackDirs = {};\n const componentsFromBitMap = this.consumer.bitMap.getAllComponents([\n COMPONENT_ORIGINS.AUTHORED,\n COMPONENT_ORIGINS.IMPORTED,\n ]);\n await Promise.all(\n componentsFromBitMap.map(async (componentMap) => {\n const bitId = componentMap.id;\n const trackDir = componentMap.getTrackDir();\n if (!trackDir) throw new Error(`${bitId.toString()} has no rootDir, which is invalid in Harmony`);\n const componentId = await this.workspace.resolveComponentId(bitId);\n this.trackDirs[trackDir] = componentId;\n })\n );\n }\n\n private async getPathsToWatch(): Promise<PathOsBasedAbsolute[]> {\n await this.setTrackDirs();\n const paths = [...Object.keys(this.trackDirs), BIT_MAP];\n const pathsAbsolute = paths.map((dir) => this.consumer.toAbsolutePath(dir));\n return pathsAbsolute;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;;;AA0BO,MAAMA,OAAN,CAAc;EAEnBC,WAAW,CACDC,SADC,EAEDC,MAFC,EAGDC,SAA4C,GAAG,EAH9C,EAIDC,OAAO,GAAG,KAJT,EAKDC,gBAAsC,GAAG,EALxC,EAMT;IAAA,KALQJ,SAKR,GALQA,SAKR;IAAA,KAJQC,MAIR,GAJQA,MAIR;IAAA,KAHQC,SAGR,GAHQA,SAGR;IAAA,KAFQC,OAER,GAFQA,OAER;IAAA,KADQC,gBACR,GADQA,gBACR;IAAA;EAAE;;EAEQ,IAARC,QAAQ,GAAa;IACvB,OAAO,KAAKL,SAAL,CAAeK,QAAtB;EACD;;EAEa,MAARC,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,KAAKxD,SAAL,GAAiB,EAAjB;IACA,MAAM2H,oBAAoB,GAAG,KAAKxH,QAAL,CAAcyH,MAAd,CAAqBC,gBAArB,CAAsC,CACjEC,8BAAA,CAAkBC,QAD+C,EAEjED,8BAAA,CAAkBE,QAF+C,CAAtC,CAA7B;IAIA,MAAM9G,OAAO,CAAC+G,GAAR,CACJN,oBAAoB,CAACO,GAArB,CAAyB,MAAOtB,YAAP,IAAwB;MAC/C,MAAMuB,KAAK,GAAGvB,YAAY,CAAChC,EAA3B;MACA,MAAM4B,QAAQ,GAAGI,YAAY,CAACwB,WAAb,EAAjB;MACA,IAAI,CAAC5B,QAAL,EAAe,MAAM,IAAI6B,KAAJ,CAAW,GAAEF,KAAK,CAAC1D,QAAN,EAAiB,8CAA9B,CAAN;MACf,MAAM5B,WAAW,GAAG,MAAM,KAAK/C,SAAL,CAAewI,kBAAf,CAAkCH,KAAlC,CAA1B;MACA,KAAKnI,SAAL,CAAewG,QAAf,IAA2B3D,WAA3B;IACD,CAND,CADI,CAAN;EASD;;EAE4B,MAAfpC,eAAe,GAAmC;IAC9D,MAAM,KAAK+C,YAAL,EAAN;IACA,MAAM+E,KAAK,GAAG,CAAC,GAAG5H,MAAM,CAACgD,IAAP,CAAY,KAAK3D,SAAjB,CAAJ,EAAiC0C,oBAAjC,CAAd;IACA,MAAM8F,aAAa,GAAGD,KAAK,CAACL,GAAN,CAAWhE,GAAD,IAAS,KAAK/D,QAAL,CAAcsI,cAAd,CAA6BvE,GAA7B,CAAnB,CAAtB;IACA,OAAOsE,aAAP;EACD;;AA9PkB"}
|
|
1
|
+
{"version":3,"names":["DEBOUNCE_WAIT_MS","Watcher","constructor","workspace","pubsub","trackDirs","verbose","multipleWatchers","consumer","watchAll","opts","msgs","watchOpts","pathsToWatch","getPathsToWatch","componentIds","Object","values","triggerOnPreWatch","createWatcher","watcher","fsWatcher","onStart","Promise","resolve","reject","process","env","BIT_LOG","onAll","on","onReady","filePath","startTime","Date","getTime","files","results","debounced","failureMsg","handleChange","initiator","duration","onChange","onAdd","p","onUnlink","err","onError","endsWith","BIT_MAP","buildResults","handleBitmapChanges","loader","stop","componentId","getComponentIdByPath","logger","debug","compIdStr","toString","changedFilesPerComponent","push","sleep","triggerCompChanges","length","undefined","join","msg","error","console","message","ms","setTimeout","clearComponentCache","component","get","componentMap","state","_consumer","compFiles","filter","relativeFile","getRelativePathLinux","isCompFile","Boolean","getFilesRelativeToConsumer","find","executeWatchOperationsOnComponent","previewsTrackDirs","_reloadConsumer","setTrackDirs","newDirs","difference","keys","removedDirs","add","addResults","mapSeries","dir","flat","unwatch","executeWatchOperationsOnRemove","chalk","bold","pub","WorkspaceAspect","id","creatOnComponentRemovedEvent","triggerOnComponentRemove","isChange","isComponentWatchedExternally","idStr","creatOnComponentChangeEvent","creatOnComponentAddEvent","triggerOnComponentChange","triggerOnComponentAdd","OnComponentRemovedEvent","now","hook","OnComponentChangeEvent","OnComponentAddEvent","watcherData","m","isEqual","_legacy","compilerId","trackDir","findTrackDirByFilePathRecursively","pathNormalizeToLinux","getPathRelativeToConsumer","parentDir","dirname","chokidar","watch","ignoreInitial","ignored","path","includes","sep","persistent","useFsEvents","componentsFromBitMap","bitMap","getAllComponents","COMPONENT_ORIGINS","AUTHORED","IMPORTED","all","map","bitId","getTrackDir","Error","resolveComponentId","paths","pathsAbsolute","toAbsolutePath"],"sources":["watcher.ts"],"sourcesContent":["import { PubsubMain } from '@teambit/pubsub';\nimport { dirname, sep } from 'path';\nimport { difference } from 'lodash';\nimport { ComponentID } from '@teambit/component';\nimport { BitId } from '@teambit/legacy-bit-id';\nimport loader from '@teambit/legacy/dist/cli/loader';\nimport { BIT_MAP, COMPONENT_ORIGINS } from '@teambit/legacy/dist/constants';\nimport { Consumer } from '@teambit/legacy/dist/consumer';\nimport logger from '@teambit/legacy/dist/logger/logger';\nimport { pathNormalizeToLinux } from '@teambit/legacy/dist/utils';\nimport mapSeries from 'p-map-series';\nimport chalk from 'chalk';\nimport { ChildProcess } from 'child_process';\nimport chokidar, { FSWatcher } from 'chokidar';\nimport ComponentMap from '@teambit/legacy/dist/consumer/bit-map/component-map';\nimport { PathLinux, PathOsBasedAbsolute } from '@teambit/legacy/dist/utils/path';\nimport { CompilationInitiator } from '@teambit/compiler';\nimport { WorkspaceAspect } from '../';\nimport { OnComponentChangeEvent, OnComponentAddEvent, OnComponentRemovedEvent } from '../events';\nimport { Workspace } from '../workspace';\nimport { OnComponentEventResult } from '../on-component-events';\nimport { CheckTypes } from './check-types';\n\nexport type WatcherProcessData = { watchProcess: ChildProcess; compilerId: BitId; componentIds: BitId[] };\n\nexport type EventMessages = {\n onAll: Function;\n onStart: Function;\n onReady: Function;\n onChange: Function;\n onAdd: Function;\n onUnlink: Function;\n onError: Function;\n};\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};\n\nconst DEBOUNCE_WAIT_MS = 100;\n\nexport class Watcher {\n private fsWatcher: FSWatcher;\n private changedFilesPerComponent: { [componentId: string]: string[] } = {};\n constructor(\n private workspace: Workspace,\n private pubsub: PubsubMain,\n private trackDirs: { [dir: PathLinux]: ComponentID } = {},\n private verbose = false,\n private multipleWatchers: WatcherProcessData[] = []\n ) {}\n\n get consumer(): Consumer {\n return this.workspace.consumer;\n }\n\n async watchAll(opts: WatchOptions) {\n const { msgs, ...watchOpts } = opts;\n // TODO: run build in the beginning of process (it's work like this in other envs)\n const pathsToWatch = await this.getPathsToWatch();\n const componentIds = Object.values(this.trackDirs);\n await this.workspace.triggerOnPreWatch(componentIds, watchOpts);\n await this.createWatcher(pathsToWatch);\n const watcher = this.fsWatcher;\n msgs?.onStart(this.workspace);\n\n return new Promise((resolve, reject) => {\n // prefix your command with \"BIT_LOG=*\" to see all watch events\n if (process.env.BIT_LOG) {\n // @ts-ignore\n if (msgs?.onAll) watcher.on('all', msgs?.onAll);\n }\n watcher.on('ready', () => {\n msgs?.onReady(this.workspace, this.trackDirs, this.verbose);\n });\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n watcher.on('change', async (filePath) => {\n const startTime = new Date().getTime();\n const { files, results, debounced, failureMsg } = await this.handleChange(filePath, opts?.initiator);\n if (debounced) {\n return;\n }\n const duration = new Date().getTime() - startTime;\n msgs?.onChange(files, results, this.verbose, duration, failureMsg);\n });\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n watcher.on('add', async (filePath) => {\n const startTime = new Date().getTime();\n const { files, results, debounced, failureMsg } = await this.handleChange(filePath, opts?.initiator);\n if (debounced) {\n return;\n }\n const duration = new Date().getTime() - startTime;\n msgs?.onAdd(files, results, this.verbose, duration, failureMsg);\n });\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n watcher.on('unlink', async (p) => {\n msgs?.onUnlink(p);\n await this.handleChange(p);\n });\n watcher.on('error', (err) => {\n msgs?.onError(err);\n reject(err);\n });\n });\n }\n\n /**\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 */\n private async handleChange(\n filePath: string,\n initiator?: CompilationInitiator\n ): Promise<{\n results: OnComponentEventResult[];\n files?: string[];\n failureMsg?: string;\n debounced?: boolean;\n }> {\n try {\n if (filePath.endsWith(BIT_MAP)) {\n const buildResults = await this.handleBitmapChanges();\n loader.stop();\n return { results: buildResults, files: [filePath] };\n }\n const componentId = this.getComponentIdByPath(filePath);\n if (!componentId) {\n const failureMsg = `file ${filePath} is not part of any component, ignoring it`;\n logger.debug(failureMsg);\n loader.stop();\n return { results: [], files: [filePath], failureMsg };\n }\n\n const compIdStr = componentId.toString();\n if (this.changedFilesPerComponent[compIdStr]) {\n this.changedFilesPerComponent[compIdStr].push(filePath);\n loader.stop();\n return { results: [], 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.triggerCompChanges(componentId, files, initiator);\n const failureMsg = buildResults.length\n ? undefined\n : `files ${files.join(', ')} are inside the component ${compIdStr} but configured to be ignored`;\n loader.stop();\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 loader.stop();\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 /**\n * if a file was added/remove, once the component is loaded, it changes .bitmap, and then the\n * entire cache is invalidated and the consumer is reloaded.\n * when a file just changed, no need to reload the consumer, it is enough to just delete the\n * component from the cache (both, workspace and consumer)\n */\n private async triggerCompChanges(\n componentId: ComponentID,\n files: string[],\n initiator?: CompilationInitiator\n ): Promise<OnComponentEventResult[]> {\n this.workspace.clearComponentCache(componentId);\n const component = await this.workspace.get(componentId);\n const componentMap: ComponentMap = component.state._consumer.componentMap;\n const compFiles = files.filter((filePath) => {\n const relativeFile = this.getRelativePathLinux(filePath);\n const isCompFile = Boolean(componentMap.getFilesRelativeToConsumer().find((p) => p === relativeFile));\n if (!isCompFile) {\n logger.debug(`file ${filePath} is inside the component ${componentId.toString()} but configured to be ignored`);\n }\n return isCompFile;\n });\n if (!compFiles.length) {\n return [];\n }\n const buildResults = await this.executeWatchOperationsOnComponent(componentId, compFiles, true, initiator);\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 previewsTrackDirs = { ...this.trackDirs };\n await this.workspace._reloadConsumer();\n await this.setTrackDirs();\n const newDirs: string[] = difference(Object.keys(this.trackDirs), Object.keys(previewsTrackDirs));\n const removedDirs: string[] = difference(Object.keys(previewsTrackDirs), Object.keys(this.trackDirs));\n const results: OnComponentEventResult[] = [];\n if (newDirs.length) {\n this.fsWatcher.add(newDirs);\n const addResults = await mapSeries(newDirs, async (dir) =>\n this.executeWatchOperationsOnComponent(this.trackDirs[dir], [], false)\n );\n results.push(...addResults.flat());\n }\n if (removedDirs.length) {\n await this.fsWatcher.unwatch(removedDirs);\n await mapSeries(removedDirs, (dir) => this.executeWatchOperationsOnRemove(previewsTrackDirs[dir]));\n }\n return results;\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.creatOnComponentRemovedEvent(componentId.toString()));\n await this.workspace.triggerOnComponentRemove(componentId);\n }\n\n private async executeWatchOperationsOnComponent(\n componentId: ComponentID,\n files: string[],\n isChange = true,\n initiator?: CompilationInitiator\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.creatOnComponentChangeEvent(idStr, 'OnComponentChange'));\n } else {\n logger.debug(`running OnComponentAdd hook for ${chalk.bold(idStr)}`);\n this.pubsub.pub(WorkspaceAspect.id, this.creatOnComponentAddEvent(idStr, 'OnComponentAdd'));\n }\n\n let buildResults: OnComponentEventResult[];\n try {\n buildResults = isChange\n ? await this.workspace.triggerOnComponentChange(componentId, files, initiator)\n : await this.workspace.triggerOnComponentAdd(componentId);\n } catch (err: any) {\n // do not exit the watch process on errors, just print them\n const msg = `found an issue during onComponentChange or onComponentAdd hooks`;\n logger.error(msg, err);\n logger.console(`\\n${msg}: ${err.message || err}`);\n return [];\n }\n return buildResults;\n }\n\n private creatOnComponentRemovedEvent(idStr) {\n return new OnComponentRemovedEvent(Date.now(), idStr);\n }\n\n private creatOnComponentChangeEvent(idStr, hook) {\n return new OnComponentChangeEvent(Date.now(), idStr, hook);\n }\n\n private creatOnComponentAddEvent(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._legacy)));\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 trackDir = this.findTrackDirByFilePathRecursively(relativeFile);\n if (!trackDir) {\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.trackDirs[trackDir];\n }\n\n private getRelativePathLinux(filePath: string) {\n return pathNormalizeToLinux(this.consumer.getPathRelativeToConsumer(filePath));\n }\n\n private findTrackDirByFilePathRecursively(filePath: string): string | null {\n if (this.trackDirs[filePath]) return filePath;\n const parentDir = dirname(filePath);\n if (parentDir === filePath) return null;\n return this.findTrackDirByFilePathRecursively(parentDir);\n }\n\n private async createWatcher(pathsToWatch: string[]) {\n this.fsWatcher = chokidar.watch(pathsToWatch, {\n ignoreInitial: true,\n // Using the function way since the regular way not working as expected\n // It might be solved when upgrading to chokidar > 3.0.0\n // See:\n // https://github.com/paulmillr/chokidar/issues/773\n // https://github.com/paulmillr/chokidar/issues/492\n // https://github.com/paulmillr/chokidar/issues/724\n ignored: (path) => {\n // Ignore package.json temporarily since it cerates endless loop since it's re-written after each build\n if (path.includes(`${sep}node_modules${sep}`) || path.includes(`${sep}package.json`)) {\n return true;\n }\n return false;\n },\n persistent: true,\n useFsEvents: false,\n });\n }\n\n async setTrackDirs() {\n this.trackDirs = {};\n const componentsFromBitMap = this.consumer.bitMap.getAllComponents([\n COMPONENT_ORIGINS.AUTHORED,\n COMPONENT_ORIGINS.IMPORTED,\n ]);\n await Promise.all(\n componentsFromBitMap.map(async (componentMap) => {\n const bitId = componentMap.id;\n const trackDir = componentMap.getTrackDir();\n if (!trackDir) throw new Error(`${bitId.toString()} has no rootDir, which is invalid in Harmony`);\n const componentId = await this.workspace.resolveComponentId(bitId);\n this.trackDirs[trackDir] = componentId;\n })\n );\n }\n\n private async getPathsToWatch(): Promise<PathOsBasedAbsolute[]> {\n await this.setTrackDirs();\n const paths = [...Object.keys(this.trackDirs), BIT_MAP];\n const pathsAbsolute = paths.map((dir) => this.consumer.toAbsolutePath(dir));\n return pathsAbsolute;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIA;EAAA;;EAAA;IAAA;E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,EAAjB;IACA,MAAMyI,oBAAoB,GAAG,KAAKtI,QAAL,CAAcuI,MAAd,CAAqBC,gBAArB,CAAsC,CACjEC,8BAAA,CAAkBC,QAD+C,EAEjED,8BAAA,CAAkBE,QAF+C,CAAtC,CAA7B;IAIA,MAAM5H,OAAO,CAAC6H,GAAR,CACJN,oBAAoB,CAACO,GAArB,CAAyB,MAAOxE,YAAP,IAAwB;MAC/C,MAAMyE,KAAK,GAAGzE,YAAY,CAAC8B,EAA3B;MACA,MAAMoB,QAAQ,GAAGlD,YAAY,CAAC0E,WAAb,EAAjB;MACA,IAAI,CAACxB,QAAL,EAAe,MAAM,IAAIyB,KAAJ,CAAW,GAAEF,KAAK,CAAC1F,QAAN,EAAiB,8CAA9B,CAAN;MACf,MAAML,WAAW,GAAG,MAAM,KAAKpD,SAAL,CAAesJ,kBAAf,CAAkCH,KAAlC,CAA1B;MACA,KAAKjJ,SAAL,CAAe0H,QAAf,IAA2BxE,WAA3B;IACD,CAND,CADI,CAAN;EASD;;EAE4B,MAAfzC,eAAe,GAAmC;IAC9D,MAAM,KAAK6E,YAAL,EAAN;IACA,MAAM+D,KAAK,GAAG,CAAC,GAAG1I,MAAM,CAAC8E,IAAP,CAAY,KAAKzF,SAAjB,CAAJ,EAAiC6C,oBAAjC,CAAd;IACA,MAAMyG,aAAa,GAAGD,KAAK,CAACL,GAAN,CAAWlD,GAAD,IAAS,KAAK3F,QAAL,CAAcoJ,cAAd,CAA6BzD,GAA7B,CAAnB,CAAtB;IACA,OAAOwD,aAAP;EACD;;AA5TkB"}
|
package/install.cmd.tsx
CHANGED
|
@@ -20,7 +20,6 @@ export default class InstallCmd implements Command {
|
|
|
20
20
|
description = 'install development workspace dependencies';
|
|
21
21
|
alias = 'in';
|
|
22
22
|
group = 'development';
|
|
23
|
-
shortDescription = '';
|
|
24
23
|
options = [
|
|
25
24
|
['v', 'variants <variants>', 'add packages to specific variants'],
|
|
26
25
|
['t', 'type [lifecycleType]', '"runtime" (default) or "peer" (dev is not a valid option)'],
|
package/link/link.cmd.ts
CHANGED
|
@@ -19,8 +19,8 @@ type LinkCommandOpts = {
|
|
|
19
19
|
export class LinkCommand implements Command {
|
|
20
20
|
name = 'link [ids...]';
|
|
21
21
|
alias = '';
|
|
22
|
-
description
|
|
23
|
-
|
|
22
|
+
description = 'link components and core aspects';
|
|
23
|
+
extendedDescription: string;
|
|
24
24
|
group = 'development';
|
|
25
25
|
private = false;
|
|
26
26
|
options = [
|
|
@@ -48,7 +48,7 @@ export class LinkCommand implements Command {
|
|
|
48
48
|
|
|
49
49
|
private docsDomain: string
|
|
50
50
|
) {
|
|
51
|
-
this.
|
|
51
|
+
this.extendedDescription = `https://${this.docsDomain}/workspace/component-links`;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
async report([ids]: [string[]], opts: LinkCommandOpts) {
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/workspace",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.753",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/workspace/workspace",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.workspace",
|
|
8
8
|
"name": "workspace",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.753"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -39,46 +39,46 @@
|
|
|
39
39
|
"@teambit/bit-error": "0.0.394",
|
|
40
40
|
"@teambit/component-id": "0.0.402",
|
|
41
41
|
"@teambit/legacy-bit-id": "0.0.399",
|
|
42
|
-
"@teambit/logger": "0.0.
|
|
43
|
-
"@teambit/scope": "0.0.
|
|
44
|
-
"@teambit/cli": "0.0.
|
|
45
|
-
"@teambit/isolator": "0.0.
|
|
46
|
-
"@teambit/component-tree": "0.0.
|
|
42
|
+
"@teambit/logger": "0.0.590",
|
|
43
|
+
"@teambit/scope": "0.0.753",
|
|
44
|
+
"@teambit/cli": "0.0.497",
|
|
45
|
+
"@teambit/isolator": "0.0.753",
|
|
46
|
+
"@teambit/component-tree": "0.0.541",
|
|
47
47
|
"@teambit/component.ui.component-status-resolver": "0.0.492",
|
|
48
|
-
"@teambit/lanes.ui.lanes": "0.0.
|
|
48
|
+
"@teambit/lanes.ui.lanes": "0.0.64",
|
|
49
49
|
"@teambit/harmony.modules.resolved-component": "0.0.484",
|
|
50
|
-
"@teambit/dependency-resolver": "0.0.
|
|
51
|
-
"@teambit/compiler": "0.0.
|
|
52
|
-
"@teambit/component": "0.0.
|
|
53
|
-
"@teambit/graphql": "0.0.
|
|
54
|
-
"@teambit/aspect-loader": "0.0.
|
|
55
|
-
"@teambit/bundler": "0.0.
|
|
56
|
-
"@teambit/community": "0.0.
|
|
57
|
-
"@teambit/envs": "0.0.
|
|
58
|
-
"@teambit/pubsub": "0.0.
|
|
59
|
-
"@teambit/ui": "0.0.
|
|
60
|
-
"@teambit/variants": "0.0.
|
|
50
|
+
"@teambit/dependency-resolver": "0.0.753",
|
|
51
|
+
"@teambit/compiler": "0.0.753",
|
|
52
|
+
"@teambit/component": "0.0.753",
|
|
53
|
+
"@teambit/graphql": "0.0.753",
|
|
54
|
+
"@teambit/aspect-loader": "0.0.753",
|
|
55
|
+
"@teambit/bundler": "0.0.753",
|
|
56
|
+
"@teambit/community": "0.0.45",
|
|
57
|
+
"@teambit/envs": "0.0.753",
|
|
58
|
+
"@teambit/pubsub": "0.0.753",
|
|
59
|
+
"@teambit/ui": "0.0.753",
|
|
60
|
+
"@teambit/variants": "0.0.593",
|
|
61
61
|
"@teambit/component-issues": "0.0.53",
|
|
62
|
-
"@teambit/config": "0.0.
|
|
62
|
+
"@teambit/config": "0.0.510",
|
|
63
63
|
"@teambit/harmony.modules.requireable-component": "0.0.484",
|
|
64
|
-
"@teambit/importer": "0.0.
|
|
65
|
-
"@teambit/lane-id": "0.0.
|
|
64
|
+
"@teambit/importer": "0.0.182",
|
|
65
|
+
"@teambit/lane-id": "0.0.16",
|
|
66
66
|
"@teambit/workspace.modules.match-pattern": "0.0.489",
|
|
67
|
-
"@teambit/component.ui.component-drawer": "0.0.
|
|
67
|
+
"@teambit/component.ui.component-drawer": "0.0.43",
|
|
68
68
|
"@teambit/design.ui.tree": "0.0.5",
|
|
69
|
-
"@teambit/ui-foundation.ui.side-bar": "0.0.
|
|
70
|
-
"@teambit/command-bar": "0.0.
|
|
69
|
+
"@teambit/ui-foundation.ui.side-bar": "0.0.561",
|
|
70
|
+
"@teambit/command-bar": "0.0.753",
|
|
71
71
|
"@teambit/component.ui.component-filters": "0.0.5",
|
|
72
|
-
"@teambit/graph": "0.0.
|
|
73
|
-
"@teambit/sidebar": "0.0.
|
|
72
|
+
"@teambit/graph": "0.0.753",
|
|
73
|
+
"@teambit/sidebar": "0.0.753",
|
|
74
74
|
"@teambit/ui-foundation.ui.main-dropdown": "0.0.487",
|
|
75
75
|
"@teambit/ui-foundation.ui.menu": "0.0.487",
|
|
76
76
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.490",
|
|
77
77
|
"@teambit/ui-foundation.ui.tree.drawer": "0.0.499",
|
|
78
78
|
"@teambit/toolbox.time.time-format": "0.0.483",
|
|
79
79
|
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.487",
|
|
80
|
-
"@teambit/component-descriptor": "0.0.
|
|
81
|
-
"@teambit/deprecation": "0.0.
|
|
80
|
+
"@teambit/component-descriptor": "0.0.59",
|
|
81
|
+
"@teambit/deprecation": "0.0.753",
|
|
82
82
|
"@teambit/ui-foundation.ui.constants.z-indexes": "0.0.487",
|
|
83
83
|
"@teambit/ui-foundation.ui.buttons.collapser": "0.0.194",
|
|
84
84
|
"@teambit/ui-foundation.ui.corner": "0.0.498",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"peerDependencies": {
|
|
106
106
|
"react-router-dom": "^6.0.0",
|
|
107
107
|
"@apollo/client": "^3.0.0",
|
|
108
|
-
"@teambit/legacy": "1.0.
|
|
108
|
+
"@teambit/legacy": "1.0.277",
|
|
109
109
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
110
110
|
"react": "^16.8.0 || ^17.0.0"
|
|
111
111
|
},
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"react": "-"
|
|
134
134
|
},
|
|
135
135
|
"peerDependencies": {
|
|
136
|
-
"@teambit/legacy": "1.0.
|
|
136
|
+
"@teambit/legacy": "1.0.277",
|
|
137
137
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
138
138
|
"react": "^16.8.0 || ^17.0.0"
|
|
139
139
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@0.0.
|
|
2
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@0.0.
|
|
1
|
+
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@0.0.753/dist/workspace.composition.js')]
|
|
2
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.workspace_workspace@0.0.753/dist/workspace.docs.mdx')]
|
package/uninstall.cmd.tsx
CHANGED
package/update.cmd.tsx
CHANGED
|
@@ -11,7 +11,6 @@ export default class UpdateCmd implements Command {
|
|
|
11
11
|
description = 'update dependencies';
|
|
12
12
|
alias = 'up';
|
|
13
13
|
group = 'development';
|
|
14
|
-
shortDescription = '';
|
|
15
14
|
options = [['y', 'yes', 'automatically update all outdated packages']] as CommandOptions;
|
|
16
15
|
|
|
17
16
|
constructor(
|
package/watch/watch.cmd.tsx
CHANGED
|
@@ -33,20 +33,40 @@ export class WatchCommand implements Command {
|
|
|
33
33
|
)
|
|
34
34
|
);
|
|
35
35
|
},
|
|
36
|
-
onChange: (
|
|
36
|
+
onChange: (
|
|
37
|
+
filePaths: string[],
|
|
38
|
+
buildResults: OnComponentEventResult[],
|
|
39
|
+
verbose: boolean,
|
|
40
|
+
duration,
|
|
41
|
+
failureMsg?: string
|
|
42
|
+
) => {
|
|
43
|
+
const files = filePaths.join(', ');
|
|
37
44
|
clearOutdatedData();
|
|
38
45
|
if (!buildResults.length) {
|
|
39
|
-
|
|
46
|
+
failureMsg = failureMsg || `The files ${files} have been changed, but nothing to compile`;
|
|
47
|
+
this.logger.console(`${failureMsg}\n\n`);
|
|
40
48
|
return;
|
|
41
49
|
}
|
|
42
|
-
this.logger.console(`The file ${
|
|
50
|
+
this.logger.console(`The file(s) ${files} have been changed.\n\n`);
|
|
43
51
|
this.logger.console(formatCompileResults(buildResults, verbose));
|
|
44
52
|
this.logger.console(`Finished. (${duration}ms)`);
|
|
45
53
|
this.logger.console(chalk.yellow(`Watching for component changes (${moment().format('HH:mm:ss')})...`));
|
|
46
54
|
},
|
|
47
|
-
onAdd: (
|
|
55
|
+
onAdd: (
|
|
56
|
+
filePaths: string[],
|
|
57
|
+
buildResults: OnComponentEventResult[],
|
|
58
|
+
verbose: boolean,
|
|
59
|
+
duration,
|
|
60
|
+
failureMsg?: string
|
|
61
|
+
) => {
|
|
62
|
+
const files = filePaths.join(', ');
|
|
48
63
|
clearOutdatedData();
|
|
49
|
-
|
|
64
|
+
if (!buildResults.length) {
|
|
65
|
+
failureMsg = failureMsg || `The files ${files} have been added, but nothing to compile`;
|
|
66
|
+
this.logger.console(`${failureMsg}\n\n`);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
this.logger.console(`The file(s) ${filePaths} have been added.\n\n`);
|
|
50
70
|
this.logger.console(formatCompileResults(buildResults, verbose));
|
|
51
71
|
this.logger.console(`Finished. (${duration}ms)`);
|
|
52
72
|
this.logger.console(chalk.yellow(`Watching for component changes (${moment().format('HH:mm:ss')})...`));
|
|
@@ -63,7 +83,6 @@ export class WatchCommand implements Command {
|
|
|
63
83
|
description = 'watch a set of components';
|
|
64
84
|
alias = '';
|
|
65
85
|
group = 'development';
|
|
66
|
-
shortDescription = '';
|
|
67
86
|
options = [
|
|
68
87
|
['v', 'verbose', 'showing npm verbose output for inspection and prints stack trace'],
|
|
69
88
|
['', 'skip-pre-compilation', 'skip the compilation step before starting to watch'],
|