Skip to content

Commit bc954c6

Browse files
authored
fix: type definition build errors (#99)
* fix: type definition build errors * fix * update shipjs
1 parent 33c5303 commit bc954c6

File tree

7 files changed

+84
-82
lines changed

7 files changed

+84
-82
lines changed

ship.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ module.exports = {
5050
`${releaseType} release v${version}`,
5151
formatPullRequestTitle: ({ version, releaseType }) =>
5252
`${releaseType} release v${version}`,
53+
afterPublish: ({ exec, dir, version, releaseTag }) => {
54+
exec(`yarn tag add vue-i18n@${version} next`)
55+
},
5356
shouldRelease: () => true,
5457
releases: {
5558
extractChangelog: ({ version, dir }) => {

src/components/DatetimeFormat.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineComponent, PropType } from 'vue'
1+
import { RenderFunction, SetupContext } from 'vue'
22
import { useI18n } from '../i18n'
33
import { DateTimeOptions } from '../core'
44
import { Composer, ComposerInternal } from '../composer'
@@ -33,21 +33,21 @@ const DATETIME_FORMAT_KEYS = [
3333
'timeZoneName'
3434
]
3535

36-
export const DatetimeFormat = defineComponent({
36+
export const DatetimeFormat = {
3737
/* eslint-disable */
3838
name: 'i18n-d',
3939
props: {
4040
...baseFormatProps,
4141
value: {
42-
type: [Number, Date] as PropType<number | Date>,
42+
type: [Number, Date],
4343
required: true
4444
},
4545
format: {
46-
type: [String, Object] as PropType<Intl.DateTimeFormatOptions>
46+
type: [String, Object]
4747
}
4848
},
4949
/* eslint-enable */
50-
setup(props, context) {
50+
setup(props: DatetimeFormatProps, context: SetupContext): RenderFunction {
5151
const i18n = useI18n({ useScope: 'parent' }) as Composer & ComposerInternal
5252

5353
return renderFormatter<
@@ -60,4 +60,4 @@ export const DatetimeFormat = defineComponent({
6060
i18n.__datetimeParts(...args)
6161
)
6262
}
63-
})
63+
}

src/components/NumberFormat.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineComponent, PropType } from 'vue'
1+
import { SetupContext, RenderFunction } from 'vue'
22
import { useI18n } from '../i18n'
33
import { NumberOptions } from '../core'
44
import { Composer, ComposerInternal } from '../composer'
@@ -28,7 +28,7 @@ const NUMBER_FORMAT_KEYS = [
2828
'formatMatcher'
2929
]
3030

31-
export const NumberFormat = defineComponent({
31+
export const NumberFormat = {
3232
/* eslint-disable */
3333
name: 'i18n-n',
3434
props: {
@@ -38,11 +38,11 @@ export const NumberFormat = defineComponent({
3838
required: true
3939
},
4040
format: {
41-
type: [String, Object] as PropType<Intl.NumberFormatOptions>
41+
type: [String, Object]
4242
}
4343
},
4444
/* eslint-enable */
45-
setup(props, context) {
45+
setup(props: NumberFormatProps, context: SetupContext): RenderFunction {
4646
const i18n = useI18n({ useScope: 'parent' }) as Composer & ComposerInternal
4747

4848
return renderFormatter<
@@ -55,4 +55,4 @@ export const NumberFormat = defineComponent({
5555
i18n.__numberParts(...args)
5656
)
5757
}
58-
})
58+
}

src/components/Translation.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { h, Fragment, defineComponent, SetupContext, VNodeChild } from 'vue'
1+
import { h, Fragment, SetupContext, VNodeChild, RenderFunction } from 'vue'
22
import { Composer, ComposerInternal } from '../composer'
33
import { useI18n } from '../i18n'
44
import { TranslateOptions } from '../core'
@@ -11,7 +11,7 @@ export interface TranslationProps extends BaseFormatProps {
1111
plural?: number | string
1212
}
1313

14-
export const Translation = defineComponent({
14+
export const Translation = {
1515
/* eslint-disable */
1616
name: 'i18n-t',
1717
props: {
@@ -27,7 +27,7 @@ export const Translation = defineComponent({
2727
}
2828
},
2929
/* eslint-enable */
30-
setup(props, context) {
30+
setup(props: TranslationProps, context: SetupContext): RenderFunction {
3131
const { slots, attrs } = context
3232
const i18n = useI18n({ useScope: props.scope }) as Composer &
3333
ComposerInternal
@@ -51,7 +51,7 @@ export const Translation = defineComponent({
5151
: h(Fragment, { ...attrs }, children)
5252
}
5353
}
54-
})
54+
}
5555

5656
function getInterpolateArg(
5757
{ slots }: SetupContext,

src/components/base.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { PropType } from 'vue'
21
import { Locale } from '../core'
32
import { I18nScope } from '../i18n'
43

@@ -12,13 +11,13 @@ export interface BaseFormatProps {
1211

1312
export const baseFormatProps = {
1413
tag: {
15-
type: [String, Object] as PropType<string | object>
14+
type: [String, Object]
1615
},
1716
locale: {
1817
type: String
1918
},
2019
scope: {
21-
type: String as PropType<ComponetI18nScope>,
20+
type: String,
2221
validator: (val: ComponetI18nScope): boolean =>
2322
val === 'parent' || val === 'global',
2423
default: 'parent' as ComponetI18nScope

src/plugin.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { App } from 'vue'
1+
import { App, Component } from 'vue'
22
import { I18nSymbol, I18n } from './i18n'
33
import { Translation, NumberFormat, DatetimeFormat } from './components'
44
import { vTDirective } from './directive'
@@ -41,10 +41,10 @@ export function apply<Messages, DateTimeFormats, NumberFormats>(
4141
// install components
4242
app.component(
4343
!useI18nComponentName ? Translation.name : 'i18n',
44-
Translation
44+
Translation as Component
4545
)
46-
app.component(NumberFormat.name, NumberFormat)
47-
app.component(DatetimeFormat.name, DatetimeFormat)
46+
app.component(NumberFormat.name, NumberFormat as Component)
47+
app.component(DatetimeFormat.name, DatetimeFormat as Component)
4848
}
4949

5050
// install directive

yarn.lock

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -608,11 +608,11 @@
608608
universal-user-agent "^6.0.0"
609609

610610
"@octokit/plugin-paginate-rest@^2.2.0":
611-
version "2.3.0"
612-
resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.3.0.tgz#7d1073e56cfd15d3f99dcfe81fa5d2b466f3a6f6"
613-
integrity sha512-Ye2ZJreP0ZlqJQz8fz+hXvrEAEYK4ay7br1eDpWzr6j76VXs/gKqxFcH8qRzkB3fo/2xh4Vy9VtGii4ZDc9qlA==
611+
version "2.3.1"
612+
resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.3.1.tgz#00f91701dfda26227c3e748d42bc89e2d0d9ce55"
613+
integrity sha512-81A+ONLpcSX7vWxnEmVZteQPNsbdeScSVUqjgMYPSk1trzG69iYkhS42wPRWtN0nYw6OEmT48DNeQCjHeyroYw==
614614
dependencies:
615-
"@octokit/types" "^5.2.0"
615+
"@octokit/types" "^5.3.0"
616616

617617
"@octokit/plugin-request-log@^1.0.0":
618618
version "1.0.0"
@@ -667,7 +667,7 @@
667667
dependencies:
668668
"@types/node" ">= 8"
669669

670-
"@octokit/types@^5.0.0", "@octokit/types@^5.0.1", "@octokit/types@^5.2.0":
670+
"@octokit/types@^5.0.0", "@octokit/types@^5.0.1", "@octokit/types@^5.3.0":
671671
version "5.4.1"
672672
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-5.4.1.tgz#d5d5f2b70ffc0e3f89467c3db749fa87fc3b7031"
673673
integrity sha512-OlMlSySBJoJ6uozkr/i03nO5dlYQyE05vmQNZhAh9MyO4DPBP88QlwsDVLmVjIMFssvIZB6WO0ctIGMRG+xsJQ==
@@ -1012,69 +1012,69 @@
10121012
dependencies:
10131013
eslint-visitor-keys "^1.1.0"
10141014

1015-
1016-
version "3.0.0-rc.8"
1017-
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.0.0-rc.8.tgz#c8a630b440d03a1790d34b3c5a7b3c86caa8a84e"
1018-
integrity sha512-67sHKlKhrBhxF72gJc8PkJeAA1iZ4x1krVDuS2yOvS44Gj+fNHu8Y25mThLu+eq2rXCUrrbbmZge9ND6VuyFUA==
1015+
1016+
version "3.0.0-rc.9"
1017+
resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.0.0-rc.9.tgz#f2baef360dec3630a230a056dde1e76c9c7bb5f5"
1018+
integrity sha512-/Ns7KGT5P0wh4JTM91drBmNIiBlKrCFUqIE2vk8dmaVvqEJf1mqympz1CDZpikghCQC6hKu3tYKxA7qtcMRazw==
10191019
dependencies:
10201020
"@babel/parser" "^7.10.4"
10211021
"@babel/types" "^7.10.4"
1022-
"@vue/shared" "3.0.0-rc.8"
1022+
"@vue/shared" "3.0.0-rc.9"
10231023
estree-walker "^2.0.1"
10241024
source-map "^0.6.1"
10251025

1026-
1027-
version "3.0.0-rc.8"
1028-
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.0.0-rc.8.tgz#a4fd66356e1dbe7bf3f3e41f6034e682b7c22b3d"
1029-
integrity sha512-xnYswIMWTu8ck5ZcyXrZBhB/gBXla5JpfdEkoPqjNNSXZn1w6N398KuB6UQtjSDjjIsZ7shs7/x5hgtnqTNBJQ==
1026+
1027+
version "3.0.0-rc.9"
1028+
resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.0.0-rc.9.tgz#2a122181db498c0605213fe541af24ecb03ef27e"
1029+
integrity sha512-0hCnrIxwp0TKVXKnGYFztM4LMUvFpfXW7YoEglvHqIfZsGkyKcnCYDx4FPk1frDM21xnrr5HgcHt42rlz8lDBA==
10301030
dependencies:
1031-
"@vue/compiler-core" "3.0.0-rc.8"
1032-
"@vue/shared" "3.0.0-rc.8"
1031+
"@vue/compiler-core" "3.0.0-rc.9"
1032+
"@vue/shared" "3.0.0-rc.9"
10331033

1034-
1035-
version "3.0.0-rc.8"
1036-
resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.0.0-rc.8.tgz#4b6137922ede1c6abca74e15fda8baf7163e14e0"
1037-
integrity sha512-0NtZ6e90CpD/MJRDY0AgGNA1t3utjMkg1A/xc2RruUvJgpCsr/9sj6wK0ZoXV/MKKKFzE5DVgPjwVs0o5wxTfg==
1034+
1035+
version "3.0.0-rc.9"
1036+
resolved "https://registry.yarnpkg.com/@vue/compiler-ssr/-/compiler-ssr-3.0.0-rc.9.tgz#52e4523b54d993ca0ad137813c5b1212988e62af"
1037+
integrity sha512-lpbnkJrhkI5QgprLPXcB1Uq402QiibPFKRUQZ5vu3zeAvUeMYuQUtZS/Dslurcvqd1dbBC/HM0gCpLtjEQ+2qA==
10381038
dependencies:
1039-
"@vue/compiler-dom" "3.0.0-rc.8"
1040-
"@vue/shared" "3.0.0-rc.8"
1039+
"@vue/compiler-dom" "3.0.0-rc.9"
1040+
"@vue/shared" "3.0.0-rc.9"
10411041

1042-
1043-
version "3.0.0-rc.8"
1044-
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.0.0-rc.8.tgz#329a00e63781663516e5b356ab17e4782bafa7d6"
1045-
integrity sha512-/NjP+CI3ggeRXaIlJCI/zJBuClOhwy+SPvt8mcIQEMeewn67bh1Qzl5iqD+yFFzaS3MR3ofdkcCiq1UQ/k2Omg==
1042+
1043+
version "3.0.0-rc.9"
1044+
resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.0.0-rc.9.tgz#d6a3f40bb9c2e3b0f6f20b4693efc2f91d0c220b"
1045+
integrity sha512-1fJSt4zZ/icZUNsN3Te5BeVChmQ7Ner2xUYy9ALtShLSj2RwxRVhtysjXxLE16TbwLkHjsOHjA8tQWrdBfQG0A==
10461046
dependencies:
1047-
"@vue/shared" "3.0.0-rc.8"
1047+
"@vue/shared" "3.0.0-rc.9"
10481048

1049-
1050-
version "3.0.0-rc.8"
1051-
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.0.0-rc.8.tgz#3672094478c7dcf84e6906ac6f0c20fe386fcf9c"
1052-
integrity sha512-VZpfCqsjz9rixDWCrEB4aI2qjlTslxAlK+5lVK+4jq7Tz2ZLQa93/Zg9p5DRzdI5GCd3nkOxo9hFXkPu+B2pIw==
1049+
1050+
version "3.0.0-rc.9"
1051+
resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.0.0-rc.9.tgz#5b4872363c69df6db4e937678ebdc68a141960bb"
1052+
integrity sha512-5tViEzPl8K1moMjCQJXqvTa/RjR/h8cZ9dUDgKfKWvZhxAmXHtmYlBWrvEeFTGWiEuZj0XlZkNxMNjuHLVF0Vg==
10531053
dependencies:
1054-
"@vue/reactivity" "3.0.0-rc.8"
1055-
"@vue/shared" "3.0.0-rc.8"
1054+
"@vue/reactivity" "3.0.0-rc.9"
1055+
"@vue/shared" "3.0.0-rc.9"
10561056

1057-
1058-
version "3.0.0-rc.8"
1059-
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.0.0-rc.8.tgz#96bde809e1d49ff0655bc63e7852cdaa25b23a8e"
1060-
integrity sha512-Da1wMDU1bh1c5WLSc3E78ns3XphZG4WHl6v0elhFkwpnSF5qB14ZYnuuqXVZ4N8Afe6ZjvtM4GSWOZlD4TkYng==
1057+
1058+
version "3.0.0-rc.9"
1059+
resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.0.0-rc.9.tgz#6673901830c78cbe0b7c7c3f656db6ba49783dd1"
1060+
integrity sha512-OUKFLOaoshmQPaW7iaYuxl9ip3v08g8cXYr0bu68/0r94PF2/xO/b0GhoUoyeqp/pu1VzZ1TxulJ94JOXsuYjg==
10611061
dependencies:
1062-
"@vue/runtime-core" "3.0.0-rc.8"
1063-
"@vue/shared" "3.0.0-rc.8"
1062+
"@vue/runtime-core" "3.0.0-rc.9"
1063+
"@vue/shared" "3.0.0-rc.9"
10641064
csstype "^2.6.8"
10651065

10661066
"@vue/server-renderer@^3.0.0-rc.8":
1067-
version "3.0.0-rc.8"
1068-
resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.0.0-rc.8.tgz#e8090f7470e485f42a05b66707ae60b45a2316aa"
1069-
integrity sha512-OHMDMQobmnX+DbwE694WQwx0vkmzjegkyRS38DlwzffmK1IvyHbWeuwhNV0itXl0Llzdgp2E4pSBoZtJkQW+tg==
1067+
version "3.0.0-rc.9"
1068+
resolved "https://registry.yarnpkg.com/@vue/server-renderer/-/server-renderer-3.0.0-rc.9.tgz#c8c17573f94344e78865928296b5b95016fd24a9"
1069+
integrity sha512-GT7I6a2WOW1YTrmUXRbI6dJkKeV3vuiJ6Z22M70K6d6ekLM0o8CqHTJYqtiKNeoZdfhHinewlT0xelDgIDMb9g==
10701070
dependencies:
1071-
"@vue/compiler-ssr" "3.0.0-rc.8"
1072-
"@vue/shared" "3.0.0-rc.8"
1071+
"@vue/compiler-ssr" "3.0.0-rc.9"
1072+
"@vue/shared" "3.0.0-rc.9"
10731073

1074-
1075-
version "3.0.0-rc.8"
1076-
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.0.0-rc.8.tgz#d6b80e14c202c37d9f1953965a1517eab46c1d3b"
1077-
integrity sha512-GSvG6mbDcOQtLKfeNe77ds0oo5PRfTDhsPlqx1fwvpyROS/BAOo1YK17CXwmI+Vsf+51L/l42tTneBTdhQotmg==
1074+
1075+
version "3.0.0-rc.9"
1076+
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.0.0-rc.9.tgz#81e71c2c40dbbfc4f05b3b4a3f92cb2842864aa3"
1077+
integrity sha512-SHD7qwziiG6208nKrs0qqbWbYckvBiCBCLwlRjUb6NEDUMN0TOVyzyaTvdnHND9ion/ZMdwEKMtWWtgJJkHDdw==
10781078

10791079
JSONStream@^1.0.4:
10801080
version "1.3.5"
@@ -2626,9 +2626,9 @@ eslint-plugin-vue@^7.0.0-beta.2:
26262626
vue-eslint-parser "^7.1.0"
26272627

26282628
eslint-rule-docs@^1.1.5:
2629-
version "1.1.205"
2630-
resolved "https://registry.yarnpkg.com/eslint-rule-docs/-/eslint-rule-docs-1.1.205.tgz#05df8791c5941d6831b6f181bc88629b46ec3dce"
2631-
integrity sha512-yguHHAkBG9L09YoaOpXXi3MsvEwPlqhas8yDnnaykbA6I8BAxUpa3FkCspxyzdnDPuLWEy+vVmrZHXL2M4zFTQ==
2629+
version "1.1.206"
2630+
resolved "https://registry.yarnpkg.com/eslint-rule-docs/-/eslint-rule-docs-1.1.206.tgz#bdbe29583467f3a39362dd3f8c9c166bdbce6741"
2631+
integrity sha512-xEHu3DuY/3rAhyp6Hg3zrMWvpNYE7ez3DaV7ywlLBmqaybnjbYtZnU7b+xY5V3sjPwhqrj27sqjM0vxkFIBEWg==
26322632

26332633
eslint-scope@^4.0.0:
26342634
version "4.0.3"
@@ -5150,9 +5150,9 @@ minipass-collect@^1.0.2:
51505150
minipass "^3.0.0"
51515151

51525152
minipass-fetch@^1.1.2:
5153-
version "1.3.0"
5154-
resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-1.3.0.tgz#110fed67fedd02dbeab823489ff0453f84fa5a6c"
5155-
integrity sha512-Yb23ESZZ/8QxiBvSpJ4atbVMVDx2CXrerzrtQzQ67eLqKg+zFIkYFTagk3xh6fdo+e/FvDtVuCD4QcuYDRR3hw==
5153+
version "1.3.1"
5154+
resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-1.3.1.tgz#6d09556764474119ed79e270bc98b9c76d12c8e2"
5155+
integrity sha512-N0ddPAD8OZnoAHUYj1ZH4ZJVna+ucy7if777LrdeIV1ko8f46af4jbyM5EC1gN4xc9Wq5c3C38GnxRJ2gneXRA==
51565156
dependencies:
51575157
minipass "^3.1.0"
51585158
minipass-sized "^1.0.3"
@@ -7546,13 +7546,13 @@ vue-eslint-parser@^7.1.0:
75467546
lodash "^4.17.15"
75477547

75487548
vue@^3.0.0-rc.8:
7549-
version "3.0.0-rc.8"
7550-
resolved "https://registry.yarnpkg.com/vue/-/vue-3.0.0-rc.8.tgz#001b9d7a4033d6ff4b601c6457fc080e192fead9"
7551-
integrity sha512-2TPckyMoOjEawJBsjb+02GusPBBTwgCqGSjQYsJnToCPDR7PnVCkA4dbGJYlw1w9heXfwgyI+9qmZT0vMVLGmg==
7549+
version "3.0.0-rc.9"
7550+
resolved "https://registry.yarnpkg.com/vue/-/vue-3.0.0-rc.9.tgz#8c54e6168625e3533f1f764ad3fa89235b01afb3"
7551+
integrity sha512-bimvpl5q/sKy1dAOE+KNX9T3p6Qq8kuNRmOYwaxtacI91ksjS7nVGse1FANhTL+XTQgl8+ySrd3f67xWi26nxw==
75527552
dependencies:
7553-
"@vue/compiler-dom" "3.0.0-rc.8"
7554-
"@vue/runtime-dom" "3.0.0-rc.8"
7555-
"@vue/shared" "3.0.0-rc.8"
7553+
"@vue/compiler-dom" "3.0.0-rc.9"
7554+
"@vue/runtime-dom" "3.0.0-rc.9"
7555+
"@vue/shared" "3.0.0-rc.9"
75567556

75577557
w3c-hr-time@^1.0.2:
75587558
version "1.0.2"

0 commit comments

Comments
 (0)