diff --git a/.gitignore b/.gitignore index 0bdff84..f71570e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,8 @@ node_modules *.log dist/ coverage/ -/types/ \ No newline at end of file +<<<<<<< HEAD +/types/ +======= +types/ +>>>>>>> feat: 🎸 add runtime typings diff --git a/package.json b/package.json index 8bce09e..39ebf99 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "svelte-i18n", - "version": "2.3.0", + "version": "2.2.4", "main": "dist/runtime.cjs.js", "module": "dist/runtime.esm.js", "types": "types/runtime/index.d.ts", diff --git a/src/client/includes/flatObj.ts b/src/runtime/includes/flatObj.ts similarity index 100% rename from src/client/includes/flatObj.ts rename to src/runtime/includes/flatObj.ts diff --git a/src/client/includes/getClientLocale.ts b/src/runtime/includes/getClientLocale.ts similarity index 100% rename from src/client/includes/getClientLocale.ts rename to src/runtime/includes/getClientLocale.ts diff --git a/src/client/stores/formatters.ts b/src/runtime/stores/formatters.ts similarity index 100% rename from src/client/stores/formatters.ts rename to src/runtime/stores/formatters.ts diff --git a/test/runtime/includes/utils.test.ts b/test/runtime/includes/utils.test.ts index 8adfc1e..8a27a40 100644 --- a/test/runtime/includes/utils.test.ts +++ b/test/runtime/includes/utils.test.ts @@ -1,5 +1,5 @@ -import { getClientLocale } from '../../../src/client/includes/getClientLocale' -import { flatObj } from '../../../src/client/includes/flatObj' +import { getClientLocale } from '../../../src/runtime/includes/getClientLocale' +import { flatObj } from '../../../src/runtime/includes/flatObj' describe('getting client locale', () => { beforeEach(() => { diff --git a/test/runtime/index.test.ts b/test/runtime/index.test.ts index c92fc89..84e7f19 100644 --- a/test/runtime/index.test.ts +++ b/test/runtime/index.test.ts @@ -5,7 +5,7 @@ import { getLocaleDictionary, $dictionary, } from '../../src/runtime/stores/dictionary' -import { $format } from '../../src/runtime/stores/format' +import { $format } from '../../src/runtime/stores/formatters' test('defineMessages returns the identity of its first argument', () => { const obj = {} diff --git a/test/client/stores/formatters.test.ts b/test/runtime/stores/formatters.test.ts similarity index 82% rename from test/client/stores/formatters.test.ts rename to test/runtime/stores/formatters.test.ts index b6de057..4b3da0b 100644 --- a/test/client/stores/formatters.test.ts +++ b/test/runtime/stores/formatters.test.ts @@ -1,10 +1,4 @@ -<<<<<<< HEAD:test/runtime/stores/format.test.ts -import { Formatter } from '../../../src/runtime/types' -import { $format } from '../../../src/runtime/stores/format' -import { init } from '../../../src/runtime/configs' -import { addMessages } from '../../../src/runtime/stores/dictionary' -import { $locale } from '../../../src/runtime/stores/locale' -======= + import { get } from 'svelte/store' import { @@ -12,17 +6,16 @@ import { $formatTime, $formatDate, $formatNumber, -} from '../../../src/client/stores/formatters' -import { init } from '../../../src/client/configs' -import { addMessages } from '../../../src/client/stores/dictionary' -import { $locale } from '../../../src/client/stores/locale' -import { MessageFormatter } from '../../../src/client/types' -import { +} from '../../../src/runtime/stores/formatters' +import { init } from '../../../src/runtime/configs' +import { addMessages } from '../../../src/runtime/stores/dictionary' +import { $locale } from '../../../src/runtime/stores/locale' +import { MessageFormatter , TimeFormatter, DateFormatter, NumberFormatter, -} from '../../../src/client/types/index' ->>>>>>> feat: 🎸 make date,time and number formatters tree-shakeable:test/client/stores/formatters.test.ts +} from '../../../src/runtime/types' + let formatMessage: MessageFormatter let formatTime: TimeFormatter diff --git a/test/runtime/stores/locale.test.ts b/test/runtime/stores/locale.test.ts index 90c40cc..416dcc4 100644 --- a/test/runtime/stores/locale.test.ts +++ b/test/runtime/stores/locale.test.ts @@ -8,11 +8,10 @@ import { getCurrentLocale, $locale, isRelatedLocale, -} from '../../../src/client/stores/locale' -import { getOptions, init } from '../../../src/client/configs' -import { register } from '../../../src/client' -import { hasLocaleQueue } from '../../../src/client/includes/loaderQueue' -import { getClientLocale } from '../../../src/client/includes/getClientLocale' +} from '../../../src/runtime/stores/locale' +import { getOptions, init } from '../../../src/runtime/configs' +import { register } from '../../../src/runtime' +import { hasLocaleQueue } from '../../../src/runtime/includes/loaderQueue' beforeEach(() => { init({ fallbackLocale: undefined })