@teambit/workspace 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 (63) hide show
  1. package/artifacts/__bit_junit.xml +1 -1
  2. package/artifacts/preview/static/css/teambit.workspace/{workspace-preview.62922c86.css → workspace-preview.5a6afd26.css} +2 -2
  3. package/artifacts/preview/teambit_workspace_workspace-preview.js +1 -1
  4. package/artifacts/schema.json +2824 -2298
  5. package/commands/local-only-cmd.ts +1 -1
  6. package/component-config-file/component-config-file.ts +1 -1
  7. package/dist/aspects-merger.js.map +1 -1
  8. package/dist/auto-tag.d.ts +9 -0
  9. package/dist/auto-tag.js +121 -0
  10. package/dist/auto-tag.js.map +1 -0
  11. package/dist/bit-map.d.ts +1 -1
  12. package/dist/bit-map.js.map +1 -1
  13. package/dist/build-graph-from-fs.js +4 -4
  14. package/dist/build-graph-from-fs.js.map +1 -1
  15. package/dist/build-graph-ids-from-fs.js +8 -8
  16. package/dist/build-graph-ids-from-fs.js.map +1 -1
  17. package/dist/commands/local-only-cmd.js +5 -5
  18. package/dist/commands/local-only-cmd.js.map +1 -1
  19. package/dist/component-config-file/component-config-file.js +9 -9
  20. package/dist/component-config-file/component-config-file.js.map +1 -1
  21. package/dist/eject-conf.cmd.js +4 -4
  22. package/dist/eject-conf.cmd.js.map +1 -1
  23. package/dist/envs-subcommands/envs-set.cmd.js +4 -4
  24. package/dist/envs-subcommands/envs-set.cmd.js.map +1 -1
  25. package/dist/envs-subcommands/envs-unset.cmd.js +5 -5
  26. package/dist/envs-subcommands/envs-unset.cmd.js.map +1 -1
  27. package/dist/envs-subcommands/envs-update.cmd.js +4 -4
  28. package/dist/envs-subcommands/envs-update.cmd.js.map +1 -1
  29. package/dist/filter.js.map +1 -1
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.js.map +1 -1
  32. package/dist/merge-conflict-file.js +4 -4
  33. package/dist/merge-conflict-file.js.map +1 -1
  34. package/dist/on-component-events.d.ts +1 -1
  35. package/dist/on-component-events.js.map +1 -1
  36. package/dist/preview-1733830651067.js +7 -0
  37. package/dist/scope-subcommands/scope-set.cmd.js +5 -5
  38. package/dist/scope-subcommands/scope-set.cmd.js.map +1 -1
  39. package/dist/workspace-aspects-loader.js +9 -9
  40. package/dist/workspace-aspects-loader.js.map +1 -1
  41. package/dist/workspace-component/comp-files.d.ts +1 -2
  42. package/dist/workspace-component/comp-files.js.map +1 -1
  43. package/dist/workspace-component/component-status-loader.d.ts +1 -1
  44. package/dist/workspace-component/component-status-loader.js +18 -25
  45. package/dist/workspace-component/component-status-loader.js.map +1 -1
  46. package/dist/workspace-component/workspace-component-loader.d.ts +1 -2
  47. package/dist/workspace-component/workspace-component-loader.js +19 -26
  48. package/dist/workspace-component/workspace-component-loader.js.map +1 -1
  49. package/dist/workspace.d.ts +7 -6
  50. package/dist/workspace.js +60 -50
  51. package/dist/workspace.js.map +1 -1
  52. package/dist/workspace.main.runtime.js +12 -19
  53. package/dist/workspace.main.runtime.js.map +1 -1
  54. package/dist/workspace.ui.runtime.d.ts +1 -1
  55. package/envs-subcommands/envs-set.cmd.ts +1 -1
  56. package/envs-subcommands/envs-unset.cmd.ts +1 -1
  57. package/envs-subcommands/envs-update.cmd.ts +1 -1
  58. package/package.json +45 -33
  59. package/scope-subcommands/scope-set.cmd.ts +1 -1
  60. package/workspace-component/comp-files.ts +1 -2
  61. package/workspace-component/component-status-loader.ts +4 -7
  62. package/workspace-component/workspace-component-loader.ts +6 -4
  63. package/dist/preview-1733541556857.js +0 -7
