@teambit/workspace 1.0.1000 → 1.0.1002
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/dist/filter.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentID, ComponentIdList } from '@teambit/component-id';
|
|
2
2
|
import type { Workspace } from './workspace';
|
|
3
|
-
export declare const statesFilter: readonly ["new", "modified", "deprecated", "deleted", "snappedOnMain", "softTagged", "codeModified", "localOnly"];
|
|
3
|
+
export declare const statesFilter: readonly ["new", "modified", "deprecated", "deleted", "internal", "snappedOnMain", "softTagged", "codeModified", "localOnly"];
|
|
4
4
|
export type StatesFilter = (typeof statesFilter)[number];
|
|
5
5
|
export declare class Filter {
|
|
6
6
|
private workspace;
|
|
@@ -15,6 +15,7 @@ export declare class Filter {
|
|
|
15
15
|
byNew(withinIds?: ComponentID[]): Promise<ComponentID[]>;
|
|
16
16
|
byDeprecated(withinIds?: ComponentID[]): Promise<ComponentID[]>;
|
|
17
17
|
byDeleted(withinIds?: ComponentID[]): Promise<ComponentID[]>;
|
|
18
|
+
byInternal(withinIds?: ComponentID[]): Promise<ComponentID[]>;
|
|
18
19
|
byDuringMergeState(): ComponentIdList;
|
|
19
20
|
/**
|
|
20
21
|
* list components that their head is a snap, not a tag.
|
package/dist/filter.js
CHANGED
|
@@ -26,7 +26,7 @@ function _lodash() {
|
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
28
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
29
|
-
const statesFilter = exports.statesFilter = ['new', 'modified', 'deprecated', 'deleted', 'snappedOnMain', 'softTagged', 'codeModified', 'localOnly'];
|
|
29
|
+
const statesFilter = exports.statesFilter = ['new', 'modified', 'deprecated', 'deleted', 'internal', 'snappedOnMain', 'softTagged', 'codeModified', 'localOnly'];
|
|
30
30
|
class Filter {
|
|
31
31
|
constructor(workspace) {
|
|
32
32
|
this.workspace = workspace;
|
|
@@ -40,6 +40,7 @@ class Filter {
|
|
|
40
40
|
modified: this.byModified,
|
|
41
41
|
deprecated: this.byDeprecated,
|
|
42
42
|
deleted: this.byDeleted,
|
|
43
|
+
internal: this.byInternal,
|
|
43
44
|
snappedOnMain: this.bySnappedOnMain,
|
|
44
45
|
softTagged: this.bySoftTagged,
|
|
45
46
|
codeModified: this.byCodeModified,
|
|
@@ -111,6 +112,20 @@ class Filter {
|
|
|
111
112
|
const deletedIds = comps.filter(c => c.isDeleted()).map(c => c.id);
|
|
112
113
|
return (0, _lodash().compact)(deletedIds);
|
|
113
114
|
}
|
|
115
|
+
async byInternal(withinIds) {
|
|
116
|
+
const ids = withinIds || (await this.workspace.listIds());
|
|
117
|
+
const results = await Promise.all(ids.map(async id => {
|
|
118
|
+
const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(id, {
|
|
119
|
+
ignoreVersion: true
|
|
120
|
+
});
|
|
121
|
+
if (bitmapEntry?.isInternal()) return id;
|
|
122
|
+
if (bitmapEntry?.isUninternalized()) return null;
|
|
123
|
+
const modelComponent = await this.workspace.consumer.scope.getModelComponentIfExist(id);
|
|
124
|
+
const internal = await modelComponent?.isInternal(this.workspace.consumer.scope.objects);
|
|
125
|
+
return internal ? id : null;
|
|
126
|
+
}));
|
|
127
|
+
return (0, _lodash().compact)(results);
|
|
128
|
+
}
|
|
114
129
|
byDuringMergeState() {
|
|
115
130
|
const unmergedComponents = this.workspace.scope.legacyScope.objects.unmergedComponents.getComponents();
|
|
116
131
|
return _componentId().ComponentIdList.fromArray(unmergedComponents.map(u => _componentId().ComponentID.fromObject(u.id)));
|
package/dist/filter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_componentId","data","require","_pMapSeries","_interopRequireDefault","_lodash","e","__esModule","default","statesFilter","exports","Filter","constructor","workspace","by","criteria","ids","includes","byMultiParamState","byState","state","statePerMethod","new","byNew","modified","byModified","deprecated","byDeprecated","deleted","byDeleted","snappedOnMain","bySnappedOnMain","softTagged","bySoftTagged","codeModified","byCodeModified","localOnly","byLocalOnly","Error","join","bind","stateSplit","split","length","stateName","stateParams","byEnv","env","withinIds","listIds","comps","getMany","compsUsingEnv","filter","c","envId","envs","getEnvId","envIdWithoutVer","ComponentID","getStringWithoutVersion","map","id","modifiedIds","Promise","all","comp","isModified","undefined","compact","compFiles","pMapSeries","getFilesModification","bitMap","getBitmapEntry","ignoreVersion","hasVersion","results","modelComponent","consumer","scope","getModelComponentIfExist","isDeprecated","objects","deletedIds","isDeleted","byDuringMergeState","unmergedComponents","legacyScope","getComponents","ComponentIdList","fromArray","u","fromObject","isOnMain","compIds","componentsFromModel","getModelComps","compsDuringMerge","listLocalOnly","hasWithoutVersion","toComponentId","isHeadSnap","toComponentIdWithHead","withCompIds","components","nextVersion","getBitObjectModelComponent"],"sources":["filter.ts"],"sourcesContent":["import { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport pMapSeries from 'p-map-series';\nimport type { ModelComponent } from '@teambit/objects';\nimport { compact } from 'lodash';\nimport type { Workspace } from './workspace';\n\nexport const statesFilter = [\n 'new',\n 'modified',\n 'deprecated',\n 'deleted',\n 'snappedOnMain',\n 'softTagged',\n 'codeModified',\n 'localOnly',\n] as const;\nexport type StatesFilter = (typeof statesFilter)[number];\n\nexport class Filter {\n constructor(private workspace: Workspace) {}\n\n async by(criteria: StatesFilter | string, ids: ComponentID[]): Promise<ComponentID[]> {\n return criteria.includes(':') ? this.byMultiParamState(criteria, ids) : this.byState(criteria as StatesFilter, ids);\n }\n\n async byState(state: StatesFilter, ids: ComponentID[]): Promise<ComponentID[]> {\n const statePerMethod = {\n new: this.byNew,\n modified: this.byModified,\n deprecated: this.byDeprecated,\n deleted: this.byDeleted,\n snappedOnMain: this.bySnappedOnMain,\n softTagged: this.bySoftTagged,\n codeModified: this.byCodeModified,\n localOnly: this.byLocalOnly,\n };\n if (!statePerMethod[state]) {\n throw new Error(`state ${state} is not recognized, possible values: ${statesFilter.join(', ')}`);\n }\n return statePerMethod[state].bind(this)(ids);\n }\n\n async byMultiParamState(state: string, ids: ComponentID[]): Promise<ComponentID[]> {\n const stateSplit = state.split(':');\n if (stateSplit.length < 2) {\n throw new Error(`byMultiParamState expect the state to have at least one param after the colon, got ${state}`);\n }\n const [stateName, ...stateParams] = stateSplit;\n if (stateName === 'env') {\n return this.byEnv(stateParams[0], ids);\n }\n throw new Error(`byMultiParamState expect the state to be one of the following: ['env'], got ${stateName}`);\n }\n\n async byEnv(env: string, withinIds?: ComponentID[]): Promise<ComponentID[]> {\n const ids = withinIds || this.workspace.listIds();\n const comps = await this.workspace.getMany(ids);\n const compsUsingEnv = comps.filter((c) => {\n const envId = this.workspace.envs.getEnvId(c);\n if (envId === env) return true;\n // try without version\n const envIdWithoutVer = ComponentID.getStringWithoutVersion(envId);\n return envIdWithoutVer === env;\n });\n return compsUsingEnv.map((c) => c.id);\n }\n\n async byModified(withinIds?: ComponentID[]): Promise<ComponentID[]> {\n const ids = withinIds || (await this.workspace.listIds());\n const comps = await this.workspace.getMany(ids);\n const modifiedIds = await Promise.all(comps.map(async (comp) => ((await comp.isModified()) ? comp.id : undefined)));\n return compact(modifiedIds);\n }\n\n async byCodeModified(withinIds?: ComponentID[]): Promise<ComponentID[]> {\n const ids = withinIds || (await this.workspace.listIds());\n const compFiles = await pMapSeries(ids, (id) => this.workspace.getFilesModification(id));\n const modifiedIds = compFiles.filter((c) => c.isModified()).map((c) => c.id);\n return compact(modifiedIds);\n }\n\n byLocalOnly(withinIds?: ComponentID[]): ComponentID[] {\n const ids = withinIds || this.workspace.listIds();\n return ids.filter((id) => this.workspace.bitMap.getBitmapEntry(id, { ignoreVersion: true }).localOnly);\n }\n\n async byNew(withinIds?: ComponentID[]): Promise<ComponentID[]> {\n const ids = withinIds || (await this.workspace.listIds());\n return ids.filter((id) => !id.hasVersion());\n }\n\n async byDeprecated(withinIds?: ComponentID[]) {\n const ids = withinIds || (await this.workspace.listIds());\n const comps = await this.workspace.getMany(ids);\n const results = await Promise.all(\n comps.map(async (c) => {\n const modelComponent = await this.workspace.consumer.scope.getModelComponentIfExist(c.id);\n const deprecated = await modelComponent?.isDeprecated(this.workspace.consumer.scope.objects);\n return deprecated ? c.id : null;\n })\n );\n return compact(results);\n }\n\n async byDeleted(withinIds?: ComponentID[]) {\n const ids = withinIds || (await this.workspace.listIds());\n const comps = await this.workspace.getMany(ids);\n const deletedIds = comps.filter((c) => c.isDeleted()).map((c) => c.id);\n return compact(deletedIds);\n }\n\n byDuringMergeState(): ComponentIdList {\n const unmergedComponents = this.workspace.scope.legacyScope.objects.unmergedComponents.getComponents();\n return ComponentIdList.fromArray(unmergedComponents.map((u) => ComponentID.fromObject(u.id)));\n }\n\n /**\n * list components that their head is a snap, not a tag.\n * this is relevant only when the lane is the default (main), otherwise, the head is always a snap.\n * components that are during-merge are filtered out, we don't want them during tag and don't want\n * to show them in the \"snapped\" section in bit-status.\n */\n async bySnappedOnMain(withinIds?: ComponentID[]) {\n if (!this.workspace.isOnMain()) {\n return [];\n }\n const ids = withinIds || (await this.workspace.listIds());\n const compIds = ComponentIdList.fromArray(ids);\n const componentsFromModel = await this.getModelComps(ids);\n const compsDuringMerge = this.byDuringMergeState();\n const localOnly = this.workspace.listLocalOnly();\n const comps = componentsFromModel\n .filter((c) => compIds.hasWithoutVersion(c.toComponentId()))\n .filter((c) => !compsDuringMerge.hasWithoutVersion(c.toComponentId()))\n .filter((c) => !localOnly.hasWithoutVersion(c.toComponentId()))\n .filter((c) => c.isHeadSnap());\n return comps.map((c) => c.toComponentIdWithHead());\n }\n\n bySoftTagged(withinIds?: ComponentID[]): ComponentID[] {\n const withCompIds = ComponentIdList.fromArray(withinIds || []);\n const all = this.workspace.consumer.bitMap.components.filter((c) => c.nextVersion).map((c) => c.id);\n return withinIds ? all.filter((id) => withCompIds.hasWithoutVersion(id)) : all;\n }\n\n private async getModelComps(ids: ComponentID[]): Promise<ModelComponent[]> {\n const comps = await Promise.all(ids.map((id) => this.worksp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;IACzE,MAAMkC,KAAK,GAAG,MAAMc,OAAO,CAACC,GAAG,CAACjD,GAAG,CAAC6C,GAAG,CAAEC,EAAE,IAAK,IAAI,CAACjD,SAAS,CAACmE,KAAK,CAAC2B,0BAA0B,CAAC7C,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;IAC5G,OAAO,IAAAO,iBAAO,EAACnB,KAAK,CAAC;EACvB;AACF;AAACxC,OAAA,CAAAC,MAAA,GAAAA,MAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_componentId","data","require","_pMapSeries","_interopRequireDefault","_lodash","e","__esModule","default","statesFilter","exports","Filter","constructor","workspace","by","criteria","ids","includes","byMultiParamState","byState","state","statePerMethod","new","byNew","modified","byModified","deprecated","byDeprecated","deleted","byDeleted","internal","byInternal","snappedOnMain","bySnappedOnMain","softTagged","bySoftTagged","codeModified","byCodeModified","localOnly","byLocalOnly","Error","join","bind","stateSplit","split","length","stateName","stateParams","byEnv","env","withinIds","listIds","comps","getMany","compsUsingEnv","filter","c","envId","envs","getEnvId","envIdWithoutVer","ComponentID","getStringWithoutVersion","map","id","modifiedIds","Promise","all","comp","isModified","undefined","compact","compFiles","pMapSeries","getFilesModification","bitMap","getBitmapEntry","ignoreVersion","hasVersion","results","modelComponent","consumer","scope","getModelComponentIfExist","isDeprecated","objects","deletedIds","isDeleted","bitmapEntry","getBitmapEntryIfExist","isInternal","isUninternalized","byDuringMergeState","unmergedComponents","legacyScope","getComponents","ComponentIdList","fromArray","u","fromObject","isOnMain","compIds","componentsFromModel","getModelComps","compsDuringMerge","listLocalOnly","hasWithoutVersion","toComponentId","isHeadSnap","toComponentIdWithHead","withCompIds","components","nextVersion","getBitObjectModelComponent"],"sources":["filter.ts"],"sourcesContent":["import { ComponentID, ComponentIdList } from '@teambit/component-id';\nimport pMapSeries from 'p-map-series';\nimport type { ModelComponent } from '@teambit/objects';\nimport { compact } from 'lodash';\nimport type { Workspace } from './workspace';\n\nexport const statesFilter = [\n 'new',\n 'modified',\n 'deprecated',\n 'deleted',\n 'internal',\n 'snappedOnMain',\n 'softTagged',\n 'codeModified',\n 'localOnly',\n] as const;\nexport type StatesFilter = (typeof statesFilter)[number];\n\nexport class Filter {\n constructor(private workspace: Workspace) {}\n\n async by(criteria: StatesFilter | string, ids: ComponentID[]): Promise<ComponentID[]> {\n return criteria.includes(':') ? this.byMultiParamState(criteria, ids) : this.byState(criteria as StatesFilter, ids);\n }\n\n async byState(state: StatesFilter, ids: ComponentID[]): Promise<ComponentID[]> {\n const statePerMethod = {\n new: this.byNew,\n modified: this.byModified,\n deprecated: this.byDeprecated,\n deleted: this.byDeleted,\n internal: this.byInternal,\n snappedOnMain: this.bySnappedOnMain,\n softTagged: this.bySoftTagged,\n codeModified: this.byCodeModified,\n localOnly: this.byLocalOnly,\n };\n if (!statePerMethod[state]) {\n throw new Error(`state ${state} is not recognized, possible values: ${statesFilter.join(', ')}`);\n }\n return statePerMethod[state].bind(this)(ids);\n }\n\n async byMultiParamState(state: string, ids: ComponentID[]): Promise<ComponentID[]> {\n const stateSplit = state.split(':');\n if (stateSplit.length < 2) {\n throw new Error(`byMultiParamState expect the state to have at least one param after the colon, got ${state}`);\n }\n const [stateName, ...stateParams] = stateSplit;\n if (stateName === 'env') {\n return this.byEnv(stateParams[0], ids);\n }\n throw new Error(`byMultiParamState expect the state to be one of the following: ['env'], got ${stateName}`);\n }\n\n async byEnv(env: string, withinIds?: ComponentID[]): Promise<ComponentID[]> {\n const ids = withinIds || this.workspace.listIds();\n const comps = await this.workspace.getMany(ids);\n const compsUsingEnv = comps.filter((c) => {\n const envId = this.workspace.envs.getEnvId(c);\n if (envId === env) return true;\n // try without version\n const envIdWithoutVer = ComponentID.getStringWithoutVersion(envId);\n return envIdWithoutVer === env;\n });\n return compsUsingEnv.map((c) => c.id);\n }\n\n async byModified(withinIds?: ComponentID[]): Promise<ComponentID[]> {\n const ids = withinIds || (await this.workspace.listIds());\n const comps = await this.workspace.getMany(ids);\n const modifiedIds = await Promise.all(comps.map(async (comp) => ((await comp.isModified()) ? comp.id : undefined)));\n return compact(modifiedIds);\n }\n\n async byCodeModified(withinIds?: ComponentID[]): Promise<ComponentID[]> {\n const ids = withinIds || (await this.workspace.listIds());\n const compFiles = await pMapSeries(ids, (id) => this.workspace.getFilesModification(id));\n const modifiedIds = compFiles.filter((c) => c.isModified()).map((c) => c.id);\n return compact(modifiedIds);\n }\n\n byLocalOnly(withinIds?: ComponentID[]): ComponentID[] {\n const ids = withinIds || this.workspace.listIds();\n return ids.filter((id) => this.workspace.bitMap.getBitmapEntry(id, { ignoreVersion: true }).localOnly);\n }\n\n async byNew(withinIds?: ComponentID[]): Promise<ComponentID[]> {\n const ids = withinIds || (await this.workspace.listIds());\n return ids.filter((id) => !id.hasVersion());\n }\n\n async byDeprecated(withinIds?: ComponentID[]) {\n const ids = withinIds || (await this.workspace.listIds());\n const comps = await this.workspace.getMany(ids);\n const results = await Promise.all(\n comps.map(async (c) => {\n const modelComponent = await this.workspace.consumer.scope.getModelComponentIfExist(c.id);\n const deprecated = await modelComponent?.isDeprecated(this.workspace.consumer.scope.objects);\n return deprecated ? c.id : null;\n })\n );\n return compact(results);\n }\n\n async byDeleted(withinIds?: ComponentID[]) {\n const ids = withinIds || (await this.workspace.listIds());\n const comps = await this.workspace.getMany(ids);\n const deletedIds = comps.filter((c) => c.isDeleted()).map((c) => c.id);\n return compact(deletedIds);\n }\n\n async byInternal(withinIds?: ComponentID[]) {\n const ids = withinIds || (await this.workspace.listIds());\n const results = await Promise.all(\n ids.map(async (id) => {\n const bitmapEntry = this.workspace.bitMap.getBitmapEntryIfExist(id, { ignoreVersion: true });\n if (bitmapEntry?.isInternal()) return id;\n if (bitmapEntry?.isUninternalized()) return null;\n const modelComponent = await this.workspace.consumer.scope.getModelComponentIfExist(id);\n const internal = await modelComponent?.isInternal(this.workspace.consumer.scope.objects);\n return internal ? id : null;\n })\n );\n return compact(results);\n }\n\n byDuringMergeState(): ComponentIdList {\n const unmergedComponents = this.workspace.scope.legacyScope.objects.unmergedComponents.getComponents();\n return ComponentIdList.fromArray(unmergedComponents.map((u) => ComponentID.fromObject(u.id)));\n }\n\n /**\n * list components that their head is a snap, not a tag.\n * this is relevant only when the lane is the default (main), otherwise, the head is always a snap.\n * components that are during-merge are filtered out, we don't want them during tag and don't want\n * to show them in the \"snapped\" section in bit-status.\n */\n async bySnappedOnMain(withinIds?: ComponentID[]) {\n if (!this.workspace.isOnMain()) {\n return [];\n }\n const ids = withinIds || (await this.workspace.listIds());\n const compIds = ComponentIdList.fromArray(ids);\n const componentsFromModel = await this.getModelComps(ids);\n const compsDuringMerge = this.byDuringMergeState();\n const localOnly = this.workspace.listLocalOnly();\n const comps = componentsFromModel\n .filter((c) => compIds.hasWithoutVersion(c.toComponentId()))\n .filter((c) => !compsDuringMerge.hasWithoutVersion(c.toComponentId()))\n .filter((c) => !localOnly.hasWithoutVersion(c.toComponentId()))\n .filter((c) => c.isHeadSnap());\n return comps.map((c) => c.toComponentIdWithHead());\n }\n\n bySoftTagged(withinIds?: ComponentID[]): ComponentID[] {\n const withCompIds = ComponentIdList.fromArray(withinIds || []);\n const all = this.workspace.consumer.bitMap.components.filter((c) => c.nextVersion).map((c) => c.id);\n return withinIds ? all.filter((id) => withCompIds.hasWithoutVersion(id)) : all;\n }\n\n private async getModelComps(ids: ComponentID[]): Promise<ModelComponent[]> {\n const comps = await Promise.all(ids.map((id) => this.workspace.scope.getBitObjectModelComponent(id, false)));\n return compact(comps);\n }\n}\n"],"mappings":";;;;;;AAAA,SAAAA,aAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,YAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,QAAA;E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EP,CAAC,IAAKA,CAAC,CAACqD,qBAAqB,CAAC,CAAC,CAAC;EACpD;EAEA1E,YAAYA,CAACe,SAAyB,EAAiB;IACrD,MAAM4D,WAAW,GAAGd,8BAAe,CAACC,SAAS,CAAC/C,SAAS,IAAI,EAAE,CAAC;IAC9D,MAAMiB,GAAG,GAAG,IAAI,CAACtD,SAAS,CAACoE,QAAQ,CAACN,MAAM,CAACoC,UAAU,CAACxD,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACwD,WAAW,CAAC,CAACjD,GAAG,CAAEP,CAAC,IAAKA,CAAC,CAACQ,EAAE,CAAC;IACnG,OAAOd,SAAS,GAAGiB,GAAG,CAACZ,MAAM,CAAES,EAAE,IAAK8C,WAAW,CAACJ,iBAAiB,CAAC1C,EAAE,CAAC,CAAC,GAAGG,GAAG;EAChF;EAEA,MAAcoC,aAAaA,CAACvF,GAAkB,EAA6B;IACzE,MAAMoC,KAAK,GAAG,MAAMc,OAAO,CAACC,GAAG,CAACnD,GAAG,CAAC+C,GAAG,CAAEC,EAAE,IAAK,IAAI,CAACnD,SAAS,CAACqE,KAAK,CAAC+B,0BAA0B,CAACjD,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;IAC5G,OAAO,IAAAO,iBAAO,EAACnB,KAAK,CAAC;EACvB;AACF;AAAC1C,OAAA,CAAAC,MAAA,GAAAA,MAAA","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.
|
|
2
|
-
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.
|
|
1
|
+
import * as compositions_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.1002/dist/workspace.composition.js';
|
|
2
|
+
import * as overview_0 from '/home/circleci/Library/Caches/Bit/capsules/8891be5ad/teambit.workspace_workspace@1.0.1002/dist/workspace.docs.mdx';
|
|
3
3
|
|
|
4
4
|
export const compositions = [compositions_0];
|
|
5
5
|
export const overview = [overview_0];
|
|
@@ -7,8 +7,8 @@ type UseWorkspaceOptions = {
|
|
|
7
7
|
onComponentRemoved?: (compId: ComponentID[]) => void;
|
|
8
8
|
};
|
|
9
9
|
export declare function useWorkspace(options?: UseWorkspaceOptions): {
|
|
10
|
-
errors?: ReadonlyArray<import("graphql").GraphQLFormattedError> | undefined;
|
|
11
10
|
error?: import("@apollo/client").ApolloError | undefined;
|
|
11
|
+
errors?: ReadonlyArray<import("graphql").GraphQLFormattedError> | undefined;
|
|
12
12
|
client: import("@apollo/client").ApolloClient<any>;
|
|
13
13
|
loading: boolean;
|
|
14
14
|
variables: import("@apollo/client").OperationVariables | undefined;
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/workspace",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1002",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/workspace/workspace",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.workspace",
|
|
8
8
|
"name": "workspace",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.1002"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"lodash": "4.17.21",
|
|
@@ -30,40 +30,20 @@
|
|
|
30
30
|
"reset-css": "5.0.1",
|
|
31
31
|
"@teambit/component-id": "1.2.4",
|
|
32
32
|
"@teambit/harmony": "0.4.7",
|
|
33
|
-
"@teambit/legacy.extension-data": "0.0.120",
|
|
34
|
-
"@teambit/legacy.scope": "0.0.118",
|
|
35
33
|
"@teambit/component-version": "1.0.4",
|
|
36
|
-
"@teambit/legacy.consumer-component": "0.0.119",
|
|
37
|
-
"@teambit/legacy.consumer": "0.0.118",
|
|
38
34
|
"@teambit/bit-error": "0.0.404",
|
|
39
35
|
"@teambit/lane-id": "0.0.312",
|
|
40
|
-
"@teambit/legacy.bit-map": "0.0.175",
|
|
41
36
|
"@teambit/toolbox.fs.last-modified": "0.0.15",
|
|
42
37
|
"@teambit/toolbox.path.path": "0.0.17",
|
|
43
38
|
"@teambit/graph.cleargraph": "0.0.11",
|
|
44
|
-
"@teambit/logger": "0.0.1421",
|
|
45
|
-
"@teambit/cli": "0.0.1328",
|
|
46
39
|
"@teambit/component.ui.component-status-resolver": "0.0.510",
|
|
47
|
-
"@teambit/legacy.constants": "0.0.27",
|
|
48
40
|
"@teambit/harmony.modules.resolved-component": "0.0.514",
|
|
49
41
|
"@teambit/legacy.utils": "0.0.38",
|
|
50
|
-
"@teambit/scope.remotes": "0.0.118",
|
|
51
|
-
"@teambit/config-store": "0.0.209",
|
|
52
|
-
"@teambit/config": "0.0.1503",
|
|
53
42
|
"@teambit/harmony.modules.requireable-component": "0.0.514",
|
|
54
43
|
"@teambit/toolbox.modules.module-resolver": "0.0.20",
|
|
55
|
-
"@teambit/workspace.modules.node-modules-linker": "0.0.349",
|
|
56
|
-
"@teambit/global-config": "0.0.1332",
|
|
57
|
-
"@teambit/legacy.consumer-config": "0.0.118",
|
|
58
|
-
"@teambit/variants": "0.0.1596",
|
|
59
44
|
"@teambit/component-issues": "0.0.172",
|
|
60
|
-
"@teambit/component.sources": "0.0.170",
|
|
61
45
|
"@teambit/dependencies.modules.packages-excluder": "1.0.8",
|
|
62
|
-
"@teambit/git.modules.git-executable": "0.0.28",
|
|
63
|
-
"@teambit/harmony.modules.in-memory-cache": "0.0.31",
|
|
64
46
|
"@teambit/legacy-bit-id": "1.1.3",
|
|
65
|
-
"@teambit/legacy.component-list": "0.0.172",
|
|
66
|
-
"@teambit/legacy.scope-api": "0.0.173",
|
|
67
47
|
"@teambit/toolbox.path.is-path-inside": "0.0.509",
|
|
68
48
|
"@teambit/workspace.modules.match-pattern": "0.0.521",
|
|
69
49
|
"@teambit/component.ui.component-drawer": "0.0.482",
|
|
@@ -81,7 +61,6 @@
|
|
|
81
61
|
"@teambit/ui-foundation.ui.menu": "0.0.503",
|
|
82
62
|
"@teambit/ui-foundation.ui.react-router.slot-router": "0.0.523",
|
|
83
63
|
"@teambit/ui-foundation.ui.tree.drawer": "1.0.0",
|
|
84
|
-
"@teambit/harmony.modules.concurrency": "0.0.28",
|
|
85
64
|
"@teambit/toolbox.promise.map-pool": "0.0.15",
|
|
86
65
|
"@teambit/base-react.themes.theme-switcher": "1.1.2",
|
|
87
66
|
"@teambit/ui-foundation.ui.hooks.use-data-query": "0.0.506",
|
|
@@ -106,23 +85,44 @@
|
|
|
106
85
|
"@teambit/cloud.hooks.use-cloud-scopes": "0.0.21",
|
|
107
86
|
"@teambit/explorer.ui.gallery.component-grid": "0.0.496",
|
|
108
87
|
"@teambit/workspace.ui.empty-workspace": "0.0.509",
|
|
109
|
-
"@teambit/component": "1.0.
|
|
110
|
-
"@teambit/dependency-resolver": "1.0.
|
|
111
|
-
"@teambit/envs": "1.0.
|
|
112
|
-
"@teambit/
|
|
113
|
-
"@teambit/scope": "
|
|
114
|
-
"@teambit/
|
|
115
|
-
"@teambit/
|
|
116
|
-
"@teambit/
|
|
117
|
-
"@teambit/
|
|
118
|
-
"@teambit/
|
|
119
|
-
"@teambit/
|
|
120
|
-
"@teambit/
|
|
121
|
-
"@teambit/
|
|
122
|
-
"@teambit/
|
|
123
|
-
"@teambit/
|
|
124
|
-
"@teambit/
|
|
125
|
-
"@teambit/
|
|
88
|
+
"@teambit/component": "1.0.1002",
|
|
89
|
+
"@teambit/dependency-resolver": "1.0.1002",
|
|
90
|
+
"@teambit/envs": "1.0.1002",
|
|
91
|
+
"@teambit/legacy.extension-data": "0.0.121",
|
|
92
|
+
"@teambit/legacy.scope": "0.0.119",
|
|
93
|
+
"@teambit/legacy.consumer-component": "0.0.120",
|
|
94
|
+
"@teambit/legacy.consumer": "0.0.119",
|
|
95
|
+
"@teambit/legacy.bit-map": "0.0.176",
|
|
96
|
+
"@teambit/logger": "0.0.1422",
|
|
97
|
+
"@teambit/objects": "0.0.509",
|
|
98
|
+
"@teambit/scope": "1.0.1002",
|
|
99
|
+
"@teambit/graph": "1.0.1002",
|
|
100
|
+
"@teambit/cli": "0.0.1329",
|
|
101
|
+
"@teambit/isolator": "1.0.1002",
|
|
102
|
+
"@teambit/component-tree": "1.0.1002",
|
|
103
|
+
"@teambit/legacy.constants": "0.0.28",
|
|
104
|
+
"@teambit/watcher": "1.0.1002",
|
|
105
|
+
"@teambit/scope.remotes": "0.0.119",
|
|
106
|
+
"@teambit/aspect-loader": "1.0.1002",
|
|
107
|
+
"@teambit/config-store": "0.0.210",
|
|
108
|
+
"@teambit/config": "0.0.1504",
|
|
109
|
+
"@teambit/workspace.modules.node-modules-linker": "0.0.350",
|
|
110
|
+
"@teambit/graphql": "1.0.1002",
|
|
111
|
+
"@teambit/bundler": "1.0.1002",
|
|
112
|
+
"@teambit/global-config": "0.0.1333",
|
|
113
|
+
"@teambit/legacy.consumer-config": "0.0.119",
|
|
114
|
+
"@teambit/ui": "1.0.1002",
|
|
115
|
+
"@teambit/variants": "0.0.1597",
|
|
116
|
+
"@teambit/component.sources": "0.0.171",
|
|
117
|
+
"@teambit/git.modules.git-executable": "0.0.29",
|
|
118
|
+
"@teambit/harmony.modules.in-memory-cache": "0.0.32",
|
|
119
|
+
"@teambit/legacy.component-list": "0.0.173",
|
|
120
|
+
"@teambit/legacy.scope-api": "0.0.174",
|
|
121
|
+
"@teambit/command-bar": "1.0.1002",
|
|
122
|
+
"@teambit/sidebar": "1.0.1002",
|
|
123
|
+
"@teambit/pubsub": "1.0.1002",
|
|
124
|
+
"@teambit/harmony.modules.concurrency": "0.0.29",
|
|
125
|
+
"@teambit/deprecation": "1.0.1002"
|
|
126
126
|
},
|
|
127
127
|
"devDependencies": {
|
|
128
128
|
"@types/lodash": "4.14.165",
|