@teambit/workspace 1.0.491 → 1.0.493

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.
@@ -1,5 +1,5 @@
1
- import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.491/dist/workspace.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.491/dist/workspace.docs.mdx';
1
+ import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.493/dist/workspace.composition.js';
2
+ import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.493/dist/workspace.docs.mdx';
3
3
 
4
4
  export const compositions = [compositions_0];
5
5
  export const overview = [overview_0];
@@ -142,7 +142,7 @@ var _default = (workspace, graphql) => {
142
142
  const componentID = await ws.resolveComponentId(id);
143
143
  const component = await ws.get(componentID);
144
144
  return component;
145
- } catch (error) {
145
+ } catch {
146
146
  return null;
147
147
  }
148
148
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_graphqlTag","data","require","_workspace","_default","workspace","graphql","typeDefs","gql","resolvers","Subscription","componentAdded","subscribe","pubsub","asyncIterator","ComponentAdded","componentChanged","ComponentChanged","componentRemoved","ComponentRemoved","Component","status","wsComponent","getStatus","issuesCount","getIssues","count","issues","toObjectWithDataAsString","Workspace","path","ws","name","icon","components","offset","limit","list","getComponent","id","componentID","resolveComponentId","component","get","error","Query","exports","default"],"sources":["workspace.graphql.ts"],"sourcesContent":["import { GraphqlMain } from '@teambit/graphql';\nimport { gql } from 'graphql-tag';\n\nimport { ComponentAdded, ComponentChanged, ComponentRemoved, Workspace } from './workspace';\nimport { WorkspaceComponent } from './workspace-component';\n\nexport default (workspace: Workspace, graphql: GraphqlMain) => {\n return {\n typeDefs: gql`\n type ModifyInfo {\n # is the component modified.\n hasModifiedFiles: Boolean\n\n # the component has Modified Dependencies\n hasModifiedDependencies: Boolean\n }\n\n type ComponentStatus {\n # component is pending to be tagged automatically.\n modifyInfo: ModifyInfo\n\n # is the new component new.\n isNew: Boolean\n\n # is the component deleted from the workspace.\n isDeleted: Boolean\n\n # is the component staged.\n isStaged: Boolean\n\n # does the component exists in the workspace.\n isInWorkspace: Boolean\n\n # does the component exists in the scope.\n isInScope: Boolean\n\n # does the component is outdated (pending for update).\n isOutdated: Boolean\n }\n\n extend type Component {\n status: ComponentStatus\n }\n\n type Issue {\n type: String!\n description: String!\n solution: String\n data: String\n }\n\n extend type Component {\n # the count of errors in component in workspace\n issuesCount: Int\n issues: [Issue]\n }\n\n type Workspace {\n name: String\n path: String\n icon: String\n components(offset: Int, limit: Int): [Component]\n getComponent(id: String!): Component\n }\n\n type Subscription {\n componentAdded: ComponentAdded\n componentChanged: ComponentChanged\n componentRemoved: ComponentRemoved\n }\n\n type ComponentAdded {\n component: Component\n }\n\n type ComponentChanged {\n component: Component\n }\n\n type ComponentRemoved {\n componentIds: [ComponentID]\n }\n\n type Query {\n workspace: Workspace\n }\n `,\n resolvers: {\n Subscription: {\n componentAdded: {\n subscribe: () => graphql.pubsub.asyncIterator(ComponentAdded),\n },\n componentChanged: {\n subscribe: () => graphql.pubsub.asyncIterator(ComponentChanged),\n },\n componentRemoved: {\n subscribe: () => graphql.pubsub.asyncIterator(ComponentRemoved),\n },\n },\n Component: {\n status: async (wsComponent: WorkspaceComponent) => {\n return wsComponent.getStatus();\n },\n issuesCount: (wsComponent: WorkspaceComponent): number => {\n return wsComponent.getIssues()?.count || 0;\n },\n issues: (wsComponent: WorkspaceComponent) => {\n return wsComponent.getIssues()?.toObjectWithDataAsString();\n },\n },\n Workspace: {\n path: (ws) => ws.path,\n name: (ws) => ws.name,\n icon: (ws) => ws.icon,\n components: async (ws: Workspace, { offset, limit }: { offset: number; limit: number }) => {\n return ws.list({ offset, limit });\n },\n getComponent: async (ws: Workspace, { id }: { id: string }) => {\n try {\n const componentID = await ws.resolveComponentId(id);\n const component = await ws.get(componentID);\n return component;\n } catch (error: any) {\n return null;\n }\n },\n },\n Query: {\n workspace: () => workspace,\n },\n },\n };\n};\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"names":["_graphqlTag","data","require","_workspace","_default","workspace","graphql","typeDefs","gql","resolvers","Subscription","componentAdded","subscribe","pubsub","asyncIterator","ComponentAdded","componentChanged","ComponentChanged","componentRemoved","ComponentRemoved","Component","status","wsComponent","getStatus","issuesCount","getIssues","count","issues","toObjectWithDataAsString","Workspace","path","ws","name","icon","components","offset","limit","list","getComponent","id","componentID","resolveComponentId","component","get","Query","exports","default"],"sources":["workspace.graphql.ts"],"sourcesContent":["import { GraphqlMain } from '@teambit/graphql';\nimport { gql } from 'graphql-tag';\n\nimport { ComponentAdded, ComponentChanged, ComponentRemoved, Workspace } from './workspace';\nimport { WorkspaceComponent } from './workspace-component';\n\nexport default (workspace: Workspace, graphql: GraphqlMain) => {\n return {\n typeDefs: gql`\n type ModifyInfo {\n # is the component modified.\n hasModifiedFiles: Boolean\n\n # the component has Modified Dependencies\n hasModifiedDependencies: Boolean\n }\n\n type ComponentStatus {\n # component is pending to be tagged automatically.\n modifyInfo: ModifyInfo\n\n # is the new component new.\n isNew: Boolean\n\n # is the component deleted from the workspace.\n isDeleted: Boolean\n\n # is the component staged.\n isStaged: Boolean\n\n # does the component exists in the workspace.\n isInWorkspace: Boolean\n\n # does the component exists in the scope.\n isInScope: Boolean\n\n # does the component is outdated (pending for update).\n isOutdated: Boolean\n }\n\n extend type Component {\n status: ComponentStatus\n }\n\n type Issue {\n type: String!\n description: String!\n solution: String\n data: String\n }\n\n extend type Component {\n # the count of errors in component in workspace\n issuesCount: Int\n issues: [Issue]\n }\n\n type Workspace {\n name: String\n path: String\n icon: String\n components(offset: Int, limit: Int): [Component]\n getComponent(id: String!): Component\n }\n\n type Subscription {\n componentAdded: ComponentAdded\n componentChanged: ComponentChanged\n componentRemoved: ComponentRemoved\n }\n\n type ComponentAdded {\n component: Component\n }\n\n type ComponentChanged {\n component: Component\n }\n\n type ComponentRemoved {\n componentIds: [ComponentID]\n }\n\n type Query {\n workspace: Workspace\n }\n `,\n resolvers: {\n Subscription: {\n componentAdded: {\n subscribe: () => graphql.pubsub.asyncIterator(ComponentAdded),\n },\n componentChanged: {\n subscribe: () => graphql.pubsub.asyncIterator(ComponentChanged),\n },\n componentRemoved: {\n subscribe: () => graphql.pubsub.asyncIterator(ComponentRemoved),\n },\n },\n Component: {\n status: async (wsComponent: WorkspaceComponent) => {\n return wsComponent.getStatus();\n },\n issuesCount: (wsComponent: WorkspaceComponent): number => {\n return wsComponent.getIssues()?.count || 0;\n },\n issues: (wsComponent: WorkspaceComponent) => {\n return wsComponent.getIssues()?.toObjectWithDataAsString();\n },\n },\n Workspace: {\n path: (ws) => ws.path,\n name: (ws) => ws.name,\n icon: (ws) => ws.icon,\n components: async (ws: Workspace, { offset, limit }: { offset: number; limit: number }) => {\n return ws.list({ offset, limit });\n },\n getComponent: async (ws: Workspace, { id }: { id: string }) => {\n try {\n const componentID = await ws.resolveComponentId(id);\n const component = await ws.get(componentID);\n return component;\n } catch {\n return null;\n }\n },\n },\n Query: {\n workspace: () => workspace,\n },\n },\n };\n};\n"],"mappings":";;;;;;AACA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4F,IAAAG,QAAA,GAG7EA,CAACC,SAAoB,EAAEC,OAAoB,KAAK;EAC7D,OAAO;IACLC,QAAQ,EAAE,IAAAC,iBAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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mB,CAAC,KAAK;UAC7D,IAAI;YACF,MAAMC,WAAW,GAAG,MAAMT,EAAE,CAACU,kBAAkB,CAACF,EAAE,CAAC;YACnD,MAAMG,SAAS,GAAG,MAAMX,EAAE,CAACY,GAAG,CAACH,WAAW,CAAC;YAC3C,OAAOE,SAAS;UAClB,CAAC,CAAC,MAAM;YACN,OAAO,IAAI;UACb;QACF;MACF,CAAC;MACDE,KAAK,EAAE;QACLvC,SAAS,EAAEA,CAAA,KAAMA;MACnB;IACF;EACF,CAAC;AACH,CAAC;AAAAwC,OAAA,CAAAC,OAAA,GAAA1C,QAAA","ignoreList":[]}
package/dist/workspace.js CHANGED
@@ -405,7 +405,6 @@ class Workspace {
405
405
  });
