Skip to content

Commit d52bae7

Browse files
authored
Fix esm import (#86)
* Fix ESM local import * Add tool to auto fix import
1 parent aeb14da commit d52bae7

File tree

29 files changed

+101
-35
lines changed

29 files changed

+101
-35
lines changed

packages/components/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"deploy:docs": "yarn run build:docs && gh-pages -d storybook-static",
3434
"doc": "api-extractor run --local",
3535
"prettier:check": "prettier --config ../../.prettierrc --check \"src/**/*.ts\"",
36-
"prettier": "prettier --config ../../.prettierrc --write \"src/**/*.ts\"",
36+
"prettier": "tsc-esm-fix --src=\"src\" --ext=\".js\" && prettier --config ../../.prettierrc --write \"src/**/*.ts\"",
3737
"eslint:check": "eslint . --ext .ts",
3838
"eslint": "eslint . --ext .ts --fix",
3939
"prepublishOnly": "rimraf README.md && cp ../../README.md . && yarn run build",
@@ -91,6 +91,7 @@
9191
"storybook": "^7.5.3",
9292
"ts-jest": "^29.1.0",
9393
"ts-loader": "^9.4.3",
94+
"tsc-esm-fix": "^2.20.21",
9495
"tslib": "^2.6.0",
9596
"typescript": "~5.2.2",
9697
"webpack": "^5.0.0"

packages/components/src/accordion-item/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
AccordionItemOptions,
88
accordionItemTemplate as template
99
} from '@microsoft/fast-foundation';
10-
import { accordionItemStyles as styles } from './accordion-item.styles';
10+
import { accordionItemStyles as styles } from './accordion-item.styles.js';
1111

1212
/**
1313
* A function that returns a {@link @microsoft/fast-foundation#AccordionItem} registration for configuring the component with a DesignSystem.

packages/components/src/anchor/anchor.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Jupyter Development Team.
22
// Distributed under the terms of the Modified BSD License.
33
import type { StoryFn, Meta, StoryObj } from '@storybook/html';
4-
import { getFaIcon } from '../utilities/storybook';
4+
import { getFaIcon } from '../utilities/storybook/index.js';
55

66
export default {
77
title: 'Components/Anchor',

packages/components/src/breadcrumb-item/breadcrumb-item.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Jupyter Development Team.
22
// Distributed under the terms of the Modified BSD License.
33
import type { StoryFn, Meta, StoryObj } from '@storybook/html';
4-
import { getFaIcon } from '../utilities/storybook';
4+
import { getFaIcon } from '../utilities/storybook/index.js';
55

66
export default {
77
title: 'Components/Breadcrumb Item',

packages/components/src/breadcrumb/breadcrumb.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Jupyter Development Team.
22
// Distributed under the terms of the Modified BSD License.
33
import type { StoryFn, Meta, StoryObj } from '@storybook/html';
4-
import { getFaIcon } from '../utilities/storybook';
4+
import { getFaIcon } from '../utilities/storybook/index.js';
55

66
export default {
77
title: 'Components/Breadcrumb',

packages/components/src/button/button.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Distributed under the terms of the Modified BSD License.
33
import type { StoryFn, Meta, StoryObj } from '@storybook/html';
44
import { action } from '@storybook/addon-actions';
5-
import { getFaIcon } from '../utilities/storybook';
5+
import { getFaIcon } from '../utilities/storybook/index.js';
66

77
export default {
88
title: 'Components/Button',

packages/components/src/card/card.stories.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// Copyright (c) Jupyter Development Team.
22
// Distributed under the terms of the Modified BSD License.
33
import type { StoryFn, Meta, StoryObj } from '@storybook/html';
4-
import { neutralForegroundRest, typeRampBaseFontSize } from '../design-tokens';
4+
import {
5+
neutralForegroundRest,
6+
typeRampBaseFontSize
7+
} from '../design-tokens.js';
58

69
export default {
710
title: 'Components/Card',

packages/components/src/checkbox/checkbox.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Distributed under the terms of the Modified BSD License.
33
import type { Meta, StoryFn, StoryObj } from '@storybook/html';
44
import { action } from '@storybook/addon-actions';
5-
import { Checkbox } from './index';
5+
import { Checkbox } from './index.js';
66

77
export default {
88
title: 'Components/Checkbox',

packages/components/src/combobox/combobox.stories.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
import type { StoryFn, Meta, StoryObj } from '@storybook/html';
55
import { action } from '@storybook/addon-actions';
6-
import { getFaIcon } from '../utilities/storybook';
7-
import { Combobox } from './index';
6+
import { getFaIcon } from '../utilities/storybook/index.js';
7+
import { Combobox } from './index.js';
88

99
export default {
1010
title: 'Components/Combobox',

packages/components/src/data-grid/data-grid.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Distributed under the terms of the Modified BSD License.
33

44
import type { StoryFn, Meta, StoryObj } from '@storybook/html';
5-
import { DataGrid } from './index';
5+
import { DataGrid } from './index.js';
66

77
export default {
88
title: 'Components/Data Grid',

0 commit comments

Comments
 (0)