@teambit/component 0.0.555 → 0.0.559
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/component.graphql.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/package.json +49 -34
- package/tsconfig.json +1 -1
- package/aspect-entry.ts +0 -67
- package/aspect-list.ts +0 -100
- package/aspect.section.tsx +0 -16
- package/component-factory.ts +0 -106
- package/component-fs.ts +0 -60
- package/component-map/component-map.ts +0 -106
- package/component-map/index.ts +0 -1
- package/component-meta.ts +0 -29
- package/component.aspect.ts +0 -9
- package/component.graphql.ts +0 -202
- package/component.main.runtime.ts +0 -162
- package/component.route.ts +0 -26
- package/component.ts +0 -278
- package/component.ui.runtime.tsx +0 -216
- package/config.ts +0 -34
- package/dependencies/dependencies.ts +0 -74
- package/dependencies/index.ts +0 -1
- package/exceptions/could-not-find-latest.ts +0 -8
- package/exceptions/host-not-found.ts +0 -14
- package/exceptions/index.ts +0 -4
- package/exceptions/nothing-to-snap.ts +0 -1
- package/hash.ts +0 -4
- package/head.ts +0 -0
- package/history-graph.ts +0 -1
- package/host/component-host-model.ts +0 -9
- package/host/index.ts +0 -2
- package/host/use-component-host.ts +0 -39
- package/index.ts +0 -32
- package/on-load.ts +0 -0
- package/package-tar/teambit-component-0.0.555.tgz +0 -0
- package/section/index.ts +0 -1
- package/section/section.tsx +0 -8
- package/show/extensions.fragment.ts +0 -23
- package/show/files.fragment.ts +0 -24
- package/show/id.fragment.ts +0 -20
- package/show/index.ts +0 -8
- package/show/main-file.fragment.ts +0 -13
- package/show/name.fragment.ts +0 -13
- package/show/scope.fragment.ts +0 -15
- package/show/show-fragment.ts +0 -44
- package/show/show.cmd.ts +0 -85
- package/snap/author.ts +0 -19
- package/snap/index.ts +0 -2
- package/snap/snap.ts +0 -63
- package/state.ts +0 -73
- package/store.ts +0 -3
- package/tag/index.ts +0 -1
- package/tag/tag.ts +0 -37
- package/tag-map.ts +0 -87
- package/types/asset.d.ts +0 -29
- package/types/style.d.ts +0 -42
- package/ui/aspect-page/aspect-page.tsx +0 -64
- package/ui/aspect-page/index.ts +0 -1
- package/ui/component-error/component-error.tsx +0 -22
- package/ui/component-error/index.ts +0 -1
- package/ui/component-model/component-model.ts +0 -169
- package/ui/component-model/index.ts +0 -1
- package/ui/component.tsx +0 -48
- package/ui/context/component-context.ts +0 -5
- package/ui/context/component-provider.tsx +0 -20
- package/ui/context/index.ts +0 -2
- package/ui/index.ts +0 -3
- package/ui/menu/index.ts +0 -2
- package/ui/menu/menu-nav.tsx +0 -37
- package/ui/menu/menu.tsx +0 -94
- package/ui/menu/nav-plugin.tsx +0 -9
- package/ui/top-bar-nav/index.ts +0 -1
- package/ui/top-bar-nav/top-bar-nav.tsx +0 -26
- package/ui/use-component-query.ts +0 -195
- package/ui/use-component.tsx +0 -34
package/component.ui.runtime.tsx
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
import PubsubAspect, { PubsubUI, BitBaseEvent } from '@teambit/pubsub';
|
|
2
|
-
import PreviewAspect, { ClickInsideAnIframeEvent } from '@teambit/preview';
|
|
3
|
-
import { MenuItemSlot, MenuItem } from '@teambit/ui-foundation.ui.main-dropdown';
|
|
4
|
-
import { Slot } from '@teambit/harmony';
|
|
5
|
-
import { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';
|
|
6
|
-
import { NavLinkProps } from '@teambit/base-ui.routing.nav-link';
|
|
7
|
-
import { UIRuntime } from '@teambit/ui';
|
|
8
|
-
import { isBrowser } from '@teambit/ui-foundation.ui.is-browser';
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import { RouteProps } from 'react-router-dom';
|
|
11
|
-
import CommandBarAspect, { CommandBarUI, CommandEntry } from '@teambit/command-bar';
|
|
12
|
-
import copy from 'copy-to-clipboard';
|
|
13
|
-
import { ComponentAspect } from './component.aspect';
|
|
14
|
-
import { Component, ComponentPageElement, ComponentPageSlot } from './ui/component';
|
|
15
|
-
import { Menu, NavPlugin, OrderedNavigationSlot } from './ui/menu';
|
|
16
|
-
import { AspectSection } from './aspect.section';
|
|
17
|
-
import { ComponentModel } from './ui';
|
|
18
|
-
|
|
19
|
-
export type Server = {
|
|
20
|
-
env: string;
|
|
21
|
-
url: string;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export type ComponentMeta = {
|
|
25
|
-
id: string;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const componentIdUrlRegex = '[\\w\\/-]*[\\w-]';
|
|
29
|
-
|
|
30
|
-
export class ComponentUI {
|
|
31
|
-
readonly routePath = `/:componentId(${componentIdUrlRegex})`;
|
|
32
|
-
|
|
33
|
-
constructor(
|
|
34
|
-
/**
|
|
35
|
-
* Pubsub aspects
|
|
36
|
-
*/
|
|
37
|
-
private pubsub: PubsubUI,
|
|
38
|
-
|
|
39
|
-
private routeSlot: RouteSlot,
|
|
40
|
-
|
|
41
|
-
private navSlot: OrderedNavigationSlot,
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* slot for registering a new widget to the menu.
|
|
45
|
-
*/
|
|
46
|
-
private widgetSlot: OrderedNavigationSlot,
|
|
47
|
-
|
|
48
|
-
private menuItemSlot: MenuItemSlot,
|
|
49
|
-
|
|
50
|
-
private pageItemSlot: ComponentPageSlot,
|
|
51
|
-
|
|
52
|
-
private commandBarUI: CommandBarUI
|
|
53
|
-
) {
|
|
54
|
-
if (isBrowser) this.registerPubSub();
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* the current visible component
|
|
59
|
-
*/
|
|
60
|
-
private activeComponent?: ComponentModel;
|
|
61
|
-
|
|
62
|
-
private copyNpmId = () => {
|
|
63
|
-
const packageName = this.activeComponent?.packageName;
|
|
64
|
-
if (packageName) {
|
|
65
|
-
const version = this.activeComponent?.id.version;
|
|
66
|
-
const versionString = version ? `@${version}` : '';
|
|
67
|
-
copy(`${packageName}${versionString}`);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* key bindings used by component aspect
|
|
73
|
-
*/
|
|
74
|
-
private keyBindings: CommandEntry[] = [
|
|
75
|
-
{
|
|
76
|
-
id: 'component.copyBitId', // TODO - extract to a component!
|
|
77
|
-
handler: () => {
|
|
78
|
-
copy(this.activeComponent?.id.toString() || '');
|
|
79
|
-
},
|
|
80
|
-
displayName: 'Copy component ID',
|
|
81
|
-
keybinding: '.',
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
id: 'component.copyNpmId', // TODO - extract to a component!
|
|
85
|
-
handler: this.copyNpmId,
|
|
86
|
-
displayName: 'Copy component package name',
|
|
87
|
-
keybinding: ',',
|
|
88
|
-
},
|
|
89
|
-
];
|
|
90
|
-
|
|
91
|
-
private menuItems: MenuItem[] = [
|
|
92
|
-
{
|
|
93
|
-
category: 'general',
|
|
94
|
-
title: 'Open command bar',
|
|
95
|
-
keyChar: 'mod+k',
|
|
96
|
-
handler: () => this.commandBarUI?.run('command-bar.open'),
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
category: 'general',
|
|
100
|
-
title: 'Toggle component list',
|
|
101
|
-
keyChar: 'alt+s',
|
|
102
|
-
handler: () => this.commandBarUI?.run('sidebar.toggle'),
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
category: 'workflow',
|
|
106
|
-
title: 'Copy component ID',
|
|
107
|
-
keyChar: '.',
|
|
108
|
-
handler: () => this.commandBarUI?.run('component.copyBitId'),
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
category: 'workflow',
|
|
112
|
-
title: 'Copy component package name',
|
|
113
|
-
keyChar: ',',
|
|
114
|
-
handler: () => this.commandBarUI?.run('component.copyNpmId'),
|
|
115
|
-
},
|
|
116
|
-
];
|
|
117
|
-
|
|
118
|
-
registerPubSub() {
|
|
119
|
-
this.pubsub.sub(PreviewAspect.id, (be: BitBaseEvent<any>) => {
|
|
120
|
-
if (be.type === ClickInsideAnIframeEvent.TYPE) {
|
|
121
|
-
const event = new MouseEvent('mousedown', {
|
|
122
|
-
view: window,
|
|
123
|
-
bubbles: true,
|
|
124
|
-
cancelable: true,
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
const body = document.body;
|
|
128
|
-
body?.dispatchEvent(event);
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
handleComponentChange = (activeComponent?: ComponentModel) => {
|
|
134
|
-
this.activeComponent = activeComponent;
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
getComponentUI(host: string) {
|
|
138
|
-
return (
|
|
139
|
-
<Component
|
|
140
|
-
routeSlot={this.routeSlot}
|
|
141
|
-
containerSlot={this.pageItemSlot}
|
|
142
|
-
onComponentChange={this.handleComponentChange}
|
|
143
|
-
host={host}
|
|
144
|
-
/>
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
getMenu(host: string) {
|
|
149
|
-
return (
|
|
150
|
-
<Menu navigationSlot={this.navSlot} widgetSlot={this.widgetSlot} host={host} menuItemSlot={this.menuItemSlot} />
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
registerRoute(route: RouteProps) {
|
|
155
|
-
this.routeSlot.register(route);
|
|
156
|
-
return this;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
registerNavigation(nav: NavLinkProps, order?: number) {
|
|
160
|
-
this.navSlot.register({
|
|
161
|
-
props: nav,
|
|
162
|
-
order,
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
registerWidget(widget: NavLinkProps, order?: number) {
|
|
167
|
-
this.widgetSlot.register({ props: widget, order });
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
registerMenuItem = (menuItems: MenuItem[]) => {
|
|
171
|
-
this.menuItemSlot.register(menuItems);
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
registerPageItem = (...items: ComponentPageElement[]) => {
|
|
175
|
-
this.pageItemSlot.register(items);
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
static dependencies = [PubsubAspect, CommandBarAspect];
|
|
179
|
-
|
|
180
|
-
static runtime = UIRuntime;
|
|
181
|
-
|
|
182
|
-
static slots = [
|
|
183
|
-
Slot.withType<RouteProps>(),
|
|
184
|
-
Slot.withType<NavPlugin>(),
|
|
185
|
-
Slot.withType<NavigationSlot>(),
|
|
186
|
-
Slot.withType<MenuItemSlot>(),
|
|
187
|
-
Slot.withType<ComponentPageSlot>(),
|
|
188
|
-
];
|
|
189
|
-
|
|
190
|
-
static async provider(
|
|
191
|
-
[pubsub, commandBarUI]: [PubsubUI, CommandBarUI],
|
|
192
|
-
config,
|
|
193
|
-
[routeSlot, navSlot, widgetSlot, menuItemSlot, pageSlot]: [
|
|
194
|
-
RouteSlot,
|
|
195
|
-
OrderedNavigationSlot,
|
|
196
|
-
OrderedNavigationSlot,
|
|
197
|
-
MenuItemSlot,
|
|
198
|
-
ComponentPageSlot
|
|
199
|
-
]
|
|
200
|
-
) {
|
|
201
|
-
// TODO: refactor ComponentHost to a separate extension (including sidebar, host, graphql, etc.)
|
|
202
|
-
// TODO: add contextual hook for ComponentHost @uri/@oded
|
|
203
|
-
const componentUI = new ComponentUI(pubsub, routeSlot, navSlot, widgetSlot, menuItemSlot, pageSlot, commandBarUI);
|
|
204
|
-
const section = new AspectSection();
|
|
205
|
-
|
|
206
|
-
componentUI.commandBarUI.addCommand(...componentUI.keyBindings);
|
|
207
|
-
componentUI.registerMenuItem(componentUI.menuItems);
|
|
208
|
-
componentUI.registerRoute(section.route);
|
|
209
|
-
componentUI.registerWidget(section.navigationLink, section.order);
|
|
210
|
-
return componentUI;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
export default ComponentUI;
|
|
215
|
-
|
|
216
|
-
ComponentAspect.addRuntime(ComponentUI);
|
package/config.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Compilers, Testers } from '@teambit/legacy/dist/consumer/config/abstract-config';
|
|
2
|
-
import { ComponentOverridesData } from '@teambit/legacy/dist/consumer/config/component-overrides';
|
|
3
|
-
import { ExtensionDataList } from '@teambit/legacy/dist/consumer/config/extension-data';
|
|
4
|
-
import { PathLinux } from '@teambit/legacy/dist/utils/path';
|
|
5
|
-
// import { CustomResolvedPath } from '@teambit/legacy/dist/consumer/component/consumer-component';
|
|
6
|
-
// import { ComponentOverridesData } from '@teambit/legacy/dist/consumer/config/component-overrides';
|
|
7
|
-
|
|
8
|
-
type LegacyConfigProps = {
|
|
9
|
-
lang?: string;
|
|
10
|
-
compiler?: string | Compilers;
|
|
11
|
-
tester?: string | Testers;
|
|
12
|
-
bindingPrefix: string;
|
|
13
|
-
extensions?: ExtensionDataList;
|
|
14
|
-
overrides?: ComponentOverridesData;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* in-memory representation of the component configuration.
|
|
19
|
-
*/
|
|
20
|
-
export default class Config {
|
|
21
|
-
constructor(
|
|
22
|
-
/**
|
|
23
|
-
* version main file
|
|
24
|
-
*/
|
|
25
|
-
readonly main: PathLinux,
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* configured extensions
|
|
29
|
-
*/
|
|
30
|
-
readonly extensions: ExtensionDataList,
|
|
31
|
-
|
|
32
|
-
readonly legacyProperties?: LegacyConfigProps
|
|
33
|
-
) {}
|
|
34
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-classes-per-file */
|
|
2
|
-
import { BitError } from '@teambit/bit-error';
|
|
3
|
-
import { BitId } from '@teambit/legacy-bit-id';
|
|
4
|
-
|
|
5
|
-
const DEV_ENV = 'development';
|
|
6
|
-
const RUNTIME_ENV = 'runtime';
|
|
7
|
-
|
|
8
|
-
// type Environment = DEV_ENV | RUNTIME_ENV;
|
|
9
|
-
type Environment = 'development' | 'runtime';
|
|
10
|
-
// type WrappingMethod = 'component' | 'package';
|
|
11
|
-
|
|
12
|
-
export class DependencyId extends BitId {}
|
|
13
|
-
|
|
14
|
-
export class Dependency {
|
|
15
|
-
constructor(public id: DependencyId) {}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export class PackageDependency extends Dependency {}
|
|
19
|
-
|
|
20
|
-
export class ComponentDependency extends Dependency {}
|
|
21
|
-
|
|
22
|
-
export class DependencyList extends Array<Dependency> {
|
|
23
|
-
/**
|
|
24
|
-
* Get only package dependencies
|
|
25
|
-
*
|
|
26
|
-
* @readonly
|
|
27
|
-
* @memberof DependencyList
|
|
28
|
-
*/
|
|
29
|
-
get packages(): PackageDependency[] {
|
|
30
|
-
return this.filter((dep) => dep instanceof PackageDependency);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
get components(): ComponentDependency[] {
|
|
34
|
-
return this.filter((dep) => dep instanceof ComponentDependency);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
static fromArray(dependencies: Dependency[]): DependencyList {
|
|
38
|
-
return new DependencyList(...dependencies);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export class Dependencies {
|
|
43
|
-
constructor(public runtime: DependencyList, public dev: DependencyList, public peer: DependencyList) {}
|
|
44
|
-
|
|
45
|
-
private getByEnvironment(env: Environment): DependencyList {
|
|
46
|
-
if (env === DEV_ENV) {
|
|
47
|
-
return DependencyList.fromArray(this.runtime.concat(this.dev).concat(this.peer));
|
|
48
|
-
}
|
|
49
|
-
if (env === RUNTIME_ENV) {
|
|
50
|
-
return DependencyList.fromArray(this.runtime.concat(this.peer));
|
|
51
|
-
}
|
|
52
|
-
throw new BitError(`env ${env} is not supported`);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Get dependencies needed for development environnement such as runtime, dev and peer
|
|
57
|
-
*
|
|
58
|
-
* @returns {DependencyList}
|
|
59
|
-
* @memberof Dependencies
|
|
60
|
-
*/
|
|
61
|
-
computeDev(): DependencyList {
|
|
62
|
-
return this.getByEnvironment(DEV_ENV);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Get dependencies needed for runtime environnement such as runtime and peer
|
|
67
|
-
*
|
|
68
|
-
* @returns {DependencyList}
|
|
69
|
-
* @memberof Dependencies
|
|
70
|
-
*/
|
|
71
|
-
computeRuntime(): DependencyList {
|
|
72
|
-
return this.getByEnvironment(RUNTIME_ENV);
|
|
73
|
-
}
|
|
74
|
-
}
|
package/dependencies/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Dependencies } from './dependencies';
|
package/exceptions/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default class NothingToSnap extends Error {}
|
package/hash.ts
DELETED
package/head.ts
DELETED
|
File without changes
|
package/history-graph.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default class HistoryGraph {}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ComponentModel } from '../ui';
|
|
2
|
-
|
|
3
|
-
export class ComponentHostModel {
|
|
4
|
-
constructor(readonly name: string, readonly components: ComponentModel[]) {}
|
|
5
|
-
|
|
6
|
-
static from(data: any) {
|
|
7
|
-
return new ComponentHostModel(data.getHost.name, ComponentModel.fromArray(data.getHost.list));
|
|
8
|
-
}
|
|
9
|
-
}
|
package/host/index.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { useDataQuery } from '@teambit/ui-foundation.ui.hooks.use-data-query';
|
|
2
|
-
import { gql } from '@apollo/client';
|
|
3
|
-
|
|
4
|
-
import { ComponentHostModel } from './component-host-model';
|
|
5
|
-
|
|
6
|
-
const COMPONENT_HOST = gql`
|
|
7
|
-
{
|
|
8
|
-
getHost {
|
|
9
|
-
id # used for GQL caching
|
|
10
|
-
name
|
|
11
|
-
list {
|
|
12
|
-
id {
|
|
13
|
-
name
|
|
14
|
-
version
|
|
15
|
-
scope
|
|
16
|
-
}
|
|
17
|
-
deprecation {
|
|
18
|
-
isDeprecate
|
|
19
|
-
}
|
|
20
|
-
env {
|
|
21
|
-
id
|
|
22
|
-
icon
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
|
-
export function useComponentHost() {
|
|
30
|
-
const { data, loading } = useDataQuery(COMPONENT_HOST);
|
|
31
|
-
|
|
32
|
-
if (!data || loading) {
|
|
33
|
-
return {};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const host = ComponentHostModel.from(data);
|
|
37
|
-
|
|
38
|
-
return { host };
|
|
39
|
-
}
|
package/index.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ComponentAspect } from './component.aspect';
|
|
2
|
-
|
|
3
|
-
export { useComponentHost } from './host';
|
|
4
|
-
export { Component, InvalidComponent } from './component';
|
|
5
|
-
export { ComponentID } from '@teambit/component-id';
|
|
6
|
-
export { default as ComponentFS } from './component-fs';
|
|
7
|
-
export type { default as ComponentConfig } from './config';
|
|
8
|
-
export type { ComponentFactory } from './component-factory';
|
|
9
|
-
export type { AspectList } from './aspect-list';
|
|
10
|
-
export { AspectEntry, AspectData } from './aspect-entry';
|
|
11
|
-
// TODO: check why it's not working when using the index in snap dir like this:
|
|
12
|
-
// export { Snap, Author } from './snap';
|
|
13
|
-
export { Snap } from './snap/snap';
|
|
14
|
-
export type { Author } from './snap/author';
|
|
15
|
-
// TODO: check why it's not working when using the index in tag dir like this:
|
|
16
|
-
// export { Tag } from './tag';
|
|
17
|
-
export { Tag } from './tag/tag';
|
|
18
|
-
export { State } from './state';
|
|
19
|
-
export type { Hash } from './hash';
|
|
20
|
-
export { TagMap } from './tag-map';
|
|
21
|
-
export { ComponentMap } from './component-map';
|
|
22
|
-
export type { ComponentMain } from './component.main.runtime';
|
|
23
|
-
export type { ComponentUI } from './component.ui.runtime';
|
|
24
|
-
export { Section } from './section';
|
|
25
|
-
export { ComponentContext } from './ui/context/component-context';
|
|
26
|
-
export { ComponentModel, ComponentModelProps } from './ui/component-model';
|
|
27
|
-
export type { ShowFragment, ShowRow } from './show';
|
|
28
|
-
export { default as Config } from './config';
|
|
29
|
-
// export { AspectList } from './aspect-list';
|
|
30
|
-
// export { AspectEntry } from './aspect-entry';
|
|
31
|
-
export { ComponentAspect };
|
|
32
|
-
export default ComponentAspect;
|
package/on-load.ts
DELETED
|
File without changes
|
|
Binary file
|
package/section/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Section } from './section';
|
package/section/section.tsx
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ShowFragment } from './show-fragment';
|
|
2
|
-
import { Component } from '../component';
|
|
3
|
-
|
|
4
|
-
export class ExtensionsFragment implements ShowFragment {
|
|
5
|
-
private renderList(component: Component) {
|
|
6
|
-
const aspects = component.state.aspects.entries.map((entry) => entry.id.toString());
|
|
7
|
-
return aspects.join('\n');
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
async renderRow(component: Component) {
|
|
11
|
-
return {
|
|
12
|
-
title: 'extensions',
|
|
13
|
-
content: this.renderList(component),
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
async json(component: Component) {
|
|
18
|
-
return {
|
|
19
|
-
title: 'configuration',
|
|
20
|
-
json: component.state.aspects.serialize() as any,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
}
|
package/show/files.fragment.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ShowFragment } from './show-fragment';
|
|
2
|
-
import { Component } from '../component';
|
|
3
|
-
|
|
4
|
-
export class FilesFragment implements ShowFragment {
|
|
5
|
-
async renderRow(component: Component) {
|
|
6
|
-
return {
|
|
7
|
-
title: 'files',
|
|
8
|
-
content: this.getRelativePaths(component).join('\n'),
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
async json(component: Component) {
|
|
13
|
-
return {
|
|
14
|
-
title: 'files',
|
|
15
|
-
json: this.getRelativePaths(component),
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
private getRelativePaths(component: Component) {
|
|
20
|
-
return component.state.filesystem.files.map((file) => file.relative);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
weight = 4;
|
|
24
|
-
}
|
package/show/id.fragment.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ShowFragment } from './show-fragment';
|
|
2
|
-
import { Component } from '../component';
|
|
3
|
-
|
|
4
|
-
export class IDFragment implements ShowFragment {
|
|
5
|
-
async renderRow(component: Component) {
|
|
6
|
-
return {
|
|
7
|
-
title: 'id',
|
|
8
|
-
content: component.id.toString(),
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
async json(component: Component) {
|
|
13
|
-
return {
|
|
14
|
-
title: 'id',
|
|
15
|
-
json: component.id.toString(),
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
weight = 0;
|
|
20
|
-
}
|
package/show/index.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { ShowFragment, ShowRow } from './show-fragment';
|
|
2
|
-
export { ShowCmd } from './show.cmd';
|
|
3
|
-
export { MainFileFragment } from './main-file.fragment';
|
|
4
|
-
export { NameFragment } from './name.fragment';
|
|
5
|
-
export { IDFragment } from './id.fragment';
|
|
6
|
-
export { ScopeFragment } from './scope.fragment';
|
|
7
|
-
export { FilesFragment } from './files.fragment';
|
|
8
|
-
export { ExtensionsFragment } from './extensions.fragment';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ShowFragment } from './show-fragment';
|
|
2
|
-
import { Component } from '../component';
|
|
3
|
-
|
|
4
|
-
export class MainFileFragment implements ShowFragment {
|
|
5
|
-
async renderRow(component: Component) {
|
|
6
|
-
return {
|
|
7
|
-
title: 'main file',
|
|
8
|
-
content: component.state._consumer.mainFile,
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
weight = 4;
|
|
13
|
-
}
|
package/show/name.fragment.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ShowFragment } from './show-fragment';
|
|
2
|
-
import { Component } from '../component';
|
|
3
|
-
|
|
4
|
-
export class NameFragment implements ShowFragment {
|
|
5
|
-
async renderRow(component: Component) {
|
|
6
|
-
return {
|
|
7
|
-
title: 'name',
|
|
8
|
-
content: component.id.fullName,
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
weight = 2;
|
|
13
|
-
}
|
package/show/scope.fragment.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ShowFragment } from './show-fragment';
|
|
2
|
-
import { Component } from '../component';
|
|
3
|
-
|
|
4
|
-
export class ScopeFragment implements ShowFragment {
|
|
5
|
-
async renderRow(component: Component) {
|
|
6
|
-
return {
|
|
7
|
-
title: 'scope',
|
|
8
|
-
content: component.id.scope || '',
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
getRow() {}
|
|
13
|
-
|
|
14
|
-
weight = 1;
|
|
15
|
-
}
|
package/show/show-fragment.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Component } from '../component';
|
|
2
|
-
|
|
3
|
-
export interface ShowFragment {
|
|
4
|
-
/**
|
|
5
|
-
* render a row into the `show` CLI.
|
|
6
|
-
*/
|
|
7
|
-
renderRow(component: Component): Promise<ShowRow>;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* return a json output.
|
|
11
|
-
*/
|
|
12
|
-
json?(component: Component): Promise<JSONRow>;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* weight is used to determine the position of the fragment
|
|
16
|
-
* within the `show` table.
|
|
17
|
-
*/
|
|
18
|
-
weight?: number;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface JSONRow {
|
|
22
|
-
/**
|
|
23
|
-
* name of the field.
|
|
24
|
-
*/
|
|
25
|
-
title: string;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* json content.
|
|
29
|
-
* TODO: change this from any to a more structured type (e.g. Serializable).
|
|
30
|
-
*/
|
|
31
|
-
json: any;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface ShowRow {
|
|
35
|
-
/**
|
|
36
|
-
* title of the fragment
|
|
37
|
-
*/
|
|
38
|
-
title: string;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* content to render within the fragment.
|
|
42
|
-
*/
|
|
43
|
-
content: string;
|
|
44
|
-
}
|