From 1cd65fc66cb278467be2a8d84f3b5f96eeb40b63 Mon Sep 17 00:00:00 2001 From: "S. Amir Mohammad Najafi" Date: Tue, 17 Jan 2023 13:01:08 +0330 Subject: [PATCH 1/4] refactor: inline export/import type --- core/fetch/src/fetch.ts | 2 +- core/i18n/src/i18n.ts | 2 +- core/i18n/src/type.ts | 2 +- core/logger/src/logger.ts | 2 +- core/math/src/math.ts | 4 ++-- core/nano-server/README.md | 3 +-- core/nano-server/src/nano-server.ts | 2 +- core/router/src/router.ts | 5 ++--- core/storage-client/README.md | 3 +-- core/storage-client/src/storage-client.ts | 8 +++---- core/storage-engine/README.md | 4 +--- core/storage-engine/src/storage-engine.ts | 9 ++++---- core/token/README.md | 4 +--- core/token/src/token.ts | 4 ++-- core/type/src/index.ts | 21 +++++++++++++------ core/validator/src/validator.ts | 2 +- demo/fetch/index.ts | 4 +--- demo/token/benchmark.ts | 4 +--- demo/token/index.ts | 4 +--- services/flight-crawler/src/crawl.ts | 3 +-- ui/demo-pwa/src/pwa-root.ts | 4 ++-- ui/element/src/mixins/logging.ts | 3 +-- ui/element/src/root-element.ts | 7 ++----- ui/element/src/surface-element.ts | 4 +--- ui/icon/src/icon.ts | 4 ++-- ui/ui-kit/src/card/card.ts | 4 +--- ui/ui-kit/src/chat/chat-text-input.ts | 3 +-- ui/ui-kit/src/chat/chat.ts | 4 ++-- uniquely/flight-finder-pwa/src/alwatr-pwa.ts | 4 +--- .../src/component/job-add-form.ts | 4 ++-- .../src/component/job-item.ts | 20 ++++++++++++------ .../src/component/page-flight-finder.ts | 7 +++---- .../flight-finder-pwa/src/director/job-add.ts | 3 +-- .../src/director/job-delete.ts | 4 +--- .../src/director/job-document-storage.ts | 3 +-- 35 files changed, 77 insertions(+), 93 deletions(-) diff --git a/core/fetch/src/fetch.ts b/core/fetch/src/fetch.ts index 7e948fd31..7adc8474c 100644 --- a/core/fetch/src/fetch.ts +++ b/core/fetch/src/fetch.ts @@ -7,7 +7,7 @@ import type { AlwatrServiceResponseSuccess, } from '@alwatr/type'; -export { +export type { FetchOptions, CacheDuplicate, CacheStrategy, diff --git a/core/i18n/src/i18n.ts b/core/i18n/src/i18n.ts index a74b9789b..dd770ecb6 100644 --- a/core/i18n/src/i18n.ts +++ b/core/i18n/src/i18n.ts @@ -4,7 +4,7 @@ import {SignalInterface} from '@alwatr/signal'; import type {I18nConfig, L10Resource, Locale} from './type.js'; -export * from './type.js'; +export type {I18nConfig, L10Resource, Locale} from './type.js'; const logger = createLogger('alwatr/i18n'); diff --git a/core/i18n/src/type.ts b/core/i18n/src/type.ts index 04c8a6f61..645558819 100644 --- a/core/i18n/src/type.ts +++ b/core/i18n/src/type.ts @@ -1,6 +1,6 @@ import type {L10Resource, Locale} from '@alwatr/type'; -export {L10Resource, Locale}; +export type {L10Resource, Locale}; declare global { interface AlwatrSignals { diff --git a/core/logger/src/logger.ts b/core/logger/src/logger.ts index 04a4d534d..9276683df 100644 --- a/core/logger/src/logger.ts +++ b/core/logger/src/logger.ts @@ -2,7 +2,7 @@ import {globalAlwatr} from './global-alwatr.js'; import type {AlwatrLogger} from './type.js'; -export {AlwatrLogger, globalAlwatr}; +export {type AlwatrLogger, globalAlwatr}; const isBrowser = typeof process === 'undefined'; diff --git a/core/math/src/math.ts b/core/math/src/math.ts index 63ee6d254..9db3c7ed0 100644 --- a/core/math/src/math.ts +++ b/core/math/src/math.ts @@ -1,7 +1,7 @@ import {globalAlwatr} from '@alwatr/logger'; -import {TransformRangeOptions} from './type.js'; -export * from './unicode-digits.js'; +import type {TransformRangeOptions} from './type.js'; +export {UnicodeDigits, type UnicodeLangKeys} from './unicode-digits.js'; globalAlwatr.registeredList.push({ name: '@alwatr/math', diff --git a/core/nano-server/README.md b/core/nano-server/README.md index f3482c13f..c055dd0c4 100644 --- a/core/nano-server/README.md +++ b/core/nano-server/README.md @@ -5,8 +5,7 @@ Elegant powerful nodejs server for nanoservice use cases, written in tiny TypeSc ## Example usage ```ts -import {AlwatrNanoServer} from 'https://esm.run/@alwatr/nano-server'; -import type {AlwatrConnection} from 'https://esm.run/@alwatr/nano-server'; +import {type AlwatrConnection, AlwatrNanoServer} from 'https://esm.run/@alwatr/nano-server'; const nanoServer = new AlwatrNanoServer(); diff --git a/core/nano-server/src/nano-server.ts b/core/nano-server/src/nano-server.ts index bfb58cba9..f92d3c046 100644 --- a/core/nano-server/src/nano-server.ts +++ b/core/nano-server/src/nano-server.ts @@ -23,7 +23,7 @@ export type RouteMiddleware, TMeta = Record MaybePromise | null>; -export { +export type { NanoServerConfig, ConnectionConfig, AlwatrServiceResponse, diff --git a/core/router/src/router.ts b/core/router/src/router.ts index 177f39171..38908fb93 100644 --- a/core/router/src/router.ts +++ b/core/router/src/router.ts @@ -3,11 +3,10 @@ import {routeChangeSignal} from './signal.js'; import {clickTrigger} from './trigger-click.js'; import {popstateTrigger} from './trigger-popstate.js'; -import type {InitOptions, Route, RoutesConfig} from './type.js'; +import type {InitOptions, Route, RoutesConfig, RequestRouteParam} from './type.js'; import type {SignalInterface} from '@alwatr/signal'; -export {routeChangeSignal}; -export type {Route, RequestRouteParam, RoutesConfig} from './type.js'; +export {type Route, type RequestRouteParam, type RoutesConfig, routeChangeSignal}; /** * Initial and config the Router. diff --git a/core/storage-client/README.md b/core/storage-client/README.md index 9c97f6a7d..d7960dfa2 100644 --- a/core/storage-client/README.md +++ b/core/storage-client/README.md @@ -5,8 +5,7 @@ Elegant micro client for storage server written in tiny TypeScript ES module. ## Example usage ```ts -import {AlwatrStorageClient} from '@alwatr/storage-client'; -import type {AlwatrDocumentObject} from '@alwatr/storage-client'; +import {type AlwatrDocumentObject, AlwatrStorageClient} from '@alwatr/storage-client'; type User = AlwatrDocumentObject & { email: string; diff --git a/core/storage-client/src/storage-client.ts b/core/storage-client/src/storage-client.ts index c6f2af5b9..d9e2d17ac 100644 --- a/core/storage-client/src/storage-client.ts +++ b/core/storage-client/src/storage-client.ts @@ -1,11 +1,10 @@ -import {serviceRequest} from '@alwatr/fetch'; +import {type FetchOptions, serviceRequest} from '@alwatr/fetch'; import {createLogger, globalAlwatr} from '@alwatr/logger'; import type {AlwatrStorageClientConfig} from './type.js'; -import type {FetchOptions} from '@alwatr/fetch'; import type {AlwatrDocumentObject, AlwatrDocumentStorage} from '@alwatr/type'; -export {AlwatrStorageClientConfig}; +export {type AlwatrStorageClientConfig}; globalAlwatr.registeredList.push({ name: '@alwatr/storage-client', @@ -18,8 +17,7 @@ globalAlwatr.registeredList.push({ * Example: * * ```ts - * import {AlwatrStorageClient} from '@alwatr/storage-client'; - * import type {AlwatrDocumentObject } from '@alwatr/storage-client'; + * import {type AlwatrDocumentObject, AlwatrStorageClient} from '@alwatr/storage-client'; * * interface User extends AlwatrDocumentObject { * fname: string; diff --git a/core/storage-engine/README.md b/core/storage-engine/README.md index 9324024b9..2f91b8346 100644 --- a/core/storage-engine/README.md +++ b/core/storage-engine/README.md @@ -5,9 +5,7 @@ Elegant micro in-memory json-like storage with disk backed, Fastest NoSQL Databa ## Example usage ```ts -import {AlwatrStorageEngine} from '@alwatr/storage-engine'; - -import type {AlwatrDocumentObject} from '@alwatr/storage-engine'; +import {type AlwatrDocumentObject, AlwatrStorageEngine} from '@alwatr/storage-engine'; type User = AlwatrDocumentObject & { fname: string; diff --git a/core/storage-engine/src/storage-engine.ts b/core/storage-engine/src/storage-engine.ts index 43a5de2be..bdae1543a 100644 --- a/core/storage-engine/src/storage-engine.ts +++ b/core/storage-engine/src/storage-engine.ts @@ -1,12 +1,13 @@ import {resolve} from 'node:path'; import {createLogger, globalAlwatr, type AlwatrLogger} from '@alwatr/logger'; -import {type AlwatrDocumentStorage, type AlwatrDocumentObject} from '@alwatr/type'; import exitHook from 'exit-hook'; -import {type AlwatrStorageEngineConfig} from './type.js'; import {readJsonFile, writeJsonFile} from './util.js'; +import type {AlwatrStorageEngineConfig} from './type.js'; +import type {AlwatrDocumentStorage, AlwatrDocumentObject} from '@alwatr/type'; + export {type AlwatrDocumentObject, type AlwatrDocumentStorage}; globalAlwatr.registeredList.push({ @@ -21,9 +22,7 @@ globalAlwatr.registeredList.push({ * Example: * * ```ts - * import {AlwatrStorageEngine} from '@alwatr/storage-engine'; - * - * import type {AlwatrDocumentObject} from '@alwatr/storage-engine'; + * import {type AlwatrDocumentObject, AlwatrStorageEngine} from '@alwatr/storage-engine'; * * interface User extends AlwatrDocumentObject { * fname: string; diff --git a/core/token/README.md b/core/token/README.md index f720aa9fe..882a2c611 100644 --- a/core/token/README.md +++ b/core/token/README.md @@ -6,9 +6,7 @@ Secure authentication HOTP token generator (HMAC-based One-Time Password algorit ```ts import {createLogger} from '@alwatr/logger'; -import {AlwatrTokenGenerator} from '@alwatr/token'; - -import type {TokenStatus} from '@alwatr/token'; +import {type TokenStatus, AlwatrTokenGenerator} from '@alwatr/token'; type User = { id: string; diff --git a/core/token/src/token.ts b/core/token/src/token.ts index 629905ba1..71fa37761 100644 --- a/core/token/src/token.ts +++ b/core/token/src/token.ts @@ -3,9 +3,9 @@ import {createHmac} from 'node:crypto'; import {createLogger, globalAlwatr} from '@alwatr/logger'; import {parseDuration} from '@alwatr/math'; -import type {TokenGeneratorConfig, TokenStatus} from './type.js'; +import type {TokenGeneratorConfig, TokenStatus, DigestAlgorithm} from './type.js'; -export * from './type.js'; +export type {TokenGeneratorConfig, TokenStatus, DigestAlgorithm}; globalAlwatr.registeredList.push({ name: '@alwatr/token', diff --git a/core/type/src/index.ts b/core/type/src/index.ts index 96a3e6360..cf7dca8f3 100644 --- a/core/type/src/index.ts +++ b/core/type/src/index.ts @@ -1,9 +1,18 @@ -export * from './chat.js'; -export * from './service-response.js'; -export * from './storage.js'; -export * from './global.js'; -export * from './i18n.js'; -export * from './type-helper.js'; +export type {ChatMessage, ChatPhotoMessage, ChatStorage, ChatTextMessage} from './chat.js'; +export type { + AlwatrServiceResponse, + AlwatrServiceResponseFailed, + AlwatrServiceResponseSuccess, + AlwatrServiceResponseSuccessWithMeta, + Methods, + ParamKeyType, + ParamValueType, + QueryParameters, +} from './service-response.js'; +export type {AlwatrDocumentObject, AlwatrDocumentStorage, AlwatrStorageMeta} from './storage.js'; +export {type AlwatrPackageInfo, GlobalAlwatr} from './global.js'; +export type {L10Resource, LocalCode, Locale, i18nString} from './i18n.js'; +export type {Constructor, MaybePromise} from './type-helper.js'; Alwatr.registeredList.push({ name: '@alwatr/type', diff --git a/core/validator/src/validator.ts b/core/validator/src/validator.ts index 3424afdf3..f06aa1d84 100644 --- a/core/validator/src/validator.ts +++ b/core/validator/src/validator.ts @@ -2,7 +2,7 @@ import {isNumber} from '@alwatr/math'; import type {JsonSchema, ValidType} from './type.js'; -export {JsonSchema}; +export {type JsonSchema}; export function validator( validSchema: JsonSchema, diff --git a/demo/fetch/index.ts b/demo/fetch/index.ts index be96d6521..c9ddd98dd 100644 --- a/demo/fetch/index.ts +++ b/demo/fetch/index.ts @@ -1,7 +1,5 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ -import {fetch} from '@alwatr/fetch'; - -import type {CacheStrategy, CacheDuplicate} from '@alwatr/fetch'; +import {type CacheStrategy, type CacheDuplicate, fetch} from '@alwatr/fetch'; const buttons = document.querySelectorAll('button') as NodeListOf; diff --git a/demo/token/benchmark.ts b/demo/token/benchmark.ts index 60d0cfb8e..52723fa3f 100644 --- a/demo/token/benchmark.ts +++ b/demo/token/benchmark.ts @@ -1,6 +1,4 @@ -import {AlwatrTokenGenerator} from '@alwatr/token'; - -import type {DigestAlgorithm} from '@alwatr/token'; +import {type DigestAlgorithm, AlwatrTokenGenerator} from '@alwatr/token'; if (process.env.NODE_ENV !== 'production') { console.log('Please run node in production for benchmark. NODE_ENV=production node demo/token/benchmark.js'); diff --git a/demo/token/index.ts b/demo/token/index.ts index bfb4e502a..0a6272693 100644 --- a/demo/token/index.ts +++ b/demo/token/index.ts @@ -1,7 +1,5 @@ import {createLogger} from '@alwatr/logger'; -import {AlwatrTokenGenerator} from '@alwatr/token'; - -import type {TokenStatus} from '@alwatr/token'; +import {type TokenStatus, AlwatrTokenGenerator} from '@alwatr/token'; const logger = createLogger('token/demo'); diff --git a/services/flight-crawler/src/crawl.ts b/services/flight-crawler/src/crawl.ts index b1829acf4..4612b04f5 100644 --- a/services/flight-crawler/src/crawl.ts +++ b/services/flight-crawler/src/crawl.ts @@ -1,11 +1,10 @@ -import {fetch} from '@alwatr/fetch'; +import {type FetchOptions, fetch} from '@alwatr/fetch'; import {config, logger} from './config.js'; import {cityList} from './lib/city-list.js'; import {storageClient} from './lib/storage.js'; import type {SepehrResponse} from './lib/type.js'; -import type {FetchOptions} from '@alwatr/fetch'; import type {Job, JobDetail, JobResult} from '@alwatr/type/flight-finder.js'; export async function crawlAllJobs(): Promise { diff --git a/ui/demo-pwa/src/pwa-root.ts b/ui/demo-pwa/src/pwa-root.ts index 10bfa48c9..bb3fb1923 100644 --- a/ui/demo-pwa/src/pwa-root.ts +++ b/ui/demo-pwa/src/pwa-root.ts @@ -1,10 +1,10 @@ import {AlwatrRootElement, html, customElement} from '@alwatr/element'; +import type {RoutesConfig} from '@alwatr/router'; + import './page-chat.js'; import './page-card.js'; -import type {RoutesConfig} from '@alwatr/router'; - declare global { interface HTMLElementTagNameMap { 'alwatr-pwa-root': AlwatrPwaRoot; diff --git a/ui/element/src/mixins/logging.ts b/ui/element/src/mixins/logging.ts index 1afd83e87..bbbe17b02 100644 --- a/ui/element/src/mixins/logging.ts +++ b/ui/element/src/mixins/logging.ts @@ -1,6 +1,5 @@ -import {createLogger} from '@alwatr/logger'; +import {type AlwatrLogger, createLogger} from '@alwatr/logger'; -import type {AlwatrLogger} from '@alwatr/logger/type.js'; import type {Constructor} from '@alwatr/type'; import type {LitElement, PropertyValues} from 'lit'; diff --git a/ui/element/src/root-element.ts b/ui/element/src/root-element.ts index 598c6aa68..2b1e8baa6 100644 --- a/ui/element/src/root-element.ts +++ b/ui/element/src/root-element.ts @@ -1,13 +1,10 @@ import {l10n} from '@alwatr/i18n'; -import {router} from '@alwatr/router'; -import {html, css} from 'lit'; +import {type RoutesConfig, router} from '@alwatr/router'; +import {type CSSResultGroup, html, css} from 'lit'; import {cache} from 'lit/directives/cache.js'; import {AlwatrSmartElement} from './smart-element.js'; -import type {RoutesConfig} from '@alwatr/router'; -import type {CSSResultGroup} from 'lit'; - /** * Alwatr Root Base Element * diff --git a/ui/element/src/surface-element.ts b/ui/element/src/surface-element.ts index b2bffb97b..e35cffe17 100644 --- a/ui/element/src/surface-element.ts +++ b/ui/element/src/surface-element.ts @@ -1,9 +1,7 @@ -import {css} from 'lit'; +import {type CSSResultGroup, css} from 'lit'; import {AlwatrDummyElement} from './dummy-element.js'; -import type {CSSResultGroup} from 'lit'; - /** * Alwatr Surface Base Element * diff --git a/ui/icon/src/icon.ts b/ui/icon/src/icon.ts index e5b9dfcda..87b890f9d 100644 --- a/ui/icon/src/icon.ts +++ b/ui/icon/src/icon.ts @@ -1,4 +1,6 @@ import { + type PropertyValues, + type HTMLTemplateResult, AlwatrDummyElement, unsafeSVG, customElement, @@ -11,8 +13,6 @@ import { import {fetch} from '@alwatr/fetch'; import {globalAlwatr} from '@alwatr/logger'; -import type {PropertyValues, HTMLTemplateResult} from '@alwatr/element'; - globalAlwatr.registeredList.push({ name: '@alwatr/icon', version: '{{ALWATR_VERSION}}', diff --git a/ui/ui-kit/src/card/card.ts b/ui/ui-kit/src/card/card.ts index 4e67d67c7..07c38e4e3 100644 --- a/ui/ui-kit/src/card/card.ts +++ b/ui/ui-kit/src/card/card.ts @@ -1,6 +1,4 @@ -import {AlwatrSurfaceElement, css, customElement, html} from '@alwatr/element'; - -import type {CSSResultGroup} from '@alwatr/element'; +import {type CSSResultGroup, AlwatrSurfaceElement, css, customElement, html} from '@alwatr/element'; export type CardType = 'elevated' | 'filled' | 'outlined'; diff --git a/ui/ui-kit/src/chat/chat-text-input.ts b/ui/ui-kit/src/chat/chat-text-input.ts index 6d58bb369..79679a2ee 100644 --- a/ui/ui-kit/src/chat/chat-text-input.ts +++ b/ui/ui-kit/src/chat/chat-text-input.ts @@ -1,9 +1,8 @@ -import {AlwatrDummyElement, css, customElement, html, LocalizeMixin} from '@alwatr/element'; +import {type PropertyValues, AlwatrDummyElement, css, customElement, html, LocalizeMixin} from '@alwatr/element'; import '../icon-button/standard-icon-button.js'; import type {AlwatrStandardIconButton} from '../icon-button/standard-icon-button.js'; -import type {PropertyValues} from '@alwatr/element'; declare global { interface HTMLElementTagNameMap { diff --git a/ui/ui-kit/src/chat/chat.ts b/ui/ui-kit/src/chat/chat.ts index 7eedafafe..16d233ac5 100644 --- a/ui/ui-kit/src/chat/chat.ts +++ b/ui/ui-kit/src/chat/chat.ts @@ -1,10 +1,10 @@ import {customElement, AlwatrSmartElement, css, html} from '@alwatr/element'; +import type {ChatStorage} from '@alwatr/type'; + import './chat-footer.js'; import './chat-list.js'; -import type {ChatStorage} from '@alwatr/type'; - declare global { interface HTMLElementTagNameMap { 'alwatr-chat': AlwatrChat; diff --git a/uniquely/flight-finder-pwa/src/alwatr-pwa.ts b/uniquely/flight-finder-pwa/src/alwatr-pwa.ts index d3ce2c3de..bd48ecea1 100644 --- a/uniquely/flight-finder-pwa/src/alwatr-pwa.ts +++ b/uniquely/flight-finder-pwa/src/alwatr-pwa.ts @@ -1,6 +1,6 @@ import {AlwatrSmartElement, customElement, css, html} from '@alwatr/element'; import {l10n} from '@alwatr/i18n'; -import {router} from '@alwatr/router'; +import {type RoutesConfig, router} from '@alwatr/router'; import ionNormalize from './style/ionic.normalize.js'; import ionTheming from './style/ionic.theming.js'; @@ -8,8 +8,6 @@ import ionTheming from './style/ionic.theming.js'; import './component/page-flight-finder.js'; import './component/ionic-components.js'; -import type {RoutesConfig} from '@alwatr/router'; - declare global { interface HTMLElementTagNameMap { 'alwatr-pwa': AlwatrPWA; diff --git a/uniquely/flight-finder-pwa/src/component/job-add-form.ts b/uniquely/flight-finder-pwa/src/component/job-add-form.ts index 80b5c5ddd..7df8f05ba 100644 --- a/uniquely/flight-finder-pwa/src/component/job-add-form.ts +++ b/uniquely/flight-finder-pwa/src/component/job-add-form.ts @@ -6,11 +6,11 @@ import {cityList} from '../city-list.js'; import ionNormalize from '../style/ionic.normalize.js'; import ionTheming from '../style/ionic.theming.js'; -import './ionic-components'; - import type {NewJobDetail} from '../type.js'; import type {InputCustomEvent, SelectCustomEvent} from '@ionic/core'; +import './ionic-components'; + declare global { interface HTMLElementTagNameMap { 'job-add-form': JobAddForm; diff --git a/uniquely/flight-finder-pwa/src/component/job-item.ts b/uniquely/flight-finder-pwa/src/component/job-item.ts index b987fa2a8..6a457ec08 100644 --- a/uniquely/flight-finder-pwa/src/component/job-item.ts +++ b/uniquely/flight-finder-pwa/src/component/job-item.ts @@ -1,18 +1,26 @@ -import {AlwatrSmartElement, customElement, property, query, when, css, html, nothing} from '@alwatr/element'; +import { + type TemplateResult, + AlwatrSmartElement, + customElement, + property, + query, + when, + css, + html, + nothing, +} from '@alwatr/element'; import {l10n} from '@alwatr/i18n'; import {SignalInterface} from '@alwatr/signal'; -import '@alwatr/icon'; - import {cityList} from '../city-list.js'; import ionNormalize from '../style/ionic.normalize.js'; import ionTheming from '../style/ionic.theming.js'; -import './ionic-components.js'; - -import type {TemplateResult} from '@alwatr/element'; import type {Job, JobResult} from '@alwatr/type/flight-finder.js'; +import '@alwatr/icon'; +import './ionic-components.js'; + declare global { interface HTMLElementTagNameMap { 'job-item': JobItem; diff --git a/uniquely/flight-finder-pwa/src/component/page-flight-finder.ts b/uniquely/flight-finder-pwa/src/component/page-flight-finder.ts index b1ac4407d..05b7ca62f 100644 --- a/uniquely/flight-finder-pwa/src/component/page-flight-finder.ts +++ b/uniquely/flight-finder-pwa/src/component/page-flight-finder.ts @@ -1,4 +1,4 @@ -import {AlwatrSmartElement, map, customElement, query, css, html} from '@alwatr/element'; +import {type TemplateResult, AlwatrSmartElement, map, customElement, query, css, html} from '@alwatr/element'; import {l10n} from '@alwatr/i18n'; import {SignalInterface} from '@alwatr/signal'; import {modalController} from '@ionic/core'; @@ -6,12 +6,11 @@ import {modalController} from '@ionic/core'; import ionNormalize from '../style/ionic.normalize.js'; import ionTheming from '../style/ionic.theming.js'; +import type {Job} from '@alwatr/type/flight-finder.js'; + import './job-item.js'; import './job-add-form.js'; -import type {TemplateResult} from '@alwatr/element'; -import type {Job} from '@alwatr/type/flight-finder.js'; - declare global { interface HTMLElementTagNameMap { 'page-flight-finder': PageFlightFinder; diff --git a/uniquely/flight-finder-pwa/src/director/job-add.ts b/uniquely/flight-finder-pwa/src/director/job-add.ts index 6a227129c..dfc4913ce 100644 --- a/uniquely/flight-finder-pwa/src/director/job-add.ts +++ b/uniquely/flight-finder-pwa/src/director/job-add.ts @@ -1,10 +1,9 @@ -import {fetch} from '@alwatr/fetch'; +import {type AlwatrServiceResponse, fetch} from '@alwatr/fetch'; import {SignalInterface} from '@alwatr/signal'; import {jobDocumentStorageSignal} from './job-document-storage.js'; import {showToastSignal} from './toast.js'; -import type {AlwatrServiceResponse} from '@alwatr/fetch'; import type {Job} from '@alwatr/type/flight-finder.js'; export const jobAddSignal = new SignalInterface('job-add'); diff --git a/uniquely/flight-finder-pwa/src/director/job-delete.ts b/uniquely/flight-finder-pwa/src/director/job-delete.ts index 89ce99f2e..e05982e4c 100644 --- a/uniquely/flight-finder-pwa/src/director/job-delete.ts +++ b/uniquely/flight-finder-pwa/src/director/job-delete.ts @@ -1,11 +1,9 @@ -import {fetch} from '@alwatr/fetch'; +import {type AlwatrServiceResponse, fetch} from '@alwatr/fetch'; import {SignalInterface} from '@alwatr/signal'; import {jobDocumentStorageSignal} from './job-document-storage.js'; import {showToastSignal} from './toast.js'; -import type {AlwatrServiceResponse} from '@alwatr/fetch'; - export const jobDeleteSignal = new SignalInterface('job-delete'); jobDeleteSignal.addListener(async (id) => { diff --git a/uniquely/flight-finder-pwa/src/director/job-document-storage.ts b/uniquely/flight-finder-pwa/src/director/job-document-storage.ts index cab524676..44a2569a9 100644 --- a/uniquely/flight-finder-pwa/src/director/job-document-storage.ts +++ b/uniquely/flight-finder-pwa/src/director/job-document-storage.ts @@ -1,10 +1,9 @@ -import {serviceRequest} from '@alwatr/fetch'; +import {type CacheStrategy, serviceRequest} from '@alwatr/fetch'; import {createLogger} from '@alwatr/logger'; import {SignalInterface} from '@alwatr/signal'; import {showToastSignal} from './toast.js'; -import type {CacheStrategy} from '@alwatr/fetch'; import type {AlwatrDocumentStorage} from '@alwatr/type'; import type {Job} from '@alwatr/type/flight-finder.js'; From 936164e3138ed587a7bdd783feb4ce759d0ffc7b Mon Sep 17 00:00:00 2001 From: "S. Ali Mihandoost" Date: Tue, 17 Jan 2023 15:46:42 +0330 Subject: [PATCH 2/4] lint(storage-engine): export type --- core/storage-engine/src/storage-engine.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/storage-engine/src/storage-engine.ts b/core/storage-engine/src/storage-engine.ts index bdae1543a..a2266fce2 100644 --- a/core/storage-engine/src/storage-engine.ts +++ b/core/storage-engine/src/storage-engine.ts @@ -8,7 +8,7 @@ import {readJsonFile, writeJsonFile} from './util.js'; import type {AlwatrStorageEngineConfig} from './type.js'; import type {AlwatrDocumentStorage, AlwatrDocumentObject} from '@alwatr/type'; -export {type AlwatrDocumentObject, type AlwatrDocumentStorage}; +export type {AlwatrDocumentObject, AlwatrDocumentStorage}; globalAlwatr.registeredList.push({ name: '@alwatr/storage-engine', From 09953df6a2baf91eea7960ccc83b892447d307d1 Mon Sep 17 00:00:00 2001 From: "S. Ali Mihandoost" Date: Tue, 17 Jan 2023 15:48:28 +0330 Subject: [PATCH 3/4] lint(type): rollback type export --- core/type/src/index.ts | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/core/type/src/index.ts b/core/type/src/index.ts index cf7dca8f3..96a3e6360 100644 --- a/core/type/src/index.ts +++ b/core/type/src/index.ts @@ -1,18 +1,9 @@ -export type {ChatMessage, ChatPhotoMessage, ChatStorage, ChatTextMessage} from './chat.js'; -export type { - AlwatrServiceResponse, - AlwatrServiceResponseFailed, - AlwatrServiceResponseSuccess, - AlwatrServiceResponseSuccessWithMeta, - Methods, - ParamKeyType, - ParamValueType, - QueryParameters, -} from './service-response.js'; -export type {AlwatrDocumentObject, AlwatrDocumentStorage, AlwatrStorageMeta} from './storage.js'; -export {type AlwatrPackageInfo, GlobalAlwatr} from './global.js'; -export type {L10Resource, LocalCode, Locale, i18nString} from './i18n.js'; -export type {Constructor, MaybePromise} from './type-helper.js'; +export * from './chat.js'; +export * from './service-response.js'; +export * from './storage.js'; +export * from './global.js'; +export * from './i18n.js'; +export * from './type-helper.js'; Alwatr.registeredList.push({ name: '@alwatr/type', From b83a25a5f23f69c9bdadfe7c2dea12f1ffe2209a Mon Sep 17 00:00:00 2001 From: "S. Ali Mihandoost" Date: Tue, 17 Jan 2023 15:53:26 +0330 Subject: [PATCH 4/4] lint(validator): type export --- core/validator/src/validator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/validator/src/validator.ts b/core/validator/src/validator.ts index f06aa1d84..fcaf495c4 100644 --- a/core/validator/src/validator.ts +++ b/core/validator/src/validator.ts @@ -2,7 +2,7 @@ import {isNumber} from '@alwatr/math'; import type {JsonSchema, ValidType} from './type.js'; -export {type JsonSchema}; +export type {JsonSchema}; export function validator( validSchema: JsonSchema,