From b9d07487eb2f68fb00f44d22cea11ed666c501be Mon Sep 17 00:00:00 2001 From: Nikos Vasileiou Date: Wed, 10 Jan 2024 12:59:49 +0200 Subject: [PATCH] Update packages --- packages/angular/package.json | 26 ++++---- packages/api/.eslintrc.json | 2 +- packages/api/package.json | 24 ++++---- packages/cli/package.json | 30 +++++----- packages/dom/package.json | 31 +++++----- packages/dom/src/operations.js | 3 +- packages/express/package.json | 8 +-- packages/i18next/package.json | 34 +++++------ packages/i18next/src/TransifexI18next.js | 6 +- packages/jsonapi/.eslintrc.json | 2 +- packages/jsonapi/package.json | 30 +++++----- packages/jsonapi/src/resources.js | 4 +- packages/native/package.json | 21 ++++--- packages/native/src/TxNative.js | 8 ++- packages/native/tests/plurals.test.js | 75 +++++++++++++++--------- packages/react/package.json | 28 ++++----- packages/react/tests/T.test.js | 4 +- packages/react/tests/useT.test.js | 24 ++++---- packages/vue2/package.json | 20 +++---- packages/vue3/package.json | 24 ++++---- 20 files changed, 212 insertions(+), 192 deletions(-) diff --git a/packages/angular/package.json b/packages/angular/package.json index 09fa8eaa..33a3a2ff 100644 --- a/packages/angular/package.json +++ b/packages/angular/package.json @@ -42,33 +42,33 @@ "@angular/router": "~14.3.0", "@transifex/native": "^6.0.2", "rxjs": "~6.6.0", - "tslib": "^2.0.0", - "zone.js": "~0.11.4" + "tslib": "^2.6.2", + "zone.js": "^0.11.8" }, "devDependencies": { "@angular-devkit/architect": "^0.1402.11", - "@angular-devkit/build-angular": "^14.2.11", + "@angular-devkit/build-angular": "^14.2.13", "@angular-eslint/builder": "^14.4.0", "@angular-eslint/eslint-plugin": "^14.4.0", "@angular-eslint/eslint-plugin-template": "^14.4.0", "@angular-eslint/schematics": "14.4.0", "@angular-eslint/template-parser": "^14.4.0", - "@angular/cli": "^14.2.11", + "@angular/cli": "^14.2.13", "@angular/compiler-cli": "^14.3.0", "@types/jasmine": "~4.0.0", - "@types/node": "^16.18.23", - "@typescript-eslint/eslint-plugin": "^5.36.2", - "@typescript-eslint/parser": "^5.36.2", - "eslint": "^8.23.0", - "eslint-config-airbnb-typescript": "^16.0.0", - "eslint-import-resolver-typescript": "^3.5.5", - "eslint-plugin-import": "^2.25.3", + "@types/node": "^16.18.70", + "@typescript-eslint/eslint-plugin": "^5.62.0", + "@typescript-eslint/parser": "^5.62.0", + "eslint": "^8.56.0", + "eslint-config-airbnb-typescript": "^16.2.0", + "eslint-import-resolver-typescript": "^3.6.1", + "eslint-plugin-import": "^2.29.1", "eslint-plugin-prefer-arrow": "^1.2.3", "eslint-plugin-promise": "^6.1.1", "eslint-plugin-rxjs": "^5.0.3", - "eslint-plugin-rxjs-angular": "^2.0.0", + "eslint-plugin-rxjs-angular": "^2.0.1", "eslint-plugin-tsdoc": "^0.2.17", - "eslint-plugin-unicorn": "^46.0.0", + "eslint-plugin-unicorn": "^46.0.1", "jasmine-core": "~4.3.0", "jasmine-spec-reporter": "^7.0.0", "karma": "~6.4.1", diff --git a/packages/api/.eslintrc.json b/packages/api/.eslintrc.json index 58ecca8e..748b87cb 100644 --- a/packages/api/.eslintrc.json +++ b/packages/api/.eslintrc.json @@ -5,7 +5,7 @@ "no-plusplus": "off", "no-underscore-dangle": "off" }, - "parser": "babel-eslint", + "parser": "@babel/eslint-parser", "parserOptions": { "ecmaVersion": 12, "sourceType": "module" diff --git a/packages/api/package.json b/packages/api/package.json index 37ff2e98..c0c1f47e 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -25,23 +25,23 @@ "publish-npm": "npm publish" }, "dependencies": { - "core-js": "^3.22.4" + "core-js": "^3.35.0" }, "devDependencies": { - "@babel/cli": "^7.17.10", - "@babel/core": "^7.17.10", - "@babel/preset-env": "^7.17.10", + "@babel/cli": "^7.23.4", + "@babel/core": "^7.23.7", + "@babel/eslint-parser": "^7.23.3", + "@babel/preset-env": "^7.23.8", "@transifex/jsonapi": "^6.0.2", - "babel-eslint": "^10.1.0", - "babel-loader": "^8.2.5", - "eslint": "^7.32.0", - "eslint-config-airbnb-base": "^14.2.1", - "eslint-plugin-import": "^2.26.0", - "webpack": "^5.72.0", - "webpack-cli": "^4.8.0" + "babel-loader": "^9.1.3", + "eslint": "^8.56.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-import": "^2.29.1", + "webpack": "^5.89.0", + "webpack-cli": "^5.1.4" }, "engines": { - "node": ">=14.0.0" + "node": ">=16.0.0" }, "publishConfig": { "access": "public" diff --git a/packages/cli/package.json b/packages/cli/package.json index 28026f35..61a370b0 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -24,32 +24,32 @@ "access": "public" }, "dependencies": { - "@babel/parser": "^7.20.3", - "@babel/traverse": "^7.20.1", - "@colors/colors": "^1.5.0", - "@oclif/core": "^1.20.4", + "@babel/parser": "^7.23.6", + "@babel/traverse": "^7.23.7", + "@colors/colors": "^1.6.0", + "@oclif/core": "^1.26.2", "@transifex/native": "^6.0.2", - "@vue/compiler-sfc": "^3.2.45", + "@vue/compiler-sfc": "^3.4.7", "angular-html-parser": "^1.8.0", - "axios": "^1.1.3", - "ejs": "^3.1.8", - "glob": "^8.0.3", + "axios": "^1.6.5", + "ejs": "^3.1.9", + "glob": "^8.1.0", "lodash": "^4.17.21", "pug": "^3.0.2" }, "devDependencies": { "@oclif/dev-cli": "^1.26.10", - "@oclif/test": "^2.2.12", - "chai": "^4.3.7", - "eslint": "^8.28.0", + "@oclif/test": "^2.5.6", + "chai": "^4.4.0", + "eslint": "^8.56.0", "eslint-config-airbnb-base": "^15.0.0", - "eslint-plugin-import": "^2.26.0", - "mocha": "^10.1.0", - "nock": "^13.2.9", + "eslint-plugin-import": "^2.29.1", + "mocha": "^10.2.0", + "nock": "^13.4.0", "nyc": "^15.1.0" }, "engines": { - "node": ">=14.0.0" + "node": ">=16.0.0" }, "files": [ "/bin", diff --git a/packages/dom/package.json b/packages/dom/package.json index 3725040e..ccbed5cf 100644 --- a/packages/dom/package.json +++ b/packages/dom/package.json @@ -31,25 +31,24 @@ "url": "https://github.com/transifex/transifex-javascript/issues" }, "engines": { - "node": ">=14.0.0" + "node": ">=16.0.0" }, "devDependencies": { - "@babel/core": "^7.20.2", - "@babel/plugin-transform-runtime": "^7.19.6", - "@babel/preset-env": "^7.20.2", - "@babel/runtime": "^7.20.1", - "babel-eslint": "^10.1.0", - "babel-loader": "^8.3.0", - "chai": "^4.3.7", - "eslint": "^7.28.0", - "eslint-config-airbnb-base": "^14.2.0", - "eslint-plugin-import": "^2.23.4", - "glob": "^8.0.1", + "@babel/core": "^7.23.7", + "@babel/plugin-transform-runtime": "^7.23.7", + "@babel/preset-env": "^7.23.8", + "@babel/runtime": "^7.23.8", + "babel-loader": "^9.1.3", + "chai": "^5.0.0", + "eslint": "^8.56.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-import": "^2.29.1", + "glob": "^8.1.0", "linkedom": "0.14.18", - "mocha": "^10.1.0", + "mocha": "^10.2.0", "nyc": "^15.1.0", - "source-map-support": "^0.5.19", - "webpack": "^5.75.0", - "webpack-cli": "^4.9.2" + "source-map-support": "^0.5.21", + "webpack": "^5.89.0", + "webpack-cli": "^5.1.4" } } diff --git a/packages/dom/src/operations.js b/packages/dom/src/operations.js index c08869e6..fe6fdb05 100644 --- a/packages/dom/src/operations.js +++ b/packages/dom/src/operations.js @@ -40,7 +40,8 @@ export function SET_FRAGMENT({ item, text, document }) { } // add it to element (item.snodeBefore || item.snodeAfter).parentNode.insertBefore( - frag, item.snodeAfter, + frag, + item.snodeAfter, ); } diff --git a/packages/express/package.json b/packages/express/package.json index 073285c2..4c3147e3 100644 --- a/packages/express/package.json +++ b/packages/express/package.json @@ -30,14 +30,14 @@ "url": "https://github.com/transifex/transifex-javascript/issues" }, "engines": { - "node": ">=14.0.0" + "node": ">=16.0.0" }, "devDependencies": { "@transifex/native": "^6.0.2", - "eslint": "^8.10.0", + "eslint": "^8.56.0", "eslint-config-airbnb-base": "^15.0.0", - "eslint-plugin-import": "^2.25.4", - "jest": "^28.0.3" + "eslint-plugin-import": "^2.29.1", + "jest": "^29.7.0" }, "dependencies": { "type-is": "^1.6.18" diff --git a/packages/i18next/package.json b/packages/i18next/package.json index 97c9db59..0254eb56 100644 --- a/packages/i18next/package.json +++ b/packages/i18next/package.json @@ -32,26 +32,26 @@ "url": "https://github.com/transifex/transifex-javascript/issues" }, "engines": { - "node": ">=14.0.0" + "node": ">=16.0.0" }, "devDependencies": { - "@babel/core": "^7.17.10", - "@babel/plugin-transform-runtime": "^7.17.10", - "@babel/preset-env": "^7.17.10", - "@babel/runtime": "^7.17.8", - "babel-loader": "^8.1.0", - "chai": "^4.3.4", - "eslint": "^7.28.0", - "eslint-config-airbnb-base": "^14.2.0", - "eslint-plugin-import": "^2.23.4", - "glob": "^8.0.1", - "i18next": "^21.6.16", - "mocha": "^10.0.0", - "nock": "^13.2.4", + "@babel/core": "^7.23.7", + "@babel/plugin-transform-runtime": "^7.23.7", + "@babel/preset-env": "^7.23.8", + "@babel/runtime": "^7.23.8", + "babel-loader": "^9.1.3", + "chai": "^5.0.0", + "eslint": "^8.56.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-import": "^2.29.1", + "glob": "^8.1.0", + "i18next": "^23.7.16", + "mocha": "^10.2.0", + "nock": "^13.4.0", "nyc": "^15.1.0", - "source-map-support": "^0.5.19", - "webpack": "^5.72.0", - "webpack-cli": "^4.9.2" + "source-map-support": "^0.5.21", + "webpack": "^5.89.0", + "webpack-cli": "^5.1.4" }, "dependencies": { "@transifex/native": "^6.0.2" diff --git a/packages/i18next/src/TransifexI18next.js b/packages/i18next/src/TransifexI18next.js index c1c12792..2072cd86 100644 --- a/packages/i18next/src/TransifexI18next.js +++ b/packages/i18next/src/TransifexI18next.js @@ -17,8 +17,10 @@ export default class TransifexI18next { read(language, namespace, callback) { this.tx.fetchTranslations(language).then(() => { - callback(null, - this._convertPlurals(this.tx.cache.getTranslations(language))); + callback( + null, + this._convertPlurals(this.tx.cache.getTranslations(language)), + ); }).catch((err) => { callback(err, null); }); diff --git a/packages/jsonapi/.eslintrc.json b/packages/jsonapi/.eslintrc.json index 811726d8..246f03c3 100644 --- a/packages/jsonapi/.eslintrc.json +++ b/packages/jsonapi/.eslintrc.json @@ -5,7 +5,7 @@ "no-plusplus": "off", "no-underscore-dangle": "off" }, - "parser": "babel-eslint", + "parser": "@babel/eslint-parser", "parserOptions": { "ecmaVersion": 12, "sourceType": "module" diff --git a/packages/jsonapi/package.json b/packages/jsonapi/package.json index 585ac97c..c6455811 100644 --- a/packages/jsonapi/package.json +++ b/packages/jsonapi/package.json @@ -27,25 +27,25 @@ "url": "https://github.com/transifex/transifex-javascript/issues" }, "engines": { - "node": ">=14.0.0" + "node": ">=16.0.0" }, "devDependencies": { - "@babel/cli": "^7.17.10", - "@babel/preset-env": "^7.17.10", - "babel-eslint": "^10.1.0", - "babel-jest": "^28.0.3", - "babel-loader": "^8.2.5", - "eslint": "^7.32.0", - "eslint-config-airbnb-base": "^14.2.1", - "eslint-plugin-import": "^2.26.0", - "jest": "^28.0.3", - "webpack": "^5.72.0", - "webpack-cli": "^4.8.0" + "@babel/cli": "^7.23.4", + "@babel/eslint-parser": "^7.23.3", + "@babel/preset-env": "^7.23.8", + "babel-jest": "^29.7.0", + "babel-loader": "^9.1.3", + "eslint": "^8.56.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-import": "^2.29.1", + "jest": "^29.7.0", + "webpack": "^5.89.0", + "webpack-cli": "^5.1.4" }, "dependencies": { - "axios": "^0.27.2", - "core-js": "^3.22.4", + "axios": "^1.6.5", + "core-js": "^3.35.0", "lodash": "^4.17.21", - "regenerator-runtime": "^0.13.9" + "regenerator-runtime": "^0.14.1" } } diff --git a/packages/jsonapi/src/resources.js b/packages/jsonapi/src/resources.js index 495740d8..14cc0fb9 100644 --- a/packages/jsonapi/src/resources.js +++ b/packages/jsonapi/src/resources.js @@ -207,7 +207,9 @@ export default class Resource { ) ) { this.related[relationshipName] = Collection.fromData( - this.constructor.API, resources, url, + this.constructor.API, + resources, + url, ); } } diff --git a/packages/native/package.json b/packages/native/package.json index 5e0116ba..aaffaeaf 100644 --- a/packages/native/package.json +++ b/packages/native/package.json @@ -31,20 +31,19 @@ "url": "https://github.com/transifex/transifex-javascript/issues" }, "engines": { - "node": ">=14.0.0" + "node": ">=16.0.0" }, "browserslist": "> 0.5%, last 2 versions, Firefox ESR, not dead", "devDependencies": { - "@babel/core": "^7.23.5", - "@babel/plugin-transform-runtime": "^7.23.4", - "@babel/preset-env": "^7.23.5", - "@babel/runtime": "^7.23.5", - "babel-eslint": "^10.1.0", - "babel-loader": "^8.3.0", - "chai": "^4.3.10", - "eslint": "^7.28.0", - "eslint-config-airbnb-base": "^14.2.1", - "eslint-plugin-import": "^2.29.0", + "@babel/core": "^7.23.7", + "@babel/plugin-transform-runtime": "^7.23.7", + "@babel/preset-env": "^7.23.8", + "@babel/runtime": "^7.23.8", + "babel-loader": "^9.1.3", + "chai": "^5.0.0", + "eslint": "^8.56.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-import": "^2.29.1", "glob": "^8.1.0", "mocha": "^10.2.0", "nock": "^13.4.0", diff --git a/packages/native/src/TxNative.js b/packages/native/src/TxNative.js index 59d67d59..e46c323d 100644 --- a/packages/native/src/TxNative.js +++ b/packages/native/src/TxNative.js @@ -157,8 +157,12 @@ export default class TxNative { if (!isString(translation)) translation = `${translation}`; return translation; } catch (err) { - return this.errorPolicy.handle(err, - `${sourceString}`, locale, params); + return this.errorPolicy.handle( + err, + `${sourceString}`, + locale, + params, + ); } } diff --git a/packages/native/tests/plurals.test.js b/packages/native/tests/plurals.test.js index 93a54e83..e2879ac7 100644 --- a/packages/native/tests/plurals.test.js +++ b/packages/native/tests/plurals.test.js @@ -21,16 +21,23 @@ describe('isPluralized', () => { describe('explodePlurals', () => { it('should handle simple cases', () => { - testExplode('hello world', - [null, { other: 'hello world' }]); - testExplode('{cnt, plural, one {hello world} other {hello worlds}}', - ['cnt', { one: 'hello world', other: 'hello worlds' }]); - testExplode('{cnt, plural, =1 {hello world} =5 {hello worlds}}', - ['cnt', { one: 'hello world', other: 'hello worlds' }]); - testExplode('{cnt, plural, one {hello world} =5 {hello worlds}}', - ['cnt', { one: 'hello world', other: 'hello worlds' }]); - testExplode('{cnt, plural, =1 {hello world} other {hello worlds}}', - ['cnt', { one: 'hello world', other: 'hello worlds' }]); + testExplode('hello world', [null, { other: 'hello world' }]); + testExplode( + '{cnt, plural, one {hello world} other {hello worlds}}', + ['cnt', { one: 'hello world', other: 'hello worlds' }], + ); + testExplode( + '{cnt, plural, =1 {hello world} =5 {hello worlds}}', + ['cnt', { one: 'hello world', other: 'hello worlds' }], + ); + testExplode( + '{cnt, plural, one {hello world} =5 {hello worlds}}', + ['cnt', { one: 'hello world', other: 'hello worlds' }], + ); + testExplode( + '{cnt, plural, =1 {hello world} other {hello worlds}}', + ['cnt', { one: 'hello world', other: 'hello worlds' }], + ); }); it('should not explode with leading/tailing spaces', () => { @@ -61,10 +68,8 @@ describe('explodePlurals', () => { testExplode('{cnt, plural}', [null, { other: '{cnt, plural}' }]); testExplode('{cnt, plural, }', [null, { other: '{cnt, plural, }' }]); testExplode('{cnt, plural, one}', [null, { other: '{cnt, plural, one}' }]); - testExplode('{cnt, plural, one {}', - [null, { other: '{cnt, plural, one {}' }]); - testExplode('{cnt, plural, one hello world}', - [null, { other: '{cnt, plural, one hello world}' }]); + testExplode('{cnt, plural, one {}', [null, { other: '{cnt, plural, one {}' }]); + testExplode('{cnt, plural, one hello world}', [null, { other: '{cnt, plural, one hello world}' }]); }); it('should fail if variable, plural keyword or rules are wrong', () => { @@ -108,13 +113,17 @@ describe('explodePlurals', () => { }); it('should handle nested brackets', () => { - testExplode('{cnt, plural, one {hello {world}} other {hello worlds}}', - ['cnt', { one: 'hello {world}', other: 'hello worlds' }]); + testExplode( + '{cnt, plural, one {hello {world}} other {hello worlds}}', + ['cnt', { one: 'hello {world}', other: 'hello worlds' }], + ); }); it("should fail when minimum plural rules don't exist", () => { - testExplode('{cnt, plural, one {hello world}}', - [null, { other: '{cnt, plural, one {hello world}}' }]); + testExplode( + '{cnt, plural, one {hello world}}', + [null, { other: '{cnt, plural, one {hello world}}' }], + ); testExplode( '{cnt, plural, few {hello world} other {hello worlds}}', [null, { other: '{cnt, plural, few {hello world} other {hello worlds}}' }], @@ -122,21 +131,31 @@ describe('explodePlurals', () => { }); it('should propertly escape stuff with apostrophes', () => { - testExplode("{cnt, plural, one {hello '{'world'}'} other {hello worlds}}", - ['cnt', { one: "hello '{'world'}'", other: 'hello worlds' }]); - testExplode("{cnt, plural, one {hello '{world}'} other {hello worlds}}", - ['cnt', { one: "hello '{world}'", other: 'hello worlds' }]); - testExplode("{cnt, plural, one {hello ''{world}''} other {hello worlds}}", - ['cnt', { one: "hello ''{world}''", other: 'hello worlds' }]); - testExplode("{cnt, plural, one {hello '{'world} other {hello worlds}}", - ['cnt', { one: "hello '{'world", other: 'hello worlds' }]); + testExplode( + "{cnt, plural, one {hello '{'world'}'} other {hello worlds}}", + ['cnt', { one: "hello '{'world'}'", other: 'hello worlds' }], + ); + testExplode( + "{cnt, plural, one {hello '{world}'} other {hello worlds}}", + ['cnt', { one: "hello '{world}'", other: 'hello worlds' }], + ); + testExplode( + "{cnt, plural, one {hello ''{world}''} other {hello worlds}}", + ['cnt', { one: "hello ''{world}''", other: 'hello worlds' }], + ); + testExplode( + "{cnt, plural, one {hello '{'world} other {hello worlds}}", + ['cnt', { one: "hello '{'world", other: 'hello worlds' }], + ); testExplode( "{cnt, plural, one {hello '{{'world} other {hello worlds}}", ['cnt', { one: "hello '{{'world", other: 'hello worlds' }], ); - testExplode("{cnt, plural, one {hello 'world} other {hello worlds}}", - ['cnt', { one: "hello 'world", other: 'hello worlds' }]); + testExplode( + "{cnt, plural, one {hello 'world} other {hello worlds}}", + ['cnt', { one: "hello 'world", other: 'hello worlds' }], + ); }); }); diff --git a/packages/react/package.json b/packages/react/package.json index 3a2ed585..ec323ccd 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -35,7 +35,7 @@ "url": "https://github.com/transifex/transifex-javascript/issues" }, "engines": { - "node": ">=14.0.0" + "node": ">=16.0.0" }, "peerDependencies": { "@transifex/native": "^6.0.0", @@ -43,22 +43,20 @@ "react": "^16.0.0 || ^17.0.0 || ^18.0.0" }, "devDependencies": { - "@testing-library/jest-dom": "^5.16.4", - "@testing-library/react": "^13.2.0", + "@testing-library/jest-dom": "^6.2.0", + "@testing-library/react": "^14.1.2", "@transifex/native": "^6.0.2", - "eslint": "^6.6.0", - "eslint-config-airbnb": "^18.2.0", - "eslint-plugin-import": "^2.26.0", - "eslint-plugin-jsx-a11y": "^6.3.1", - "eslint-plugin-react": "^7.22.0", - "eslint-plugin-react-hooks": "^4.5.0", - "jest": "^28.0.3", - "jest-environment-jsdom": "^28.0.2", - "microbundle-crl": "^0.13.10", + "eslint": "^8.56.0", + "eslint-config-airbnb": "^19.0.4", + "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-hooks": "^4.6.0", + "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", + "microbundle-crl": "^0.13.11", "npm-run-all": "^4.1.5", - "prop-types": "^15.7.2", - "react": "^18.1.0", - "react-dom": "^18.1.0", + "prop-types": "^15.8.1", + "react": "^18.2.0", + "react-dom": "^18.2.0", "react-scripts": "^5.0.1" }, "files": [ diff --git a/packages/react/tests/T.test.js b/packages/react/tests/T.test.js index fb932886..af864ead 100644 --- a/packages/react/tests/T.test.js +++ b/packages/react/tests/T.test.js @@ -23,7 +23,7 @@ describe('T', () => { }); it('rerenders on prop change', () => { - const MyComp = () => { + function MyComp() { const [word, setWord] = useState(''); return ( <> @@ -31,7 +31,7 @@ describe('T', () => {

); - }; + } render(); fireEvent.change( screen.getByRole('textbox'), diff --git a/packages/react/tests/useT.test.js b/packages/react/tests/useT.test.js index a7bacb20..81bc3ee7 100644 --- a/packages/react/tests/useT.test.js +++ b/packages/react/tests/useT.test.js @@ -39,7 +39,7 @@ describe('useT', () => { }); it('rerenders on prop change', () => { - const MyComp = () => { + function MyComp() { const [word, setWord] = useState(''); const t = useT(); const message = t('hello {word}', { word }); @@ -49,7 +49,7 @@ describe('useT', () => {

{message}

); - }; + } render(); fireEvent.change( screen.getByRole('textbox'), @@ -59,7 +59,7 @@ describe('useT', () => { }); it('renders react elements', () => { - const MyComp = () => { + function MyComp() { const [word, setWord] = useState(''); const t = useT(); const message = t('hello {w}', { w: world }); @@ -69,7 +69,7 @@ describe('useT', () => {

{message}

); - }; + } render(); expect(screen.getByText('world')).toBeTruthy(); act(() => { @@ -81,15 +81,13 @@ describe('useT', () => { const instance = createNativeInstance(); instance.translateLocale = () => 'hello from custom instance'; - const MyComp = () => { + function MyComp() { const t = useT(instance); const message = t('hello'); return ( - <> -

{message}

- +

{message}

); - }; + } render(); expect(screen.getByText('hello from custom instance')).toBeTruthy(); }); @@ -98,15 +96,13 @@ describe('useT', () => { const instance = createNativeInstance(); instance.translateLocale = () => 'hello from provider'; - const MyComp = () => { + function MyComp() { const t = useT(); const message = t('hello'); return ( - <> -

{message}

- +

{message}

); - }; + } render( diff --git a/packages/vue2/package.json b/packages/vue2/package.json index 1b5c88c1..b93785ef 100644 --- a/packages/vue2/package.json +++ b/packages/vue2/package.json @@ -24,7 +24,7 @@ "url": "https://github.com/transifex/transifex-javascript/issues" }, "engines": { - "node": ">=14.0.0" + "node": ">=16.0.0" }, "main": "dist/index.js", "source": "src/index.js", @@ -41,22 +41,22 @@ "vue": "^2.0.0" }, "devDependencies": { - "@babel/core": "^7.17.10", - "@babel/preset-env": "^7.17.10", - "@testing-library/jest-dom": "^5.16.4", - "@testing-library/vue": "^5.8.2", + "@babel/core": "^7.23.7", + "@babel/preset-env": "^7.23.8", + "@testing-library/jest-dom": "^5.17.0", + "@testing-library/vue": "^5.9.0", "@transifex/native": "^6.0.2", - "@vue/compiler-sfc": "^3.2.33", + "@vue/compiler-sfc": "^3.4.7", "@vue/vue2-jest": "^27.0.0", "babel-jest": "^27.5.1", - "eslint": "^8.6.0", + "eslint": "^8.56.0", "eslint-config-airbnb": "^19.0.4", - "eslint-plugin-import": "^2.25.4", + "eslint-plugin-import": "^2.29.1", "jest": "^27.5.1", "npm-run-all": "^4.1.5", - "rollup": "^2.71.1", + "rollup": "^2.79.1", "rollup-plugin-vue2": "^0.8.1", - "vue": "^2.6.11" + "vue": "^2.7.16" }, "jest": { "moduleFileExtensions": [ diff --git a/packages/vue3/package.json b/packages/vue3/package.json index 1e30ffa6..563c17de 100644 --- a/packages/vue3/package.json +++ b/packages/vue3/package.json @@ -24,7 +24,7 @@ "url": "https://github.com/transifex/transifex-javascript/issues" }, "engines": { - "node": ">=14.0.0" + "node": ">=16.0.0" }, "main": "dist/index.js", "source": "src/index.js", @@ -60,21 +60,21 @@ "vue": "^3.0.0" }, "devDependencies": { - "@babel/core": "^7.20.2", - "@babel/preset-env": "^7.20.2", - "@testing-library/jest-dom": "^5.16.5", - "@testing-library/vue": "^6.6.1", + "@babel/core": "^7.23.7", + "@babel/preset-env": "^7.23.8", + "@testing-library/jest-dom": "^6.2.0", + "@testing-library/vue": "^8.0.1", "@transifex/native": "^6.0.2", "@vue/compiler-sfc": "^3.2.45", - "@vue/vue3-jest": "^29.2.0", - "babel-jest": "^29.3.1", - "eslint": "^8.28.0", + "@vue/vue3-jest": "^29.2.6", + "babel-jest": "^29.7.0", + "eslint": "^8.56.0", "eslint-config-airbnb": "^19.0.4", - "eslint-plugin-import": "^2.26.0", - "jest": "^29.3.1", - "jest-environment-jsdom": "^29.3.1", + "eslint-plugin-import": "^2.29.1", + "jest": "^29.7.0", + "jest-environment-jsdom": "^29.7.0", "npm-run-all": "^4.1.5", - "rollup": "^3.4.0", + "rollup": "^3.29.4", "rollup-plugin-vue": "^6.0.0", "vue": "^3.2.45" }