From 1a52f67ff2788c51abd13126f34353c26aa669c3 Mon Sep 17 00:00:00 2001 From: asmanp2012 Date: Wed, 26 Oct 2022 23:16:03 +0330 Subject: [PATCH] fix: Import error in webpack --- packages/core/element/src/element.ts | 4 ++-- packages/core/i18n/src/i18n.ts | 2 +- packages/core/logger/src/logger.ts | 2 +- packages/core/math/src/math.ts | 2 +- packages/core/router/src/core.ts | 2 +- packages/core/router/src/router.ts | 12 ++++++------ packages/core/router/src/signal.ts | 2 +- packages/core/router/src/trigger-click.ts | 4 ++-- packages/core/router/src/trigger-popstate.ts | 4 ++-- packages/core/signal/src/core.ts | 2 +- packages/core/signal/src/signal.ts | 8 ++++++-- packages/core/storage/src/provider.ts | 2 +- 12 files changed, 25 insertions(+), 21 deletions(-) diff --git a/packages/core/element/src/element.ts b/packages/core/element/src/element.ts index 838e93c61..4e816ab3a 100644 --- a/packages/core/element/src/element.ts +++ b/packages/core/element/src/element.ts @@ -1,8 +1,8 @@ import {alwatrRegisteredList, createLogger} from '@alwatr/logger'; import {LitElement} from 'lit'; -import type {Constructor} from './type'; -import type {AlwatrLogger} from '@alwatr/logger/type'; +import type {Constructor} from './type.js'; +import type {AlwatrLogger} from '@alwatr/logger/type.js'; import type {PropertyValues} from 'lit'; alwatrRegisteredList.push({ diff --git a/packages/core/i18n/src/i18n.ts b/packages/core/i18n/src/i18n.ts index a6d0c2a55..198abe358 100644 --- a/packages/core/i18n/src/i18n.ts +++ b/packages/core/i18n/src/i18n.ts @@ -2,7 +2,7 @@ import {getJson} from '@alwatr/fetch'; import {alwatrRegisteredList, createLogger} from '@alwatr/logger'; import {SignalInterface} from '@alwatr/signal'; -import type {I18nConfig, L10Resource, Locale} from './type'; +import type {I18nConfig, L10Resource, Locale} from './type.js'; const logger = createLogger('alwatr/i18n'); diff --git a/packages/core/logger/src/logger.ts b/packages/core/logger/src/logger.ts index 78537f91f..d153f48db 100644 --- a/packages/core/logger/src/logger.ts +++ b/packages/core/logger/src/logger.ts @@ -1,4 +1,4 @@ -import type {AlwatrLogger} from './type'; +import type {AlwatrLogger} from './type.js'; export {AlwatrLogger}; const isBrowser = typeof process === 'undefined'; diff --git a/packages/core/math/src/math.ts b/packages/core/math/src/math.ts index ee57936fc..999bd2f29 100644 --- a/packages/core/math/src/math.ts +++ b/packages/core/math/src/math.ts @@ -1,4 +1,4 @@ -import {TransformRangeOptions} from './type'; +import {TransformRangeOptions} from './type.js'; export * from './unicode-digits.js'; /** diff --git a/packages/core/router/src/core.ts b/packages/core/router/src/core.ts index 722e3cdfa..3ab751e34 100644 --- a/packages/core/router/src/core.ts +++ b/packages/core/router/src/core.ts @@ -1,6 +1,6 @@ import {createLogger, alwatrRegisteredList} from '@alwatr/logger'; -import type {ParamList, RequestRouteParam, Route} from './type'; +import type {ParamList, RequestRouteParam, Route} from './type.js'; alwatrRegisteredList.push({ name: '@alwatr/router', diff --git a/packages/core/router/src/router.ts b/packages/core/router/src/router.ts index 70aaf586e..1a28df03c 100644 --- a/packages/core/router/src/router.ts +++ b/packages/core/router/src/router.ts @@ -1,13 +1,13 @@ -import {joinParameterList, logger, routeSignalProvider} from './core'; -import {routeChangeSignal} from './signal'; -import {clickTrigger} from './trigger-click'; -import {popstateTrigger} from './trigger-popstate'; +import {joinParameterList, logger, routeSignalProvider} from './core.js'; +import {routeChangeSignal} from './signal.js'; +import {clickTrigger} from './trigger-click.js'; +import {popstateTrigger} from './trigger-popstate.js'; -import type {InitOptions, Route, RoutesConfig} from './type'; +import type {InitOptions, Route, RoutesConfig} from './type.js'; import type {SignalInterface} from '@alwatr/signal'; export {routeChangeSignal}; -export type {Route, RequestRouteParam, RoutesConfig} from './type'; +export type {Route, RequestRouteParam, RoutesConfig} from './type.js'; /** * Initial and config the Router. diff --git a/packages/core/router/src/signal.ts b/packages/core/router/src/signal.ts index d673c4303..efff015c4 100644 --- a/packages/core/router/src/signal.ts +++ b/packages/core/router/src/signal.ts @@ -1,6 +1,6 @@ import {SignalInterface} from '@alwatr/signal'; -import type {RequestRouteParam, Route} from './type'; +import type {RequestRouteParam, Route} from './type.js'; declare global { interface AlwatrSignals { diff --git a/packages/core/router/src/trigger-click.ts b/packages/core/router/src/trigger-click.ts index 49d67ea54..a0a478069 100644 --- a/packages/core/router/src/trigger-click.ts +++ b/packages/core/router/src/trigger-click.ts @@ -1,5 +1,5 @@ -import {logger} from './core'; -import {routeChangeSignal} from './signal'; +import {logger} from './core.js'; +import {routeChangeSignal} from './signal.js'; let _enabled = false; diff --git a/packages/core/router/src/trigger-popstate.ts b/packages/core/router/src/trigger-popstate.ts index 591433a80..7150e1b38 100644 --- a/packages/core/router/src/trigger-popstate.ts +++ b/packages/core/router/src/trigger-popstate.ts @@ -1,5 +1,5 @@ -import {logger} from './core'; -import {routeChangeSignal} from './signal'; +import {logger} from './core.js'; +import {routeChangeSignal} from './signal.js'; let _enabled = false; diff --git a/packages/core/signal/src/core.ts b/packages/core/signal/src/core.ts index 0203d3ca5..c6300634d 100644 --- a/packages/core/signal/src/core.ts +++ b/packages/core/signal/src/core.ts @@ -9,7 +9,7 @@ import type { SignalProvider, SignalProviderOptions, SignalStack, -} from './type'; +} from './type.js'; export const logger = createLogger('alwatr/signal'); diff --git a/packages/core/signal/src/signal.ts b/packages/core/signal/src/signal.ts index 06e1b8bb4..d3aa6fc9e 100644 --- a/packages/core/signal/src/signal.ts +++ b/packages/core/signal/src/signal.ts @@ -1,6 +1,10 @@ import {createLogger} from '@alwatr/logger'; -import {_getSignalObject, _removeSignalListener, _setSignalProvider, _dispatchSignal, _addSignalListener} from './core'; +import { + _getSignalObject, _removeSignalListener, + _setSignalProvider, _dispatchSignal, + _addSignalListener, +} from './core.js'; import type { ListenerOptions, @@ -10,7 +14,7 @@ import type { SignalProviderOptions, ListenerObject, SignalObject, -} from './type'; +} from './type.js'; /** * Signal API interface as a remote controller. diff --git a/packages/core/storage/src/provider.ts b/packages/core/storage/src/provider.ts index 989cec790..ff75f1432 100644 --- a/packages/core/storage/src/provider.ts +++ b/packages/core/storage/src/provider.ts @@ -2,7 +2,7 @@ import {createLogger} from '@alwatr/logger'; import {AlwatrStorage} from './storage.js'; -import type {AlwatrStorageConfig, AlwatrStorageProviderConfig, DocumentObject} from './type'; +import type {AlwatrStorageConfig, AlwatrStorageProviderConfig, DocumentObject} from './type.js'; // TODO: auto unload base of last usage time and memory limit.