Skip to content

Commit

Permalink
Merge pull request #1007 from general-galactic/master
Browse files Browse the repository at this point in the history
Remove VueLexer
  • Loading branch information
karellm authored Jun 9, 2024
2 parents 5843671 + a0a960c commit 7af6ca4
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 132 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Finally, if you want to make this process even less painful, I invite you to che
## Features

- Choose your weapon: A CLI, a standalone parser or a stream transform
- 6 built in lexers: Javascript, JSX, HTML, Handlebars, TypeScript+tsx and Vue
- 5 built in lexers: Javascript, JSX, HTML, Handlebars, and TypeScript+tsx
- Handles VueJS 3.0 (.vue) files
- Creates one catalog file per locale and per namespace
- Backs up the old keys your code doesn't use anymore in `namespace_old.json` catalog
- Restores keys from the `_old` file if the one in the translation file is empty
Expand Down
5 changes: 5 additions & 0 deletions docs/migration.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Migrating from `8.x` to `9.x`

## Breaking changes
- Support for the `VueLexer` has been dropped as it creates compatibility problems when trying to parse Vue3 code bases. You must remove any references to `VueLexer` in your configuration files. For Vue3, you can simply use `JavascriptLexer` instead.

# Migrating from `7.x` to `8.x`

## Breaking changes
Expand Down
8 changes: 1 addition & 7 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import EventEmitter from "events";

export type SupportedLexer = "HandlebarsLexer" | "HTMLLexer" | "JavascriptLexer" | "JsxLexer" | "VueLexer";
export type SupportedLexer = "HandlebarsLexer" | "HTMLLexer" | "JavascriptLexer" | "JsxLexer";

// BaseLexer is not importable therefore this is the best if done simple
export class CustomLexerClass extends EventEmitter {}
Expand Down Expand Up @@ -75,19 +75,13 @@ export interface JsxWithTypesLexerConfig {
transIdentityFunctionsToIgnore?: string[];
}

export interface VueLexerConfig {
lexer: "VueLexer";
functions?: string[];
}

export type LexerConfig =
| HandlebarsLexerConfig
| HTMLLexerConfig
| JavascriptLexerConfig
| JavascriptWithTypesLexerConfig
| JsxLexerConfig
| JsxWithTypesLexerConfig
| VueLexerConfig
| CustomLexerConfig;

export interface UserConfig {
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "i18next-parser",
"description": "Command Line tool for i18next",
"version": "8.13.0",
"version": "9.0.0",
"type": "module",
"license": "MIT",
"author": "Karel Ledru",
Expand Down Expand Up @@ -43,8 +43,7 @@
"sort-keys": "^5.0.0",
"typescript": "^5.0.4",
"vinyl": "~3.0.0",
"vinyl-fs": "^4.0.0",
"vue-template-compiler": "^2.6.11"
"vinyl-fs": "^4.0.0"
},
"devDependencies": {
"@babel/cli": "^7.0.0",
Expand Down
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ export { default as HandlebarsLexer } from './lexers/handlebars-lexer.js'
export { default as HTMLLexer } from './lexers/html-lexer.js'
export { default as JavascriptLexer } from './lexers/javascript-lexer.js'
export { default as JsxLexer } from './lexers/jsx-lexer.js'
export { default as VueLexer } from './lexers/vue-lexer.js'
26 changes: 0 additions & 26 deletions src/lexers/vue-lexer.js

This file was deleted.

4 changes: 1 addition & 3 deletions src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import HandlebarsLexer from './lexers/handlebars-lexer.js'
import HTMLLexer from './lexers/html-lexer.js'
import JavascriptLexer from './lexers/javascript-lexer.js'
import JsxLexer from './lexers/jsx-lexer.js'
import VueLexer from './lexers/vue-lexer.js'

const lexers = {
hbs: ['HandlebarsLexer'],
Expand All @@ -19,7 +18,7 @@ const lexers = {
jsx: ['JsxLexer'],
tsx: ['JsxLexer'],

vue: ['VueLexer'],
vue: ['JavascriptLexer'],

default: ['JavascriptLexer'],
}
Expand All @@ -29,7 +28,6 @@ const lexersMap = {
HTMLLexer,
JavascriptLexer,
JsxLexer,
VueLexer,
}

export default class Parser extends EventEmitter {
Expand Down
77 changes: 0 additions & 77 deletions test/lexers/vue-lexer.test.js

This file was deleted.

15 changes: 1 addition & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2406,11 +2406,6 @@ d@1, d@^1.0.1:
es5-ext "^0.10.50"
type "^1.0.1"

de-indent@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d"
integrity sha1-sgOOhG3DO6pXlhKNCAS0VbjB4h0=

[email protected], debug@^2.2.0, debug@^2.3.3:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
Expand Down Expand Up @@ -3441,7 +3436,7 @@ has@^1.0.3:
dependencies:
function-bind "^1.1.1"

[email protected], he@^1.2.0:
[email protected]:
version "1.2.0"
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==
Expand Down Expand Up @@ -6179,14 +6174,6 @@ vinyl@^3.0.0, vinyl@~3.0.0:
replace-ext "^2.0.0"
teex "^1.0.1"

vue-template-compiler@^2.6.11:
version "2.7.16"
resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.7.16.tgz#c81b2d47753264c77ac03b9966a46637482bb03b"
integrity sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==
dependencies:
de-indent "^1.0.2"
he "^1.2.0"

walk-sync@^0.3.3:
version "0.3.4"
resolved "https://registry.yarnpkg.com/walk-sync/-/walk-sync-0.3.4.tgz#cf78486cc567d3a96b5b2237c6108017a5ffb9a4"
Expand Down

0 comments on commit 7af6ca4

Please sign in to comment.