Skip to content
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
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ module.exports = {

// A map from regular expressions to module names that allow to stub out resources with a single module
moduleNameMapper: {
'^@intlify/core/src/runtime$': '<rootDir>/packages/core/src/index.ts',
'^@intlify/(.*?)$': '<rootDir>/packages/$1/src',
'vue-i18n': '<rootDir>/packages/vue-i18n/src'
},
Expand Down
20 changes: 20 additions & 0 deletions packages/core-base/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2020 kazuya kawaguchi

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7 changes: 7 additions & 0 deletions packages/core-base/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @intlify/core-base

The intlify core base module

## :copyright: License

[MIT](http://opensource.org/licenses/MIT)
7 changes: 7 additions & 0 deletions packages/core-base/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../api-extractor.json",
"mainEntryPointFilePath": "./dist/packages/<unscopedPackageName>/src/index.d.ts",
"dtsRollup": {
"publicTrimmedFilePath": "./dist/<unscopedPackageName>.d.ts"
}
}
7 changes: 7 additions & 0 deletions packages/core-base/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict'

if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/core-base.cjs.prod.js')
} else {
module.exports = require('./dist/core-base.cjs.js')
}
54 changes: 54 additions & 0 deletions packages/core-base/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"name": "@intlify/core-base",
"version": "9.0.0-beta.12",
"description": "@intlify/core-base",
"keywords": [
"core",
"fundamental",
"i18n",
"internationalization",
"intlify"
],
"license": "MIT",
"author": {
"name": "kazuya kawaguchi",
"email": "kawakazu80@gmail.com"
},
"homepage": "https://github.com/intlify/vue-i18n-next/tree/master/packages/core-base#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/intlify/vue-i18n-next.git",
"directory": "packages/core"
},
"bugs": {
"url": "https://github.com/intlify/vue-i18n-next/issues"
},
"files": [
"index.js",
"dist"
],
"main": "index.js",
"module": "dist/core-base.esm-bundler.js",
"unpkg": "dist/core-base.global.js",
"jsdelivr": "dist/core-base.global.js",
"types": "dist/core-base.d.ts",
"dependencies": {
"@intlify/message-compiler": "9.0.0-beta.12",
"@intlify/message-resolver": "9.0.0-beta.12",
"@intlify/runtime": "9.0.0-beta.12",
"@intlify/shared": "9.0.0-beta.12"
},
"engines": {
"node": ">= 10"
},
"buildOptions": {
"name": "IntlifyCoreBase",
"formats": [
"esm-bundler",
"esm-browser",
"cjs",
"global"
]
},
"sideEffects": false
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions packages/core-base/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export * from '@intlify/message-resolver'
export * from '@intlify/runtime'
export {
CompileError,
CompileErrorCodes,
createCompileError
} from '@intlify/message-compiler'
export * from './context'
export * from './compile'
export * from './translate'
export * from './datetime'
export * from './number'
export * from './debugger'
export { getWarnMessage, CoreWarnCodes } from './warnings'
export { CoreError, CoreErrorCodes, createCoreError } from './errors'
export * from './types'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@
"bugs": {
"url": "https://github.com/intlify/vue-i18n-next/issues"
},
"files": ["index.js", "dist"],
"files": [
"index.js",
"dist"
],
"main": "index.js",
"module": "dist/core.esm-bundler.js",
"unpkg": "dist/core.global.js",
"jsdelivr": "dist/core.global.js",
"types": "dist/core.d.ts",
"dependencies": {
"@intlify/message-compiler": "9.0.0-beta.12",
"@intlify/message-resolver": "9.0.0-beta.12",
"@intlify/runtime": "9.0.0-beta.12",
"@intlify/shared": "9.0.0-beta.12"
"@intlify/core-base": "9.0.0-beta.12"
},
"engines": {
"node": ">= 10"
Expand Down
13 changes: 2 additions & 11 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import { registerMessageCompiler } from './context'
import { compileToFunction } from './compile'
import { registerMessageCompiler, compileToFunction } from '@intlify/core-base'

// register message compiler at @intlify/core
registerMessageCompiler(compileToFunction)

export * from './context'
export * from './compile'
export * from './translate'
export * from './datetime'
export * from './number'
export * from './debugger'
export * from './warnings'
export * from './errors'
export * from './types'
export * from '@intlify/core-base'
11 changes: 1 addition & 10 deletions packages/core/src/runtime.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
// NOTE: for runtime only buidling & vue-i18n direct inmporting
export * from './context'
export * from './compile'
export * from './translate'
export * from './datetime'
export * from './number'
export * from './debugger'
export * from './warnings'
export * from './errors'
export * from './types'
export * from '@intlify/core-base'
Empty file added packages/core/test/.gitkeep
Empty file.
12 changes: 10 additions & 2 deletions packages/message-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
"bugs": {
"url": "https://github.com/intlify/vue-i18n-next/issues"
},
"files": ["index.js", "dist"],
"files": [
"index.js",
"dist"
],
"main": "index.js",
"module": "dist/message-compiler.esm-bundler.js",
"unpkg": "dist/message-compiler.global.js",
Expand All @@ -39,7 +42,12 @@
},
"buildOptions": {
"name": "IntlifyMessageCompiler",
"formats": ["esm-bundler", "esm-browser", "cjs", "global"]
"formats": [
"esm-bundler",
"esm-browser",
"cjs",
"global"
]
},
"sideEffects": false
}
17 changes: 14 additions & 3 deletions packages/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
"name": "@intlify/runtime",
"version": "9.0.0-beta.12",
"description": "@intlify/runtime",
"keywords": ["i18n", "internationalization", "intlify", "runtime"],
"keywords": [
"i18n",
"internationalization",
"intlify",
"runtime"
],
"license": "MIT",
"author": {
"name": "kazuya kawaguchi",
Expand All @@ -17,7 +22,10 @@
"bugs": {
"url": "https://github.com/intlify/vue-i18n-next/issues"
},
"files": ["index.js", "dist"],
"files": [
"index.js",
"dist"
],
"main": "index.js",
"module": "dist/runtime.esm-bundler.js",
"types": "dist/runtime.d.ts",
Expand All @@ -31,7 +39,10 @@
},
"buildOptions": {
"name": "IntlifyRuntime",
"formats": ["esm-bundler", "cjs"]
"formats": [
"esm-bundler",
"cjs"
]
},
"sideEffects": false
}
5 changes: 4 additions & 1 deletion packages/size-check-core/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "@intlify/size-check-core",
"private": true
"private": true,
"dependencies": {
"@intlify/core": "9.0.0-beta.12"
}
}
1 change: 0 additions & 1 deletion packages/size-check-core/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import commonjs from '@rollup/plugin-commonjs'
import { terser } from 'rollup-plugin-terser'

