@teambit/component 1.0.226 → 1.0.228

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.
Files changed (88) hide show
  1. package/artifacts/__bit_junit.xml +1 -1
  2. package/artifacts/preview/teambit_component_component-preview.js +1 -1
  3. package/artifacts/schema.json +821 -1517
  4. package/dist/component-factory.js.map +1 -1
  5. package/dist/component.js +3 -0
  6. package/dist/component.js.map +1 -1
  7. package/dist/{preview-1712632644937.js → preview-1712805335812.js} +2 -2
  8. package/package.json +22 -22
  9. package/tsconfig.json +46 -1
  10. package/dist/aspect-entry.d.ts +0 -39
  11. package/dist/aspect-list.d.ts +0 -43
  12. package/dist/aspect.section.d.ts +0 -13
  13. package/dist/component-factory.d.ts +0 -149
  14. package/dist/component-fs.d.ts +0 -34
  15. package/dist/component-interface.d.ts +0 -22
  16. package/dist/component-map/component-map.d.ts +0 -63
  17. package/dist/component-map/index.d.ts +0 -1
  18. package/dist/component-meta.d.ts +0 -22
  19. package/dist/component.aspect.d.ts +0 -3
  20. package/dist/component.composition.d.ts +0 -1
  21. package/dist/component.d.ts +0 -182
  22. package/dist/component.graphql.d.ts +0 -83
  23. package/dist/component.main.runtime.d.ts +0 -75
  24. package/dist/component.route.d.ts +0 -18
  25. package/dist/component.ui.runtime.d.ts +0 -104
  26. package/dist/config.d.ts +0 -18
  27. package/dist/dependencies/dependencies.d.ts +0 -43
  28. package/dist/dependencies/index.d.ts +0 -1
  29. package/dist/exceptions/could-not-find-latest.d.ts +0 -4
  30. package/dist/exceptions/host-not-found.d.ts +0 -12
  31. package/dist/exceptions/index.d.ts +0 -4
  32. package/dist/exceptions/main-file-not-found.d.ts +0 -14
  33. package/dist/exceptions/nothing-to-snap.d.ts +0 -2
  34. package/dist/get-component-opts.d.ts +0 -13
  35. package/dist/hash.d.ts +0 -4
  36. package/dist/head.d.ts +0 -0
  37. package/dist/history-graph.d.ts +0 -2
  38. package/dist/host/component-host-model.d.ts +0 -7
  39. package/dist/host/index.d.ts +0 -2
  40. package/dist/host/use-component-host.d.ts +0 -6
  41. package/dist/index.d.ts +0 -37
  42. package/dist/on-load.d.ts +0 -0
  43. package/dist/section/index.d.ts +0 -1
  44. package/dist/section/section.d.ts +0 -11
  45. package/dist/show/extensions.fragment.d.ts +0 -13
  46. package/dist/show/files.fragment.d.ts +0 -14
  47. package/dist/show/id.fragment.d.ts +0 -13
  48. package/dist/show/index.d.ts +0 -8
  49. package/dist/show/main-file.fragment.d.ts +0 -9
  50. package/dist/show/name.fragment.d.ts +0 -9
  51. package/dist/show/scope.fragment.d.ts +0 -10
  52. package/dist/show/show-fragment.d.ts +0 -37
  53. package/dist/show/show.cmd.d.ts +0 -26
  54. package/dist/snap/author.d.ts +0 -17
  55. package/dist/snap/index.d.ts +0 -2
  56. package/dist/snap/snap.d.ts +0 -56
  57. package/dist/state.d.ts +0 -65
  58. package/dist/store.d.ts +0 -3
  59. package/dist/tag/index.d.ts +0 -1
  60. package/dist/tag/tag.d.ts +0 -32
  61. package/dist/tag-map.d.ts +0 -35
  62. package/dist/ui/aspect-page/aspect-page.d.ts +0 -1
  63. package/dist/ui/aspect-page/index.d.ts +0 -1
  64. package/dist/ui/component-error/component-error.d.ts +0 -20
  65. package/dist/ui/component-error/index.d.ts +0 -1
  66. package/dist/ui/component-model/component-model.d.ts +0 -186
  67. package/dist/ui/component-model/index.d.ts +0 -1
  68. package/dist/ui/component-searcher/component-result.d.ts +0 -16
  69. package/dist/ui/component-searcher/component-searcher.d.ts +0 -22
  70. package/dist/ui/component-searcher/index.d.ts +0 -2
  71. package/dist/ui/component.d.ts +0 -26
  72. package/dist/ui/context/component-context.d.ts +0 -6
  73. package/dist/ui/context/component-provider.d.ts +0 -25
  74. package/dist/ui/context/index.d.ts +0 -3
  75. package/dist/ui/index.d.ts +0 -12
  76. package/dist/ui/menu/index.d.ts +0 -3
  77. package/dist/ui/menu/menu-nav.d.ts +0 -23
  78. package/dist/ui/menu/menu.d.ts +0 -97
  79. package/dist/ui/menu/nav-plugin.d.ts +0 -28
  80. package/dist/ui/top-bar-nav/index.d.ts +0 -1
  81. package/dist/ui/top-bar-nav/top-bar-nav.d.ts +0 -2
  82. package/dist/ui/use-component-from-location.d.ts +0 -1
  83. package/dist/ui/use-component-logs.d.ts +0 -16
  84. package/dist/ui/use-component-query.d.ts +0 -3
  85. package/dist/ui/use-component.d.ts +0 -3
  86. package/dist/ui/use-component.fragments.d.ts +0 -10
  87. package/dist/ui/use-component.model.d.ts +0 -44
  88. package/dist/ui/use-component.utils.d.ts +0 -1
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import { RouteProps } from 'react-router-dom';
3
- import type { UseComponentType, Filters } from './ui/use-component';
4
- export type GetComponentsOptions = {
5
- useComponent?: UseComponentType;
6
- componentId?: string | (() => string | undefined);
7
- useComponentFilters?: () => Filters;
8
- path?: string;
9
- skipRightSide?: boolean;
10
- RightNode?: React.ReactNode;
11
- className?: string;
12
- routes?: RouteProps[];
13
- };
package/dist/hash.d.ts DELETED
@@ -1,4 +0,0 @@
1
- /**
2
- * type for representing content-addressable filesystem hashes.
3
- */
4
- export type Hash = string;
package/dist/head.d.ts DELETED
File without changes
@@ -1,2 +0,0 @@
1
- export default class HistoryGraph {
2
- }
@@ -1,7 +0,0 @@
1
- import { ComponentModel } from '../ui';
2
- export declare class ComponentHostModel {
3
- readonly name: string;
4
- readonly components: ComponentModel[];
5
- constructor(name: string, components: ComponentModel[]);
6
- static from(data: any): ComponentHostModel;
7
- }
@@ -1,2 +0,0 @@
1
- export { useComponentHost } from './use-component-host';
2
- export * from './component-host-model';
@@ -1,6 +0,0 @@
1
- import { ComponentHostModel } from './component-host-model';
2
- export declare function useComponentHost(): {
3
- host?: undefined;
4
- } | {
5
- host: ComponentHostModel;
6
- };
package/dist/index.d.ts DELETED
@@ -1,37 +0,0 @@
1
- import { ComponentAspect } from './component.aspect';
2
- export type { GetComponentsOptions } from './get-component-opts';
3
- export type { UseComponentType } from './ui/use-component';
4
- export { useComponentHost } from './host';
5
- export { Component, InvalidComponent } from './component';
6
- export { ComponentID } from '@teambit/component-id';
7
- export { default as ComponentFS } from './component-fs';
8
- export type { Config as ComponentConfig } from './config';
9
- export type { ComponentFactory, ResolveAspectsOptions, FilterAspectsOptions, LoadAspectsOptions, } from './component-factory';
10
- export type { AspectList } from './aspect-list';
11
- export { AspectEntry, AspectData, ResolveComponentIdFunc } from './aspect-entry';
12
- export { Snap, SnapProps } from './snap/snap';
13
- export type { Author } from './snap/author';
14
- export { Tag, TagProps } from './tag/tag';
15
- export type { IComponent } from './component-interface';
16
- export { State } from './state';
17
- export type { Hash } from './hash';
18
- export { TagMap } from './tag-map';
19
- export { ComponentMap } from './component-map';
20
- export type { ComponentMain } from './component.main.runtime';
21
- export type { ComponentUI } from './component.ui.runtime';
22
- export type { Section } from './section';
23
- export { ComponentContext, ComponentDescriptorContext, useComponentDescriptor } from './ui/context/component-context';
24
- export type { ComponentProviderProps, ComponentDescriptorProviderProps } from './ui/context';
25
- export { ComponentProvider, ComponentDescriptorProvider } from './ui/context';
26
- export { componentFields, componentIdFields, componentOverviewFields } from './ui';
27
- export type { NavPlugin, ConsumePlugin, MenuNavProps } from './ui/menu';
28
- export { CollapsibleMenuNav, ComponentMenu, VersionRelatedDropdowns } from './ui/menu';
29
- export type { RegisteredComponentRoute, ComponentUrlParams } from './component.route';
30
- export type { ComponentModelProps } from './ui/component-model';
31
- export { ComponentModel } from './ui/component-model';
32
- export { TopBarNav } from './ui/top-bar-nav';
33
- export type { ShowFragment, ShowRow, ShowJSONRow } from './show';
34
- export { Config } from './config';
35
- export { useComponent, useIdFromLocation, useComponentLogs, ComponentLogsResult, Filters } from './ui';
36
- export { ComponentAspect };
37
- export default ComponentAspect;
package/dist/on-load.d.ts DELETED
File without changes
@@ -1 +0,0 @@
1
- export { Section } from './section';
@@ -1,11 +0,0 @@
1
- import type { LinkProps } from '@teambit/base-react.navigation.link';
2
- import { RouteProps } from 'react-router-dom';
3
- export interface Section {
4
- route: RouteProps;
5
- navigationLink: LinkProps;
6
- /**
7
- * text to be used in the mobile res dropdown
8
- */
9
- displayName?: string;
10
- order?: number;
11
- }
@@ -1,13 +0,0 @@
1
- import { ShowFragment } from './show-fragment';
2
- import { Component } from '../component';
3
- export declare class ExtensionsFragment implements ShowFragment {
4
- private renderList;
5
- renderRow(component: Component): Promise<{
6
- title: string;
7
- content: string;
8
- }>;
9
- json(component: Component): Promise<{
10
- title: string;
11
- json: any;
12
- }>;
13
- }
@@ -1,14 +0,0 @@
1
- import { ShowFragment } from './show-fragment';
2
- import { Component } from '../component';
3
- export declare class FilesFragment implements ShowFragment {
4
- renderRow(component: Component): Promise<{
5
- title: string;
6
- content: string;
7
- }>;
8
- json(component: Component): Promise<{
9
- title: string;
10
- json: string[];
11
- }>;
12
- private getRelativePaths;
13
- weight: number;
14
- }
@@ -1,13 +0,0 @@
1
- import { ShowFragment } from './show-fragment';
2
- import { Component } from '../component';
3
- export declare class IDFragment implements ShowFragment {
4
- renderRow(component: Component): Promise<{
5
- title: string;
6
- content: string;
7
- }>;
8
- json(component: Component): Promise<{
9
- title: string;
10
- json: string;
11
- }>;
12
- weight: number;
13
- }
@@ -1,8 +0,0 @@
1
- export { ShowFragment, ShowRow, JSONRow as ShowJSONRow } 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,9 +0,0 @@
1
- import { ShowFragment } from './show-fragment';
2
- import { Component } from '../component';
3
- export declare class MainFileFragment implements ShowFragment {
4
- renderRow(component: Component): Promise<{
5
- title: string;
6
- content: any;
7
- }>;
8
- weight: number;
9
- }
@@ -1,9 +0,0 @@
1
- import { ShowFragment } from './show-fragment';
2
- import { Component } from '../component';
3
- export declare class NameFragment implements ShowFragment {
4
- renderRow(component: Component): Promise<{
5
- title: string;
6
- content: string;
7
- }>;
8
- weight: number;
9
- }
@@ -1,10 +0,0 @@
1
- import { ShowFragment } from './show-fragment';
2
- import { Component } from '../component';
3
- export declare class ScopeFragment implements ShowFragment {
4
- renderRow(component: Component): Promise<{
5
- title: string;
6
- content: string;
7
- }>;
8
- getRow(): void;
9
- weight: number;
10
- }
@@ -1,37 +0,0 @@
1
- import { Component } from '../component';
2
- export interface ShowFragment {
3
- /**
4
- * render a row into the `show` CLI.
5
- */
6
- renderRow(component: Component): Promise<ShowRow>;
7
- /**
8
- * return a json output.
9
- */
10
- json?(component: Component): Promise<JSONRow>;
11
- /**
12
- * weight is used to determine the position of the fragment
13
- * within the `show` table.
14
- */
15
- weight?: number;
16
- }
17
- export interface JSONRow {
18
- /**
19
- * name of the field.
20
- */
21
- title: string;
22
- /**
23
- * json content.
24
- * TODO: change this from any to a more structured type (e.g. Serializable).
25
- */
26
- json: any;
27
- }
28
- export interface ShowRow {
29
- /**
30
- * title of the fragment
31
- */
32
- title: string;
33
- /**
34
- * content to render within the fragment.
35
- */
36
- content: string;
37
- }
@@ -1,26 +0,0 @@
1
- import { Command, CommandOptions } from '@teambit/cli';
2
- import { ComponentMain } from '../component.main.runtime';
3
- export declare class ShowCmd implements Command {
4
- private component;
5
- name: string;
6
- description: string;
7
- alias: string;
8
- group: string;
9
- arguments: {
10
- name: string;
11
- description: string;
12
- }[];
13
- options: CommandOptions;
14
- constructor(component: ComponentMain);
15
- private getComponent;
16
- useLegacy(id: string, json?: boolean, remote?: boolean, compare?: boolean): Promise<string>;
17
- report([idStr]: [string], { legacy, remote, compare }: {
18
- legacy: boolean;
19
- remote: boolean;
20
- compare: boolean;
21
- }): Promise<string>;
22
- json([idStr]: [string], { remote, legacy }: {
23
- remote: boolean;
24
- legacy: boolean;
25
- }): Promise<any>;
26
- }
@@ -1,17 +0,0 @@
1
- /**
2
- * author type.
3
- */
4
- export type Author = {
5
- /**
6
- * author full name (for example: "Ran Mizrahi")
7
- */
8
- displayName: string;
9
- /**
10
- * author username (for example: "ranm8")
11
- */
12
- name?: string;
13
- /**
14
- * author email in a proper format (e.g. "ran@bit.dev")
15
- */
16
- email: string;
17
- };
@@ -1,2 +0,0 @@
1
- export { Author } from './author';
2
- export { Snap, SnapProps } from './snap';
@@ -1,56 +0,0 @@
1
- import { Author } from './author';
2
- export type SnapProps = {
3
- hash: string;
4
- timestamp: string;
5
- parents: string[];
6
- author: Author;
7
- message: string;
8
- };
9
- /**
10
- * `Snap` represents a sealed state of the component in the working tree.
11
- */
12
- export declare class Snap {
13
- /**
14
- * hash of the snap.
15
- */
16
- readonly hash: string;
17
- /**
18
- * date time of the snap.
19
- */
20
- readonly timestamp: Date;
21
- /**
22
- * parent snap
23
- */
24
- readonly parents: string[];
25
- /**
26
- * author of the component `Snap`.
27
- */
28
- readonly author: Author;
29
- /**
30
- * message added by the `Snap` author.
31
- */
32
- readonly message: string;
33
- constructor(
34
- /**
35
- * hash of the snap.
36
- */
37
- hash: string,
38
- /**
39
- * date time of the snap.
40
- */
41
- timestamp: Date,
42
- /**
43
- * parent snap
44
- */
45
- parents: string[],
46
- /**
47
- * author of the component `Snap`.
48
- */
49
- author: Author,
50
- /**
51
- * message added by the `Snap` author.
52
- */
53
- message: string);
54
- static fromObject(snapObject: SnapProps): Snap;
55
- toObject(): SnapProps;
56
- }
package/dist/state.d.ts DELETED
@@ -1,65 +0,0 @@
1
- import { IssuesList } from '@teambit/component-issues';
2
- import ComponentFS from './component-fs';
3
- import { Config } from './config';
4
- import { AspectList } from './aspect-list';
5
- export declare class State {
6
- /**
7
- * component configuration which is later generated to a component `package.json` and `bit.json`.
8
- * @deprecated please use `aspects` instead.
9
- */
10
- readonly config: Config;
11
- /**
12
- * list of aspects configured on the component.
13
- */
14
- private _aspects;
15
- /**
16
- * in-memory representation of the component current filesystem.
17
- */
18
- readonly filesystem: ComponentFS;
19
- /**
20
- * dependency graph of the component current. ideally package dependencies would be also placed here.
21
- */
22
- readonly dependencies: any;
23
- /**
24
- * instance of legacy consumer component.
25
- */
26
- readonly _consumer: any;
27
- constructor(
28
- /**
29
- * component configuration which is later generated to a component `package.json` and `bit.json`.
30
- * @deprecated please use `aspects` instead.
31
- */
32
- config: Config,
33
- /**
34
- * list of aspects configured on the component.
35
- */
36
- _aspects: AspectList,
37
- /**
38
- * in-memory representation of the component current filesystem.
39
- */
40
- filesystem: ComponentFS,
41
- /**
42
- * dependency graph of the component current. ideally package dependencies would be also placed here.
43
- */
44
- dependencies: any,
45
- /**
46
- * instance of legacy consumer component.
47
- */
48
- _consumer: any);
49
- /**
50
- * get the main file of the component.
51
- */
52
- get mainFile(): import("@teambit/legacy/dist/consumer/component/sources").AbstractVinyl;
53
- /**
54
- * calculate the hash of this state
55
- */
56
- get hash(): string;
57
- get issues(): IssuesList;
58
- /**
59
- * @deprecated please use `component.isModified`.
60
- * the way it's implemented here is unreliable and will only work if in the legacy the "isModified" was calculated.
61
- */
62
- get isModified(): boolean;
63
- get aspects(): AspectList;
64
- set aspects(aspects: AspectList);
65
- }
package/dist/store.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { ExtensionDataList } from '@teambit/legacy/dist/consumer/config/extension-data';
2
- export declare class Store extends ExtensionDataList {
3
- }
@@ -1 +0,0 @@
1
- export { Tag } from './tag';
package/dist/tag/tag.d.ts DELETED
@@ -1,32 +0,0 @@
1
- import { SemVer } from 'semver';
2
- export type TagProps = {
3
- hash: string;
4
- version: string;
5
- };
6
- /**
7
- * `Tag` provides a sematic reference to a specific state `Snap` in the working tree.
8
- */
9
- export declare class Tag {
10
- /**
11
- * tag hash, can be used to load it by component-factory.getSnap
12
- */
13
- readonly hash: string;
14
- /**
15
- * sematic version of the snap.
16
- */
17
- readonly version: SemVer;
18
- constructor(
19
- /**
20
- * tag hash, can be used to load it by component-factory.getSnap
21
- */
22
- hash: string,
23
- /**
24
- * sematic version of the snap.
25
- */
26
- version: SemVer);
27
- /**
28
- * create a plain tag object.
29
- */
30
- toObject(): TagProps;
31
- static fromObject(tag: TagProps): Tag;
32
- }
package/dist/tag-map.d.ts DELETED
@@ -1,35 +0,0 @@
1
- import { SemVer } from 'semver';
2
- import { Hash } from './hash';
3
- import { Tag } from './tag';
4
- export declare class TagMap extends Map<SemVer, Tag> {
5
- /**
6
- * get snap by hash.
7
- */
8
- byHash(hash: Hash): Tag | undefined;
9
- /**
10
- * e.g.
11
- * {
12
- * alpha: '1.0.0-alpha.5',
13
- * dev: '2.2.4-dev.37
14
- * }
15
- */
16
- getPreReleaseLatestTags(): {
17
- [preRelease: string]: string;
18
- };
19
- /**
20
- * Get a map that map snap hash to tag
21
- */
22
- getHashMap(): Map<Hash, Tag>;
23
- /**
24
- * get the latest semver from the tag map.
25
- */
26
- getLatest(): string;
27
- isEmpty(): boolean;
28
- /**
29
- * get an array of all tags.
30
- */
31
- toArray(): Tag[];
32
- byVersion(version: string): Tag | undefined;
33
- static fromArray(tags: Tag[]): TagMap;
34
- static empty(): TagMap;
35
- }
@@ -1 +0,0 @@
1
- export declare function AspectPage(): import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- export { AspectPage } from './aspect-page';
@@ -1,20 +0,0 @@
1
- export declare class ComponentError {
2
- /**
3
- * http status code of error
4
- */
5
- readonly code: number;
6
- /**
7
- * error message of the error
8
- */
9
- readonly message?: string | undefined;
10
- constructor(
11
- /**
12
- * http status code of error
13
- */
14
- code: number,
15
- /**
16
- * error message of the error
17
- */
18
- message?: string | undefined);
19
- renderError(): import("react/jsx-runtime").JSX.Element;
20
- }
@@ -1 +0,0 @@
1
- export { ComponentError } from './component-error';