@teambit/component 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.
Files changed (105) hide show
  1. package/dist/aspect-list.d.ts +18 -0
  2. package/dist/component-factory.d.ts +49 -0
  3. package/dist/component-fs.d.ts +20 -1
  4. package/dist/component-map/component-map.d.ts +32 -0
  5. package/dist/component-meta.d.ts +11 -1
  6. package/dist/component.d.ts +96 -1
  7. package/dist/component.graphql.d.ts +1 -1
  8. package/dist/component.main.runtime.d.ts +30 -1
  9. package/dist/component.ui.runtime.d.ts +21 -1
  10. package/dist/config.d.ts +18 -1
  11. package/dist/dependencies/dependencies.d.ts +18 -0
  12. package/dist/exceptions/host-not-found.d.ts +8 -1
  13. package/dist/hash.d.ts +3 -0
  14. package/dist/index.d.ts +2 -2
  15. package/dist/index.js +12 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/show/show-fragment.d.ts +23 -0
  18. package/dist/snap/author.d.ts +12 -0
  19. package/dist/snap/snap.d.ts +39 -1
  20. package/dist/state.d.ts +44 -1
  21. package/dist/tag/tag.d.ts +21 -1
  22. package/dist/tag-map.d.ts +19 -0
  23. package/dist/ui/component-error/component-error.d.ts +15 -1
  24. package/dist/ui/component-model/component-model.d.ts +102 -1
  25. package/dist/ui/component.d.ts +3 -0
  26. package/dist/ui/context/component-provider.d.ts +6 -0
  27. package/dist/ui/menu/menu.d.ts +12 -0
  28. package/dist/ui/use-component-query.d.ts +1 -0
  29. package/package.json +42 -34
  30. package/tsconfig.json +1 -2
  31. package/aspect-entry.ts +0 -67
  32. package/aspect-list.ts +0 -100
  33. package/aspect.section.tsx +0 -16
  34. package/component-factory.ts +0 -106
  35. package/component-fs.ts +0 -60
  36. package/component-map/component-map.ts +0 -106
  37. package/component-map/index.ts +0 -1
  38. package/component-meta.ts +0 -29
  39. package/component.aspect.ts +0 -9
  40. package/component.docs.mdx +0 -8
  41. package/component.graphql.ts +0 -202
  42. package/component.main.runtime.ts +0 -162
  43. package/component.route.ts +0 -26
  44. package/component.ts +0 -278
  45. package/component.ui.runtime.tsx +0 -216
  46. package/config.ts +0 -34
  47. package/dependencies/dependencies.ts +0 -74
  48. package/dependencies/index.ts +0 -1
  49. package/exceptions/could-not-find-latest.ts +0 -8
  50. package/exceptions/host-not-found.ts +0 -14
  51. package/exceptions/index.ts +0 -4
  52. package/exceptions/nothing-to-snap.ts +0 -1
  53. package/hash.ts +0 -4
  54. package/head.ts +0 -0
  55. package/history-graph.ts +0 -1
  56. package/host/component-host-model.ts +0 -9
  57. package/host/index.ts +0 -2
  58. package/host/use-component-host.ts +0 -39
  59. package/index.ts +0 -32
  60. package/on-load.ts +0 -0
  61. package/package-tar/teambit-component-0.0.554.tgz +0 -0
  62. package/section/index.ts +0 -1
  63. package/section/section.tsx +0 -8
  64. package/show/extensions.fragment.ts +0 -23
  65. package/show/files.fragment.ts +0 -24
  66. package/show/id.fragment.ts +0 -20
  67. package/show/index.ts +0 -8
  68. package/show/main-file.fragment.ts +0 -13
  69. package/show/name.fragment.ts +0 -13
  70. package/show/scope.fragment.ts +0 -15
  71. package/show/show-fragment.ts +0 -44
  72. package/show/show.cmd.ts +0 -85
  73. package/snap/author.ts +0 -19
  74. package/snap/index.ts +0 -2
  75. package/snap/snap.ts +0 -63
  76. package/state.ts +0 -73
  77. package/store.ts +0 -3
  78. package/tag/index.ts +0 -1
  79. package/tag/tag.ts +0 -37
  80. package/tag-map.ts +0 -87
  81. package/types/asset.d.ts +0 -29
  82. package/types/style.d.ts +0 -42
  83. package/ui/aspect-page/aspect-page.module.scss +0 -20
  84. package/ui/aspect-page/aspect-page.tsx +0 -64
  85. package/ui/aspect-page/index.ts +0 -1
  86. package/ui/component-error/component-error.tsx +0 -22
  87. package/ui/component-error/index.ts +0 -1
  88. package/ui/component-model/component-model.ts +0 -169
  89. package/ui/component-model/index.ts +0 -1
  90. package/ui/component.module.scss +0 -7
  91. package/ui/component.tsx +0 -48
  92. package/ui/context/component-context.ts +0 -5
  93. package/ui/context/component-provider.tsx +0 -20
  94. package/ui/context/index.ts +0 -2
  95. package/ui/index.ts +0 -3
  96. package/ui/menu/index.ts +0 -2
  97. package/ui/menu/menu-nav.tsx +0 -37
  98. package/ui/menu/menu.module.scss +0 -62
  99. package/ui/menu/menu.tsx +0 -94
  100. package/ui/menu/nav-plugin.tsx +0 -9
  101. package/ui/top-bar-nav/index.ts +0 -1
  102. package/ui/top-bar-nav/top-bar-nav.module.scss +0 -52
  103. package/ui/top-bar-nav/top-bar-nav.tsx +0 -26
  104. package/ui/use-component-query.ts +0 -195
  105. package/ui/use-component.tsx +0 -34
