Skip to content

Commit e1d966e

Browse files
authored
feat!: deprecate Legacy API mode (#2016)
* fix: deprecated Legacy API mode * fix: e2e errors * fix
1 parent 23c85d2 commit e1d966e

16 files changed

+557
-437
lines changed

e2e/fallback/basic.spec.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import { getText } from '../helper'
55
beforeAll(async () => {
66
page.on('console', msg => {
77
if (msg.type() === 'warning') {
8-
warnings.push(msg.text())
8+
const text = msg.text()
9+
if (!text.match(/^\[intlify\] Legacy API mode has been/)) {
10+
warnings.push(msg.text())
11+
}
912
}
1013
})
1114
await page.goto(

e2e/fallback/format.spec.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import { getText } from '../helper'
55
beforeAll(async () => {
66
page.on('console', msg => {
77
if (msg.type() === 'warning') {
8-
warnings.push(msg.text())
8+
const text = msg.text()
9+
if (!text.match(/^\[intlify\] Legacy API mode has been/)) {
10+
warnings.push(msg.text())
11+
}
912
}
1013
})
1114
await page.goto(

e2e/fallback/option.spec.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import { getText } from '../helper'
55
beforeAll(async () => {
66
page.on('console', msg => {
77
if (msg.type() === 'warning') {
8-
warnings.push(msg.text())
8+
const text = msg.text()
9+
if (!text.match(/^\[intlify\] Legacy API mode has been/)) {
10+
warnings.push(msg.text())
11+
}
912
}
1013
})
1114
await page.goto(

e2e/fallback/suppress.spec.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import { getText } from '../helper'
55
beforeAll(async () => {
66
page.on('console', msg => {
77
if (msg.type() === 'warning') {
8-
warnings.push(msg.text())
8+
const text = msg.text()
9+
if (!text.match(/^\[intlify\] Legacy API mode has been/)) {
10+
warnings.push(msg.text())
11+
}
912
}
1013
})
1114
await page.goto(

e2e/missing/handler.spec.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import { getText } from '../helper'
55
beforeAll(async () => {
66
page.on('console', msg => {
77
if (msg.type() === 'warning') {
8-
warnings.push(msg.text())
8+
const text = msg.text()
9+
if (!text.match(/^\[intlify\] Legacy API mode has been/)) {
10+
warnings.push(msg.text())
11+
}
912
}
1013
})
1114
await page.goto(

e2e/missing/option.spec.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import { getText } from '../helper'
55
beforeAll(async () => {
66
page.on('console', msg => {
77
if (msg.type() === 'warning') {
8-
warnings.push(msg.text())
8+
const text = msg.text()
9+
if (!text.match(/^\[intlify\] Legacy API mode has been/)) {
10+
warnings.push(msg.text())
11+
}
912
}
1013
})
1114
await page.goto(

e2e/missing/suppress.spec.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import { getText } from '../helper'
55
beforeAll(async () => {
66
page.on('console', msg => {
77
if (msg.type() === 'warning') {
8-
warnings.push(msg.text())
8+
const text = msg.text()
9+
if (!text.match(/^\[intlify\] Legacy API mode has been/)) {
10+
warnings.push(msg.text())
11+
}
912
}
1013
})
1114
await page.goto(

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"@types/minimist": "^1.2.5",
8989
"@types/node": "^22.5.3",
9090
"@types/rc": "^1.2.4",
91-
"@vitest/coverage-v8": "^2.0.0",
91+
"@vitest/coverage-v8": "^2.1.5",
9292
"api-docs-gen": "^0.4.0",
9393
"benchmark": "^2.1.4",
9494
"brotli": "^1.3.2",
@@ -145,7 +145,7 @@
145145
"typescript": "^5.5.3",
146146
"typescript-eslint": "^8.4.0",
147147
"vitepress": "1.5.0",
148-
"vitest": "^2.0.4",
148+
"vitest": "^2.1.5",
149149
"vue": "3.5.12",
150150
"vue-i18n": "workspace:*"
151151
},
@@ -177,7 +177,7 @@
177177
"pnpm": {
178178
"overrides": {
179179
"vue": "3.5.12",
180-
"vite": "^5.1.2"
180+
"vite": "^5.4.11"
181181
}
182182
}
183183
}

packages/size-check-petite-vue-i18n/src/main.ts

+59-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,69 @@ import { createApp } from 'vue'
22
import { createI18n } from 'vue-i18n'
33
import App from './App.vue'
44

5+
const ast = {
6+
type: 0,
7+
start: 0,
8+
end: 6,
9+
loc: {
10+
start: {
11+
line: 1,
12+
column: 1,
13+
offset: 0
14+
},
15+
end: {
16+
line: 1,
17+
column: 7,
18+
offset: 6
19+
},
20+
source: 'hello!'
21+
},
22+
body: {
23+
type: 2,
24+
start: 0,
25+
end: 6,
26+
loc: {
27+
start: {
28+
line: 1,
29+
column: 1,
30+
offset: 0
31+
},
32+
end: {
33+
line: 1,
34+
column: 7,
35+
offset: 6
36+
}
37+
},
38+
items: [
39+
{
40+
type: 3,
41+
start: 0,
42+
end: 6,
43+
loc: {
44+
start: {
45+
line: 1,
46+
column: 1,
47+
offset: 0
48+
},
49+
end: {
50+
line: 1,
51+
column: 7,
52+
offset: 6
53+
}
54+
},
55+
value: 'hello!'
56+
}
57+
],
58+
static: 'hello!'
59+
},
60+
cacheKey: '{"l":"en","k":"hello","s":"hello!"}'
61+
}
62+
563
const i18n = createI18n({
664
locale: 'en',
765
messages: {
866
en: {
9-
hello: 'hello!'
67+
hello: ast
1068
}
1169
}
1270
})

0 commit comments

Comments
 (0)