@teambit/component-writer 1.0.1174 → 1.0.1175

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.
@@ -0,0 +1,480 @@
1
+ "use strict";
2
+
3
+ function _chai() {
4
+ const data = require("chai");
5
+ _chai = function () {
6
+ return data;
7
+ };
8
+ return data;
9
+ }
10
+ function _fsExtra() {
11
+ const data = _interopRequireDefault(require("fs-extra"));
12
+ _fsExtra = function () {
13
+ return data;
14
+ };
15
+ return data;
16
+ }
17
+ function _os() {
18
+ const data = _interopRequireDefault(require("os"));
19
+ _os = function () {
20
+ return data;
21
+ };
22
+ return data;
23
+ }
24
+ function _path() {
25
+ const data = _interopRequireDefault(require("path"));
26
+ _path = function () {
27
+ return data;
28
+ };
29
+ return data;
30
+ }
31
+ function _legacy() {
32
+ const data = require("@teambit/legacy.bit-map");
33
+ _legacy = function () {
34
+ return data;
35
+ };
36
+ return data;
37
+ }
38
+ function _legacy2() {
39
+ const data = require("@teambit/legacy.constants");
40
+ _legacy2 = function () {
41
+ return data;
42
+ };
43
+ return data;
44
+ }
45
+ function _legacy3() {
46
+ const data = require("@teambit/legacy.extension-data");
47
+ _legacy3 = function () {
48
+ return data;
49
+ };
50
+ return data;
51
+ }
52
+ function _workspaceRoot() {
53
+ const data = require("@teambit/workspace-root");
54
+ _workspaceRoot = function () {
55
+ return data;
56
+ };
57
+ return data;
58
+ }
59
+ function _componentWriter() {
60
+ const data = _interopRequireWildcard(require("./component-writer"));
61
+ _componentWriter = function () {
62
+ return data;
63
+ };
64
+ return data;
65
+ }
66
+ function _componentWriterMain() {
67
+ const data = require("./component-writer.main.runtime");
68
+ _componentWriterMain = function () {
69
+ return data;
70
+ };
71
+ return data;
72
+ }
73
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
74
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
75
+ describe('isOwnedByNestedComponent', () => {
76
+ const nested = ['packages/comp1', 'packages/comp2'];
77
+ it('should claim a file inside a nested component', () => {
78
+ (0, _chai().expect)((0, _componentWriter().isOwnedByNestedComponent)('packages/comp1/index.js', nested)).to.be.true;
79
+ });
80
+ it('should claim a file deeper inside a nested component', () => {
81
+ (0, _chai().expect)((0, _componentWriter().isOwnedByNestedComponent)('packages/comp1/src/util.js', nested)).to.be.true;
82
+ });
83
+ it('should leave a file the root owns', () => {
84
+ (0, _chai().expect)((0, _componentWriter().isOwnedByNestedComponent)('packages/readme.md', nested)).to.be.false;
85
+ (0, _chai().expect)((0, _componentWriter().isOwnedByNestedComponent)('workspace.jsonc', nested)).to.be.false;
86
+ });
87
+ it('should not claim a directory that merely shares a prefix with a nested one', () => {
88
+ (0, _chai().expect)((0, _componentWriter().isOwnedByNestedComponent)('packages/comp10/index.js', nested)).to.be.false;
89
+ });
90
+ it('should claim the nested root-dir itself, a file cannot sit where the directory is', () => {
91
+ // an older root carries it as a plain file, from before the component was extracted there.
92
+ // writing it over the directory fails the checkout with EISDIR - see isOwnedByNestedComponent
93
+ (0, _chai().expect)((0, _componentWriter().isOwnedByNestedComponent)('packages/comp1', nested)).to.be.true;
94
+ });
95
+ it('should not claim a sibling whose name merely starts with a nested one', () => {
96
+ (0, _chai().expect)((0, _componentWriter().isOwnedByNestedComponent)('packages/comp10', nested)).to.be.false;
97
+ });
98
+ it('should claim nothing when no component is nested, the ordinary case', () => {
99
+ (0, _chai().expect)((0, _componentWriter().isOwnedByNestedComponent)('packages/comp1/index.js', [])).to.be.false;
100
+ });
101
+ });
102
+ describe('populateFilesToWriteToComponentDir', () => {
103
+ /**
104
+ * the method only reads these fields off the writer. building it through the constructor would
105
+ * need a consumer and a scope, which say nothing about the file-set it produces.
106
+ */
107
+ function writerFor(files, nestedRootDirs, writeToPath = '.') {
108
+ const written = [];
109
+ const writer = Object.create(_componentWriter().default.prototype);
110
+ Object.assign(writer, {
111
+ writeToPath,
112
+ override: true,
113
+ writeConfig: false,
114
+ deleteBitDirContent: false,
115
+ bitMap: {
116
+ getNestedRootDirs: () => nestedRootDirs
117
+ },
118
+ component: {
119
+ files: files.map(relative => ({
120
+ relative
121
+ })),
122
+ dataToPersist: {
123
+ addFile: file => written.push(file.relative)
124
+ },
125
+ license: undefined
126
+ }
127
+ });
128
+ return {
129
+ writer,
130
+ written
131
+ };
132
+ }
133
+ it('should not write over the source of a component nested in the root, an old version still carries it', async () => {
134
+ // the root was snapped before comp1 was extracted out of it, so that version holds comp1's files
135
+ const {
136
+ writer,
137
+ written
138
+ } = writerFor(['workspace.jsonc', 'packages/comp1/index.js', 'readme.md'], ['packages/comp1']);
139
+ await writer.populateFilesToWriteToComponentDir();
140
+ (0, _chai().expect)(written).to.deep.equal(['workspace.jsonc', 'readme.md']);
141
+ });
142
+ it('should write every file when nothing is nested', async () => {
143
+ const {
144
+ writer,
145
+ written
146
+ } = writerFor(['workspace.jsonc', 'packages/comp1/index.js'], []);
147
+ await writer.populateFilesToWriteToComponentDir();
148
+ (0, _chai().expect)(written).to.deep.equal(['workspace.jsonc', 'packages/comp1/index.js']);
149
+ });
150
+ it('should keep skipping the live .bitmap, which is never written from a versioned copy', async () => {
151
+ const {
152
+ writer,
153
+ written
154
+ } = writerFor(['.bitmap', 'workspace.jsonc'], []);
155
+ await writer.populateFilesToWriteToComponentDir();
156
+ (0, _chai().expect)(written).to.deep.equal(['workspace.jsonc']);
157
+ });
158
+ it('should skip it for an ordinary component too, no component but the root ever tracks one', async () => {
159
+ // the scan drops a `.bitmap` at any other component's root (see getScanIgnorePatterns), so what a
160
+ // component versions is what a write lands
161
+ const {
162
+ writer,
163
+ written
164
+ } = writerFor(['.bitmap', 'index.js'], [], 'comp1');
165
+ await writer.populateFilesToWriteToComponentDir();
166
+ (0, _chai().expect)(written).to.deep.equal(['index.js']);
167
+ });
168
+ });
169
+ describe('the workspace-root import preflight checks', () => {
170
+ /**
171
+ * the checks read the incoming files, the nested root-dirs and the paths on disk. going through
172
+ * writeMany would need a workspace and a scope, which say nothing about which paths they look at.
173
+ */
174
+ function runtimeFor(nestedRootDirs, workspacePath) {
175
+ const main = Object.create(_componentWriterMain().ComponentWriterMain.prototype);
176
+ // `consumer` is a getter on the class, so it is defined rather than assigned
177
+ Object.defineProperty(main, 'consumer', {
178
+ value: {
179
+ bitMap: {
180
+ getNestedRootDirs: () => nestedRootDirs,
181
+ components: []
182
+ },
183
+ toAbsolutePath: relativePath => _path().default.join(workspacePath, relativePath)
184
+ }
185
+ });
186
+ return main;
187
+ }
188
+ const componentFor = files => ({
189
+ id: {
190
+ toString: () => 'my-scope/ws-root'
191
+ },
192
+ files: files.map(relative => ({
193
+ relative
194
+ }))
195
+ });
196
+ let workspacePath;
197
+ beforeEach(async () => {
198
+ workspacePath = await _fsExtra().default.mkdtemp(_path().default.join(_os().default.tmpdir(), 'bit-preflight-'));
199
+ });
200
+ afterEach(async () => {
201
+ await _fsExtra().default.remove(workspacePath);
202
+ });
203
+ it('should ignore a symlink inside a nested component, the write never goes through it', async () => {
204
+ // an older root version still carries comp1's files, but the writer leaves that directory alone
205
+ await _fsExtra().default.ensureDir(_path().default.join(workspacePath, 'packages'));
206
+ await _fsExtra().default.symlink(_os().default.tmpdir(), _path().default.join(workspacePath, 'packages/comp1'));
207
+ const main = runtimeFor(['packages/comp1'], workspacePath);
208
+ (0, _chai().expect)(() => main.throwForSymlinksInTheWay(componentFor(['packages/comp1/index.js']))).to.not.throw();
209
+ });
210
+ it('should ignore the live .bitmap, which the write does not land either', async () => {
211
+ // a workspace whose own .bitmap is a symbolic link must not fail an import over a file the writer
212
+ // skips anyway (see isWorkspaceMapFile)
213
+ const target = _path().default.join(workspacePath, 'elsewhere');
214
+ await _fsExtra().default.ensureDir(target);
215
+ await _fsExtra().default.symlink(target, _path().default.join(workspacePath, '.bitmap'));
216
+ const main = runtimeFor([], workspacePath);
217
+ (0, _chai().expect)(() => main.throwForSymlinksInTheWay(componentFor(['.bitmap', 'README.md']))).to.not.throw();
218
+ });
219
+ it('should refuse a symlinked component.json when the config file is written', async () => {
220
+ // it is generated rather than versioned, so it is not among the component's files - it still
221
+ // lands at the root, and the writer forces override on it
222
+ const target = _path().default.join(workspacePath, 'elsewhere');
223
+ await _fsExtra().default.ensureDir(target);
224
+ await _fsExtra().default.symlink(target, _path().default.join(workspacePath, 'component.json'));
225
+ const main = runtimeFor([], workspacePath);
226
+ (0, _chai().expect)(() => main.throwForSymlinksInTheWay(componentFor(['README.md']), true)).to.throw('is a symbolic link');
227
+ });
228
+ it('should refuse it even when the caller asked for no config file, the writer turns it on itself', async () => {
229
+ // a config file already at the rootDir makes the writer write one whatever the caller passed
230
+ // (see populateComponentsFilesToWrite), and a symlink pointing at an existing file is read as
231
+ // one. so the flag does not settle whether a write lands here.
232
+ const target = _path().default.join(workspacePath, 'elsewhere');
233
+ await _fsExtra().default.ensureDir(target);
234
+ await _fsExtra().default.symlink(target, _path().default.join(workspacePath, 'component.json'));
235
+ const main = runtimeFor([], workspacePath);
236
+ (0, _chai().expect)(() => main.throwForSymlinksInTheWay(componentFor(['README.md']), false)).to.throw('is a symbolic link');
237
+ });
238
+ it('should leave a broken symlink alone, the writer does not write through it either', async () => {
239
+ // it resolves to nothing, so the writer does not read it as an existing config file and no
240
+ // config is written. failing the whole import over it would be for nothing.
241
+ await _fsExtra().default.symlink(_path().default.join(workspacePath, 'missing'), _path().default.join(workspacePath, 'component.json'));
242
+ const main = runtimeFor([], workspacePath);
243
+ (0, _chai().expect)(() => main.throwForSymlinksInTheWay(componentFor(['README.md']), false)).to.not.throw();
244
+ });
245
+ it('should still refuse a symlink on the way to a file the root does own', async () => {
246
+ await _fsExtra().default.symlink(_os().default.tmpdir(), _path().default.join(workspacePath, 'docs'));
247
+ const main = runtimeFor(['packages/comp1'], workspacePath);
248
+ (0, _chai().expect)(() => main.throwForSymlinksInTheWay(componentFor(['docs/readme.md']))).to.throw('is a symbolic link');
249
+ });
250
+ it('should refuse a symlink at the file itself, not only above it', async () => {
251
+ const outsideFile = _path().default.join(workspacePath, 'theirs.md');
252
+ await _fsExtra().default.writeFile(outsideFile, 'theirs\n');
253
+ await _fsExtra().default.symlink(outsideFile, _path().default.join(workspacePath, 'README.md'));
254
+ const main = runtimeFor([], workspacePath);
255
+ (0, _chai().expect)(() => main.throwForSymlinksInTheWay(componentFor(['README.md']))).to.throw('is a symbolic link');
256
+ });
257
+ it('should refuse a dangling symlink, whose target does not exist, rather than write through it', async () => {
258
+ // a stat would say there is nothing there and let the write create the target; the check lstats
259
+ await _fsExtra().default.symlink(_path().default.join(workspacePath, 'missing-target'), _path().default.join(workspacePath, 'README.md'));
260
+ const main = runtimeFor([], workspacePath);
261
+ (0, _chai().expect)(() => main.throwForSymlinksInTheWay(componentFor(['README.md']))).to.throw('is a symbolic link');
262
+ });
263
+ });
264
+ describe('the conflict check at the workspace root', () => {
265
+ /** the same harness as above, with a say in what the map already tracks */
266
+ function runtimeTracking(components, workspacePath) {
267
+ const main = Object.create(_componentWriterMain().ComponentWriterMain.prototype);
268
+ Object.defineProperty(main, 'consumer', {
269
+ value: {
270
+ bitMap: {
271
+ getNestedRootDirs: () => [],
272
+ components
273
+ },
274
+ toAbsolutePath: relativePath => _path().default.join(workspacePath, relativePath)
275
+ }
276
+ });
277
+ return main;
278
+ }
279
+ const rootCarrying = (relative, content) => ({
280
+ id: {
281
+ toString: () => 'my-scope/ws-root'
282
+ },
283
+ files: [{
284
+ relative,
285
+ contents: Buffer.from(content)
286
+ }]
287
+ });
288
+ let workspacePath;
289
+ beforeEach(async () => {
290
+ workspacePath = await _fsExtra().default.mkdtemp(_path().default.join(_os().default.tmpdir(), 'bit-root-conflict-'));
291
+ });
292
+ afterEach(async () => {
293
+ await _fsExtra().default.remove(workspacePath);
294
+ });
295
+ it('should replace the workspace.jsonc "bit init" generated, while nothing is tracked yet', async () => {
296
+ await _fsExtra().default.outputFile(_path().default.join(workspacePath, _legacy2().WORKSPACE_JSONC), 'generated by bit init\n');
297
+ const main = runtimeTracking([], workspacePath);
298
+ (0, _chai().expect)(() => main.throwForOccupiedWorkspaceRoot(rootCarrying(_legacy2().WORKSPACE_JSONC, 'the versioned one\n'), {
299
+ throwForExistingDir: true
300
+ })).to.not.throw();
301
+ });
302
+ it('should protect the workspace.jsonc of a workspace that already tracks something', async () => {
303
+ // past `bit init` the file is the user's own, like every other file at the root, so replacing it
304
+ // takes --override. a map holding one component is not a freshly initialized workspace, whichever
305
+ // component it is - the exemption is about what `bit init` just wrote, not about who owns the root
306
+ await _fsExtra().default.outputFile(_path().default.join(workspacePath, _legacy2().WORKSPACE_JSONC), 'the user edited this\n');
307
+ const main = runtimeTracking([{
308
+ id: {
309
+ isEqualWithoutVersion: () => true
310
+ }
311
+ }], workspacePath);
312
+ (0, _chai().expect)(() => main.throwForOccupiedWorkspaceRoot(rootCarrying(_legacy2().WORKSPACE_JSONC, 'the versioned one\n'), {
313
+ throwForExistingDir: true
314
+ })).to.throw(_legacy2().WORKSPACE_JSONC);
315
+ });
316
+ });
317
+ describe('the guard on what may be written to the workspace root', () => {
318
+ /**
319
+ * it runs in the same branch as the symlink preflight, which an e2e case covers on the real
320
+ * "--path ." path - so what is left to check is the rule itself, on the marker a version carries.
321
+ */
322
+ const componentWith = extensions => ({
323
+ id: {
324
+ toString: () => 'my-scope/comp1'
325
+ },
326
+ extensions
327
+ });
328
+ it('should refuse an ordinary component, only a workspace-root component may own "."', () => {
329
+ const main = Object.create(_componentWriterMain().ComponentWriterMain.prototype);
330
+ (0, _chai().expect)(() => main.throwForNonWorkspaceRootComponent(componentWith(_legacy3().ExtensionDataList.fromArray([])))).to.throw('not a workspace-root component');
331
+ });
332
+ it('should accept a component whose version carries the root marker', () => {
333
+ const extensions = _legacy3().ExtensionDataList.fromArray([new (_legacy3().ExtensionDataEntry)(undefined, undefined, _workspaceRoot().WorkspaceRootAspect.id, undefined, {
334
+ isRoot: true
335
+ })]);
336
+ const main = Object.create(_componentWriterMain().ComponentWriterMain.prototype);
337
+ (0, _chai().expect)(() => main.throwForNonWorkspaceRootComponent(componentWith(extensions))).to.not.throw();
338
+ });
339
+ it('should refuse a member, which points at its root rather than being one', () => {
340
+ const extensions = _legacy3().ExtensionDataList.fromArray([new (_legacy3().ExtensionDataEntry)(undefined, undefined, _workspaceRoot().WorkspaceRootAspect.id, undefined, {
341
+ root: 'my-scope/ws-root@0.0.1'
342
+ })]);
343
+ const main = Object.create(_componentWriterMain().ComponentWriterMain.prototype);
344
+ (0, _chai().expect)(() => main.throwForNonWorkspaceRootComponent(componentWith(extensions))).to.throw('not a workspace-root component');
345
+ });
346
+ });
347
+ describe('writing the workspace-root component in the same batch as a component nested in it', () => {
348
+ /**
349
+ * the batch goes through fixDirsIfNested, which moves a component aside when another one is to be
350
+ * written inside it. the root must come out of it untouched: it owns "." by definition, and the
351
+ * components below it are the normal case rather than a collision.
352
+ */
353
+ function runFixDirs(writeToPaths, existingRootDirs = []) {
354
+ const main = Object.create(_componentWriterMain().ComponentWriterMain.prototype);
355
+ Object.defineProperty(main, 'workspace', {
356
+ value: {
357
+ bitMap: {
358
+ getAllRootDirs: () => existingRootDirs
359
+ }
360
+ }
361
+ });
362
+ const writers = writeToPaths.map(writeToPath => ({
363
+ writeToPath,
364
+ component: {
365
+ id: {
366
+ scope: 'my-org.my-scope'
367
+ }
368
+ }
369
+ }));
370
+ main.fixDirsIfNested(writers);
371
+ return writers.map(writer => writer.writeToPath);
372
+ }
373
+ it('should leave both where they were asked to go', () => {
374
+ (0, _chai().expect)(runFixDirs([_legacy().WORKSPACE_ROOT_DIR, 'packages/comp1'])).to.deep.equal([_legacy().WORKSPACE_ROOT_DIR, 'packages/comp1']);
375
+ });
376
+ it('should leave the root alone when the workspace already tracks a component inside it', () => {
377
+ (0, _chai().expect)(runFixDirs([_legacy().WORKSPACE_ROOT_DIR], ['packages/comp1'])).to.deep.equal([_legacy().WORKSPACE_ROOT_DIR]);
378
+ });
379
+ it('should leave a component alone when the workspace already tracks the root', () => {
380
+ (0, _chai().expect)(runFixDirs(['packages/comp1'], [_legacy().WORKSPACE_ROOT_DIR])).to.deep.equal(['packages/comp1']);
381
+ });
382
+ it('should still move an ordinary component that another one is written inside of', () => {
383
+ // the rule the root is untouched by, so the cases above are not passing on an inert branch
384
+ (0, _chai().expect)(runFixDirs(['bar', 'bar/foo'])).to.deep.equal(['bar_1', 'bar/foo']);
385
+ });
386
+ });
387
+ describe('deciding whether the directory-conflict check applies to a component', () => {
388
+ /**
389
+ * the decision turns on whether *this* component was asked to go somewhere, which is not the same
390
+ * question as the directory it ends up at: without --path that directory is the default one, and
391
+ * with --path-per-id the batch-level path answers for the wrong component. so it is resolved the
392
+ * same way the write itself resolves it.
393
+ */
394
+ function shouldSkip(opts, rootDir, dir = 'some-dir') {
395
+ const main = Object.create(_componentWriterMain().ComponentWriterMain.prototype);
396
+ const component = {
397
+ id: {
398
+ toStringWithoutVersion: () => 'my-scope/comp1'
399
+ }
400
+ };
401
+ return main.shouldSkipDirConflictCheck(component, dir, rootDir === undefined ? undefined : {
402
+ rootDir
403
+ }, opts);
404
+ }
405
+ it('should check a component asked for a directory it does not already own', () => {
406
+ (0, _chai().expect)(shouldSkip({
407
+ writeToPath: 'some-dir'
408
+ }, 'other-dir')).to.be.false;
409
+ });
410
+ it('should skip a component asked for the directory it holds today, it overrides itself in place', () => {
411
+ (0, _chai().expect)(shouldSkip({
412
+ writeToPath: 'some-dir'
413
+ }, 'some-dir')).to.be.true;
414
+ });
415
+ it('should skip a tracked component that was asked for nothing, it goes to its default directory', () => {
416
+ (0, _chai().expect)(shouldSkip({}, 'other-dir')).to.be.true;
417
+ });
418
+ it('should take the path asked for this component, not the one asked for the batch', () => {
419
+ (0, _chai().expect)(shouldSkip({
420
+ writeToPathPerId: {
421
+ 'my-scope/comp1': 'some-dir'
422
+ }
423
+ }, 'other-dir')).to.be.false;
424
+ });
425
+ it('should check a component that is not tracked yet, whatever was asked for it', () => {
426
+ (0, _chai().expect)(shouldSkip({})).to.be.false;
427
+ });
428
+ it('should skip everything when nothing is written to the filesystem at all', () => {
429
+ (0, _chai().expect)(shouldSkip({
430
+ skipWritingToFs: true,
431
+ writeToPath: 'some-dir'
432
+ }, 'other-dir')).to.be.true;
433
+ });
434
+ it('should treat a component already tracked at the workspace root as any other tracked directory', () => {
435
+ // re-importing a tracked component updates the files it owns, and the root is not an exception
436
+ // to that. what needs --override is a component arriving at a root someone else's files are at,
437
+ // which has no map entry yet - the !componentMap branch of throwErrorWhenDirectoryNotEmpty is
438
+ // where that is decided, and this skip never reaches past it.
439
+ (0, _chai().expect)(shouldSkip({}, _legacy().WORKSPACE_ROOT_DIR, _legacy().WORKSPACE_ROOT_DIR)).to.be.true;
440
+ (0, _chai().expect)(shouldSkip({
441
+ writeToPath: _legacy().WORKSPACE_ROOT_DIR
442
+ }, _legacy().WORKSPACE_ROOT_DIR, _legacy().WORKSPACE_ROOT_DIR)).to.be.true;
443
+ });
444
+ });
445
+ describe('the destination of an already tracked workspace-root component', () => {
446
+ it('should be the workspace root, whatever path the caller derived without --path', async () => {
447
+ const writer = Object.create(_componentWriter().default.prototype);
448
+ Object.assign(writer, {
449
+ // what composeRelativeComponentPath returns when no --path is given
450
+ writeToPath: 'my-scope/ws-root',
451
+ override: true,
452
+ writeConfig: false,
453
+ skipUpdatingBitMap: true,
454
+ existingComponentMap: {
455
+ rootDir: _legacy().WORKSPACE_ROOT_DIR,
456
+ getRootDir: () => _legacy().WORKSPACE_ROOT_DIR
457
+ },
458
+ bitMap: {
459
+ getNestedRootDirs: () => []
460
+ },
461
+ consumer: undefined,
462
+ component: {
463
+ id: {
464
+ toString: () => 'my-scope/ws-root'
465
+ },
466
+ isLegacy: false,
467
+ files: [{
468
+ relative: 'README.md',
469
+ basename: 'README.md',
470
+ path: 'README.md',
471
+ updatePaths: () => {}
472
+ }]
473
+ }
474
+ });
475
+ await writer.populateComponentsFilesToWrite();
476
+ (0, _chai().expect)(writer.writeToPath).to.equal(_legacy().WORKSPACE_ROOT_DIR);
477
+ });
478
+ });
479
+
480
+ //# sourceMappingURL=component-writer.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_chai","data","require","_fsExtra","_interopRequireDefault","_os","_path","_legacy","_legacy2","_legacy3","_workspaceRoot","_componentWriter","_interopRequireWildcard","_componentWriterMain","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","describe","nested","it","expect","isOwnedByNestedComponent","to","be","true","false","writerFor","files","nestedRootDirs","writeToPath","written","writer","create","ComponentWriter","prototype","assign","override","writeConfig","deleteBitDirContent","bitMap","getNestedRootDirs","component","map","relative","dataToPersist","addFile","file","push","license","undefined","populateFilesToWriteToComponentDir","deep","equal","runtimeFor","workspacePath","main","ComponentWriterMain","value","components","toAbsolutePath","relativePath","path","join","componentFor","id","toString","beforeEach","fs","mkdtemp","os","tmpdir","afterEach","remove","ensureDir","symlink","throwForSymlinksInTheWay","not","throw","target","outsideFile","writeFile","runtimeTracking","rootCarrying","content","contents","Buffer","from","outputFile","WORKSPACE_JSONC","throwForOccupiedWorkspaceRoot","throwForExistingDir","isEqualWithoutVersion","componentWith","extensions","throwForNonWorkspaceRootComponent","ExtensionDataList","fromArray","ExtensionDataEntry","WorkspaceRootAspect","isRoot","root","runFixDirs","writeToPaths","existingRootDirs","getAllRootDirs","writers","scope","fixDirsIfNested","WORKSPACE_ROOT_DIR","shouldSkip","opts","rootDir","dir","toStringWithoutVersion","shouldSkipDirConflictCheck","writeToPathPerId","skipWritingToFs","skipUpdatingBitMap","existingComponentMap","getRootDir","consumer","isLegacy","basename","updatePaths","populateComponentsFilesToWrite"],"sources":["component-writer.spec.ts"],"sourcesContent":["import { expect } from 'chai';\nimport fs from 'fs-extra';\nimport os from 'os';\nimport path from 'path';\nimport { WORKSPACE_ROOT_DIR } from '@teambit/legacy.bit-map';\nimport { WORKSPACE_JSONC } from '@teambit/legacy.constants';\nimport { ExtensionDataEntry, ExtensionDataList } from '@teambit/legacy.extension-data';\nimport { WorkspaceRootAspect } from '@teambit/workspace-root';\nimport ComponentWriter, { isOwnedByNestedComponent } from './component-writer';\nimport { ComponentWriterMain } from './component-writer.main.runtime';\n\ndescribe('isOwnedByNestedComponent', () => {\n const nested = ['packages/comp1', 'packages/comp2'];\n it('should claim a file inside a nested component', () => {\n expect(isOwnedByNestedComponent('packages/comp1/index.js', nested)).to.be.true;\n });\n it('should claim a file deeper inside a nested component', () => {\n expect(isOwnedByNestedComponent('packages/comp1/src/util.js', nested)).to.be.true;\n });\n it('should leave a file the root owns', () => {\n expect(isOwnedByNestedComponent('packages/readme.md', nested)).to.be.false;\n expect(isOwnedByNestedComponent('workspace.jsonc', nested)).to.be.false;\n });\n it('should not claim a directory that merely shares a prefix with a nested one', () => {\n expect(isOwnedByNestedComponent('packages/comp10/index.js', nested)).to.be.false;\n });\n it('should claim the nested root-dir itself, a file cannot sit where the directory is', () => {\n // an older root carries it as a plain file, from before the component was extracted there.\n // writing it over the directory fails the checkout with EISDIR - see isOwnedByNestedComponent\n expect(isOwnedByNestedComponent('packages/comp1', nested)).to.be.true;\n });\n it('should not claim a sibling whose name merely starts with a nested one', () => {\n expect(isOwnedByNestedComponent('packages/comp10', nested)).to.be.false;\n });\n it('should claim nothing when no component is nested, the ordinary case', () => {\n expect(isOwnedByNestedComponent('packages/comp1/index.js', [])).to.be.false;\n });\n});\n\ndescribe('populateFilesToWriteToComponentDir', () => {\n /**\n * the method only reads these fields off the writer. building it through the constructor would\n * need a consumer and a scope, which say nothing about the file-set it produces.\n */\n function writerFor(files: string[], nestedRootDirs: string[], writeToPath = '.') {\n const written: string[] = [];\n const writer = Object.create(ComponentWriter.prototype);\n Object.assign(writer, {\n writeToPath,\n override: true,\n writeConfig: false,\n deleteBitDirContent: false,\n bitMap: { getNestedRootDirs: () => nestedRootDirs },\n component: {\n files: files.map((relative) => ({ relative })),\n dataToPersist: { addFile: (file: any) => written.push(file.relative) },\n license: undefined,\n },\n });\n return { writer, written };\n }\n\n it('should not write over the source of a component nested in the root, an old version still carries it', async () => {\n // the root was snapped before comp1 was extracted out of it, so that version holds comp1's files\n const { writer, written } = writerFor(\n ['workspace.jsonc', 'packages/comp1/index.js', 'readme.md'],\n ['packages/comp1']\n );\n await writer.populateFilesToWriteToComponentDir();\n expect(written).to.deep.equal(['workspace.jsonc', 'readme.md']);\n });\n\n it('should write every file when nothing is nested', async () => {\n const { writer, written } = writerFor(['workspace.jsonc', 'packages/comp1/index.js'], []);\n await writer.populateFilesToWriteToComponentDir();\n expect(written).to.deep.equal(['workspace.jsonc', 'packages/comp1/index.js']);\n });\n\n it('should keep skipping the live .bitmap, which is never written from a versioned copy', async () => {\n const { writer, written } = writerFor(['.bitmap', 'workspace.jsonc'], []);\n await writer.populateFilesToWriteToComponentDir();\n expect(written).to.deep.equal(['workspace.jsonc']);\n });\n\n it('should skip it for an ordinary component too, no component but the root ever tracks one', async () => {\n // the scan drops a `.bitmap` at any other component's root (see getScanIgnorePatterns), so what a\n // component versions is what a write lands\n const { writer, written } = writerFor(['.bitmap', 'index.js'], [], 'comp1');\n await writer.populateFilesToWriteToComponentDir();\n expect(written).to.deep.equal(['index.js']);\n });\n});\n\ndescribe('the workspace-root import preflight checks', () => {\n /**\n * the checks read the incoming files, the nested root-dirs and the paths on disk. going through\n * writeMany would need a workspace and a scope, which say nothing about which paths they look at.\n */\n function runtimeFor(nestedRootDirs: string[], workspacePath: string) {\n const main = Object.create(ComponentWriterMain.prototype);\n // `consumer` is a getter on the class, so it is defined rather than assigned\n Object.defineProperty(main, 'consumer', {\n value: {\n bitMap: { getNestedRootDirs: () => nestedRootDirs, components: [] },\n toAbsolutePath: (relativePath: string) => path.join(workspacePath, relativePath),\n },\n });\n return main;\n }\n const componentFor = (files: string[]) =>\n ({ id: { toString: () => 'my-scope/ws-root' }, files: files.map((relative) => ({ relative })) }) as any;\n\n let workspacePath: string;\n beforeEach(async () => {\n workspacePath = await fs.mkdtemp(path.join(os.tmpdir(), 'bit-preflight-'));\n });\n afterEach(async () => {\n await fs.remove(workspacePath);\n });\n\n it('should ignore a symlink inside a nested component, the write never goes through it', async () => {\n // an older root version still carries comp1's files, but the writer leaves that directory alone\n await fs.ensureDir(path.join(workspacePath, 'packages'));\n await fs.symlink(os.tmpdir(), path.join(workspacePath, 'packages/comp1'));\n const main = runtimeFor(['packages/comp1'], workspacePath);\n expect(() => main.throwForSymlinksInTheWay(componentFor(['packages/comp1/index.js']))).to.not.throw();\n });\n\n it('should ignore the live .bitmap, which the write does not land either', async () => {\n // a workspace whose own .bitmap is a symbolic link must not fail an import over a file the writer\n // skips anyway (see isWorkspaceMapFile)\n const target = path.join(workspacePath, 'elsewhere');\n await fs.ensureDir(target);\n await fs.symlink(target, path.join(workspacePath, '.bitmap'));\n const main = runtimeFor([], workspacePath);\n expect(() => main.throwForSymlinksInTheWay(componentFor(['.bitmap', 'README.md']))).to.not.throw();\n });\n\n it('should refuse a symlinked component.json when the config file is written', async () => {\n // it is generated rather than versioned, so it is not among the component's files - it still\n // lands at the root, and the writer forces override on it\n const target = path.join(workspacePath, 'elsewhere');\n await fs.ensureDir(target);\n await fs.symlink(target, path.join(workspacePath, 'component.json'));\n const main = runtimeFor([], workspacePath);\n expect(() => main.throwForSymlinksInTheWay(componentFor(['README.md']), true)).to.throw('is a symbolic link');\n });\n\n it('should refuse it even when the caller asked for no config file, the writer turns it on itself', async () => {\n // a config file already at the rootDir makes the writer write one whatever the caller passed\n // (see populateComponentsFilesToWrite), and a symlink pointing at an existing file is read as\n // one. so the flag does not settle whether a write lands here.\n const target = path.join(workspacePath, 'elsewhere');\n await fs.ensureDir(target);\n await fs.symlink(target, path.join(workspacePath, 'component.json'));\n const main = runtimeFor([], workspacePath);\n expect(() => main.throwForSymlinksInTheWay(componentFor(['README.md']), false)).to.throw('is a symbolic link');\n });\n\n it('should leave a broken symlink alone, the writer does not write through it either', async () => {\n // it resolves to nothing, so the writer does not read it as an existing config file and no\n // config is written. failing the whole import over it would be for nothing.\n await fs.symlink(path.join(workspacePath, 'missing'), path.join(workspacePath, 'component.json'));\n const main = runtimeFor([], workspacePath);\n expect(() => main.throwForSymlinksInTheWay(componentFor(['README.md']), false)).to.not.throw();\n });\n\n it('should still refuse a symlink on the way to a file the root does own', async () => {\n await fs.symlink(os.tmpdir(), path.join(workspacePath, 'docs'));\n const main = runtimeFor(['packages/comp1'], workspacePath);\n expect(() => main.throwForSymlinksInTheWay(componentFor(['docs/readme.md']))).to.throw('is a symbolic link');\n });\n\n it('should refuse a symlink at the file itself, not only above it', async () => {\n const outsideFile = path.join(workspacePath, 'theirs.md');\n await fs.writeFile(outsideFile, 'theirs\\n');\n await fs.symlink(outsideFile, path.join(workspacePath, 'README.md'));\n const main = runtimeFor([], workspacePath);\n expect(() => main.throwForSymlinksInTheWay(componentFor(['README.md']))).to.throw('is a symbolic link');\n });\n\n it('should refuse a dangling symlink, whose target does not exist, rather than write through it', async () => {\n // a stat would say there is nothing there and let the write create the target; the check lstats\n await fs.symlink(path.join(workspacePath, 'missing-target'), path.join(workspacePath, 'README.md'));\n const main = runtimeFor([], workspacePath);\n expect(() => main.throwForSymlinksInTheWay(componentFor(['README.md']))).to.throw('is a symbolic link');\n });\n});\n\ndescribe('the conflict check at the workspace root', () => {\n /** the same harness as above, with a say in what the map already tracks */\n function runtimeTracking(components: any[], workspacePath: string) {\n const main = Object.create(ComponentWriterMain.prototype);\n Object.defineProperty(main, 'consumer', {\n value: {\n bitMap: { getNestedRootDirs: () => [], components },\n toAbsolutePath: (relativePath: string) => path.join(workspacePath, relativePath),\n },\n });\n return main;\n }\n const rootCarrying = (relative: string, content: string) =>\n ({\n id: { toString: () => 'my-scope/ws-root' },\n files: [{ relative, contents: Buffer.from(content) }],\n }) as any;\n\n let workspacePath: string;\n beforeEach(async () => {\n workspacePath = await fs.mkdtemp(path.join(os.tmpdir(), 'bit-root-conflict-'));\n });\n afterEach(async () => {\n await fs.remove(workspacePath);\n });\n\n it('should replace the workspace.jsonc \"bit init\" generated, while nothing is tracked yet', async () => {\n await fs.outputFile(path.join(workspacePath, WORKSPACE_JSONC), 'generated by bit init\\n');\n const main = runtimeTracking([], workspacePath);\n expect(() =>\n main.throwForOccupiedWorkspaceRoot(rootCarrying(WORKSPACE_JSONC, 'the versioned one\\n'), {\n throwForExistingDir: true,\n })\n ).to.not.throw();\n });\n\n it('should protect the workspace.jsonc of a workspace that already tracks something', async () => {\n // past `bit init` the file is the user's own, like every other file at the root, so replacing it\n // takes --override. a map holding one component is not a freshly initialized workspace, whichever\n // component it is - the exemption is about what `bit init` just wrote, not about who owns the root\n await fs.outputFile(path.join(workspacePath, WORKSPACE_JSONC), 'the user edited this\\n');\n const main = runtimeTracking([{ id: { isEqualWithoutVersion: () => true } }], workspacePath);\n expect(() =>\n main.throwForOccupiedWorkspaceRoot(rootCarrying(WORKSPACE_JSONC, 'the versioned one\\n'), {\n throwForExistingDir: true,\n })\n ).to.throw(WORKSPACE_JSONC);\n });\n});\n\ndescribe('the guard on what may be written to the workspace root', () => {\n /**\n * it runs in the same branch as the symlink preflight, which an e2e case covers on the real\n * \"--path .\" path - so what is left to check is the rule itself, on the marker a version carries.\n */\n const componentWith = (extensions: ExtensionDataList) =>\n ({ id: { toString: () => 'my-scope/comp1' }, extensions }) as any;\n\n it('should refuse an ordinary component, only a workspace-root component may own \".\"', () => {\n const main = Object.create(ComponentWriterMain.prototype);\n expect(() => main.throwForNonWorkspaceRootComponent(componentWith(ExtensionDataList.fromArray([])))).to.throw(\n 'not a workspace-root component'\n );\n });\n\n it('should accept a component whose version carries the root marker', () => {\n const extensions = ExtensionDataList.fromArray([\n new ExtensionDataEntry(undefined, undefined, WorkspaceRootAspect.id, undefined, { isRoot: true }),\n ]);\n const main = Object.create(ComponentWriterMain.prototype);\n expect(() => main.throwForNonWorkspaceRootComponent(componentWith(extensions))).to.not.throw();\n });\n\n it('should refuse a member, which points at its root rather than being one', () => {\n const extensions = ExtensionDataList.fromArray([\n new ExtensionDataEntry(undefined, undefined, WorkspaceRootAspect.id, undefined, {\n root: 'my-scope/ws-root@0.0.1',\n }),\n ]);\n const main = Object.create(ComponentWriterMain.prototype);\n expect(() => main.throwForNonWorkspaceRootComponent(componentWith(extensions))).to.throw(\n 'not a workspace-root component'\n );\n });\n});\n\ndescribe('writing the workspace-root component in the same batch as a component nested in it', () => {\n /**\n * the batch goes through fixDirsIfNested, which moves a component aside when another one is to be\n * written inside it. the root must come out of it untouched: it owns \".\" by definition, and the\n * components below it are the normal case rather than a collision.\n */\n function runFixDirs(writeToPaths: string[], existingRootDirs: string[] = []) {\n const main = Object.create(ComponentWriterMain.prototype);\n Object.defineProperty(main, 'workspace', { value: { bitMap: { getAllRootDirs: () => existingRootDirs } } });\n const writers = writeToPaths.map((writeToPath) => ({\n writeToPath,\n component: { id: { scope: 'my-org.my-scope' } },\n }));\n main.fixDirsIfNested(writers);\n return writers.map((writer) => writer.writeToPath);\n }\n\n it('should leave both where they were asked to go', () => {\n expect(runFixDirs([WORKSPACE_ROOT_DIR, 'packages/comp1'])).to.deep.equal([WORKSPACE_ROOT_DIR, 'packages/comp1']);\n });\n\n it('should leave the root alone when the workspace already tracks a component inside it', () => {\n expect(runFixDirs([WORKSPACE_ROOT_DIR], ['packages/comp1'])).to.deep.equal([WORKSPACE_ROOT_DIR]);\n });\n\n it('should leave a component alone when the workspace already tracks the root', () => {\n expect(runFixDirs(['packages/comp1'], [WORKSPACE_ROOT_DIR])).to.deep.equal(['packages/comp1']);\n });\n\n it('should still move an ordinary component that another one is written inside of', () => {\n // the rule the root is untouched by, so the cases above are not passing on an inert branch\n expect(runFixDirs(['bar', 'bar/foo'])).to.deep.equal(['bar_1', 'bar/foo']);\n });\n});\n\ndescribe('deciding whether the directory-conflict check applies to a component', () => {\n /**\n * the decision turns on whether *this* component was asked to go somewhere, which is not the same\n * question as the directory it ends up at: without --path that directory is the default one, and\n * with --path-per-id the batch-level path answers for the wrong component. so it is resolved the\n * same way the write itself resolves it.\n */\n function shouldSkip(opts: Record<string, any>, rootDir?: string, dir = 'some-dir') {\n const main = Object.create(ComponentWriterMain.prototype);\n const component = { id: { toStringWithoutVersion: () => 'my-scope/comp1' } };\n return main.shouldSkipDirConflictCheck(component, dir, rootDir === undefined ? undefined : { rootDir }, opts);\n }\n\n it('should check a component asked for a directory it does not already own', () => {\n expect(shouldSkip({ writeToPath: 'some-dir' }, 'other-dir')).to.be.false;\n });\n\n it('should skip a component asked for the directory it holds today, it overrides itself in place', () => {\n expect(shouldSkip({ writeToPath: 'some-dir' }, 'some-dir')).to.be.true;\n });\n\n it('should skip a tracked component that was asked for nothing, it goes to its default directory', () => {\n expect(shouldSkip({}, 'other-dir')).to.be.true;\n });\n\n it('should take the path asked for this component, not the one asked for the batch', () => {\n expect(shouldSkip({ writeToPathPerId: { 'my-scope/comp1': 'some-dir' } }, 'other-dir')).to.be.false;\n });\n\n it('should check a component that is not tracked yet, whatever was asked for it', () => {\n expect(shouldSkip({})).to.be.false;\n });\n\n it('should skip everything when nothing is written to the filesystem at all', () => {\n expect(shouldSkip({ skipWritingToFs: true, writeToPath: 'some-dir' }, 'other-dir')).to.be.true;\n });\n\n it('should treat a component already tracked at the workspace root as any other tracked directory', () => {\n // re-importing a tracked component updates the files it owns, and the root is not an exception\n // to that. what needs --override is a component arriving at a root someone else's files are at,\n // which has no map entry yet - the !componentMap branch of throwErrorWhenDirectoryNotEmpty is\n // where that is decided, and this skip never reaches past it.\n expect(shouldSkip({}, WORKSPACE_ROOT_DIR, WORKSPACE_ROOT_DIR)).to.be.true;\n expect(shouldSkip({ writeToPath: WORKSPACE_ROOT_DIR }, WORKSPACE_ROOT_DIR, WORKSPACE_ROOT_DIR)).to.be.true;\n });\n});\n\ndescribe('the destination of an already tracked workspace-root component', () => {\n it('should be the workspace root, whatever path the caller derived without --path', async () => {\n const writer = Object.create(ComponentWriter.prototype);\n Object.assign(writer, {\n // what composeRelativeComponentPath returns when no --path is given\n writeToPath: 'my-scope/ws-root',\n override: true,\n writeConfig: false,\n skipUpdatingBitMap: true,\n existingComponentMap: { rootDir: WORKSPACE_ROOT_DIR, getRootDir: () => WORKSPACE_ROOT_DIR },\n bitMap: { getNestedRootDirs: () => [] },\n consumer: undefined,\n component: {\n id: { toString: () => 'my-scope/ws-root' },\n isLegacy: false,\n files: [{ relative: 'README.md', basename: 'README.md', path: 'README.md', updatePaths: () => {} }],\n },\n });\n await writer.populateComponentsFilesToWrite();\n expect(writer.writeToPath).to.equal(WORKSPACE_ROOT_DIR);\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,SAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,QAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,IAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,GAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAI,KAAA,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,OA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,CAAC;IAC7C,IAAAxG,cAAM,EAACW,MAAM,CAACF,WAAW,CAAC,CAACP,EAAE,CAAC8B,KAAK,CAACwD,4BAAkB,CAAC;EACzD,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@teambit/component-writer",
3
- "version": "1.0.1174",
3
+ "version": "1.0.1175",
4
4
  "homepage": "https://bit.cloud/teambit/component/component-writer",
