@teambit/scope 1.0.486 → 1.0.488

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.
Files changed (46) hide show
  1. package/artifacts/__bit_junit.xml +1 -1
  2. package/artifacts/preview/static/css/teambit.scope/{scope-preview.62922c86.css → scope-preview.5a6afd26.css} +2 -2
  3. package/artifacts/preview/teambit_scope_scope-preview.js +1 -1
  4. package/artifacts/schema.json +1564 -1564
  5. package/debug-commands/cat-component.ts +3 -3
  6. package/debug-commands/cat-lane.ts +1 -1
  7. package/debug-commands/cat-object.ts +1 -1
  8. package/debug-commands/cat-scope.ts +2 -3
  9. package/dist/_scope-garbage-collector.cmd.d.ts +1 -1
  10. package/dist/_scope-garbage-collector.cmd.js.map +1 -1
  11. package/dist/debug-commands/cat-component.js +8 -8
  12. package/dist/debug-commands/cat-component.js.map +1 -1
  13. package/dist/debug-commands/cat-lane.js +4 -4
  14. package/dist/debug-commands/cat-lane.js.map +1 -1
  15. package/dist/debug-commands/cat-object.js +4 -4
  16. package/dist/debug-commands/cat-object.js.map +1 -1
  17. package/dist/debug-commands/cat-scope-cmd.d.ts +1 -1
  18. package/dist/debug-commands/cat-scope.d.ts +1 -1
  19. package/dist/debug-commands/cat-scope.js +8 -8
  20. package/dist/debug-commands/cat-scope.js.map +1 -1
  21. package/dist/preview-1733830651067.js +7 -0
  22. package/dist/routes/action.route.js +4 -4
  23. package/dist/routes/action.route.js.map +1 -1
  24. package/dist/routes/fetch.route.js +4 -4
  25. package/dist/routes/fetch.route.js.map +1 -1
  26. package/dist/routes/put.route.js +4 -4
  27. package/dist/routes/put.route.js.map +1 -1
  28. package/dist/run-action/run-action.js +8 -8
  29. package/dist/run-action/run-action.js.map +1 -1
  30. package/dist/scope-aspects-loader.d.ts +1 -1
  31. package/dist/scope-aspects-loader.js +10 -10
  32. package/dist/scope-aspects-loader.js.map +1 -1
  33. package/dist/scope-component-loader.d.ts +1 -1
  34. package/dist/scope-component-loader.js +8 -15
  35. package/dist/scope-component-loader.js.map +1 -1
  36. package/dist/scope.graphql.d.ts +1 -1
  37. package/dist/scope.main.runtime.d.ts +7 -11
  38. package/dist/scope.main.runtime.js +65 -86
  39. package/dist/scope.main.runtime.js.map +1 -1
  40. package/dist/scope.ui.runtime.d.ts +1 -1
  41. package/package.json +37 -27
  42. package/routes/action.route.ts +1 -1
  43. package/routes/fetch.route.ts +1 -1
  44. package/routes/put.route.ts +1 -1
  45. package/run-action/run-action.ts +2 -2
  46. package/dist/preview-1733541556857.js +0 -7
@@ -123,30 +123,23 @@ function _componentId() {
123
123
  };
124
124
  return data;
125
125
  }