package/dist/workspace.js CHANGED
@@ -81,16 +81,16 @@ function _legacyBitId() {
81
81
  };
82
82
  return data;
83
83
  }
84
- function _consumer() {
85
- const data = require("@teambit/legacy/dist/consumer");
86
- _consumer = function () {
84
+ function _legacy() {
85
+ const data = require("@teambit/legacy.consumer");
86
+ _legacy = function () {
87
87
  return data;
88
88
  };
89
89
  return data;
90
90
  }
91
- function _legacy() {
91
+ function _legacy2() {
92
92
  const data = require("@teambit/legacy.bit-map");
93
- _legacy = function () {
93
+ _legacy2 = function () {
94
94
  return data;
95
95
  };
96
96
  return data;
@@ -102,16 +102,16 @@ function _harmonyModules() {
102
102
  };
103
103
  return data;
104
104
  }
105
- function _legacy2() {
105
+ function _legacy3() {
106
106
  const data = require("@teambit/legacy.component-list");
107
- _legacy2 = function () {
107
+ _legacy3 = function () {
108
108
  return data;
109
109
  };
110
110
  return data;
111
111
  }
112
- function _legacy3() {
112
+ function _legacy4() {
113
113
  const data = require("@teambit/legacy.extension-data");
114
- _legacy3 = function () {
114
+ _legacy4 = function () {
115
115
  return data;
116
116
  };
117
117
  return data;
@@ -144,9 +144,9 @@ function _lodash() {
144
144
  };
145
145
  return data;
146
146
  }
147
- function _constants() {
148
- const data = require("@teambit/legacy/dist/constants");
149
- _constants = function () {
147
+ function _legacy5() {
148
+ const data = require("@teambit/legacy.constants");
149
+ _legacy5 = function () {
150
150
  return data;
151
151
  };
152
152
  return data;
@@ -158,37 +158,37 @@ function _path() {
158
158
  };
159
159
  return data;
160
160
  }
161
- function _component2() {
162
- const data = _interopRequireDefault(require("@teambit/legacy/dist/consumer/component"));
163
- _component2 = function () {
161
+ function _legacy6() {
162
+ const data = require("@teambit/legacy.consumer-component");
163
+ _legacy6 = function () {
164
164
  return data;
165
165
  };
166
166
  return data;
167
167
  }
168
- function _component3() {
168
+ function _component2() {
169
169
  const data = require("@teambit/component.sources");
170
- _component3 = function () {
170
+ _component2 = function () {
171
171
  return data;
172
172
  };
173
173
  return data;
174
174
  }
175
- function _scopeComponentsImporter() {
176
- const data = _interopRequireDefault(require("@teambit/legacy/dist/scope/component-ops/scope-components-importer"));
177
- _scopeComponentsImporter = function () {
175
+ function _legacy7() {
176
+ const data = require("@teambit/legacy.scope");
177
+ _legacy7 = function () {
178
178
  return data;
179
179
  };
180
180
  return data;
181
181
  }
182
- function _legacy4() {
182
+ function _legacy8() {
183
183
  const data = require("@teambit/legacy.scope-api");
184
- _legacy4 = function () {
184
+ _legacy8 = function () {
185
185
  return data;
186
186
  };
187
187
  return data;
188
188
  }
189
- function _scopeNotFoundOrDenied() {
190
- const data = require("@teambit/legacy/dist/remotes/exceptions/scope-not-found-or-denied");
191
- _scopeNotFoundOrDenied = function () {
189
+ function _scope() {
190
+ const data = require("@teambit/scope.remotes");
191
+ _scope = function () {
192
192
  return data;
193
193
  };
194
194
  return data;
@@ -200,9 +200,9 @@ function _componentVersion() {
200
200
  };
201
201
  return data;
202
202
  }
203
- function _http() {
204
- const data = require("@teambit/legacy/dist/scope/network/http/http");
205
- _http = function () {
203
+ function _scope2() {
204
+ const data = require("@teambit/scope.network");
205
+ _scope2 = function () {
206
206
  return data;
207
207
  };
208
208
  return data;
@@ -298,6 +298,13 @@ function _componentStatusLoader() {
298
298
  };
299
299
  return data;
300
300
  }
301
+ function _autoTag() {
302
+ const data = require("./auto-tag");
303
+ _autoTag = function () {
304
+ return data;
305
+ };
306
+ return data;
307
+ }
301
308
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
302
309
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
303
310
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -330,7 +337,7 @@ class Workspace {
330
337
  /**
331
338
  * access to the `ComponentProvider` instance
332
339
  */
333
- componentAspect, dependencyResolver, variants, aspectLoader, logger, componentList = new (_legacy2().ComponentsList)(consumer),
340
+ componentAspect, dependencyResolver, variants, aspectLoader, logger, componentList = new (_legacy3().ComponentsList)(consumer),
334
341
  /**
335
342
  * private reference to the instance of Harmony.
336
343
  */
@@ -430,7 +437,7 @@ class Workspace {
430
437
  */
431
438
  get rootComponentsPath() {
432
439
  const baseDir = this.config.rootComponentsDirectory != null ? _path().default.join(this.path, this.config.rootComponentsDirectory) : this.modulesPath;
433
- return _path().default.join(baseDir, _constants().BIT_ROOTS_DIR);
440
+ return _path().default.join(baseDir, _legacy5().BIT_ROOTS_DIR);
434
441
  }
435
442
 
436
443
  /** get the `node_modules` folder of this workspace */
@@ -484,12 +491,15 @@ class Workspace {
484
491
  get icon() {
485
492
  return this.config.icon;
486
493
  }
494
+ async getAutoTagInfo(changedComponents) {
495
+ return (0, _autoTag().getAutoTagInfo)(this.consumer, changedComponents);
496
+ }
487
497
  async listAutoTagPendingComponentIds() {
488
- const componentsList = new (_legacy2().ComponentsList)(this.consumer);
498
+ const componentsList = new (_legacy3().ComponentsList)(this.consumer);
489
499
  const modifiedComponents = (await this.modified()).map(c => c.id);
490
500
  const newComponents = await componentsList.listNewComponents();
491
501
  if (!modifiedComponents || !modifiedComponents.length) return [];
492
- const autoTagPending = await this.consumer.listComponentsForAutoTagging(_componentId().ComponentIdList.fromArray(modifiedComponents));
502
+ const autoTagPending = await (0, _autoTag().getAutoTagPending)(this.consumer, _componentId().ComponentIdList.fromArray(modifiedComponents));
493
503
  const localOnly = this.listLocalOnly();
494
504
  const comps = autoTagPending.filter(autoTagComp => !newComponents.has(autoTagComp.componentId)).filter(autoTagComp => !localOnly.has(autoTagComp.componentId));
495
505
  return comps.map(c => c.id);
@@ -761,7 +771,7 @@ it's possible that the version ${component.id.version} belong to ${idStr.split('
761
771
  async getLegacyMinimal(id) {
762
772
  try {
763
773
  const componentMap = this.consumer.bitMap.getComponent(id);
764
- return await _component2().default.loadFromFileSystem({
774
+ return await _legacy6().ConsumerComponent.loadFromFileSystem({
765
775
  componentMap,
766
776
  id,
767
777
  consumer: this.consumer
@@ -778,7 +788,7 @@ it's possible that the version ${component.id.version} belong to ${idStr.split('
778
788
  const compDirAbs = _path().default.join(this.path, compDir);
779
789
  const sourceFilesVinyls = bitMapEntry.files.map(file => {
780
790
  const filePath = _path().default.join(compDirAbs, file.relativePath);
781
- return _component3().SourceFile.load(filePath, compDirAbs, this.path, {});
791
+ return _component2().SourceFile.load(filePath, compDirAbs, this.path, {});
782
792
  });
783
793
  const repo = this.scope.legacyScope.objects;
784
794
  const getModelFiles = async () => {
@@ -857,13 +867,13 @@ it's possible that the version ${component.id.version} belong to ${idStr.split('
857
867
  this.componentLoader.clearCache();
858
868
  this.consumer.componentLoader.clearComponentsCache();
859
869
  this.componentStatusLoader.clearCache();
860
- this.componentList = new (_legacy2().ComponentsList)(this.consumer);
870
+ this.componentList = new (_legacy3().ComponentsList)(this.consumer);
861
871
  }
862
872
  clearComponentCache(id) {
863
873
  this.componentLoader.clearComponentCache(id);
864
874
  this.componentStatusLoader.clearOneComponentCache(id);
865
875
  this.consumer.clearOneComponentCache(id);
866
- this.componentList = new (_legacy2().ComponentsList)(this.consumer);
876
+ this.componentList = new (_legacy3().ComponentsList)(this.consumer);
867
877
  }
868
878
  async warmCache() {
869
879
  await this.list();
@@ -995,12 +1005,12 @@ it's possible that the version ${component.id.version} belong to ${idStr.split('
995
1005
  if (currentLaneId.isDefault()) {
996
1006
  return null;
997
1007
  }
998
- const scopeComponentImporter = _scopeComponentsImporter().default.getInstance(this.consumer.scope);
1008
+ const scopeComponentImporter = _legacy7().ScopeComponentsImporter.getInstance(this.consumer.scope);
999
1009
  try {
1000
1010
  const lanes = await scopeComponentImporter.importLanes([currentLaneId]);
1001
1011
  return lanes[0];
1002
1012
  } catch (err) {
1003
- if (err instanceof _legacyBitId().InvalidScopeName || err instanceof _scopeNotFoundOrDenied().ScopeNotFoundOrDenied || err instanceof _legacy4().LaneNotFound || err instanceof _legacyBitId().InvalidScopeNameFromRemote) {
1013
+ if (err instanceof _legacyBitId().InvalidScopeName || err instanceof _scope().ScopeNotFoundOrDenied || err instanceof _legacy8().LaneNotFound || err instanceof _legacyBitId().InvalidScopeNameFromRemote) {
1004
1014
  const bitMapLaneId = this.bitMap.getExportedLaneId();
1005
1015
  if (bitMapLaneId?.isEqual(currentLaneId)) {
1006
1016
  throw err; // we know the lane is not new, so the error is legit
@@ -1015,9 +1025,9 @@ it's possible that the version ${component.id.version} belong to ${idStr.split('
1015
1025
  }
1016
1026
  getDefaultExtensions() {
1017
1027
  if (!this.config.extensions) {
1018
- return new (_legacy3().ExtensionDataList)();
1028
+ return new (_legacy4().ExtensionDataList)();
1019
1029
  }
1020
- return _legacy3().ExtensionDataList.fromConfigObject(this.config.extensions);
1030
+ return _legacy4().ExtensionDataList.fromConfigObject(this.config.extensions);
1021
1031
  }
1022
1032
  async getComponentConfigVinylFile(id, options, excludeLocalChanges = false) {
1023
1033
  const componentId = await this.resolveComponentId(id);
@@ -1047,7 +1057,7 @@ it's possible that the version ${component.id.version} belong to ${idStr.split('
1047
1057
  const EjectConfResult = vinylFiles.map(file => ({
1048
1058
  configPath: file.path
1049
1059
  }));
1050
- const dataToPersist = new (_component3().DataToPersist)();
1060
+ const dataToPersist = new (_component2().DataToPersist)();
1051
1061
  dataToPersist.addManyFiles(vinylFiles);
1052
1062
  dataToPersist.addBasePath(this.path);
1053
1063
  await dataToPersist.persistAllToFS();
@@ -1107,7 +1117,7 @@ it's possible that the version ${component.id.version} belong to ${idStr.split('
1107
1117
  if (this.exists(id, {
1108
1118
  includeDeleted: opts.includeDeleted
1109
1119
  })) return [id];
1110
- if (throwForNoMatch) throw new (_legacy().MissingBitMapComponent)(pattern);
1120
+ if (throwForNoMatch) throw new (_legacy2().MissingBitMapComponent)(pattern);
1111
1121
  return [];
1112
1122
  }
1113
1123
  const ids = opts.includeDeleted ? this.listIdsIncludeRemoved() : await this.listIds();
@@ -1225,7 +1235,7 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1225
1235
  }
1226
1236
  this.logger.info(`current lane ${laneId.toString()} is missing, importing it`);
1227
1237
  await this.scope.legacyScope.objects.writeObjectsToTheFS([lane]);
1228
- const scopeComponentsImporter = _scopeComponentsImporter().default.getInstance(this.scope.legacyScope);
1238
+ const scopeComponentsImporter = _legacy7().ScopeComponentsImporter.getInstance(this.scope.legacyScope);
1229
1239
  const ids = _componentId().ComponentIdList.fromArray(this.getExportedFrom(lane.toBitIds()));
1230
1240
  await scopeComponentsImporter.importWithoutDeps(ids.toVersionLatest(), {
1231
1241
  cache: false,
@@ -1372,7 +1382,7 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1372
1382
  }
1373
1383
  }
1374
1384
  getConfigMergeFilePath() {
1375
- return _path().default.join(this.path, _constants().MergeConfigFilename);
1385
+ return _path().default.join(this.path, _legacy5().MergeConfigFilename);
1376
1386
  }
1377
1387
  getConflictMergeFile() {
1378
1388
  return this.aspectsMerger.mergeConflictFile;
@@ -1642,7 +1652,7 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1642
1652
  getWorkspaceAspectsLoader() {
1643
1653
  let resolveEnvsFromRoots = this.config.resolveEnvsFromRoots;
1644
1654
  if (resolveEnvsFromRoots === undefined) {
1645
- const resolveEnvsFromRootsConfig = this.globalConfig.getSync(_constants().CFG_DEFAULT_RESOLVE_ENVS_FROM_ROOTS);
1655
+ const resolveEnvsFromRootsConfig = this.globalConfig.getSync(_legacy5().CFG_DEFAULT_RESOLVE_ENVS_FROM_ROOTS);
1646
1656
  const defaultResolveEnvsFromRoots =
1647
1657
  // @ts-ignore
1648
1658
  resolveEnvsFromRootsConfig === 'true' || resolveEnvsFromRootsConfig === true;
@@ -1667,7 +1677,7 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1667
1677
  * it's currently used by watch extension as a quick workaround to load .bitmap and the components
1668
1678
  */
1669
1679
  async _reloadConsumer() {
1670
- this.consumer = await (0, _consumer().loadConsumer)(this.path, true);
1680
+ this.consumer = await (0, _legacy().loadConsumer)(this.path, true);
1671
1681
  // @ts-ignore todo: remove after deleting teambit.legacy
1672
1682
  this.bitMap = new (_bitMap().BitMap)(this.consumer.bitMap, this.consumer);
1673
1683
  await this.clearCache();
@@ -1711,9 +1721,9 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1711
1721
  return _componentId().ComponentID.fromObject(compId);
1712
1722
  }
1713
1723
  const url = `https://node-registry.bit.cloud/${packageName}`;
1714
- const token = await this.globalConfig.get(_constants().CFG_USER_TOKEN_KEY);
1715
- const headers = token ? (0, _http().getAuthHeader)(token) : {};
1716
- const res = await (0, _http().fetchWithAgent)(url, {
1724
+ const token = await this.globalConfig.get(_legacy5().CFG_USER_TOKEN_KEY);
1725
+ const headers = token ? (0, _scope2().getAuthHeader)(token) : {};
1726
+ const res = await (0, _scope2().fetchWithAgent)(url, {
1717
1727
  headers
1718
1728
  });
1719
1729
  if (!res.ok) {
@@ -1954,7 +1964,7 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1954
1964
  await Promise.all(ids.map(async id => {
1955
1965
  const extensions = await this.getExtensionsFromScopeAndSpecific(id);
1956
1966
  const envsAspect = extensions.findCoreExtension(_envs().EnvsAspect.id)?.rawConfig;
1957
- const currentEnv = envsAspect && envsAspect !== _legacy3().REMOVE_EXTENSION_SPECIAL_SIGN ? envsAspect.env : null;
1967
+ const currentEnv = envsAspect && envsAspect !== _legacy4().REMOVE_EXTENSION_SPECIAL_SIGN ? envsAspect.env : null;
1958
1968
  if (!currentEnv) {
1959
1969
  unchanged.push(id);
1960
1970
  return;