feat: 🎸 add runtime typings

 Closes: Closes #43
This commit is contained in:
Christian Kaisermann 2020-01-23 10:11:04 -03:00
parent 31b556bc3f
commit 7bf47d8790
8 changed files with 20 additions and 24 deletions

6
.gitignore vendored
View File

@ -2,4 +2,8 @@ node_modules
*.log *.log
dist/ dist/
coverage/ coverage/
/types/ <<<<<<< HEAD
/types/
=======
types/
>>>>>>> feat: 🎸 add runtime typings

View File

@ -1,5 +1,5 @@
import { getClientLocale } from '../../../src/client/includes/getClientLocale' import { getClientLocale } from '../../../src/runtime/includes/getClientLocale'
import { flatObj } from '../../../src/client/includes/flatObj' import { flatObj } from '../../../src/runtime/includes/flatObj'
describe('getting client locale', () => { describe('getting client locale', () => {
beforeEach(() => { beforeEach(() => {

View File

@ -5,7 +5,7 @@ import {
getLocaleDictionary, getLocaleDictionary,
$dictionary, $dictionary,
} from '../../src/runtime/stores/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', () => { test('defineMessages returns the identity of its first argument', () => {
const obj = {} const obj = {}

View File

@ -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 { get } from 'svelte/store'
import { import {
@ -12,17 +6,16 @@ import {
$formatTime, $formatTime,
$formatDate, $formatDate,
$formatNumber, $formatNumber,
} from '../../../src/client/stores/formatters' } from '../../../src/runtime/stores/formatters'
import { init } from '../../../src/client/configs' import { init } from '../../../src/runtime/configs'
import { addMessages } from '../../../src/client/stores/dictionary' import { addMessages } from '../../../src/runtime/stores/dictionary'
import { $locale } from '../../../src/client/stores/locale' import { $locale } from '../../../src/runtime/stores/locale'
import { MessageFormatter } from '../../../src/client/types' import { MessageFormatter ,
import {
TimeFormatter, TimeFormatter,
DateFormatter, DateFormatter,
NumberFormatter, NumberFormatter,
} from '../../../src/client/types/index' } from '../../../src/runtime/types'
>>>>>>> feat: 🎸 make date,time and number formatters tree-shakeable:test/client/stores/formatters.test.ts
let formatMessage: MessageFormatter let formatMessage: MessageFormatter
let formatTime: TimeFormatter let formatTime: TimeFormatter

View File

@ -8,11 +8,10 @@ import {
getCurrentLocale, getCurrentLocale,
$locale, $locale,
isRelatedLocale, isRelatedLocale,
} from '../../../src/client/stores/locale' } from '../../../src/runtime/stores/locale'
import { getOptions, init } from '../../../src/client/configs' import { getOptions, init } from '../../../src/runtime/configs'
import { register } from '../../../src/client' import { register } from '../../../src/runtime'
import { hasLocaleQueue } from '../../../src/client/includes/loaderQueue' import { hasLocaleQueue } from '../../../src/runtime/includes/loaderQueue'
import { getClientLocale } from '../../../src/client/includes/getClientLocale'
beforeEach(() => { beforeEach(() => {
init({ fallbackLocale: undefined }) init({ fallbackLocale: undefined })