vue-i18n-extensions
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -0,1 +1,11 @@ | ||
<a name="0.2.0"></a> | ||
# [0.2.0](https://github.com/kazupon/vue-i18n-extensions/compare/v0.1.0...v0.2.0) (2018-08-11) | ||
### :bug: Bug Fixes | ||
* fix cannot resolve dependency ([c620eda](https://github.com/kazupon/vue-i18n-extensions/commit/c620eda)), closes [#2](https://github.com/kazupon/vue-i18n-extensions/issues/2) | ||
<a name="0.1.0"></a> | ||
@@ -2,0 +12,0 @@ # 0.1.0 (2017-09-22) |
{ | ||
"name": "vue-i18n-extensions", | ||
"description": "vue-i18n extensions", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"author": { | ||
@@ -9,28 +9,22 @@ "name": "kazuya kawaguchi", | ||
}, | ||
"ava": { | ||
"babel": "inherit", | ||
"require": [ | ||
"babel-core/register" | ||
] | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/kazupon/vue-i18n-extensions/issues" | ||
}, | ||
"dependencies": { | ||
"vm2": "^3.5.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^0.22.0", | ||
"babel-cli": "^6.24.0", | ||
"babel-eslint": "^7.2.1", | ||
"babel-plugin-transform-runtime": "^6.23.0", | ||
"babel-preset-env": "^1.6.0", | ||
"@vue/server-test-utils": "^1.0.0-beta.21", | ||
"@vue/test-utils": "^1.0.0-beta.21", | ||
"babel-eslint": "^8.2.5", | ||
"conventional-changelog-cli": "^1.2.0", | ||
"conventional-github-releaser": "^1.1.3", | ||
"cross-env": "^5.0.5", | ||
"eslint": "^3.18.0", | ||
"eslint-config-vue": "^2.0.2", | ||
"eslint-plugin-vue": "^2.0.1", | ||
"eslint": "^4.19.1", | ||
"eslint-plugin-vue": "^4.7.1", | ||
"git-commit-message-convention": "git://github.com/kazupon/git-commit-message-convention.git", | ||
"nyc": "^10.2.0", | ||
"sinon": "^3.2.1", | ||
"jest": "^23.4.1", | ||
"jest-serializer-vue": "^2.0.2", | ||
"vue": "^2.4.2", | ||
"vue-i18n": "^7.2.0", | ||
"vue-i18n": "^8.0.0", | ||
"vue-jest": "^2.6.0", | ||
"vue-server-renderer": "^2.4.2", | ||
@@ -40,9 +34,21 @@ "vue-template-compiler": "^2.4.2" | ||
"engines": { | ||
"node": ">= 6.0" | ||
"node": ">= 8.0" | ||
}, | ||
"files": [ | ||
"lib", | ||
"src" | ||
], | ||
"homepage": "https://github.com/kazupon/vue-i18n-extensions#readme", | ||
"jest": { | ||
"moduleFileExtensions": [ | ||
"js", | ||
"json", | ||
"vue" | ||
], | ||
"transform": { | ||
".*\\.(vue)$": "<rootDir>/node_modules/vue-jest" | ||
}, | ||
"snapshotSerializers": [ | ||
"<rootDir>/node_modules/jest-serializer-vue" | ||
] | ||
}, | ||
"keywords": [ | ||
@@ -57,3 +63,3 @@ "extensions", | ||
"license": "MIT", | ||
"main": "lib/index.js", | ||
"main": "src/index.js", | ||
"repository": { | ||
@@ -64,16 +70,10 @@ "type": "git", | ||
"scripts": { | ||
"build": "cross-env BABEL_ENV=production babel ./src --out-dir ./lib", | ||
"changelog": "conventional-changelog -i CHANGELOG.md -s -n ./node_modules/git-commit-message-convention/convention.js", | ||
"clean": "rm -rf ./coverage && rm -rf ./lib/*.js*", | ||
"coverage": "./node_modules/.bin/nyc report --reporter=text-lcov > coverage.lcov", | ||
"lint": "eslint ./src ./test", | ||
"clean": "rm -rf ./coverage", | ||
"lint": "eslint --fix --ext .js,.vue ./src", | ||
"release": "conventional-github-releaser -n ./node_modules/git-commit-message-convention/convention.js", | ||
"test": "npm run lint && npm run test:cover", | ||
"test:cover": "cross-env BABEL_ENV=test ./node_modules/.bin/nyc report --reporter=html ava", | ||
"test:unit": "cross-env BABEL_ENV=test ava", | ||
"watch": "cross-env BABEL_ENV=development babel ./src --out-dir ./lib --watch" | ||
}, | ||
"dependencies": { | ||
"vm2": "^3.5.0" | ||
"test:cover": "jest --coverage -u", | ||
"test:unit": "jest -u" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
import { | ||
const { | ||
warn, | ||
@@ -8,5 +8,5 @@ isPlainObject, | ||
evaluateValue | ||
} from './util' | ||
} = require('./util') | ||
export function directive (vnode, dir) { | ||
function directive (vnode, dir) { | ||
const value = dir.value | ||
@@ -27,3 +27,3 @@ | ||
if (!vm) { | ||
warn('not exist Vue instance in VNode context') | ||
warn('Vue instance does not exists in VNode context') | ||
return | ||
@@ -33,3 +33,3 @@ } | ||
if (!vm.$i18n) { | ||
warn('not exist VueI18n instance in Vue instance') | ||
warn('VueI18n instance does not exists in Vue instance') | ||
return | ||
@@ -42,5 +42,5 @@ } | ||
export function module (i18n) { | ||
function compilerModule (i18n) { | ||
return { | ||
transformNode (el) { | ||
transformNode: function (el) { | ||
const exp = getAttr(el, 'v-t') | ||
@@ -67,3 +67,3 @@ if (!exp) { return } | ||
genData (el) { | ||
genData: function (el) { | ||
if (el.i18n) { | ||
@@ -102,1 +102,6 @@ addProp(el, 'textContent', `_s(${JSON.stringify(el.i18n)})`) // generate via 'domProps' | ||
} | ||
module.exports = { | ||
directive, | ||
module: compilerModule | ||
} |
@@ -1,6 +0,6 @@ | ||
import { VM } from 'vm2' | ||
const { VM } = require('vm2') | ||
const vm = new VM() | ||
export function warn (msg, err) { | ||
function warn (msg, err) { | ||
if (typeof console !== 'undefined') { | ||
@@ -17,15 +17,15 @@ console.warn('[vue-i18n-extensions] ' + msg) | ||
const OBJECT_STRING = '[object Object]' | ||
export function isPlainObject (obj) { | ||
function isPlainObject (obj) { | ||
return toString.call(obj) === OBJECT_STRING | ||
} | ||
export function addProp (el, name, value) { | ||
function addProp (el, name, value) { | ||
(el.props || (el.props = [])).push({ name, value }) | ||
} | ||
export function getAttr (el, name) { | ||
function getAttr (el, name) { | ||
return el.attrsMap[name] | ||
} | ||
export function removeAttr (el, name) { | ||
function removeAttr (el, name) { | ||
if ((el.attrsMap[name]) !== null) { | ||
@@ -42,3 +42,3 @@ const list = el.attrsList | ||
export function evaluateValue (expression) { | ||
function evaluateValue (expression) { | ||
const ret = { status: 'ng', value: undefined } | ||
@@ -52,1 +52,10 @@ try { | ||
} | ||
module.exports = { | ||
warn, | ||
isPlainObject, | ||
addProp, | ||
getAttr, | ||
removeAttr, | ||
evaluateValue | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15
1
11261
6
132
1