Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .bitmap
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"api-reference": {
"name": "api-reference",
"scope": "teambit.api-reference",
"version": "1.0.1096",
"version": "1.0.1109",
"mainFile": "index.ts",
"rootDir": "components/api-reference"
},
Expand Down Expand Up @@ -75,7 +75,7 @@
"overview/renderers/grouped-schema-nodes-overview-summary": {
"name": "overview/renderers/grouped-schema-nodes-overview-summary",
"scope": "teambit.api-reference",
"version": "0.0.70",
"version": "0.0.71",
"mainFile": "index.ts",
"rootDir": "components/overview/renderers/grouped-schema-nodes-overview-summary"
},
Expand Down Expand Up @@ -159,8 +159,8 @@
"renderers/schema-node-member-summary": {
"name": "renderers/schema-node-member-summary",
"scope": "teambit.api-reference",
"version": "0.0.80",
"mainFile": "index.ts",
"version": "0.0.0-75238957ce4bc43dee7758156dde5bc3a343e70d",
"mainFile": "dist/index.d.ts",
"rootDir": "components/renderers/schema-node-member-summary"
},
"renderers/schema-nodes-index": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ export function SchemaNodesSummary({
headings={_headings}
/>
{groupedMembersByType.map((member) => {
// @ts-expect-error - version skew: local SchemaNode has diff() but npm-published version doesn't yet
// @ts-ignore - version skew: local SchemaNode has diff() but the npm-published one doesn't yet.
// Only errors in the capsule build, where two semantic-schema versions genuinely coexist; the
// workspace type-check resolves a single copy (tsconfig paths), so @ts-expect-error would be unused there.
return renderTable(type ?? '', member, _headings);
})}
</div>
Expand All @@ -146,7 +148,8 @@ export function SchemaNodesSummary({
{groupedMembersByType.map((member) => (
<SchemaMethodMember
key={`${member.__schema}-${member.name}`}
// @ts-expect-error - version skew: local SchemaNode has diff() but npm-published version doesn't yet
// @ts-ignore - version skew: local SchemaNode has diff() but the npm-published one doesn't yet.
// Only errors in the capsule build (two semantic-schema versions); unused in the workspace type-check.
member={member}
apiNodeRendererProps={apiNodeRendererProps}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import type { HTMLAttributes } from 'react';
import React, { useMemo } from 'react';
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
// deep import on purpose: the package root re-exports `default-highlight` (highlight.js with every
// language) and `prism` (refractor with every language) alongside the light builds, so importing
// anything from the root pulls ~2.3 MB into every consumer's bundle.
import SyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-light';
import tsSyntax from 'react-syntax-highlighter/dist/esm/languages/prism/typescript';
import tsxSyntax from 'react-syntax-highlighter/dist/esm/languages/prism/tsx';
import jsSyntax from 'react-syntax-highlighter/dist/esm/languages/prism/javascript';
import jsxSyntax from 'react-syntax-highlighter/dist/esm/languages/prism/jsx';
import cssSyntax from 'react-syntax-highlighter/dist/esm/languages/prism/css';
import mdSyntax from 'react-syntax-highlighter/dist/esm/languages/prism/markdown';
import type { SchemaNode } from '@teambit/semantics.entities.semantic-schema';
import { SetAccessorSchema } from '@teambit/semantics.entities.semantic-schema';
import { transformSignature } from '@teambit/api-reference.utils.schema-node-signature-transform';
Expand All @@ -15,6 +24,14 @@ import classNames from 'classnames';

import styles from './function-node-summary.module.scss';

// `lang` below is the source file's ending: ts/tsx/js/jsx, with scss/sass mapped to css and mdx to md.
SyntaxHighlighter.registerLanguage('ts', tsSyntax);
SyntaxHighlighter.registerLanguage('tsx', tsxSyntax);
SyntaxHighlighter.registerLanguage('js', jsSyntax);
SyntaxHighlighter.registerLanguage('jsx', jsxSyntax);
SyntaxHighlighter.registerLanguage('css', cssSyntax);
SyntaxHighlighter.registerLanguage('md', mdSyntax);

export type FunctionNodeSummaryProps = {
groupElementClassName?: string;
node: SchemaNode;
Expand Down
29 changes: 29 additions & 0 deletions components/renderers/schema-node-member-summary/types/asset.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
declare module '*.png' {
const value: any;
export = value;
}
declare module '*.svg' {
import type { FunctionComponent, SVGProps } from 'react';

export const ReactComponent: FunctionComponent<SVGProps<SVGSVGElement> & { title?: string }>;
const src: string;
export default src;
}

// @TODO Gilad
declare module '*.jpg' {
const value: any;
export = value;
}
declare module '*.jpeg' {
const value: any;
export = value;
}
declare module '*.gif' {
const value: any;
export = value;
}
declare module '*.bmp' {
const value: any;
export = value;
}
42 changes: 42 additions & 0 deletions components/renderers/schema-node-member-summary/types/style.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
declare module '*.module.css' {
const classes: { readonly [key: string]: string };
export default classes;
}
declare module '*.module.scss' {
const classes: { readonly [key: string]: string };
export default classes;
}
declare module '*.module.sass' {
const classes: { readonly [key: string]: string };
export default classes;
}

declare module '*.module.less' {
const classes: { readonly [key: string]: string };
export default classes;
}

declare module '*.less' {
const classes: { readonly [key: string]: string };
export default classes;
}

declare module '*.css' {
const classes: { readonly [key: string]: string };
export default classes;
}

declare module '*.sass' {
const classes: { readonly [key: string]: string };
export default classes;
}

declare module '*.scss' {
const classes: { readonly [key: string]: string };
export default classes;
}

declare module '*.mdx' {
const component: any;
export default component;
}