@teambit/objects 0.0.727 → 0.0.728

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.
@@ -50,9 +50,9 @@ export type ComponentProps = {
50
50
  name: string;
51
51
  versions?: Versions;
52
52
  orphanedVersions?: Versions;
53
- lang: string;
54
- deprecated: boolean;
55
- bindingPrefix: string;
53
+ lang?: string;
54
+ deprecated?: boolean;
55
+ bindingPrefix?: string;
56
56
  state?: State;
57
57
  scopesList?: ScopeListItem[];
58
58
  head?: Ref;
@@ -240,17 +240,15 @@ export default class Component extends BitObject {
240
240
  toObject(): {
241
241
  name: string;
242
242
  scope: string;
243
- versions: {};
243
+ versions: Record<string, string>;
244
244
  lang: string;
245
245
  deprecated: boolean;
246
246
  bindingPrefix: string;
247
247
  remotes: ScopeListItem[];
248
248
  schema: string | undefined;
249
- detachedHeads: {
250
- heads?: string[];
251
- deleted?: string[];
252
- current?: string;
253
- } | undefined;
249
+ detachedHeads: ReturnType<DetachedHeads['toObject']>;
250
+ local?: boolean;
251
+ state?: State;
254
252
  };
255
253
  loadVersion(versionStr: string, repository: Repository, throws?: boolean): Promise<Version>;
256
254
  loadVersionSync(version: string, repository: Repository, throws?: boolean): Version;
@@ -613,12 +613,10 @@ class Component extends _objects().BitObject {
613
613
  latestExisting(repository) {
614
614
  if ((0, _lodash().isEmpty)(this.versions)) return VERSION_ZERO;
615
615
  const versions = this.listVersions('ASC');
616
- let version = null;
617
- let versionStr = null;
616
+ let version;
617
+ let versionStr;
618
618
  while (!version && versions && versions.length) {
619
- // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
620
619
  versionStr = versions.pop();
621
- // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
622
620
  version = this.loadVersionSync(versionStr, repository, false);
623
621
  }
624
622
  return versionStr || VERSION_ZERO;
@@ -945,9 +943,7 @@ Error from "semver": ${err.message}`);
945
943
  schema: this.schema,
946
944
  detachedHeads: this.detachedHeads.toObject()
947
945
  };
948
- // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
949
946
  if (this.local) componentObject.local = this.local;
950
- // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
951
947
  if (!(0, _lodash().isEmpty)(this.state)) componentObject.state = this.state;
952
948
  // @ts-ignore
953
949
  if (!(0, _lodash().isEmpty)(this.orphanedVersions)) componentObject.orphanedVersions = versions(this.orphanedVersions);
@@ -966,7 +962,6 @@ Error from "semver": ${err.message}`);
966
962
  loadVersionSync(version, repository, throws = true) {
967
963
  const versionRef = this.getRef(version);
968
964
  if (!versionRef) throw new (_legacy6().VersionNotFound)(version, this.id());
969
- // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
970
965
  return versionRef.loadSync(repository, throws);
971
966
  }
972
967
  async collectVersionsObjects(repo, versions, throwForMissingLocalArtifacts = false, workspaceId) {
@@ -1298,9 +1293,7 @@ bit import ${this.id()}@${resolvedVersion} --objects --all-history`);
1298
1293
  if (!this.state.versions) this.state = {
1299
1294
  versions: {}
1300
1295
  };
1301
- // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
1302
1296
  if (!this.state.versions[version]) this.state.versions[version] = {};
1303
- // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
1304
1297
  this.state.versions[version].local = true;
1305
1298
  }
1306
1299
 
@@ -1310,7 +1303,6 @@ bit import ${this.id()}@${resolvedVersion} --objects --all-history`);
1310
1303
  */
1311
1304
  getLocalVersions() {
1312
1305
  if ((0, _lodash().isEmpty)(this.state) || (0, _lodash().isEmpty)(this.state.versions)) return [];
1313
- // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
1314
1306
  return Object.keys(this.state.versions).filter(version => this.state.versions[version].local);
1315
1307
  }
1316
1308
  hasLocalTag(tag) {
@@ -1508,7 +1500,6 @@ bit import ${this.id()}@${resolvedVersion} --objects --all-history`);
1508
1500
  return new Component(props);
1509
1501
  }
1510
1502
  static fromBitId(bitId) {
1511
- // @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
1512
1503
  return new Component({
1513
1504
  name: bitId.fullName,
1514
1505
  scope: bitId.scope