Skip to content

Commit

Permalink
Fix ESM imports
Browse files Browse the repository at this point in the history
  • Loading branch information
evert committed Jan 15, 2024
1 parent f20abe0 commit b5047ff
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/forms.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { PageProps } from '../types';
import { PageProps } from '../types.js';
import { TemplatedLinks } from './forms/templated-links.js';
import { ActionForm } from './forms/ketting-action.js';
import { ButtonForm } from './forms/ketting-action-button.js';
Expand Down
2 changes: 1 addition & 1 deletion src/components/hal-body.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { PageProps, JsonSchema } from '../types.js';

import JsonViewer from './json-viewer';
import JsonViewer from './json-viewer.js';

export function HalBody(props: PageProps) {

Expand Down
6 changes: 3 additions & 3 deletions src/components/links-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { Link } from 'ketting';
import { PageProps } from '../types.js';

// List of links from the IANA website, auto generated
import * as ianaLinks from '../data/iana-links.json' with { type: 'json' };
import ianaLinks from '../data/iana-links.json';
// List of links from this project, overrides some IANA links with better
// descriptions
import * as editorLinks from '../data/editor-links.json' with { type: 'json' };
import editorLinks from '../data/editor-links.json';
//List of links from the Level 3 REST (https://level3.rest) specification.
import * as level3RestLinks from '../data/level3-rest-links.json' with { type: 'json' };
import level3RestLinks from '../data/level3-rest-links.json';

type LinkDescriptions = Record<string, {href: string; description: string}>;

Expand Down
2 changes: 1 addition & 1 deletion src/components/markdown-body.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import hljs from 'highlight.js';
import * as md from 'markdown-it';
import md from 'markdown-it';
import { PageProps } from '../types.js';

export function MarkdownBody(props: PageProps) {
Expand Down
2 changes: 1 addition & 1 deletion src/html-index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Context } from '@curveball/kernel';
import { Options, JsonSchema } from './types';
import { Options, JsonSchema } from './types.js';
import * as ReactDOMServer from 'react-dom/server';
import * as React from 'react';

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const defaultNavigationLinks: NavigationLinkMap = {
'search': true,
};

export { Options } from './types';
export { Options } from './types.js';

export default function browser(options?: Partial<Options>): Middleware {

Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"DOM",
"ES2022"
],
"declaration": true
"declaration": true,
"jsx": "react",
"resolveJsonModule": true
},
"include": [
"src/**/*"
Expand Down

0 comments on commit b5047ff

Please sign in to comment.