Skip to content

Commit 8022857

Browse files
committed
fix: format
1 parent 08a1722 commit 8022857

File tree

147 files changed

+1056
-3363
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+1056
-3363
lines changed

.github/CONTRIBUTING.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ It is of course fine to use non-English language, when you open a PR to translat
2222
- Work in the `src` folder and **DO NOT** checkin `dist` in the commits.
2323

2424
- If adding new feature:
25-
2625
- Add accompanying test case.
2726
- Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it greenlighted before working on it.
2827

2928
- If fixing a bug:
30-
3129
- Provide detailed description of the bug in the PR. Live demo preferred.
3230
- Add appropriate test coverage if applicable.
3331

@@ -86,18 +84,15 @@ pnpm build -- --all
8684
By default, each package will be built in multiple distribution formats as specified in the `buildOptions.formats` field in its `package.json`. These can be overwritten via the `-f` flag. The following formats are supported:
8785

8886
- **`global`**
89-
9087
- For direct use via `<script>` in the browser.
9188
- Note: global builds are not [UMD](https://github.com/umdjs/umd) builds. Instead they are built as [IIFEs](https://developer.mozilla.org/en-US/docs/Glossary/IIFE).
9289

9390
- **`esm-bundler`**
94-
9591
- Leaves prod/dev branches with `process.env.NODE_ENV` guards (to be replaced by bundler)
9692
- Does not ship a minified build (to be done together with the rest of the code after bundling)
9793
- For use with bundlers like `webpack`, `rollup` and `parcel`.
9894

9995
- **`esm-browser`**
100-
10196
- For usage via native ES modules imports (in browser via `<script type="module">`, or via Node.js native ES modules support in the future)
10297
- Inlines all dependencies - i.e. it's a single ES module with no imports from other files
10398
- This means you **must** import everything from this file and this file only to ensure you are getting the same instance of code.

benchmark/complex-jit-aot.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ function precompile(data) {
2323
return data
2424
}
2525

26-
const resources = await readJson(
27-
resolve(dirname('.'), './benchmark/complex.json')
28-
)
26+
const resources = await readJson(resolve(dirname('.'), './benchmark/complex.json'))
2927
const len = Object.keys(resources).length
3028
console.log(`complex pattern on ${len} resources (JIT + AOT):`)
3129

benchmark/complex-jit.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ import { createI18n } from 'vue-i18n'
1313
import { displayMemoryUsage, parseArgs, readJson } from './utils.mjs'
1414

1515
const args = parseArgs()
16-
const resources = await readJson(
17-
resolve(dirname('.'), './benchmark/complex.json')
18-
)
16+
const resources = await readJson(resolve(dirname('.'), './benchmark/complex.json'))
1917
const len = Object.keys(resources).length
2018
console.log(`complex pattern on ${len} resources (JIT):`)
2119

benchmark/complex.mjs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
import {
2-
clearCompileCache,
3-
createCoreContext,
4-
translate
5-
} from '@intlify/core-base'
1+
import { clearCompileCache, createCoreContext, translate } from '@intlify/core-base'
62
import { bench, run } from 'mitata'
73
import { dirname, resolve } from 'node:path'
84
import { createI18n } from 'vue-i18n'
95
import { displayMemoryUsage, parseArgs, readJson } from './utils.mjs'
106

117
const args = parseArgs()
12-
const resources = await readJson(
13-
resolve(dirname('.'), './benchmark/complex.json')
14-
)
8+
const resources = await readJson(resolve(dirname('.'), './benchmark/complex.json'))
159
const len = Object.keys(resources).length
1610
console.log(`complex pattern on ${len} resources (AOT):`)
1711

benchmark/simple-jit-aot.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ function precompile(data) {
2323
return data
2424
}
2525

26-
const resources = await readJson(
27-
resolve(dirname('.'), './benchmark/simple.json')
28-
)
26+
const resources = await readJson(resolve(dirname('.'), './benchmark/simple.json'))
2927
const len = Object.keys(resources).length
3028
console.log(`simple pattern on ${len} resources (JIT + AOT):`)
3129

benchmark/simple-jit.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ import { createI18n } from 'vue-i18n'
1313
import { displayMemoryUsage, parseArgs, readJson } from './utils.mjs'
1414

1515
const args = parseArgs()
16-
const resources = await readJson(
17-
resolve(dirname('.'), './benchmark/simple.json')
18-
)
16+
const resources = await readJson(resolve(dirname('.'), './benchmark/simple.json'))
1917
const len = Object.keys(resources).length
2018
console.log(`simple pattern on ${len} resources (JIT):`)
2119

benchmark/simple.mjs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
import {
2-
clearCompileCache,
3-
createCoreContext,
4-
translate
5-
} from '@intlify/core-base'
1+
import { clearCompileCache, createCoreContext, translate } from '@intlify/core-base'
62
import { bench, run } from 'mitata'
73
import { dirname, resolve } from 'node:path'
84
import { createI18n } from 'vue-i18n'
95
import { displayMemoryUsage, parseArgs, readJson } from './utils.mjs'
106

117
const args = parseArgs()
12-
const resources = await readJson(
13-
resolve(dirname('.'), './benchmark/simple.json')
14-
)
8+
const resources = await readJson(resolve(dirname('.'), './benchmark/simple.json'))
159
const len = Object.keys(resources).length
1610
console.log(`simple pattern on ${len} resources (AOT):`)
1711

e2e/components/datetime-format.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ import { getText, url } from '../helper'
22
;['composition'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
5-
await page.goto(
6-
url(`/examples/${pattern}/components/datetime-format.html`)
7-
)
5+
await page.goto(url(`/examples/${pattern}/components/datetime-format.html`))
86
})
97

