@teambit/workspace 0.0.881 → 0.0.882
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/bit-map.js +10 -51
- package/dist/bit-map.js.map +1 -1
- package/dist/build-graph-from-fs.js +1 -53
- package/dist/build-graph-from-fs.js.map +1 -1
- package/dist/capsule.cmd.js +2 -34
- package/dist/capsule.cmd.js.map +1 -1
- package/dist/component-config-file/component-config-file.js +2 -60
- package/dist/component-config-file/component-config-file.js.map +1 -1
- package/dist/component-config-file/exceptions/already-exists.js +0 -6
- package/dist/component-config-file/exceptions/already-exists.js.map +1 -1
- package/dist/component-config-file/exceptions/index.js +0 -3
- package/dist/component-config-file/exceptions/index.js.map +1 -1
- package/dist/component-config-file/index.js +0 -6
- package/dist/component-config-file/index.js.map +1 -1
- package/dist/component-tree.widget.js +0 -18
- package/dist/component-tree.widget.js.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/eject-conf.cmd.js +0 -23
- package/dist/eject-conf.cmd.js.map +1 -1
- package/dist/envs-subcommands/envs-replace.cmd.js +0 -13
- package/dist/envs-subcommands/envs-replace.cmd.js.map +1 -1
- package/dist/envs-subcommands/envs-set.cmd.js +0 -16
- package/dist/envs-subcommands/envs-set.cmd.js.map +1 -1
- package/dist/envs-subcommands/envs-unset.cmd.js +0 -18
- package/dist/envs-subcommands/envs-unset.cmd.js.map +1 -1
- package/dist/events/index.js +0 -6
- package/dist/events/index.js.map +1 -1
- package/dist/events/on-component-add-event.js +1 -12
- package/dist/events/on-component-add-event.js.map +1 -1
- package/dist/events/on-component-change-event.js +1 -12
- package/dist/events/on-component-change-event.js.map +1 -1
- package/dist/events/on-component-removed-event.js +1 -12
- package/dist/events/on-component-removed-event.js.map +1 -1
- package/dist/exceptions/incorrect-env-aspect.js +0 -6
- package/dist/exceptions/incorrect-env-aspect.js.map +1 -1
- package/dist/index.js +0 -19
- package/dist/index.js.map +1 -1
- package/dist/list.cmd.js +2 -15
- package/dist/list.cmd.js.map +1 -1
- package/dist/pattern.cmd.js +0 -16
- package/dist/pattern.cmd.js.map +1 -1
- package/dist/scope-subcommands/scope-set.cmd.js +0 -17
- package/dist/scope-subcommands/scope-set.cmd.js.map +1 -1
- package/dist/ui/index.js +0 -3
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/workspace/default-component.js.map +1 -1
- package/dist/ui/workspace/index.js +0 -2
- package/dist/ui/workspace/index.js.map +1 -1
- package/dist/ui/workspace/use-workspace.js +14 -49
- package/dist/ui/workspace/use-workspace.js.map +1 -1
- package/dist/ui/workspace/workspace-context.js +0 -7
- package/dist/ui/workspace/workspace-context.js.map +1 -1
- package/dist/ui/workspace/workspace-model.js +2 -14
- package/dist/ui/workspace/workspace-model.js.map +1 -1
- package/dist/ui/workspace/workspace-overview/index.js +0 -3
- package/dist/ui/workspace/workspace-overview/index.js.map +1 -1
- package/dist/ui/workspace/workspace-overview/workspace-overview.js +0 -23
- package/dist/ui/workspace/workspace-overview/workspace-overview.js.map +1 -1
- package/dist/ui/workspace/workspace-provider.js +0 -8
- package/dist/ui/workspace/workspace-provider.js.map +1 -1
- package/dist/ui/workspace/workspace.js +2 -52
- package/dist/ui/workspace/workspace.js.map +1 -1
- package/dist/use.cmd.js +0 -13
- package/dist/use.cmd.js.map +1 -1
- package/dist/watch/check-types.js +0 -1
- package/dist/watch/check-types.js.map +1 -1
- package/dist/watch/output-formatter.js +1 -12
- package/dist/watch/output-formatter.js.map +1 -1
- package/dist/watch/watch-queue.js +0 -13
- package/dist/watch/watch-queue.js.map +1 -1
- package/dist/watch/watch.cmd.js +6 -41
- package/dist/watch/watch.cmd.js.map +1 -1
- package/dist/watch/watcher.js +13 -133
- package/dist/watch/watcher.js.map +1 -1
- package/dist/workspace-component/component-status.js +0 -4
- package/dist/workspace-component/component-status.js.map +1 -1
- package/dist/workspace-component/index.js +0 -6
- package/dist/workspace-component/index.js.map +1 -1
- package/dist/workspace-component/workspace-component-loader.js +21 -114
- package/dist/workspace-component/workspace-component-loader.js.map +1 -1
- package/dist/workspace-component/workspace-component.js +1 -11
- package/dist/workspace-component/workspace-component.js.map +1 -1
- package/dist/workspace-section.js +2 -0
- package/dist/workspace-section.js.map +1 -1
- package/dist/workspace.aspect.js +0 -5
- package/dist/workspace.aspect.js.map +1 -1
- package/dist/workspace.composition.js +0 -6
- package/dist/workspace.composition.js.map +1 -1
- package/dist/workspace.graphql.js +0 -12
- package/dist/workspace.graphql.js.map +1 -1
- package/dist/workspace.js +134 -545
- package/dist/workspace.js.map +1 -1
- package/dist/workspace.main.runtime.js +0 -55
- package/dist/workspace.main.runtime.js.map +1 -1
- package/dist/workspace.provider.js +8 -77
- package/dist/workspace.provider.js.map +1 -1
- package/dist/workspace.ui-root.js +3 -17
- package/dist/workspace.ui-root.js.map +1 -1
- package/dist/workspace.ui.drawer.js +2 -24
- package/dist/workspace.ui.drawer.js.map +1 -1
- package/dist/workspace.ui.runtime.js +0 -75
- package/dist/workspace.ui.runtime.js.map +1 -1
- package/package-tar/teambit-workspace-0.0.882.tgz +0 -0
- package/package.json +18 -18
- package/{preview-1666409808293.js → preview-1666496165706.js} +2 -2
- package/package-tar/teambit-workspace-0.0.881.tgz +0 -0
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.promise.js");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.WorkspaceComponent = void 0;
|
|
9
|
-
|
|
10
8
|
function _component() {
|
|
11
9
|
const data = require("@teambit/component");
|
|
12
|
-
|
|
13
10
|
_component = function () {
|
|
14
11
|
return data;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
13
|
return data;
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
// TODO: refactor this to a composition rather than to use inheritance
|
|
21
16
|
class WorkspaceComponent extends _component().Component {
|
|
22
17
|
constructor(
|
|
@@ -46,25 +41,20 @@ class WorkspaceComponent extends _component().Component {
|
|
|
46
41
|
this.tags = tags;
|
|
47
42
|
this.workspace = workspace;
|
|
48
43
|
}
|
|
49
|
-
|
|
50
44
|
async getStatus() {
|
|
51
45
|
return this.workspace.getComponentStatus(this);
|
|
52
46
|
}
|
|
47
|
+
|
|
53
48
|
/**
|
|
54
49
|
* get all issues reported on the component.
|
|
55
50
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
58
51
|
getIssues() {
|
|
59
52
|
return this.workspace.getComponentIssues(this);
|
|
60
53
|
}
|
|
61
|
-
|
|
62
54
|
static fromComponent(component, workspace) {
|
|
63
55
|
return new WorkspaceComponent(component.id, component.head, component.state, component.tags, workspace);
|
|
64
56
|
}
|
|
65
|
-
|
|
66
57
|
}
|
|
67
|
-
|
|
68
58
|
exports.WorkspaceComponent = WorkspaceComponent;
|
|
69
59
|
|
|
70
60
|
//# sourceMappingURL=workspace-component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WorkspaceComponent","Component","constructor","id","head","workspaceState","tags","TagMap","workspace","getStatus","getComponentStatus","getIssues","getComponentIssues","fromComponent","component","state"],"sources":["workspace-component.ts"],"sourcesContent":["import { Component, ComponentID, Snap, State, TagMap } from '@teambit/component';\nimport { IssuesList } from '@teambit/component-issues';\nimport { Workspace } from '../workspace';\nimport { ComponentStatus } from './component-status';\n\n// TODO: refactor this to a composition rather than to use inheritance\nexport class WorkspaceComponent extends Component {\n constructor(\n /**\n * component ID represented by the `ComponentId` type.\n */\n readonly id: ComponentID,\n\n /**\n * head version of the component. can be `null` for new components.\n */\n readonly head: Snap | null = null,\n\n /**\n * state of the component.\n */\n workspaceState: State,\n\n /**\n * tags of the component.\n */\n readonly tags: TagMap = new TagMap(),\n\n /**\n * workspace extension.\n */\n readonly workspace: Workspace\n ) {\n super(id, head, workspaceState, tags, workspace);\n }\n\n async getStatus(): Promise<ComponentStatus> {\n return this.workspace.getComponentStatus(this);\n }\n\n /**\n * get all issues reported on the component.\n */\n getIssues(): IssuesList | null {\n return this.workspace.getComponentIssues(this);\n }\n\n static fromComponent(component: Component, workspace: Workspace) {\n return new WorkspaceComponent(component.id, component.head, component.state, component.tags, workspace);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["WorkspaceComponent","Component","constructor","id","head","workspaceState","tags","TagMap","workspace","getStatus","getComponentStatus","getIssues","getComponentIssues","fromComponent","component","state"],"sources":["workspace-component.ts"],"sourcesContent":["import { Component, ComponentID, Snap, State, TagMap } from '@teambit/component';\nimport { IssuesList } from '@teambit/component-issues';\nimport { Workspace } from '../workspace';\nimport { ComponentStatus } from './component-status';\n\n// TODO: refactor this to a composition rather than to use inheritance\nexport class WorkspaceComponent extends Component {\n constructor(\n /**\n * component ID represented by the `ComponentId` type.\n */\n readonly id: ComponentID,\n\n /**\n * head version of the component. can be `null` for new components.\n */\n readonly head: Snap | null = null,\n\n /**\n * state of the component.\n */\n workspaceState: State,\n\n /**\n * tags of the component.\n */\n readonly tags: TagMap = new TagMap(),\n\n /**\n * workspace extension.\n */\n readonly workspace: Workspace\n ) {\n super(id, head, workspaceState, tags, workspace);\n }\n\n async getStatus(): Promise<ComponentStatus> {\n return this.workspace.getComponentStatus(this);\n }\n\n /**\n * get all issues reported on the component.\n */\n getIssues(): IssuesList | null {\n return this.workspace.getComponentIssues(this);\n }\n\n static fromComponent(component: Component, workspace: Workspace) {\n return new WorkspaceComponent(component.id, component.head, component.state, component.tags, workspace);\n }\n}\n"],"mappings":";;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAKA;AACO,MAAMA,kBAAkB,SAASC,sBAAS,CAAC;EAChDC,WAAW;EACT;AACJ;AACA;EACaC,EAAe;EAExB;AACJ;AACA;EACaC,IAAiB,GAAG,IAAI;EAEjC;AACJ;AACA;EACIC,cAAqB;EAErB;AACJ;AACA;EACaC,IAAY,GAAG,KAAIC,mBAAM,GAAE;EAEpC;AACJ;AACA;EACaC,SAAoB,EAC7B;IACA,KAAK,CAACL,EAAE,EAAEC,IAAI,EAAEC,cAAc,EAAEC,IAAI,EAAEE,SAAS,CAAC;IAAC,KAtBxCL,EAAe,GAAfA,EAAe;IAAA,KAKfC,IAAiB,GAAjBA,IAAiB;IAAA,KAUjBE,IAAY,GAAZA,IAAY;IAAA,KAKZE,SAAoB,GAApBA,SAAoB;EAG/B;EAEA,MAAMC,SAAS,GAA6B;IAC1C,OAAO,IAAI,CAACD,SAAS,CAACE,kBAAkB,CAAC,IAAI,CAAC;EAChD;;EAEA;AACF;AACA;EACEC,SAAS,GAAsB;IAC7B,OAAO,IAAI,CAACH,SAAS,CAACI,kBAAkB,CAAC,IAAI,CAAC;EAChD;EAEA,OAAOC,aAAa,CAACC,SAAoB,EAAEN,SAAoB,EAAE;IAC/D,OAAO,IAAIR,kBAAkB,CAACc,SAAS,CAACX,EAAE,EAAEW,SAAS,CAACV,IAAI,EAAEU,SAAS,CAACC,KAAK,EAAED,SAAS,CAACR,IAAI,EAAEE,SAAS,CAAC;EACzG;AACF;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["workspace-section.ts"],"sourcesContent":["// export class WorkspaceSection {\n// constructor(\n// readonly route: string\n// ) {}\n\n// toRoute() {\n// return {\n// path: this.toRoute\n// children:\n// };\n// }\n// };\n\n// export interface WorkspaceSection {}\n"],"mappings":"AAAA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"names":[],"sources":["workspace-section.ts"],"sourcesContent":["// export class WorkspaceSection {\n// constructor(\n// readonly route: string\n// ) {}\n\n// toRoute() {\n// return {\n// path: this.toRoute\n// children:\n// };\n// }\n// };\n\n// export interface WorkspaceSection {}\n"],"mappings":"AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AAAA"}
|
package/dist/workspace.aspect.js
CHANGED
|
@@ -4,23 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.WorkspaceAspect = void 0;
|
|
7
|
-
|
|
8
7
|
function _harmony() {
|
|
9
8
|
const data = require("@teambit/harmony");
|
|
10
|
-
|
|
11
9
|
_harmony = function () {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
const WorkspaceAspect = _harmony().Aspect.create({
|
|
19
15
|
id: 'teambit.workspace/workspace',
|
|
20
16
|
dependencies: [],
|
|
21
17
|
defaultConfig: {}
|
|
22
18
|
});
|
|
23
|
-
|
|
24
19
|
exports.WorkspaceAspect = WorkspaceAspect;
|
|
25
20
|
var _default = WorkspaceAspect;
|
|
26
21
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WorkspaceAspect","Aspect","create","id","dependencies","defaultConfig"],"sources":["workspace.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const WorkspaceAspect = Aspect.create({\n id: 'teambit.workspace/workspace',\n dependencies: [],\n defaultConfig: {},\n});\n\nexport default WorkspaceAspect;\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["WorkspaceAspect","Aspect","create","id","dependencies","defaultConfig"],"sources":["workspace.aspect.ts"],"sourcesContent":["import { Aspect } from '@teambit/harmony';\n\nexport const WorkspaceAspect = Aspect.create({\n id: 'teambit.workspace/workspace',\n dependencies: [],\n defaultConfig: {},\n});\n\nexport default WorkspaceAspect;\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,eAAe,GAAGC,iBAAM,CAACC,MAAM,CAAC;EAC3CC,EAAE,EAAE,6BAA6B;EACjCC,YAAY,EAAE,EAAE;EAChBC,aAAa,EAAE,CAAC;AAClB,CAAC,CAAC;AAAC;AAAA,eAEYL,eAAe;AAAA"}
|
|
@@ -1,22 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.Logo = void 0;
|
|
9
|
-
|
|
10
8
|
function _react() {
|
|
11
9
|
const data = _interopRequireDefault(require("react"));
|
|
12
|
-
|
|
13
10
|
_react = function () {
|
|
14
11
|
return data;
|
|
15
12
|
};
|
|
16
|
-
|
|
17
13
|
return data;
|
|
18
14
|
}
|
|
19
|
-
|
|
20
15
|
const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
|
|
21
16
|
style: {
|
|
22
17
|
height: '100%',
|
|
@@ -29,7 +24,6 @@ const Logo = () => /*#__PURE__*/_react().default.createElement("div", {
|
|
|
29
24
|
},
|
|
30
25
|
src: "https://static.bit.dev/extensions-icons/workspace.svg"
|
|
31
26
|
}));
|
|
32
|
-
|
|
33
27
|
exports.Logo = Logo;
|
|
34
28
|
|
|
35
29
|
//# sourceMappingURL=workspace.composition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Logo","height","display","justifyContent","width"],"sources":["workspace.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/workspace.svg\" />\n </div>\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["Logo","height","display","justifyContent","width"],"sources":["workspace.composition.tsx"],"sourcesContent":["import React from 'react';\n\nexport const Logo = () => (\n <div style={{ height: '100%', display: 'flex', justifyContent: 'center' }}>\n <img style={{ width: 70 }} src=\"https://static.bit.dev/extensions-icons/workspace.svg\" />\n </div>\n);\n"],"mappings":";;;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEO,MAAMA,IAAI,GAAG,mBAClB;EAAK,KAAK,EAAE;IAAEC,MAAM,EAAE,MAAM;IAAEC,OAAO,EAAE,MAAM;IAAEC,cAAc,EAAE;EAAS;AAAE,gBACxE;EAAK,KAAK,EAAE;IAAEC,KAAK,EAAE;EAAG,CAAE;EAAC,GAAG,EAAC;AAAuD,EAAG,CAE5F;AAAC"}
|
|
@@ -1,34 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
require("core-js/modules/es.promise.js");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
8
|
exports.default = void 0;
|
|
11
|
-
|
|
12
9
|
function _graphqlTag() {
|
|
13
10
|
const data = _interopRequireDefault(require("graphql-tag"));
|
|
14
|
-
|
|
15
11
|
_graphqlTag = function () {
|
|
16
12
|
return data;
|
|
17
13
|
};
|
|
18
|
-
|
|
19
14
|
return data;
|
|
20
15
|
}
|
|
21
|
-
|
|
22
16
|
function _workspace() {
|
|
23
17
|
const data = require("./workspace");
|
|
24
|
-
|
|
25
18
|
_workspace = function () {
|
|
26
19
|
return data;
|
|
27
20
|
};
|
|
28
|
-
|
|
29
21
|
return data;
|
|
30
22
|
}
|
|
31
|
-
|
|
32
23
|
var _default = (workspace, graphql) => {
|
|
33
24
|
return {
|
|
34
25
|
typeDefs: (0, _graphqlTag().default)`
|
|
@@ -128,12 +119,10 @@ var _default = (workspace, graphql) => {
|
|
|
128
119
|
},
|
|
129
120
|
issuesCount: wsComponent => {
|
|
130
121
|
var _wsComponent$getIssue;
|
|
131
|
-
|
|
132
122
|
return ((_wsComponent$getIssue = wsComponent.getIssues()) === null || _wsComponent$getIssue === void 0 ? void 0 : _wsComponent$getIssue.count) || 0;
|
|
133
123
|
},
|
|
134
124
|
issues: wsComponent => {
|
|
135
125
|
var _wsComponent$getIssue2;
|
|
136
|
-
|
|
137
126
|
return (_wsComponent$getIssue2 = wsComponent.getIssues()) === null || _wsComponent$getIssue2 === void 0 ? void 0 : _wsComponent$getIssue2.toObjectWithDataAsString();
|
|
138
127
|
}
|
|
139
128
|
},
|
|
@@ -168,7 +157,6 @@ var _default = (workspace, graphql) => {
|
|
|
168
157
|
}
|
|
169
158
|
};
|
|
170
159
|
};
|
|
171
|
-
|
|
172
160
|
exports.default = _default;
|
|
173
161
|
|
|
174
162
|
//# sourceMappingURL=workspace.graphql.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["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"],"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":"
|
|
1
|
+
{"version":3,"names":["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"],"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;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAA4F,eAG7E,CAACA,SAAoB,EAAEC,OAAoB,KAAK;EAC7D,OAAO;IACLC,QAAQ,EAAE,IAAAC,qBAAG,CAAC;AAClB;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,EAAE,MAAMN,OAAO,CAACO,MAAM,CAACC,aAAa,CAACC,2BAAc;QAC9D,CAAC;QACDC,gBAAgB,EAAE;UAChBJ,SAAS,EAAE,MAAMN,OAAO,CAACO,MAAM,CAACC,aAAa,CAACG,6BAAgB;QAChE,CAAC;QACDC,gBAAgB,EAAE;UAChBN,SAAS,EAAE,MAAMN,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,EAAE;QAChC,CAAC;QACDC,WAAW,EAAGF,WAA+B,IAAa;UAAA;UACxD,OAAO,0BAAAA,WAAW,CAACG,SAAS,EAAE,0DAAvB,sBAAyBC,KAAK,KAAI,CAAC;QAC5C,CAAC;QACDC,MAAM,EAAGL,WAA+B,IAAK;UAAA;UAC3C,iCAAOA,WAAW,CAACG,SAAS,EAAE,2DAAvB,uBAAyBG,wBAAwB,EAAE;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,OAAOH,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,OAAOP,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,EAAE,MAAMA;MACnB;IACF;EACF,CAAC;AACH,CAAC;AAAA"}
|