@teambit/workspace 1.0.492 → 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.492/dist/workspace.composition.js';
2
- import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.492/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":";;;;;;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;IACDC,SAAS,EAAE;MACTC,YAAY,EAAE;QACZC,cAAc,EAAE;UACdC,SAAS,EAAEA,CAAA,KAAMN,OAAO,CAACO,MAAM,CAACC,aAAa,CAACC,2BAAc;QAC9D,CAAC;QACDC,gBAAgB,EAAE;UAChBJ,SAAS,EAAEA,CAAA,KAAMN,OAAO,CAACO,MAAM,CAACC,aAAa,CAACG,6BAAgB;QAChE,CAAC;QACDC,gBAAgB,EAAE;UAChBN,SAAS,EAAEA,CAAA,KAAMN,OAAO,CAACO,MAAM,CAACC,aAAa,CAACK,6BAAgB;QAChE;MACF,CAAC;MACDC,SAAS,EAAE;QACTC,MAAM,EAAE,MAAOC,WAA+B,IAAK;UACjD,OAAOA,WAAW,CAACC,SAAS,CAAC,CAAC;QAChC,CAAC;QACDC,WAAW,EAAGF,WAA+B,IAAa;UACxD,OAAOA,WAAW,CAACG,SAAS,CAAC,CAAC,EAAEC,KAAK,IAAI,CAAC;QAC5C,CAAC;QACDC,MAAM,EAAGL,WAA+B,IAAK;UAC3C,OAAOA,WAAW,CAACG,SAAS,CAAC,CAAC,EAAEG,wBAAwB,CAAC,CAAC;QAC5D;MACF,CAAC;MACDC,SAAS,EAAE;QACTC,IAAI,EAAGC,EAAE,IAAKA,EAAE,CAACD,IAAI;QACrBE,IAAI,EAAGD,EAAE,IAAKA,EAAE,CAACC,IAAI;QACrBC,IAAI,EAAGF,EAAE,IAAKA,EAAE,CAACE,IAAI;QACrBC,UAAU,EAAE,MAAAA,CAAOH,EAAa,EAAE;UAAEI,MAAM;UAAEC;QAAyC,CAAC,KAAK;UACzF,OAAOL,EAAE,CAACM,IAAI,CAAC;YAAEF,MAAM;YAAEC;UAAM,CAAC,CAAC;QACnC,CAAC;QACDE,YAAY,EAAE,MAAAA,CAAOP,EAAa,EAAE;UAAEQ;QAAmB,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,OAAOE,KAAU,EAAE;YACnB,OAAO,IAAI;UACb;QACF;MACF,CAAC;MACDC,KAAK,EAAE;QACLxC,SAAS,EAAEA,CAAA,KAAMA;MACnB;IACF;EACF,CAAC;AACH,CAAC;AAAAyC,OAAA,CAAAC,OAAA,GAAA3C,QAAA","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
@@ -775,7 +775,7 @@ it's possible that the version ${component.id.version} belong to ${idStr.split('
775
775
  id,
776
776
  consumer: this.consumer
777
777
  });
778
- } catch (err) {
778
+ } catch {
779
779
  return undefined;
780
780
  }
781
781
  }
@@ -830,7 +830,7 @@ it's possible that the version ${component.id.version} belong to ${idStr.split('
830
830
  // cases where it might fail (like when importing aspect, after the import objects
831
831
  // when we write the package.json we run the applyTransformers which get to pkg which call
832
832
  // host.get, but the component not written yet to the fs, so it fails.)
833
- } catch (e) {
833
+ } catch {
834
834
  this.logger.debug(`fail to load self as aspect with id ${component.id.toString()}`);
835
835
  this.componentLoadedSelfAsAspects.delete(component.id.toString());
836
836
  return component;
@@ -1372,7 +1372,7 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1372
1372
  try {
1373
1373
  const parsedEnvId = await this.resolveComponentId(envId);
1374
1374
  env = await this.get(parsedEnvId);
1375
- } catch (err) {
1375
+ } catch {
1376
1376
  return; // unable to get the component for some reason. don't sweat it. forget about the warning
1377
1377
  }
1378
1378
  if (!this.envs.isUsingEnvEnv(env)) {
@@ -1708,7 +1708,7 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1708
1708
  let pkgJson;
1709
1709
  try {
1710
1710
  pkgJson = await _fsExtra().default.readJson(pkgJsonPath);
1711
- } catch (err) {
1711
+ } catch {
1712
1712
  // never mind the reason. probably it's not there.
1713
1713
  }
1714
1714
  if (pkgJson) {
@@ -1864,7 +1864,7 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1864
1864
  }
1865
1865
  // Handle use case 3
1866
1866
  return await this.scope.resolveComponentId(idWithVersion);
1867
- } catch (error) {
1867
+ } catch {
1868
1868
  return _componentId().ComponentID.fromString(id.toString());
1869
1869
  }
1870
1870
  }
@@ -1998,7 +1998,7 @@ the following envs are used in this workspace: ${availableEnvs.join(', ')}`);
1998
1998
  try {
1999
1999
  const fromRemote = await this.scope.getRemoteComponent(envId);
2000
2000
  return envId.changeVersion(fromRemote.id.version);
2001
- } catch (err) {
2001
+ } catch {
2002
2002
  throw new (_bitError().BitError)(`unable to find ${envIdStr} in the remote`);
2003
2003
  }
2004
2004
  };