Skip to content

Commit c5ce1ce

Browse files
committed
fix(api): support importmaps, fix #1840
1 parent ce01a2c commit c5ce1ce

File tree

9 files changed

+33
-33
lines changed

9 files changed

+33
-33
lines changed

packages/api/src/api/api.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { ComponentBounds, Hookable } from './hooks'
2-
import { Context } from './context'
3-
import { ComponentInstance, ComponentState, StateBase } from './component'
4-
import { App } from './app'
5-
import { ID } from './util'
1+
import type { ComponentBounds, Hookable } from './hooks.js'
2+
import type { Context } from './context.js'
3+
import type { ComponentInstance, ComponentState, StateBase } from './component.js'
4+
import type { App } from './app.js'
5+
import type { ID } from './util.js'
66

77
export interface DevtoolsPluginApi<TSettings> {
88
on: Hookable<Context>

packages/api/src/api/component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { InspectorNodeTag } from './api'
2-
import { ID } from './util'
1+
import type { InspectorNodeTag } from './api.js'
2+
import type { ID } from './util.js'
33

44
export type ComponentInstance = any // @TODO
55

packages/api/src/api/context.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AppRecord } from './api'
1+
import type { AppRecord } from './api.js'
22

33
export interface Context {
44
currentTab: string

packages/api/src/api/hooks.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { ComponentTreeNode, InspectedComponentData, ComponentInstance, ComponentDevtoolsOptions } from './component'
2-
import { App } from './app'
3-
import { CustomInspectorNode, CustomInspectorState, TimelineEvent } from './api'
1+
import type { ComponentTreeNode, InspectedComponentData, ComponentInstance, ComponentDevtoolsOptions } from './component.js'
2+
import type { App } from './app.js'
3+
import type { CustomInspectorNode, CustomInspectorState, TimelineEvent } from './api.js'
44

55
export const enum Hooks {
66
TRANSFORM_CALL = 'transformCall',

packages/api/src/api/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
export * from './api'
2-
export * from './app'
3-
export * from './component'
4-
export * from './context'
5-
export * from './hooks'
6-
export * from './util'
1+
export * from './api.js'
2+
export * from './app.js'
3+
export * from './component.js'
4+
export * from './context.js'
5+
export * from './hooks.js'
6+
export * from './util.js'

packages/api/src/env.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { PluginDescriptor, SetupFunction } from '.'
2-
import { ApiProxy } from './proxy'
1+
import type { PluginDescriptor, SetupFunction } from './index.js'
2+
import type { ApiProxy } from './proxy.js'
33

44
export interface PluginQueueItem {
55
pluginDescriptor: PluginDescriptor

packages/api/src/index.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { getTarget, getDevtoolsGlobalHook, isProxyAvailable } from './env'
2-
import { HOOK_SETUP } from './const'
3-
import { DevtoolsPluginApi } from './api'
4-
import { ApiProxy } from './proxy'
5-
import { PluginDescriptor, ExtractSettingsTypes, PluginSettingsItem } from './plugin'
1+
import { getTarget, getDevtoolsGlobalHook, isProxyAvailable } from './env.js'
2+
import { HOOK_SETUP } from './const.js'
3+
import type { DevtoolsPluginApi } from './api/index.js'
4+
import { ApiProxy } from './proxy.js'
5+
import type { PluginDescriptor, ExtractSettingsTypes, PluginSettingsItem } from './plugin.js'
66

7-
export * from './api'
8-
export * from './plugin'
9-
export * from './time'
10-
export { PluginQueueItem } from './env'
7+
export * from './api/index.js'
8+
export * from './plugin.js'
9+
export * from './time.js'
10+
export { PluginQueueItem } from './env.js'
1111

1212
// https://github.com/microsoft/TypeScript/issues/30680#issuecomment-752725353
1313
type Cast<A, B> = A extends B ? A : B

packages/api/src/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { App } from './api'
1+
import type { App } from './api/index.js'
22

33
export interface PluginDescriptor {
44
id: string

packages/api/src/proxy.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Context, DevtoolsPluginApi, Hookable } from './api'
2-
import { PluginDescriptor } from './plugin'
3-
import { HOOK_PLUGIN_SETTINGS_SET } from './const'
4-
import { now } from './time'
1+
import type { Context, DevtoolsPluginApi, Hookable } from './api/index.js'
2+
import type { PluginDescriptor } from './plugin.js'
3+
import { HOOK_PLUGIN_SETTINGS_SET } from './const.js'
4+
import { now } from './time.js'
55

66
interface QueueItem {
77
method: string

0 commit comments

Comments
 (0)