@@ -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
package/section/index.ts DELETED
@@ -1 +0,0 @@
1
- export { Section } from './section';
@@ -1,8 +0,0 @@
1
- import { NavLinkProps } from '@teambit/base-ui.routing.nav-link';
2
- import { RouteProps } from 'react-router-dom';
3
-
4
- export interface Section {
5
- route: RouteProps;
6
- navigationLink: NavLinkProps;
7
- order?: number;
8
- }
@@ -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
- }
@@ -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
- }
@@ -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
- }
@@ -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
- }
@@ -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
- }
@@ -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
- }
package/show/show.cmd.ts DELETED
@@ -1,85 +0,0 @@
1
- import { Command, CommandOptions } from '@teambit/cli';
2
- // import { Logger } from '@teambit/logger';
3
- // import chalk from 'chalk';
4
- import { CLITable } from '@teambit/cli-table';
5
- import { MissingBitMapComponent } from '@teambit/legacy/dist/consumer/bit-map/exceptions';
6
- import { BitId } from '@teambit/legacy-bit-id';
7
- import LegacyShow from '@teambit/legacy/dist/cli/commands/public-cmds/show-cmd';
8
- import { ComponentMain } from '../component.main.runtime';
9
-
10
- export class ShowCmd implements Command {
11
- name = 'show <id>';
12
- description = 'show a component';
13
- alias = '';
14
- group = 'info';
15
- options = [
16
- ['j', 'json', 'return the component data in json format'],
17
- ['l', 'legacy', 'use the legacy bit show.'],
18
- ['r', 'remote', 'show a remote component'],
19
- [
20
- 'c',
21
- 'compare',
22
- 'compare current file system component to latest tagged component [default=latest]. only works in legacy.',
23
- ],
24
- ] as CommandOptions;
25
-
26
- constructor(private component: ComponentMain) {}
27
-
28
- private async getComponent(idStr: string, remote: boolean) {
29
- if (remote) {
30
- const bitId: BitId = BitId.parse(idStr, true); // user used --remote so we know it has a scope
31
- const host = this.component.getHost('teambit.scope/scope');
32
- const id = await host.resolveComponentId(bitId);
33
- if (!host.getRemoteComponent) {
34
- throw new Error('Component Host does not implement getRemoteComponent()');
35
- }
36
- const component = await host.getRemoteComponent(id);
37
- return component;
38
- }
39
- const host = this.component.getHost();
40
- const id = await host.resolveComponentId(idStr);
41
- const component = await host.get(id);
42
- if (!component) throw new MissingBitMapComponent(idStr);
43
- return component;
44
- }
45
-
46
- async useLegacy(id: string, json = false, remote = false, compare = false) {
47
- const legacyShow = new LegacyShow();
48
- const showData = await legacyShow.action([id], {
49
- json,
50
- versions: undefined,
51
- remote,
52
- compare,
53
- });
54
-
55
- return legacyShow.report(showData);
56
- }
57
-
58
- async report([idStr]: [string], { legacy, remote, compare }: { legacy: boolean; remote: boolean; compare: boolean }) {
59
- if (legacy) return this.useLegacy(idStr, false, remote, compare);
60
- const component = await this.getComponent(idStr, remote);
61
- const fragments = this.component.getShowFragments();
62
- const rows = await Promise.all(
63
- fragments.map(async (fragment) => {
64
- const row = await fragment.renderRow(component);
65
- return [row.title, row.content];
66
- })
67
- );
68
-
69
- const table = new CLITable([], rows);
70
- return table.render();
71
- }
72
-
73
- async json([idStr]: [string], { remote, legacy }: { remote: boolean; legacy: boolean }) {
74
- if (legacy) return JSON.parse(await this.useLegacy(idStr, true, remote));
75
- const component = await this.getComponent(idStr, remote);
76
- const fragments = this.component.getShowFragments();
77
- const rows = await Promise.all(
78
- fragments.map(async (fragment) => {
79
- return fragment.json ? fragment.json(component) : undefined;
80
- })
81
- );
82
-
83
- return rows.filter((row) => !!row);
84
- }
85
- }
package/snap/author.ts DELETED
@@ -1,19 +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; // added this to support the usual structure of an author
13
- // TODO - @ran, is this ok with you?
14
-
15
- /**
16
- * author email in a proper format (e.g. "ran@bit.dev")
17
- */
18
- email: string;
19
- };
package/snap/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export { Author } from './author';
2
- export { Snap, SnapProps } from './snap';
package/snap/snap.ts DELETED
@@ -1,63 +0,0 @@
1
- import { Author } from './author';
2
-
3
- export type SnapProps = {
4
- hash: string;
5
- timestamp: string;
6
- parents: string[];
7
- author: Author;
8
- message: string;
9
- };
10
-
11
- /**
12
- * `Snap` represents a sealed state of the component in the working tree.
13
- */
14
- export class Snap {
15
- constructor(
16
- /**
17
- * hash of the snap.
18
- */
19
- readonly hash: string,
20
-
21
- /**
22
- * date time of the snap.
23
- */
24
- readonly timestamp: Date,
25
-
26
- /**
27
- * parent snap
28
- */
29
- readonly parents: string[],
30
-
31
- /**
32
- * author of the component `Snap`.
33
- */
34
- readonly author: Author,
35
-
36
- /**
37
- * message added by the `Snap` author.
38
- */
39
- readonly message: string
40
- ) {}
41
-
42
- static fromObject(snapObject: SnapProps) {
43
- const parents = snapObject.parents || [];
44
-
45
- return new Snap(
46
- snapObject.hash,
47
- new Date(parseInt(snapObject.timestamp)),
48
- parents,
49
- snapObject.author,
50
- snapObject.message
51
- );
52
- }
53
-
54
- toObject(): SnapProps {
55
- return {
56
- timestamp: this.timestamp.getTime().toString(),
57
- hash: this.hash,
58
- author: this.author,
59
- message: this.message,
60
- parents: this.parents,
61
- };
62
- }
63
- }
package/state.ts DELETED
@@ -1,73 +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
-
6
- export class State {
7
- constructor(
8
- /**
9
- * component configuration which is later generated to a component `package.json` and `bit.json`.
10
- * @deprecated please use `aspects` instead.
11
- */
12
- readonly config: Config,
13
-
14
- /**
15
- * list of aspects configured on the component.
16
- */
17
- private _aspects: AspectList,
18
-
19
- /**
20
- * in-memory representation of the component current filesystem.
21
- */
22
- readonly filesystem: ComponentFS,
23
-
24
- /**
25
- * dependency graph of the component current. ideally package dependencies would be also placed here.
26
- */
27
- // readonly dependencies: Dependencies
28
- readonly dependencies,
29
-
30
- /**
31
- * instance of legacy consumer component.
32
- */
33
- readonly _consumer: any
34
- ) {}
35
-
36
- /**
37
- * calculate the hash of this state
38
- */
39
- get hash() {
40
- return '';
41
- }
42
-
43
- get issues(): IssuesList {
44
- return (this._consumer.issues ||= new IssuesList());
45
- }
46
-
47
- /**
48
- * is modified
49
- */
50
-
51
- get isModified(): boolean {
52
- return this._consumer._isModified;
53
- }
54
-
55
- get aspects(): AspectList {
56
- return this._aspects;
57
- }
58
-
59
- set aspects(aspects: AspectList) {
60
- this._aspects = aspects;
61
- }
62
-
63
- // static fromLegacy(consumerComponent: ConsumerComponent) {
64
- // return new State(
65
- // new Config(consumerComponent.mainFile, consumerComponent.extensions),
66
- // consumerComponent.version || 'new',
67
- // ComponentFS.fromVinyls(consumerComponent.files),
68
- // Store.fromArray([]),
69
- // consumerComponent.dependencies,
70
- // consumerComponent
71
- // );
72
- // }
73
- }
package/store.ts DELETED
@@ -1,3 +0,0 @@
1
- import { ExtensionDataList } from '@teambit/legacy/dist/consumer/config/extension-data';
2
-
3
- export class Store extends ExtensionDataList {}
package/tag/index.ts DELETED
@@ -1 +0,0 @@
1
- export { Tag } from './tag';
package/tag/tag.ts DELETED
@@ -1,37 +0,0 @@
1
- import { SemVer } from 'semver';
2
-
3
- export type TagProps = {
4
- hash: string;
5
- version: string;
6
- };
7
-
8
- /**
9
- * `Tag` provides a sematic reference to a specific state `Snap` in the working tree.
10
- */
11
- export class Tag {
12
- constructor(
13
- /**
14
- * tag hash, can be used to load it by component-factory.getSnap
15
- */
16
- readonly hash: string,
17
-
18
- /**
19
- * sematic version of the snap.
20
- */
21
- readonly version: SemVer
22
- ) {}
23
-
24
- /**
25
- * create a plain tag object.
26
- */
27
- toObject(): TagProps {
28
- return {
29
- hash: this.hash,
30
- version: this.version.raw,
31
- };
32
- }
33
-
34
- static fromObject(tag: TagProps) {
35
- return new Tag(tag.hash, new SemVer(tag.version));
36
- }
37
- }
package/tag-map.ts DELETED
@@ -1,87 +0,0 @@
1
- import { getLatestVersion } from '@teambit/legacy/dist/utils/semver-helper';
2
- import { SemVer, maxSatisfying } from 'semver';
3
-
4
- import { CouldNotFindLatest } from './exceptions';
5
- import { Hash } from './hash';
6
- import { Tag } from './tag';
7
-
8
- export class TagMap extends Map<SemVer, Tag> {
9
- /**
10
- * get snap by hash.
11
- */
12
- byHash(hash: Hash) {
13
- const tag = Array.from(this.values()).find((currTag) => currTag.hash === hash);
14
- return tag;
15
- }
16
-
17
- /**
18
- * e.g.
19
- * {
20
- * alpha: '1.0.0-alpha.5',
21
- * dev: '2.2.4-dev.37
22
- * }
23
- */
24
- getPreReleaseLatestTags(): { [preRelease: string]: string } {
25
- const preReleaseTagsWithAllVersions = this.toArray().reduce((acc, current) => {
26
- const preReleases = current.version.prerelease;
27
- if (!preReleases.length) return acc;
28
- if (preReleases.length !== 2) {
29
- // it could be length 1, e.g. 1.0.0-0, we ignore it.
30
- // it could also be length > 2, e.g. 1.0.0-dev.1.alpha.1, we don't support it for now.
31
- return acc;
32
- }
33
- if (typeof preReleases[0] !== 'string') return acc;
34
- (acc[preReleases[0]] ||= []).push(current.version.raw);
35
- return acc;
36
- }, {});
37
- return Object.keys(preReleaseTagsWithAllVersions).reduce((acc, current) => {
38
- acc[current] = maxSatisfying<string>(preReleaseTagsWithAllVersions[current], '*', { includePrerelease: true });
39
- return acc;
40
- }, {});
41
- }
42
-
43
- /**
44
- * Get a map that map snap hash to tag
45
- */
46
- getHashMap(): Map<Hash, Tag> {
47
- const res: Map<Hash, Tag> = new Map();
48
- this.forEach((tag: Tag) => {
49
- res.set(tag.hash, tag);
50
- });
51
- return res;
52
- }
53
-
54
- /**
55
- * get the latest semver from the tag map.
56
- */
57
- getLatest(): string {
58
- const versions = this.toArray().map((tag) => tag.version.raw);
59
- if (this.isEmpty()) throw new CouldNotFindLatest(versions);
60
- return getLatestVersion(versions);
61
- }
62
-
63
- isEmpty() {
64
- return this.size === 0;
65
- }
66
-
67
- /**
68
- * get an array of all tags.
69
- */
70
- toArray(): Tag[] {
71
- return Array.from(this.values());
72
- }
73
-
74
- byVersion(version: string): Tag | undefined {
75
- const versions = this.toArray().map((tag) => tag);
76
- return versions.find((tag) => tag.version.raw === version);
77
- }
78
-
79
- static fromArray(tags: Tag[]) {
80
- const tuples: [SemVer, Tag][] = tags.map((tag) => [tag.version, tag]);
81
- return new TagMap(tuples);
82
- }
83
-
84
- static empty() {
85
- return new TagMap();
86
- }
87
- }
package/types/asset.d.ts DELETED
@@ -1,29 +0,0 @@
1
- declare module '*.png' {
2
- const value: any;
3
- export = value;
4
- }
5
- declare module '*.svg' {
6
- import type { FunctionComponent, SVGProps } from 'react';
7
-
8
- export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
9
- const src: string;
10
- export default src;
11
- }
12
-
13
- // @TODO Gilad
14
- declare module '*.jpg' {
15
- const value: any;
16
- export = value;
17
- }
18
- declare module '*.jpeg' {
19
- const value: any;
20
- export = value;
21
- }
22
- declare module '*.gif' {
23
- const value: any;
24
- export = value;
25
- }
26
- declare module '*.bmp' {
27
- const value: any;
28
- export = value;
29
- }