@teambit/workspace 0.0.554 → 0.0.558
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/build-graph-from-fs.d.ts +30 -0
- package/dist/build-graph-from-fs.js +4 -1
- package/dist/build-graph-from-fs.js.map +1 -1
- package/dist/install.cmd.d.ts +17 -3
- package/dist/install.cmd.js.map +1 -1
- package/dist/link/link.cmd.d.ts +15 -1
- package/dist/types.d.ts +21 -0
- package/dist/ui/workspace/workspace-model.d.ts +32 -1
- package/dist/ui/workspace/workspace-provider.d.ts +9 -0
- package/dist/ui/workspace/workspace.d.ts +3 -0
- package/dist/watch/output-formatter.d.ts +6 -0
- package/dist/watch/watch.cmd.d.ts +22 -1
- package/dist/watch/watcher.d.ts +9 -0
- package/dist/workspace-component/component-status.d.ts +57 -1
- package/dist/workspace-component/workspace-component-loader.d.ts +7 -0
- package/dist/workspace-component/workspace-component.d.ts +36 -1
- package/dist/workspace.d.ts +236 -3
- package/dist/workspace.js +6 -0
- package/dist/workspace.js.map +1 -1
- package/dist/workspace.ui-root.d.ts +18 -1
- package/dist/workspace.ui.runtime.d.ts +32 -1
- package/package.json +61 -53
- package/tsconfig.json +1 -2
- package/build-graph-from-fs.ts +0 -160
- package/capsule.cmd.ts +0 -136
- package/component-config-file/component-config-file.ts +0 -98
- package/component-config-file/exceptions/already-exists.ts +0 -7
- package/component-config-file/exceptions/index.ts +0 -1
- package/component-config-file/index.ts +0 -2
- package/component-tree.widget.tsx +0 -16
- package/constants.ts +0 -1
- package/eject-conf.cmd.tsx +0 -62
- package/events/index.ts +0 -3
- package/events/on-component-add-event.ts +0 -14
- package/events/on-component-change-event.ts +0 -14
- package/events/on-component-removed-event.ts +0 -14
- package/exceptions/dependency-type-not-supported-in-policy.ts +0 -7
- package/exceptions/incorrect-env-aspect.ts +0 -8
- package/exceptions/index.ts +0 -1
- package/index.ts +0 -19
- package/install.cmd.tsx +0 -67
- package/link/component-list-links.ts +0 -50
- package/link/core-aspects-links.ts +0 -50
- package/link/get-package-name-from-target.ts +0 -5
- package/link/index.ts +0 -1
- package/link/link-row.ts +0 -20
- package/link/link-to-dir.ts +0 -13
- package/link/link.cmd.ts +0 -96
- package/link/nested-deps-in-nm-links.ts +0 -47
- package/link/rewire-row.ts +0 -17
- package/list.cmd.tsx +0 -30
- package/on-component-events.ts +0 -14
- package/package-tar/teambit-workspace-0.0.554.tgz +0 -0
- package/tag-cmd.ts +0 -247
- package/types/asset.d.ts +0 -29
- package/types/style.d.ts +0 -42
- package/types.ts +0 -40
- package/ui/index.ts +0 -1
- package/ui/workspace/default-component.ts +0 -7
- package/ui/workspace/index.ts +0 -1
- package/ui/workspace/use-workspace.ts +0 -193
- package/ui/workspace/workspace-context.tsx +0 -5
- package/ui/workspace/workspace-model.ts +0 -66
- package/ui/workspace/workspace-overview/index.ts +0 -1
- package/ui/workspace/workspace-overview/workspace-overview.module.scss +0 -6
- package/ui/workspace/workspace-overview/workspace-overview.tsx +0 -21
- package/ui/workspace/workspace-provider.tsx +0 -23
- package/ui/workspace/workspace.module.scss +0 -40
- package/ui/workspace/workspace.tsx +0 -99
- package/ui/workspace-components-drawer/index.ts +0 -1
- package/ui/workspace-components-drawer/workspace-components-drawer.module.scss +0 -4
- package/ui/workspace-components-drawer/workspace-components.drawer.tsx +0 -49
- package/watch/REFACTOR_GUIDE.md +0 -14
- package/watch/check-types.ts +0 -5
- package/watch/output-formatter.ts +0 -50
- package/watch/watch.cmd.tsx +0 -142
- package/watch/watcher.ts +0 -289
- package/workspace-component/component-status.ts +0 -67
- package/workspace-component/index.ts +0 -2
- package/workspace-component/workspace-component-loader.ts +0 -276
- package/workspace-component/workspace-component.ts +0 -51
- package/workspace-section.ts +0 -14
- package/workspace.aspect.ts +0 -9
- package/workspace.graphql.ts +0 -133
- package/workspace.main.runtime.ts +0 -50
- package/workspace.provider.ts +0 -218
- package/workspace.ts +0 -1534
- package/workspace.ui-root.ts +0 -64
- package/workspace.ui.runtime.tsx +0 -215
package/workspace.ui-root.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { BundlerMain } from '@teambit/bundler';
|
|
2
|
-
import { Component, ComponentID } from '@teambit/component';
|
|
3
|
-
import { UIRoot } from '@teambit/ui';
|
|
4
|
-
import { GetBitMapComponentOptions } from '@teambit/legacy/dist/consumer/bit-map/bit-map';
|
|
5
|
-
import { PathOsBased } from '@teambit/legacy/dist/utils/path';
|
|
6
|
-
|
|
7
|
-
import { Workspace } from './workspace';
|
|
8
|
-
|
|
9
|
-
export class WorkspaceUIRoot implements UIRoot {
|
|
10
|
-
constructor(
|
|
11
|
-
/**
|
|
12
|
-
* workspace extension.
|
|
13
|
-
*/
|
|
14
|
-
private workspace: Workspace,
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* bundler extension
|
|
18
|
-
*/
|
|
19
|
-
private bundler: BundlerMain
|
|
20
|
-
) {}
|
|
21
|
-
|
|
22
|
-
priority = true;
|
|
23
|
-
|
|
24
|
-
get name() {
|
|
25
|
-
return this.workspace.name;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
get path() {
|
|
29
|
-
return this.workspace.path;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
get configFile() {
|
|
33
|
-
return 'workspace.json';
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
buildOptions = {
|
|
37
|
-
ssr: false,
|
|
38
|
-
launchBrowserOnStart: true,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
async resolveAspects(runtimeName: string) {
|
|
42
|
-
return this.workspace.resolveAspects(runtimeName);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// TODO: @gilad please implement with variants.
|
|
46
|
-
resolvePattern(pattern: string): Promise<Component[]> {
|
|
47
|
-
return this.workspace.byPattern(pattern);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
getConfig() {
|
|
51
|
-
return {};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* proxy to `workspace.componentDir()`
|
|
56
|
-
*/
|
|
57
|
-
componentDir(
|
|
58
|
-
componentId: ComponentID,
|
|
59
|
-
bitMapOptions?: GetBitMapComponentOptions,
|
|
60
|
-
options = { relative: false }
|
|
61
|
-
): PathOsBased {
|
|
62
|
-
return this.workspace.componentDir(componentId, bitMapOptions, options);
|
|
63
|
-
}
|
|
64
|
-
}
|
package/workspace.ui.runtime.tsx
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { ComponentAspect, ComponentUI, ComponentModel } from '@teambit/component';
|
|
2
|
-
import { ComponentTreeAspect, ComponentTreeUI, ComponentTreeNode } from '@teambit/component-tree';
|
|
3
|
-
import { Slot, SlotRegistry } from '@teambit/harmony';
|
|
4
|
-
import ReactRouterAspect, { ReactRouterUI } from '@teambit/react-router';
|
|
5
|
-
import { RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';
|
|
6
|
-
import { Menu } from '@teambit/ui-foundation.ui.menu';
|
|
7
|
-
import SidebarAspect, { SidebarUI, SidebarItem, SidebarItemSlot } from '@teambit/sidebar';
|
|
8
|
-
import { MenuItemSlot, MenuItem } from '@teambit/ui-foundation.ui.main-dropdown';
|
|
9
|
-
import { UIAspect, UIRootUI as UIRoot, UIRuntime, UiUI } from '@teambit/ui';
|
|
10
|
-
import { GraphAspect, GraphUI } from '@teambit/graph';
|
|
11
|
-
import React from 'react';
|
|
12
|
-
import { RouteProps } from 'react-router-dom';
|
|
13
|
-
import CommandBarAspect, { CommandBarUI, ComponentSearcher, CommandHandler } from '@teambit/command-bar';
|
|
14
|
-
import { MenuLinkItem } from '@teambit/design.ui.surfaces.menu.link-item';
|
|
15
|
-
import { WorkspaceComponentsDrawer } from './ui/workspace-components-drawer';
|
|
16
|
-
import { ComponentTreeWidget } from './component-tree.widget';
|
|
17
|
-
import { Workspace } from './ui';
|
|
18
|
-
import { WorkspaceAspect } from './workspace.aspect';
|
|
19
|
-
|
|
20
|
-
export type SidebarWidgetSlot = SlotRegistry<ComponentTreeNode>;
|
|
21
|
-
|
|
22
|
-
export class WorkspaceUI {
|
|
23
|
-
constructor(
|
|
24
|
-
/**
|
|
25
|
-
* route slot.
|
|
26
|
-
*/
|
|
27
|
-
private routeSlot: RouteSlot,
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* component ui extension.
|
|
31
|
-
*/
|
|
32
|
-
private componentUi: ComponentUI,
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* menu slot
|
|
36
|
-
*/
|
|
37
|
-
private menuSlot: RouteSlot,
|
|
38
|
-
|
|
39
|
-
private menuItemSlot: MenuItemSlot,
|
|
40
|
-
|
|
41
|
-
private sidebar: SidebarUI,
|
|
42
|
-
|
|
43
|
-
private sidebarSlot: SidebarWidgetSlot,
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* sidebar link slot
|
|
47
|
-
*/
|
|
48
|
-
private sidebarItemSlot: SidebarItemSlot,
|
|
49
|
-
|
|
50
|
-
private commandBarUI: CommandBarUI,
|
|
51
|
-
|
|
52
|
-
reactRouterUI: ReactRouterUI
|
|
53
|
-
) {
|
|
54
|
-
this.componentSearcher = new ComponentSearcher(reactRouterUI.navigateTo);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
private setKeyBindHandler: (updated: CommandHandler) => void = () => {};
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* register a route to the workspace.
|
|
61
|
-
*/
|
|
62
|
-
registerRoute(route: RouteProps) {
|
|
63
|
-
this.routeSlot.register(route);
|
|
64
|
-
return this;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
registerSidebarWidget(componentTreeNode: ComponentTreeNode) {
|
|
68
|
-
this.sidebarSlot.register(componentTreeNode);
|
|
69
|
-
return this;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
registerMenuItem = (menuItems: MenuItem[]) => {
|
|
73
|
-
this.menuItemSlot.register(menuItems);
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
setComponents = (components: ComponentModel[]) => {
|
|
77
|
-
this.componentSearcher.update(components);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
registerSidebarLink = (...links: SidebarItem[]) => {
|
|
81
|
-
this.sidebarItemSlot.register(links);
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
componentSearcher: ComponentSearcher;
|
|
85
|
-
|
|
86
|
-
uiRoot(): UIRoot {
|
|
87
|
-
this.sidebar.registerDrawer(new WorkspaceComponentsDrawer(this.sidebarSlot));
|
|
88
|
-
this.commandBarUI.addSearcher(this.componentSearcher);
|
|
89
|
-
const [setKeyBindHandler] = this.commandBarUI.addCommand({
|
|
90
|
-
id: 'sidebar.toggle', // TODO - extract to a component!
|
|
91
|
-
handler: () => {},
|
|
92
|
-
displayName: 'Toggle component list',
|
|
93
|
-
keybinding: 'alt+s',
|
|
94
|
-
});
|
|
95
|
-
this.setKeyBindHandler = setKeyBindHandler;
|
|
96
|
-
|
|
97
|
-
return {
|
|
98
|
-
routes: [
|
|
99
|
-
{
|
|
100
|
-
path: '/',
|
|
101
|
-
children: (
|
|
102
|
-
<Workspace
|
|
103
|
-
menuSlot={this.menuSlot}
|
|
104
|
-
routeSlot={this.routeSlot}
|
|
105
|
-
sidebar={<this.sidebar.render itemSlot={this.sidebarItemSlot} />}
|
|
106
|
-
workspaceUI={this}
|
|
107
|
-
onSidebarTogglerChange={this.setKeyBindHandler}
|
|
108
|
-
/>
|
|
109
|
-
),
|
|
110
|
-
},
|
|
111
|
-
],
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
private menuItems: MenuItem[] = [
|
|
116
|
-
{
|
|
117
|
-
category: 'general',
|
|
118
|
-
title: 'Open command bar',
|
|
119
|
-
keyChar: 'mod+k',
|
|
120
|
-
handler: () => this.commandBarUI?.run('command-bar.open'),
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
category: 'general',
|
|
124
|
-
title: 'Toggle component list',
|
|
125
|
-
keyChar: 'alt+s',
|
|
126
|
-
handler: () => this.commandBarUI?.run('sidebar.toggle'),
|
|
127
|
-
},
|
|
128
|
-
];
|
|
129
|
-
|
|
130
|
-
static dependencies = [
|
|
131
|
-
UIAspect,
|
|
132
|
-
ComponentAspect,
|
|
133
|
-
SidebarAspect,
|
|
134
|
-
ComponentTreeAspect,
|
|
135
|
-
CommandBarAspect,
|
|
136
|
-
ReactRouterAspect,
|
|
137
|
-
GraphAspect,
|
|
138
|
-
];
|
|
139
|
-
|
|
140
|
-
static runtime = UIRuntime;
|
|
141
|
-
|
|
142
|
-
static slots = [
|
|
143
|
-
Slot.withType<RouteProps>(),
|
|
144
|
-
Slot.withType<RouteProps>(),
|
|
145
|
-
Slot.withType<ComponentTreeNode>(),
|
|
146
|
-
Slot.withType<MenuItemSlot>(),
|
|
147
|
-
Slot.withType<SidebarItemSlot>(),
|
|
148
|
-
];
|
|
149
|
-
|
|
150
|
-
static async provider(
|
|
151
|
-
[ui, componentUi, sidebar, componentTree, commandBarUI, reactRouterUI, graphUI]: [
|
|
152
|
-
UiUI,
|
|
153
|
-
ComponentUI,
|
|
154
|
-
SidebarUI,
|
|
155
|
-
ComponentTreeUI,
|
|
156
|
-
CommandBarUI,
|
|
157
|
-
ReactRouterUI,
|
|
158
|
-
GraphUI
|
|
159
|
-
],
|
|
160
|
-
config,
|
|
161
|
-
[routeSlot, menuSlot, menuItemSlot, sidebarSlot, sidebarItemSlot]: [
|
|
162
|
-
RouteSlot,
|
|
163
|
-
RouteSlot,
|
|
164
|
-
MenuItemSlot,
|
|
165
|
-
SidebarWidgetSlot,
|
|
166
|
-
SidebarItemSlot
|
|
167
|
-
]
|
|
168
|
-
) {
|
|
169
|
-
componentTree.registerTreeNode(new ComponentTreeWidget());
|
|
170
|
-
sidebarSlot.register(new ComponentTreeWidget());
|
|
171
|
-
graphUI.registerComponentWidget(new ComponentTreeWidget().widget);
|
|
172
|
-
|
|
173
|
-
const workspaceUI = new WorkspaceUI(
|
|
174
|
-
routeSlot,
|
|
175
|
-
componentUi,
|
|
176
|
-
menuSlot,
|
|
177
|
-
menuItemSlot,
|
|
178
|
-
sidebar,
|
|
179
|
-
sidebarSlot,
|
|
180
|
-
sidebarItemSlot,
|
|
181
|
-
commandBarUI,
|
|
182
|
-
reactRouterUI
|
|
183
|
-
);
|
|
184
|
-
ui.registerRoot(workspaceUI.uiRoot.bind(workspaceUI));
|
|
185
|
-
workspaceUI.registerMenuItem(workspaceUI.menuItems);
|
|
186
|
-
|
|
187
|
-
workspaceUI.registerSidebarLink(() => (
|
|
188
|
-
<MenuLinkItem exact href="/" icon="comps">
|
|
189
|
-
Gallery
|
|
190
|
-
</MenuLinkItem>
|
|
191
|
-
));
|
|
192
|
-
|
|
193
|
-
workspaceUI.menuSlot.register([
|
|
194
|
-
{
|
|
195
|
-
exact: true,
|
|
196
|
-
path: '/',
|
|
197
|
-
children: <Menu menuItemSlot={workspaceUI.menuItemSlot} />,
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
path: workspaceUI.componentUi.routePath,
|
|
201
|
-
children: workspaceUI.componentUi.getMenu(WorkspaceAspect.id),
|
|
202
|
-
},
|
|
203
|
-
]);
|
|
204
|
-
|
|
205
|
-
workspaceUI.routeSlot.register({
|
|
206
|
-
path: workspaceUI.componentUi.routePath,
|
|
207
|
-
children: workspaceUI.componentUi.getComponentUI(WorkspaceAspect.id),
|
|
208
|
-
});
|
|
209
|
-
return workspaceUI;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
export default WorkspaceUI;
|
|
214
|
-
|
|
215
|
-
WorkspaceAspect.addRuntime(WorkspaceUI);
|