108
test('rendering', async () => {

e2e/components/translation.spec.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import { getText, url } from '../helper'
66
})
77

88
test('rendering', async () => {
9-
expect(await getText(page, '#app p.name')).toMatch(
10-
'こんにちは、kazupon!'
11-
)
9+
expect(await getText(page, '#app p.name')).toMatch('こんにちは、kazupon!')
1210
expect(await getText(page, '#app p.list')).toMatch('hello, English!')
1311
expect(await getText(page, '#app p.linked')).toMatch(
1412
'こんにちは、かずぽん! ごきげんいかが?'

e2e/formatting/linked.spec.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,18 @@ import { getText, url } from '../helper'
66
})
77

88
test('initial rendering', async () => {
9-
expect(await getText(page, '#app p.linked')).toMatch(
10-
'DIO: the world !!!!'
11-
)
12-
expect(await getText(page, '#app p.error')).toMatch(
13-
'Please provide home address'
14-
)
15-
expect(await getText(page, '#app p.modifier')).toMatch(
16-
'custom modifiers example: snake-case'
17-
)
9+
expect(await getText(page, '#app p.linked')).toMatch('DIO: the world !!!!')
10+
expect(await getText(page, '#app p.error')).toMatch('Please provide home address')
11+
expect(await getText(page, '#app p.modifier')).toMatch('custom modifiers example: snake-case')
1812
})
1913

2014
test('change locale', async () => {
2115
await page.selectOption('#app select', 'ja')
22-
expect(await getText(page, '#app p.linked')).toMatch(
23-
'ディオ: ザ・ワールド !!!!'
24-
)
16+
expect(await getText(page, '#app p.linked')).toMatch('ディオ: ザ・ワールド !!!!')
2517
expect(await getText(page, '#app p.error')).toMatch(
2618
'どうか、ホームアドレス を提供してください。'
2719
)
28-
expect(await getText(page, '#app p.modifier')).toMatch(
29-
'カスタム修飾子の例: スネーク-ケース'
30-
)
20+
expect(await getText(page, '#app p.modifier')).toMatch('カスタム修飾子の例: スネーク-ケース')
3121
})
3222
})
3323
})

0 commit comments

Comments
 (0)