diff --git a/package.json b/package.json index cd474786..947b0d58 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@everfi/i18next-parser", "description": "Command Line tool for i18next", - "version": "5.4.3", + "version": "5.4.4", "license": "MIT", "author": "Karel Ledru", "main": "dist/index.js", @@ -40,8 +40,7 @@ "through2": "~4.0.2", "typescript": "^4.2.4", "vinyl": "~2.2.1", - "vinyl-fs": "^3.0.2", - "vue-template-compiler": "^2.6.11" + "vinyl-fs": "^3.0.2" }, "devDependencies": { "@babel/cli": "^7.0.0", diff --git a/src/lexers/vue-lexer.js b/src/lexers/vue-lexer.js deleted file mode 100644 index 556330dd..00000000 --- a/src/lexers/vue-lexer.js +++ /dev/null @@ -1,27 +0,0 @@ -import BaseLexer from './base-lexer' -import JavascriptLexer from './javascript-lexer.js' - -export default class VueLexer extends BaseLexer { - constructor(options = {}) { - super(options) - - this.functions = options.functions || ['$t'] - } - - extract(content, filename) { - let keys = [] - - const Lexer = new JavascriptLexer() - Lexer.on('warning', (warning) => this.emit('warning', warning)) - keys = keys.concat(Lexer.extract(content)) - - const compiledTemplate = require('vue-template-compiler').compile( - content - ).render - const Lexer2 = new JavascriptLexer({ functions: this.functions }) - Lexer2.on('warning', (warning) => this.emit('warning', warning)) - keys = keys.concat(Lexer2.extract(compiledTemplate)) - - return keys - } -} diff --git a/src/parser.js b/src/parser.js index bca67104..f196d943 100644 --- a/src/parser.js +++ b/src/parser.js @@ -4,7 +4,6 @@ import HandlebarsLexer from './lexers/handlebars-lexer' import HTMLLexer from './lexers/html-lexer' import JavascriptLexer from './lexers/javascript-lexer' import JsxLexer from './lexers/jsx-lexer' -import VueLexer from './lexers/vue-lexer' const lexers = { hbs: ['HandlebarsLexer'], @@ -19,8 +18,6 @@ const lexers = { jsx: ['JsxLexer'], tsx: ['JsxLexer'], - vue: ['VueLexer'], - default: ['JavascriptLexer'], } @@ -29,7 +26,6 @@ const lexersMap = { HTMLLexer, JavascriptLexer, JsxLexer, - VueLexer, } export default class Parser extends EventEmitter { diff --git a/test/lexers/vue-lexer.test.js b/test/lexers/vue-lexer.test.js deleted file mode 100644 index 09da2f39..00000000 --- a/test/lexers/vue-lexer.test.js +++ /dev/null @@ -1,77 +0,0 @@ -import { assert } from 'chai' -import VueLexer from '../../src/lexers/vue-lexer' - -describe('VueLexer', () => { - it('extracts keys from template & js', (done) => { - const Lexer = new VueLexer() - const content = - "