Skip to content
This repository was archived by the owner on Apr 22, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ module.exports = (api, options, rootOptions) => {

if (isVue3) {
pkg.dependencies['vue-i18n'] = '^9.1.0'
pkg.devDependencies['@intlify/vue-i18n-loader'] = '^2.1.0'
pkg.devDependencies['@intlify/vue-i18n-loader'] = '^3.0.0'
pkg.vue.pluginOptions.i18n['enableLegacy'] = enableLegacy
pkg.vue.pluginOptions.i18n['runtimeOnly'] = false
pkg.vue.pluginOptions.i18n['compositionOnly'] = !!enableLegacy
pkg.vue.pluginOptions.i18n['fullInstall'] = true
} else {
pkg.dependencies['vue-i18n'] = '^8.22.3'
pkg.dependencies['vue-i18n'] = '^8.25.0'
if (enableInSFC) {
pkg.devDependencies['@intlify/vue-i18n-loader'] = '^1.0.0'
pkg.devDependencies['@intlify/vue-i18n-loader'] = '^1.1.0'
}
pkg.vue.pluginOptions.i18n['enableInSFC'] = enableInSFC
}
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/generator-vue3.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ test('javascript: legacy', async () => {
expect(sfc).toMatch(`export default defineComponent({`)
const pack = files['package.json']
expect(pack).toMatch(`"vue-i18n": "^9.1.0"`)
expect(pack).toMatch(`"@intlify/vue-i18n-loader": "^2.1.0"`)
expect(pack).toMatch(`"@intlify/vue-i18n-loader": "^3.0.0"`)
})

test('javascript: composition', async () => {
Expand Down Expand Up @@ -63,7 +63,7 @@ test('javascript: composition', async () => {
expect(sfc).toMatch(`const { t } = useI18n({`)
const pack = files['package.json']
expect(pack).toMatch(`"vue-i18n": "^9.1.0"`)
expect(pack).toMatch(`"@intlify/vue-i18n-loader": "^2.1.0"`)
expect(pack).toMatch(`"@intlify/vue-i18n-loader": "^3.0.0"`)
})

test('typescript: composition', async () => {
Expand Down Expand Up @@ -108,5 +108,5 @@ test('typescript: composition', async () => {
expect(sfc).toMatch(`const { t } = useI18n({`)
const pack = files['package.json']
expect(pack).toMatch(`"vue-i18n": "^9.1.0"`)
expect(pack).toMatch(`"@intlify/vue-i18n-loader": "^2.1.0"`)
expect(pack).toMatch(`"@intlify/vue-i18n-loader": "^3.0.0"`)
})
8 changes: 4 additions & 4 deletions tests/unit/generator.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ test('javascript', async () => {
const locale = files['src/locales/en.json']
expect(locale).toMatch(`{\n "message": "hello i18n !!"\n}`)
const pack = files['package.json']
expect(pack).toMatch(`"vue-i18n": "^8.22.3"`)
expect(pack).not.toMatch(`"@intlify/vue-i18n-loader": "^1.0.0"`)
expect(pack).toMatch(`"vue-i18n": "^8.25.0"`)
expect(pack).not.toMatch(`"@intlify/vue-i18n-loader": "^1.1.0"`)
})

test('typescript', async () => {
Expand Down Expand Up @@ -57,6 +57,6 @@ test('typescript', async () => {
const sfc = files['src/components/HelloI18n.vue']
expect(sfc).toMatch(`export default Vue.extend({`)
const pack = files['package.json']
expect(pack).toMatch(`"vue-i18n": "^8.22.3"`)
expect(pack).toMatch(`"@intlify/vue-i18n-loader": "^1.0.0"`)
expect(pack).toMatch(`"vue-i18n": "^8.25.0"`)
expect(pack).toMatch(`"@intlify/vue-i18n-loader": "^1.1.0"`)
})