5
5
  "main": "dist/index.js",
6
6
  "componentId": {
7
7
  "scope": "teambit.component",
8
8
  "name": "component-writer",
9
- "version": "1.0.1174"
9
+ "version": "1.0.1175"
10
10
  },
11
11
  "dependencies": {
12
12
  "fs-extra": "10.0.0",
@@ -14,32 +14,36 @@
14
14
  "p-map-series": "2.1.0",
15
15
  "@teambit/harmony": "0.4.12",
16
16
  "@teambit/bit-error": "0.0.404",
17
- "@teambit/cli": "0.0.1393",
18
17
  "@teambit/component-id": "1.2.4",
19
- "@teambit/component.modules.merge-helper": "0.0.107",
20
- "@teambit/component.sources": "0.0.216",
21
- "@teambit/legacy.bit-map": "0.0.221",
22
- "@teambit/legacy.constants": "0.0.44",
23
- "@teambit/legacy.consumer-component": "0.0.165",
24
- "@teambit/legacy.consumer": "0.0.164",
25
18
  "@teambit/legacy.utils": "0.0.51",
26
- "@teambit/logger": "0.0.1486",
27
19
  "@teambit/component-version": "1.0.4",
28
- "@teambit/legacy.scope": "0.0.164",
29
- "@teambit/compiler": "1.0.1174",
30
- "@teambit/config-merger": "0.0.1041",
31
- "@teambit/install": "1.0.1174",
32
- "@teambit/mover": "1.0.1174",
33
- "@teambit/workspace": "1.0.1174",
34
- "@teambit/objects": "0.0.681"
20
+ "@teambit/cli": "0.0.1394",
21
+ "@teambit/compiler": "1.0.1175",
22
+ "@teambit/component.modules.merge-helper": "0.0.108",
23
+ "@teambit/component.sources": "0.0.217",
24
+ "@teambit/config-merger": "0.0.1042",
25
+ "@teambit/install": "1.0.1175",
26
+ "@teambit/legacy.bit-map": "0.0.222",
27
+ "@teambit/legacy.constants": "0.0.45",
28
+ "@teambit/legacy.consumer-component": "0.0.166",
29
+ "@teambit/legacy.consumer": "0.0.165",
30
+ "@teambit/logger": "0.0.1487",
31
+ "@teambit/mover": "1.0.1175",
32
+ "@teambit/workspace-root": "0.0.1",
33
+ "@teambit/workspace": "1.0.1175",
34
+ "@teambit/legacy.scope": "0.0.165",
35
+ "@teambit/objects": "0.0.682"
35
36
  },
36
37
  "devDependencies": {
37
38
  "@types/fs-extra": "9.0.7",
38
39
  "@types/lodash": "4.14.165",
39
40
  "@types/mocha": "9.1.0",
40
- "@teambit/harmony.envs.core-aspect-env": "2.1.1"
41
+ "@teambit/harmony.envs.core-aspect-env": "2.1.1",
42
+ "@teambit/legacy.extension-data": "0.0.167"
43
+ },
44
+ "peerDependencies": {
45
+ "chai": "5.2.1"
41
46
  },
42
- "peerDependencies": {},
43
47
  "license": "Apache-2.0",
44
48
  "optionalDependencies": {},
45
49
  "peerDependenciesMeta": {},