Skip to content

Commit

Permalink
Rewrite imports with extension
Browse files Browse the repository at this point in the history
  • Loading branch information
pvditto committed May 23, 2024
1 parent 2efe0d7 commit 3515362
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 36 deletions.
1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"plugin:react/recommended",
"prettier"
],
"exclude": ["scripts/*.js"],
"rules": {
"deprecation/deprecation": "error",
"react-hooks/rules-of-hooks": "error",
Expand Down
4 changes: 2 additions & 2 deletions src/DittoLazyProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
DittoHash,
RegisterDitto,
UnregisterDitto,
} from './DittoContext'
import { ProviderState, RenderFunction } from './DittoProvider'
} from './DittoContext.js'
import { ProviderState, RenderFunction } from './DittoProvider.js'

export interface DittoLazyProviderProps {
initOptions?: InitOptions
Expand Down
4 changes: 2 additions & 2 deletions src/DittoProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import React, {
useState,
} from 'react'

import { DittoHash, RegisterDitto, UnregisterDitto } from '.'
import { DittoContext } from './DittoContext'
import { DittoContext } from './DittoContext.js'
import { DittoHash, RegisterDitto, UnregisterDitto } from './index.js'

export type RenderFunction = (providerState: ProviderState) => ReactNode

Expand Down
6 changes: 3 additions & 3 deletions src/identity/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './useOfflinePlaygroundIdentity'
export * from './useOnlineIdentity'
export * from './useOnlinePlaygroundIdentity'
export * from './useOfflinePlaygroundIdentity.js'
export * from './useOnlineIdentity.js'
export * from './useOnlinePlaygroundIdentity.js'
16 changes: 8 additions & 8 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export * from './DittoContext'
export * from './DittoLazyProvider'
export * from './DittoProvider'
export * from './identity'
export * from './mutations'
export * from './presence'
export * from './queries'
export * from './useDitto'
export * from './DittoContext.js'
export * from './DittoLazyProvider.js'
export * from './DittoProvider.js'
export * from './identity/index.js'
export * from './mutations/index.js'
export * from './presence/index.js'
export * from './queries/index.js'
export * from './useDitto.js'
2 changes: 1 addition & 1 deletion src/mutations/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './useMutations'
export * from './useMutations.js'
2 changes: 1 addition & 1 deletion src/mutations/useMutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from '@dittolive/ditto'
import { useCallback } from 'react'

import { useDitto } from '../useDitto'
import { useDitto } from '../useDitto.js'

export interface UpdateParams {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/presence/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './useConnectionStatus'
export * from './useConnectionStatus.js'
2 changes: 1 addition & 1 deletion src/presence/useConnectionStatus.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ConnectionType, Observer } from '@dittolive/ditto'
import { useEffect, useRef, useState } from 'react'

import { useDitto } from '../useDitto'
import { useDitto } from '../useDitto.js'

export interface ConnectionStatusParams {
/**
Expand Down
12 changes: 6 additions & 6 deletions src/queries/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from './useCollections'
export * from './useLazyPendingCursorOperation'
export * from './useLazyPendingIDSpecificOperation'
export * from './usePendingCursorOperation'
export * from './usePendingIDSpecificOperation'
export * from './useRemotePeers'
export * from './useCollections.js'
export * from './useLazyPendingCursorOperation.js'
export * from './useLazyPendingIDSpecificOperation.js'
export * from './usePendingCursorOperation.js'
export * from './usePendingIDSpecificOperation.js'
export * from './useRemotePeers.js'
2 changes: 1 addition & 1 deletion src/queries/useCollections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from '@dittolive/ditto'
import { useEffect, useRef, useState } from 'react'

import { useDitto } from '../useDitto'
import { useDitto } from '../useDitto.js'

export interface CollectionsQueryParams {
/**
Expand Down
4 changes: 2 additions & 2 deletions src/queries/useLazyPendingCursorOperation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {
} from '@dittolive/ditto'
import { useEffect, useRef, useState } from 'react'

import { useDittoContext } from '../DittoContext'
import { LiveQueryParams } from './usePendingCursorOperation'
import { useDittoContext } from '../DittoContext.js'
import { LiveQueryParams } from './usePendingCursorOperation.js'

export interface LazyPendingCursorOperationReturn {
/** The initialized Ditto instance if one could be found for the provided path. */
Expand Down
4 changes: 2 additions & 2 deletions src/queries/useLazyPendingIDSpecificOperation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
} from '@dittolive/ditto'
import { useEffect, useRef, useState } from 'react'

import { useDittoContext } from '../DittoContext'
import { UsePendingIDSpecificOperationParams } from './usePendingIDSpecificOperation'
import { useDittoContext } from '../DittoContext.js'
import { UsePendingIDSpecificOperationParams } from './usePendingIDSpecificOperation.js'

export interface LazyPendingIDSpecificOperationReturn {
/** The initialized Ditto instance if one could be found for the provided path. */
Expand Down
4 changes: 2 additions & 2 deletions src/queries/usePendingCursorOperation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {
} from '@dittolive/ditto'
import { useEffect, useRef, useState } from 'react'

import { useDitto } from '../useDitto'
import { useVersion } from './useVersion'
import { useDitto } from '../useDitto.js'
import { useVersion } from './useVersion.js'

export interface LiveQueryParams {
collection: string
Expand Down
2 changes: 1 addition & 1 deletion src/queries/usePendingIDSpecificOperation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@dittolive/ditto'
import { useEffect, useRef, useState } from 'react'

import { useDitto } from '../useDitto'
import { useDitto } from '../useDitto.js'

export interface UsePendingIDSpecificOperationParams {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/queries/useRemotePeers.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Ditto, Observer, Peer } from '@dittolive/ditto'
import { useEffect, useState } from 'react'

import { useDitto } from '../useDitto'
import { useDitto } from '../useDitto.js'

export interface UsePeersParams {
/**
Expand Down
2 changes: 1 addition & 1 deletion src/useDitto.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Ditto } from '@dittolive/ditto'
import { useEffect, useState } from 'react'

import { useDittoContext } from '.'
import { useDittoContext } from './index.js'

export interface DittoHookProps {
ditto: Ditto | null
Expand Down

0 comments on commit 3515362

Please sign in to comment.