Skip to content

Commit 255ae03

Browse files
committed
refactor: verbatimModuleSyntax option
1 parent 453f50b commit 255ae03

26 files changed

+107
-89
lines changed

packages/core-base/src/translate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
} from '@intlify/shared'
2020
import { isMessageAST } from './compilation'
2121
import {
22-
CoreContext,
2322
getAdditionalMeta,
2423
handleMissing,
2524
isAlmostSameLocale,
@@ -36,6 +35,7 @@ import { CoreWarnCodes, getWarnMessage } from './warnings'
3635
import type { AdditionalPayloads } from '@intlify/devtools-types'
3736
import type { CompileError, ResourceNode } from '@intlify/message-compiler'
3837
import type {
38+
CoreContext,
3939
CoreInternalContext,
4040
DefineCoreLocaleMessage,
4141
LocaleMessages,

packages/core-base/test/context.test-d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import {
2-
createCoreContext,
1+
import { createCoreContext } from '../src'
2+
3+
import type {
34
DateTimeFormat,
45
Locale,
56
LocaleDetector,
67
NumberFormat,
78
PickupFallbackLocales
89
} from '../src'
9-
1010
import type { MyDatetimeScehma, MyNumberSchema, ResourceSchema } from './schema'
1111

1212
// loose options

packages/core-base/test/fallbacker.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import { createCoreContext as context, CoreContext } from '../src/context'
1+
import { createCoreContext as context } from '../src/context'
2+
import { CoreErrorCodes, errorMessages } from '../src/errors'
23
import {
34
fallbackWithLocaleChain,
45
fallbackWithSimple,
56
resolveLocale
67
} from '../src/fallbacker'
7-
import { errorMessages, CoreErrorCodes } from '../src/errors'
8-
import { LocaleDetector } from '@intlify/core-base'
8+
9+
import type { LocaleDetector } from '@intlify/core-base'
10+
import type { CoreContext } from '../src/context'
911

1012
describe('fallbackWithSimple', () => {
1113
let ctx: CoreContext<string>

packages/core-base/test/issues.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import { NodeTypes } from '@intlify/message-compiler'
12
import { format } from '../src/format'
23
import { createMessageContext as context } from '../src/runtime'
34

4-
import { NodeTypes, ResourceNode } from '@intlify/message-compiler'
5+
import type { ResourceNode } from '@intlify/message-compiler'
56

67
describe('CVE-2024-52809', () => {
78
function attackGetter() {

packages/core-base/test/number.test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,18 @@ vi.mock('../src/intl', async () => {
2020
}
2121
})
2222

23-
import { createCoreContext as context, NOT_REOSLVED } from '../src/context'
24-
import { number } from '../src/number'
25-
import { CoreErrorCodes, errorMessages } from '../src/errors'
23+
import { compile } from '../src/compilation'
2624
import {
27-
registerMessageCompiler,
28-
registerLocaleFallbacker
25+
createCoreContext as context,
26+
NOT_REOSLVED,
27+
registerLocaleFallbacker,
28+
registerMessageCompiler
2929
} from '../src/context'
30-
import { compile } from '../src/compilation'
30+
import { CoreErrorCodes, errorMessages } from '../src/errors'
3131
import { fallbackWithLocaleChain } from '../src/fallbacker'
32-
import { NumberFormats } from '../src/types/index'
32+
import { number } from '../src/number'
33+
34+
import type { NumberFormats } from '../src/types/index'
3335

3436
type MyNumberSchema = {
3537
currency: {} // loose schema

packages/core-base/test/runtime.test-d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MessageType } from '../src/runtime'
1+
import type { MessageType } from '../src/runtime'
22

33
/**
44
* Message Type

packages/format-explorer/vite.config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { defineConfig } from 'vite'
21
import vue from '@vitejs/plugin-vue'
32
import { execaSync } from 'execa'
43
import path from 'node:path'
54
import { URL } from 'node:url'
5+
import { defineConfig } from 'vite'
66

77
const commit = execaSync('git', ['rev-parse', 'HEAD']).stdout.slice(0, 7)
88
console.log('commit', commit)
99

1010
const __dirname = path.dirname(new URL(import.meta.url).pathname)
1111

1212
// https://vitejs.dev/config/
13-
export default defineConfig({
13+
const config = defineConfig({
1414
define: {
1515
__COMMIT__: JSON.stringify(commit),
1616
__BROWSER__: false
@@ -25,3 +25,5 @@ export default defineConfig({
2525
},
2626
plugins: [vue()]
2727
})
28+
29+
export default config

packages/message-compiler/src/nodes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SourceLocation } from './location'
1+
import type { SourceLocation } from './location'
22

33
export const enum NodeTypes {
44
Resource, // 0

packages/vue-i18n-core/src/components/base.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { Composer } from '../composer'
2-
31
import type { Locale } from '@intlify/core-base'
2+
import type { Composer } from '../composer'
43
import type { I18nScope } from '../i18n'
54

65
export type ComponentI18nScope = Exclude<I18nScope, 'local'>
Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
export { BaseFormatProps, ComponentI18nScope } from './base'
2-
export { DatetimeFormat, DatetimeFormatProps, I18nD } from './DatetimeFormat'
3-
export { FormattableProps } from './formatRenderer'
4-
export { I18nN, NumberFormat, NumberFormatProps } from './NumberFormat'
5-
export { I18nT, Translation, TranslationProps } from './Translation'
1+
export { DatetimeFormat, I18nD } from './DatetimeFormat'
2+
export { I18nN, NumberFormat } from './NumberFormat'
3+
export { I18nT, Translation } from './Translation'
4+
5+
export type { BaseFormatProps, ComponentI18nScope } from './base'
6+
export type { DatetimeFormatProps } from './DatetimeFormat'
7+
export type { FormattableProps } from './formatRenderer'
8+
export type { NumberFormatProps } from './NumberFormat'
9+
export type { TranslationProps } from './Translation'

0 commit comments

Comments
 (0)