126
- function _objects() {
127
- const data = require("@teambit/legacy/dist/scope/objects");
128
- _objects = function () {
129
- return data;
130
- };
131
- return data;
132
- }
133
- function _scopeLoader() {
134
- const data = require("@teambit/legacy/dist/scope/scope-loader");
135
- _scopeLoader = function () {
126
+ function _scope() {
127
+ const data = require("@teambit/scope.objects");
128
+ _scope = function () {
136
129
  return data;
137
130
  };
138
131
  return data;
139
132
  }
140
- function _getDivergeData() {
141
- const data = require("@teambit/legacy/dist/scope/component-ops/get-diverge-data");
142
- _getDivergeData = function () {
133
+ function _legacy() {
134
+ const data = require("@teambit/legacy.scope");
135
+ _legacy = function () {
143
136
  return data;
144
137
  };
145
138
  return data;
146
139
  }
147
- function _actions() {
148
- const data = require("@teambit/legacy/dist/scope/actions");
149
- _actions = function () {
140
+ function _scope2() {
141
+ const data = require("@teambit/scope.remote-actions");
142
+ _scope2 = function () {
150
143
  return data;
151
144
  };
152
145
  return data;
@@ -158,9 +151,9 @@ function _dependencyResolver() {
158
151
  };
159
152
  return data;
160
153
  }
161
- function _scopeRemotes() {
162
- const data = require("@teambit/legacy/dist/scope/scope-remotes");
163
- _scopeRemotes = function () {
154
+ function _scope3() {
155
+ const data = require("@teambit/scope.remotes");
156
+ _scope3 = function () {
164
157
  return data;
165
158
  };
166
159
  return data;
@@ -172,13 +165,6 @@ function _workspaceModules() {
172
165
  };
173
166
  return data;
174
167
  }
175
- function _scope() {
176
- const data = require("@teambit/legacy/dist/scope");
177
- _scope = function () {
178
- return data;
179
- };
180
- return data;
181
- }
182
168
  function _chokidar() {
183
169
  const data = _interopRequireDefault(require("chokidar"));
184
170
  _chokidar = function () {
@@ -186,23 +172,23 @@ function _chokidar() {
186
172
  };
187
173
  return data;
188
174
  }
189
- function _objectList() {
190
- const data = require("@teambit/legacy/dist/scope/objects/object-list");
191
- _objectList = function () {
175
+ function _component2() {
176
+ const data = require("@teambit/component.snap-distance");
177
+ _component2 = function () {
192
178
  return data;
193
179
  };
194
180
  return data;
195
181
  }
196
- function _http() {
197
- const data = require("@teambit/legacy/dist/scope/network/http/http");
198
- _http = function () {
182
+ function _scope4() {
183
+ const data = require("@teambit/scope.network");
184
+ _scope4 = function () {
199
185
  return data;
200
186
  };
201
187
  return data;
202
188
  }
203
- function _legacy() {
189
+ function _legacy2() {
204
190
  const data = require("@teambit/legacy.scope-api");
205
- _legacy = function () {
191
+ _legacy2 = function () {
206
192
  return data;
207
193
  };
208
194
  return data;
@@ -214,16 +200,16 @@ function _bitError() {
214
200
  };
215
201
  return data;
216
202
  }
217
- function _exportScopeComponents() {
218
- const data = require("@teambit/legacy/dist/scope/component-ops/export-scope-components");
219
- _exportScopeComponents = function () {
203
+ function _export() {
204
+ const data = require("@teambit/export");
205
+ _export = function () {
220
206
  return data;
221
207
  };
222
208
  return data;
223
209
  }
224
- function _constants() {
225
- const data = require("@teambit/legacy/dist/constants");
226
- _constants = function () {
210
+ function _legacy3() {
211
+ const data = require("@teambit/legacy.constants");
212
+ _legacy3 = function () {
227
213
  return data;
228
214
  };
229
215
  return data;
@@ -235,9 +221,9 @@ function _legacyBitId() {
235
221
  };
236
222
  return data;
237
223
  }
238
- function _legacy2() {
224
+ function _legacy4() {
239
225
  const data = require("@teambit/legacy.extension-data");
240
- _legacy2 = function () {
226
+ _legacy4 = function () {
241
227
  return data;
242
228
  };
243
229
  return data;
@@ -256,16 +242,9 @@ function _lodash() {
256
242
  };
257
243
  return data;
258
244
  }
259
- function _config() {
260
- const data = require("@teambit/legacy/dist/global-config/config");
261
- _config = function () {
262
- return data;
263
- };
264
- return data;
265
- }
266
- function _globalConfig2() {
267
- const data = require("@teambit/legacy/dist/api/consumer/lib/global-config");
268
- _globalConfig2 = function () {
245
+ function _legacy5() {
246
+ const data = require("@teambit/legacy.global-config");
247
+ _legacy5 = function () {
269
248
  return data;
270
249
  };
271
250
  return data;
@@ -277,23 +256,23 @@ function _exceptions() {
277
256
  };
278
257
  return data;
279
258
  }
280
- function _scope2() {
259
+ function _scope5() {
281
260
  const data = require("./scope.aspect");
282
- _scope2 = function () {
261
+ _scope5 = function () {
283
262
  return data;
284
263
  };
285
264
  return data;
286
265
  }
287
- function _scope3() {
266
+ function _scope6() {
288
267
  const data = require("./scope.graphql");
289
- _scope3 = function () {
268
+ _scope6 = function () {
290
269
  return data;
291
270
  };
292
271
  return data;
293
272
  }
294
- function _scope4() {
273
+ function _scope7() {
295
274
  const data = require("./scope.ui-root");
296
- _scope4 = function () {
275
+ _scope7 = function () {
297
276
  return data;
298
277
  };
299
278
  return data;
@@ -457,7 +436,7 @@ class ScopeMain {
457
436
  return this.legacyScope.isLegacy;
458
437
  }
459
438
  get isGlobalScope() {
460
- return this.path === _constants().GLOBAL_SCOPE;
439
+ return this.path === _legacy3().GLOBAL_SCOPE;
461
440
  }
462
441
  get aspectsPackageManager() {
463
442
  return this.config.aspectsPackageManager;
@@ -560,7 +539,7 @@ class ScopeMain {
560
539
  }
561
540
  async getDataEntry(extension, data) {
562
541
  // TODO: @gilad we need to refactor the extension data entry api.
563
- return new (_legacy2().ExtensionDataEntry)(undefined, undefined, extension, undefined, data);
542
+ return new (_legacy4().ExtensionDataEntry)(undefined, undefined, extension, undefined, data);
564
543
  }
565
544
  getIsolateAspectsOpts(opts) {
566
545
  const scopeAspectsLoader = this.getScopeAspectsLoader();
@@ -589,7 +568,7 @@ class ScopeMain {
589
568
  builderDataMapToLegacyOnTagResults(builderDataComponentMap) {
590
569
  const builderDataToLegacyExtension = (component, builderData) => {
591
570
  const existingBuilder = component.state.aspects.get(_builder().BuilderAspect.id)?.legacy;
592
- const builderExtension = existingBuilder || new (_legacy2().ExtensionDataEntry)(undefined, undefined, _builder().BuilderAspect.id);
571
+ const builderExtension = existingBuilder || new (_legacy4().ExtensionDataEntry)(undefined, undefined, _builder().BuilderAspect.id);
593
572
  builderExtension.data = builderData;
594
573
  return builderExtension;
595
574
  };
@@ -645,8 +624,8 @@ class ScopeMain {
645
624
  force,
646
625
  lanes
647
626
  }, headers) {
648
- const authData = (0, _http().getAuthDataFromHeader)(headers?.authorization);
649
- const result = await (0, _legacy().remove)({
627
+ const authData = (0, _scope4().getAuthDataFromHeader)(headers?.authorization);
628
+ const result = await (0, _legacy2().remove)({
650
629
  path: this.path,
651
630
  ids,
652
631
  force,
@@ -684,7 +663,7 @@ class ScopeMain {
684
663
  async watchScopeInternalFiles() {
685
664
  const scopeIndexFile = this.legacyScope.objects.scopeIndex.getPath();
686
665
  const remoteLanesDir = this.legacyScope.objects.remoteLanes.basePath;
687
- const globalConfigFile = (0, _config().getGlobalConfigPath)();
666
+ const globalConfigFile = (0, _legacy5().getGlobalConfigPath)();
688
667
  const pathsToWatch = [scopeIndexFile, remoteLanesDir, globalConfigFile];
689
668
  const watcher = _chokidar().default.watch(pathsToWatch);
690
669
  watcher.on('ready', () => {
@@ -699,7 +678,7 @@ class ScopeMain {
699
678
  this.legacyScope.objects.remoteLanes.removeFromCacheByFilePath(filePath);
700
679
  } else if (filePath === globalConfigFile) {
701
680
  this.logger.debug('global config file has been changed, invalidating its cache');
702
- (0, _globalConfig2().invalidateCache)();
681
+ (0, _legacy5().invalidateCache)();
703
682
  } else {
704
683
  this.logger.error('unknown file has been changed, please check why it is watched by scope.watchSystemFiles', filePath);
705
684
  }
@@ -707,7 +686,7 @@ class ScopeMain {
707
686
  }
708
687
  async toObjectList(types) {
709
688
  const objects = await this.legacyScope.objects.list(types);
710
- return _objectList().ObjectList.fromBitObjects(objects);
689
+ return _scope().ObjectList.fromBitObjects(objects);
711
690
  }
712
691
 
713
692
  // TODO: temporary compiler workaround - discuss this with david.
@@ -1121,11 +1100,11 @@ class ScopeMain {
1121
1100
  throw new Error(`getDivergeData got sourceHead and targetHead empty. at least one of them should be populated`);
1122
1101
  }
1123
1102
  const modelComponent = await this.legacyScope.getModelComponent(componentId);
1124
- return (0, _getDivergeData().getDivergeData)({
1103
+ return (0, _component2().getDivergeData)({
1125
1104
  modelComponent,
1126
1105
  repo: this.legacyScope.objects,
1127
- sourceHead: sourceHead ? _objects().Ref.from(sourceHead) : modelComponent.head || null,
1128
- targetHead: targetHead ? _objects().Ref.from(targetHead) : modelComponent.head || null,
1106
+ sourceHead: sourceHead ? _scope().Ref.from(sourceHead) : modelComponent.head || null,
1107
+ targetHead: targetHead ? _scope().Ref.from(targetHead) : modelComponent.head || null,
1129
1108
  throws
1130
1109
  });
1131
1110
  }
@@ -1137,7 +1116,7 @@ class ScopeMain {
1137
1116
  })?.toString();
1138
1117
  }
1139
1118
  async resumeExport(exportId, remotes) {
1140
- return (0, _exportScopeComponents().resumeExport)(this.legacyScope, exportId, remotes);
1119
+ return (0, _export().resumeExport)(this.legacyScope, exportId, remotes);
1141
1120
  }
1142
1121
 
1143
1122
  /**
@@ -1149,7 +1128,7 @@ class ScopeMain {
1149
1128
 
1150
1129
  // TODO: add new API for this
1151
1130
  async _legacyRemotes() {
1152
- return (0, _scopeRemotes().getScopeRemotes)(this.legacyScope);
1131
+ return (0, _scope3().getScopeRemotes)(this.legacyScope);
1153
1132
  }
1154
1133
 
1155
1134
  /**
@@ -1249,8 +1228,8 @@ class ScopeMain {
1249
1228
  await this.loadAspects(aspectIds, true, component.id.toString());
1250
1229
  }
1251
1230
  async addAspectsFromConfigObject(component, configObject) {
1252
- const extensionsFromConfigObject = _legacy2().ExtensionDataList.fromConfigObject(configObject);
1253
- const extensionDataList = _legacy2().ExtensionDataList.mergeConfigs([extensionsFromConfigObject, component.state._consumer.extensions]).filterRemovedExtensions();
1231
+ const extensionsFromConfigObject = _legacy4().ExtensionDataList.fromConfigObject(configObject);
1232
+ const extensionDataList = _legacy4().ExtensionDataList.mergeConfigs([extensionsFromConfigObject, component.state._consumer.extensions]).filterRemovedExtensions();
1254
1233
  component.state._consumer.extensions = extensionDataList;
1255
1234
  }
1256
1235
  async createAspectListFromExtensionDataList(extensionDataList) {
@@ -1270,7 +1249,7 @@ class ScopeMain {
1270
1249
  // no-op (it's relevant for the workspace only)
1271
1250
  }
1272
1251
  async hasObjects(hashes) {
1273
- const refs = hashes.map(h => _objects().Ref.from(h));
1252
+ const refs = hashes.map(h => _scope().Ref.from(h));
1274
1253
  const results = await this.legacyScope.objects.hasMultiple(refs);
1275
1254
  return results.map(r => r.hash);
1276
1255
  }
@@ -1283,12 +1262,12 @@ class ScopeMain {
1283
1262
  const bitConfig = harmony.config.get('teambit.harmony/bit');
1284
1263
  const debugCommands = [new (_catScopeCmd().CatScopeCmd)(), new (_catComponentCmd().CatComponentCmd)(), new (_catObjectCmd().default)(), new (_catLaneCmd().default)()];
1285
1264
  const allCommands = [new (_scopeCmd().ScopeCmd)(), ...debugCommands, new (_runAction().RunActionCmd)()];
1286
- const legacyScope = await (0, _scopeLoader().loadScopeIfExist)(bitConfig?.cwd);
1265
+ const legacyScope = await (0, _legacy().loadScopeIfExist)(bitConfig?.cwd);
1287
1266
  if (!legacyScope) {
1288
1267
  cli.register(...allCommands);
1289
1268
  return undefined;
1290
1269
  }
1291
- const logger = loggerMain.createLogger(_scope2().ScopeAspect.id);
1270
+ const logger = loggerMain.createLogger(_scope5().ScopeAspect.id);
1292
1271
  const scope = new ScopeMain(harmony, legacyScope, componentExt, config, postPutSlot, postDeleteSlot, postExportSlot, postObjectsPersistSlot, preFetchObjectsSlot, OnCompAspectReCalcSlot, isolator, aspectLoader, logger, envs, depsResolver, globalConfig);
1293
1272
  cli.register(...allCommands, new (_scopeGarbageCollector().ScopeGarbageCollectorCmd)(scope));
1294
1273
  cli.registerOnStart(async hasWorkspace => {
@@ -1311,9 +1290,9 @@ class ScopeMain {
1311
1290
  logger.debug(`onPutHook, completed. (${ids.length} components)`);
1312
1291
  };
1313
1292
  const getAuthData = () => {
1314
- const token = _http().Http.getToken();
1293
+ const token = _scope4().Http.getToken();
1315
1294
  return token ? {
1316
- type: _http().DEFAULT_AUTH_TYPE,
1295
+ type: _scope4().DEFAULT_AUTH_TYPE,
1317
1296
  credentials: token
1318
1297
  } : undefined;
1319
1298
  };
@@ -1339,15 +1318,15 @@ class ScopeMain {
1339
1318
  await Promise.all(fns.map(async fn => fn(undefined, metadata)));
1340
1319
  logger.debug(`onPostObjectsPersistHook, completed`);
1341
1320
  };
1342
- _actions().ExportPersist.onPutHook = onPutHook;
1343
- _actions().PostSign.onPutHook = onPutHook;
1344
- _scope().Scope.onPostExport = onPostExportHook;
1345
- _objects().Repository.onPostObjectsPersist = onPostObjectsPersistHook;
1346
- _legacy().ExternalActions.externalActions.push(new (_clearCacheAction().ClearCacheAction)(scope));
1321
+ _scope2().ExportPersist.onPutHook = onPutHook;
1322
+ _scope2().PostSign.onPutHook = onPutHook;
1323
+ _legacy().Scope.onPostExport = onPostExportHook;
1324
+ _scope().Repository.onPostObjectsPersist = onPostObjectsPersistHook;
1325
+ _legacy2().ExternalActions.externalActions.push(new (_clearCacheAction().ClearCacheAction)(scope));
1347
1326
  express.register([new (_routes().PutRoute)(scope, postPutSlot), new (_routes().FetchRoute)(scope, logger), new (_routes().ActionRoute)(scope), new (_routes().DeleteRoute)(scope)]);
1348
1327
  // @ts-ignore - @ran to implement the missing functions and remove it
1349
- ui.registerUiRoot(new (_scope4().ScopeUIRoot)(scope));
1350
- graphql.register((0, _scope3().scopeSchema)(scope));
1328
+ ui.registerUiRoot(new (_scope7().ScopeUIRoot)(scope));
1329
+ graphql.register((0, _scope6().scopeSchema)(scope));
1351
1330
  componentExt.registerHost(scope);
1352
1331
  return scope;
1353
1332
  }
@@ -1362,6 +1341,6 @@ _defineProperty(ScopeMain, "dependencies", [_component().ComponentAspect, _ui().
1362
1341
  _defineProperty(ScopeMain, "defaultConfig", {
1363
1342
  httpTimeOut: 600000
1364
1343
  });
1365
- _scope2().ScopeAspect.addRuntime(ScopeMain);
1344
+ _scope5().ScopeAspect.addRuntime(ScopeMain);
1366
1345
 
1367
1346
  //# sourceMappingURL=scope.main.runtime.js.map