const config = {
external: [],
output: {
file: path.resolve(__dirname, './dist/index.js'),
format: 'es'
Expand Down
5 changes: 1 addition & 4 deletions packages/size-check-core/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
createCoreContext,
translate
} from '../../core/dist/core.runtime.esm-bundler.js'
import { createCoreContext, translate } from '@intlify/core'

const ctx = createCoreContext({
locale: 'en',
Expand Down
5 changes: 4 additions & 1 deletion packages/size-check-vue-i18n/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "@intlify/size-check-vue-i18n",
"private": true
"private": true,
"dependencies": {
"@intlify/vue-i18n": "9.0.0-beta.12"
}
}
10 changes: 5 additions & 5 deletions packages/vue-i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
"bugs": {
"url": "https://github.com/intlify/vue-i18n-next/issues"
},
"files": ["index.js", "dist"],
"files": [
"index.js",
"dist"
],
"main": "index.js",
"module": "dist/vue-i18n.esm-bundler.js",
"unpkg": "dist/vue-i18n.global.js",
"jsdelivr": "dist/vue-i18n.global.js",
"types": "dist/vue-i18n.d.ts",
"dependencies": {
"@intlify/core": "9.0.0-beta.12",
"@intlify/message-compiler": "9.0.0-beta.12",
"@intlify/message-resolver": "9.0.0-beta.12",
"@intlify/runtime": "9.0.0-beta.12",
"@intlify/core-base": "9.0.0-beta.12",
"@intlify/shared": "9.0.0-beta.12",
"@vue/devtools-api": "^6.0.0-beta.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-i18n/src/components/DatetimeFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { renderFormatter } from './formatRenderer'
import { baseFormatProps } from './base'

import type { RenderFunction, SetupContext } from 'vue'
import type { DateTimeOptions } from '@intlify/core/src/runtime'
import type { DateTimeOptions } from '@intlify/core-base'
import type { Composer, ComposerInternal } from '../composer'
import type { FormattableProps } from './formatRenderer'

Expand Down
2 changes: 1 addition & 1 deletion packages/vue-i18n/src/components/NumberFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { renderFormatter } from './formatRenderer'
import { baseFormatProps } from './base'

import type { SetupContext, RenderFunction } from 'vue'
import type { NumberOptions } from '@intlify/core/src/runtime'
import type { NumberOptions } from '@intlify/core-base'
import type { Composer, ComposerInternal } from '../composer'
import type { FormattableProps } from './formatRenderer'

Expand Down
2 changes: 1 addition & 1 deletion packages/vue-i18n/src/components/Translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { baseFormatProps } from './base'

import type { SetupContext, VNodeChild, RenderFunction } from 'vue'
import type { Composer, ComposerInternal } from '../composer'
import type { TranslateOptions } from '@intlify/core/src/runtime'
import type { TranslateOptions } from '@intlify/core-base'
import type { NamedValue } from '@intlify/runtime'
import type { BaseFormatProps } from './base'

Expand Down
2 changes: 1 addition & 1 deletion packages/vue-i18n/src/components/base.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Locale } from '@intlify/core/src/runtime'
import type { Locale } from '@intlify/core'
import type { I18nScope } from '../i18n'

export type ComponetI18nScope = Exclude<I18nScope, 'local'>
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-i18n/src/components/formatRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
VNodeChild,
VNodeArrayChildren
} from 'vue'
import type { NumberOptions, DateTimeOptions } from '@intlify/core/src/runtime'
import type { NumberOptions, DateTimeOptions } from '@intlify/core-base'
import type { BaseFormatProps } from './base'

/**
Expand Down
23 changes: 11 additions & 12 deletions packages/vue-i18n/src/composer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ import {
makeSymbol,
isObject
} from '@intlify/shared'
import { parse as parsePath, resolveValue } from '@intlify/message-resolver'
import {
parse as parsePath,
resolveValue,
createCoreContext,
MISSING_RESOLVE_VALUE,
updateFallbackLocale,
Expand All @@ -40,14 +41,20 @@ import {
clearNumberFormat,
NOT_REOSLVED,
DevToolsTimelineEvents
} from '@intlify/core/src/runtime'
} from '@intlify/core-base'
import { I18nWarnCodes, getWarnMessage } from './warnings'
import { I18nErrorCodes, createI18nError } from './errors'

import type { ComponentInternalInstance, VNode, VNodeArrayChildren } from 'vue'
import type { WritableComputedRef, ComputedRef } from '@vue/reactivity'
import type { Path } from '@intlify/message-resolver'
import type {
Path,
LinkedModifiers,
PluralizationRules,
NamedValue,
MessageFunctions,
MessageProcessor,
MessageType,
Locale,
LocaleMessageValue,
LocaleMessages,
Expand All @@ -70,15 +77,7 @@ import type {
NumberFormats as NumberFormatsType,
DateTimeFormat,
NumberFormat
} from '@intlify/core/src/runtime'
import type {
LinkedModifiers,
PluralizationRules,
NamedValue,
MessageFunctions,
MessageProcessor,
MessageType
} from '@intlify/runtime'
} from '@intlify/core-base'

// extend VNode interface
declare module '@vue/runtime-core' {
Expand Down
Loading