406
406
  this.componentLoader = new (_workspaceComponentLoader().WorkspaceComponentLoader)(this, logger, dependencyResolver, envs, aspectLoader);
407
407
  this.validateConfig();
408
- // @ts-ignore todo: remove after deleting teambit.legacy
409
408
  this.bitMap = new (_bitMap().BitMap)(this.consumer.bitMap, this.consumer);
410
409
  // memoize this method to improve performance.
411
410
  this.componentDefaultScopeFromComponentDirAndNameWithoutConfigFileMemoized = (0, _memoizee().default)(this.componentDefaultScopeFromComponentDirAndNameWithoutConfigFile.bind(this), {
@@ -776,7 +775,7 @@ it's possible that the version ${component.id.version} belong to ${idStr.split('
776
775
  id,
777
776
  consumer: this.consumer
778
777
  });
779
- } catch (err) {
778
+ } catch {
780
779
  return undefined;
781
780
  }
782
781
  }
@@ -831,7 +830,7 @@ it's possible that the version ${component.id.version} belong to ${idStr.split('
831
830
  // cases where it might fail (like when importing aspect, after the import objects
832
831
  // when we write the package.json we run the applyTransformers which get to pkg which call
833
832
  // host.get, but the component not written yet to the fs, so it fails.)
834
- } catch (e) {
833
+ } catch {
835
834
  this.logger.debug(`fail to load self as aspect with id ${component.id.toString()}`);
836
835
  this.componentLoadedSelfAsAspects.delete(component.id.toString());
837
836
  return component;
@@ -1373,7 +1372,7 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1373
1372
  try {
1374
1373
  const parsedEnvId = await this.resolveComponentId(envId);
1375
1374
  env = await this.get(parsedEnvId);
1376
- } catch (err) {
1375
+ } catch {
1377
1376
  return; // unable to get the component for some reason. don't sweat it. forget about the warning
1378
1377
  }
1379
1378
  if (!this.envs.isUsingEnvEnv(env)) {
@@ -1678,7 +1677,6 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1678
1677
  */
1679
1678
  async _reloadConsumer() {
1680
1679
  this.consumer = await (0, _legacy().loadConsumer)(this.path, true);
1681
- // @ts-ignore todo: remove after deleting teambit.legacy
1682
1680
  this.bitMap = new (_bitMap().BitMap)(this.consumer.bitMap, this.consumer);
1683
1681
  await this.clearCache();
1684
1682
  }
@@ -1710,7 +1708,7 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1710
1708
  let pkgJson;
1711
1709
  try {
1712
1710
  pkgJson = await _fsExtra().default.readJson(pkgJsonPath);
1713
- } catch (err) {
1711
+ } catch {
1714
1712
  // never mind the reason. probably it's not there.
1715
1713
  }
1716
1714
  if (pkgJson) {
@@ -1866,7 +1864,7 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1866
1864
  }
1867
1865
  // Handle use case 3
1868
1866
  return await this.scope.resolveComponentId(idWithVersion);
1869
- } catch (error) {
1867
+ } catch {
1870
1868
  return _componentId().ComponentID.fromString(id.toString());
1871
1869
  }
1872
1870
  }
@@ -2000,7 +1998,7 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
2000
1998
  try {
2001
1999
  const fromRemote = await this.scope.getRemoteComponent(envId);
2002
2000
  return envId.changeVersion(fromRemote.id.version);
2003
- } catch (err) {
2001
+ } catch {
2004
2002
  throw new (_bitError().BitError)(`unable to find ${envIdStr} in the remote`);
2005
2003
  }
2006
2004
  };