@teambit/workspace 1.0.487 → 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.
- package/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/static/css/teambit.workspace/{workspace-preview.62922c86.css → workspace-preview.5a6afd26.css} +2 -2
- package/artifacts/preview/teambit_workspace_workspace-preview.js +1 -1
- package/artifacts/schema.json +2824 -2298
- package/commands/local-only-cmd.ts +1 -1
- package/component-config-file/component-config-file.ts +1 -1
- package/dist/aspects-merger.js.map +1 -1
- package/dist/auto-tag.d.ts +9 -0
- package/dist/auto-tag.js +121 -0
- package/dist/auto-tag.js.map +1 -0
- package/dist/bit-map.d.ts +1 -1
- package/dist/bit-map.js.map +1 -1
- package/dist/build-graph-from-fs.js +4 -4
- package/dist/build-graph-from-fs.js.map +1 -1
- package/dist/build-graph-ids-from-fs.js +8 -8
- package/dist/build-graph-ids-from-fs.js.map +1 -1
- package/dist/commands/local-only-cmd.js +5 -5
- package/dist/commands/local-only-cmd.js.map +1 -1
- package/dist/component-config-file/component-config-file.js +9 -9
- package/dist/component-config-file/component-config-file.js.map +1 -1
- package/dist/eject-conf.cmd.js +4 -4
- package/dist/eject-conf.cmd.js.map +1 -1
- package/dist/envs-subcommands/envs-set.cmd.js +4 -4
- package/dist/envs-subcommands/envs-set.cmd.js.map +1 -1
- package/dist/envs-subcommands/envs-unset.cmd.js +5 -5
- package/dist/envs-subcommands/envs-unset.cmd.js.map +1 -1
- package/dist/envs-subcommands/envs-update.cmd.js +4 -4
- package/dist/envs-subcommands/envs-update.cmd.js.map +1 -1
- package/dist/filter.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js.map +1 -1
- package/dist/merge-conflict-file.js +4 -4
- package/dist/merge-conflict-file.js.map +1 -1
- package/dist/on-component-events.d.ts +1 -1
- package/dist/on-component-events.js.map +1 -1
- package/dist/preview-1733830651067.js +7 -0
- package/dist/scope-subcommands/scope-set.cmd.js +5 -5
- package/dist/scope-subcommands/scope-set.cmd.js.map +1 -1
- package/dist/workspace-aspects-loader.js +9 -9
- package/dist/workspace-aspects-loader.js.map +1 -1
- package/dist/workspace-component/comp-files.d.ts +1 -2
- package/dist/workspace-component/comp-files.js.map +1 -1
- package/dist/workspace-component/component-status-loader.d.ts +1 -1
- package/dist/workspace-component/component-status-loader.js +18 -25
- package/dist/workspace-component/component-status-loader.js.map +1 -1
- package/dist/workspace-component/workspace-component-loader.d.ts +1 -2
- package/dist/workspace-component/workspace-component-loader.js +19 -26
- package/dist/workspace-component/workspace-component-loader.js.map +1 -1
- package/dist/workspace.d.ts +7 -6
- package/dist/workspace.js +60 -50
- package/dist/workspace.js.map +1 -1
- package/dist/workspace.main.runtime.js +12 -19
- package/dist/workspace.main.runtime.js.map +1 -1
- package/dist/workspace.ui.runtime.d.ts +1 -1
- package/envs-subcommands/envs-set.cmd.ts +1 -1
- package/envs-subcommands/envs-unset.cmd.ts +1 -1
- package/envs-subcommands/envs-update.cmd.ts +1 -1
- package/package.json +45 -33
- package/scope-subcommands/scope-set.cmd.ts +1 -1
- package/workspace-component/comp-files.ts +1 -2
- package/workspace-component/component-status-loader.ts +4 -7
- package/workspace-component/workspace-component-loader.ts +6 -4
- package/dist/preview-1733714450424.js +0 -7
package/dist/workspace.js
CHANGED
|
@@ -81,16 +81,16 @@ function _legacyBitId() {
|
|
|
81
81
|
};
|
|
82
82
|
return data;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
const data = require("@teambit/legacy
|
|
86
|
-
|
|
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
|
|
91
|
+
function _legacy2() {
|
|
92
92
|
const data = require("@teambit/legacy.bit-map");
|
|
93
|
-
|
|
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
|
|
105
|
+
function _legacy3() {
|
|
106
106
|
const data = require("@teambit/legacy.component-list");
|
|
107
|
-
|
|
107
|
+
_legacy3 = function () {
|
|
108
108
|
return data;
|
|
109
109
|
};
|
|
110
110
|
return data;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function _legacy4() {
|
|
113
113
|
const data = require("@teambit/legacy.extension-data");
|
|
114
|
-
|
|
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
|
|
148
|
-
const data = require("@teambit/legacy
|
|
149
|
-
|
|
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
|
|
162
|
-
const data =
|
|
163
|
-
|
|
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
|
|
168
|
+
function _component2() {
|
|
169
169
|
const data = require("@teambit/component.sources");
|
|
170
|
-
|
|
170
|
+
_component2 = function () {
|
|
171
171
|
return data;
|
|
172
172
|
};
|
|
173
173
|
return data;
|
|
174
174
|
}
|
|
175
|
-
function
|
|
176
|
-
const data =
|
|
177
|
-
|
|
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
|
|
182
|
+
function _legacy8() {
|
|
183
183
|
const data = require("@teambit/legacy.scope-api");
|
|
184
|
-
|
|
184
|
+
_legacy8 = function () {
|
|
185
185
|
return data;
|
|
186
186
|
};
|
|
187
187
|
return data;
|
|
188
188
|
}
|
|
189
|
-
function
|
|
190
|
-
const data = require("@teambit/
|
|
191
|
-
|
|
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
|
|
204
|
-
const data = require("@teambit/
|
|
205
|
-
|
|
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 (
|
|
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,
|
|
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 (
|
|
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
|
|
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
|
|
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
|
|
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 (
|
|
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 (
|
|
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 =
|
|
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
|
|
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 (
|
|
1028
|
+
return new (_legacy4().ExtensionDataList)();
|
|
1019
1029
|
}
|
|
1020
|
-
return
|
|
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 (
|
|
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 (
|
|
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 =
|
|
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,
|
|
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(
|
|
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,
|
|
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(
|
|
1715
|
-
const headers = token ? (0,
|
|
1716
|
-
const res = await (0,
|
|
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 !==
|
|
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;
|