From 189abcddf354070fe5f674945195291016d2b2a6 Mon Sep 17 00:00:00 2001 From: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com> Date: Wed, 24 Aug 2022 13:41:16 +0500 Subject: [PATCH 1/5] refactor: migrated off babel-plugin-react-intl --- config/babel-preserve-modules.config.js | 4 +- config/babel.config.js | 4 +- package-lock.json | 547 +++++++++++++----------- package.json | 4 +- 4 files changed, 311 insertions(+), 248 deletions(-) diff --git a/config/babel-preserve-modules.config.js b/config/babel-preserve-modules.config.js index 673de5397..2669bb3e5 100644 --- a/config/babel-preserve-modules.config.js +++ b/config/babel-preserve-modules.config.js @@ -17,9 +17,9 @@ module.exports = { i18n: { plugins: [ [ - 'react-intl', + 'formatjs', { - messagesDir: './temp/babel-plugin-react-intl', + messagesDir: './temp/babel-plugin-formatjs', moduleSourceName: '@edx/frontend-platform/i18n', }, ], diff --git a/config/babel.config.js b/config/babel.config.js index 89ba41477..0263fab58 100644 --- a/config/babel.config.js +++ b/config/babel.config.js @@ -33,9 +33,9 @@ module.exports = { i18n: { plugins: [ [ - 'react-intl', + 'formatjs', { - messagesDir: './temp/babel-plugin-react-intl', + messagesDir: './temp/babel-plugin-formatjs', moduleSourceName: '@edx/frontend-platform/i18n', }, ], diff --git a/package-lock.json b/package-lock.json index b5f31a57c..e4619dedf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,8 +23,8 @@ "@svgr/webpack": "6.2.1", "autoprefixer": "10.2.6", "babel-jest": "26.6.3", - "babel-loader": "8.2.3", - "babel-plugin-react-intl": "7.9.4", + "babel-loader": "^8.2.5", + "babel-plugin-formatjs": "^10.3.27", "babel-plugin-transform-imports": "2.0.0", "babel-polyfill": "6.26.0", "clean-webpack-plugin": "3.0.0", @@ -1864,56 +1864,39 @@ } }, "node_modules/@formatjs/ecma402-abstract": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.4.0.tgz", - "integrity": "sha512-Mv027hcLFjE45K8UJ8PjRpdDGfR0aManEFj1KzoN8zXNveHGEygpZGfFf/FTTMl+QEVSrPAUlyxaCApvmv47AQ==", + "version": "1.11.10", + "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.10.tgz", + "integrity": "sha512-v8nuQpx6pc0xzg4VMCXPWesFx8PxBysdF7q1CGEoet0X9nhbGPGNq0SC+D9g+Kh0pWWITidlEYsepLF7lb8Tqw==", "dependencies": { - "tslib": "^2.0.1" + "@formatjs/intl-localematcher": "0.2.30", + "tslib": "2.4.0" } }, - "node_modules/@formatjs/intl-numberformat": { - "version": "5.7.6", - "resolved": "https://registry.npmjs.org/@formatjs/intl-numberformat/-/intl-numberformat-5.7.6.tgz", - "integrity": "sha512-ZlZfYtvbVHYZY5OG3RXizoCwxKxEKOrzEe2YOw9wbzoxF3PmFn0SAgojCFGLyNXkkR6xVxlylhbuOPf1dkIVNg==", - "dependencies": { - "@formatjs/ecma402-abstract": "1.4.0", - "tslib": "^2.0.1" - } - }, - "node_modules/@formatjs/ts-transformer": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/@formatjs/ts-transformer/-/ts-transformer-2.13.0.tgz", - "integrity": "sha512-mu7sHXZk1NWZrQ3eUqugpSYo8x5/tXkrI4uIbFqCEC0eNgQaIcoKgVeDFgDAcgG+cEme2atAUYSFF+DFWC4org==", + "node_modules/@formatjs/icu-messageformat-parser": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.1.6.tgz", + "integrity": "sha512-f7jeuomhWzHIAMcH8hGyTdPrKml+yAKKtax5Tks56+5+nT7rdzCOyi/l/F5g0bN33PcnFB/eI9cW/CP0FNezig==", "dependencies": { - "intl-messageformat-parser": "6.1.2", - "tslib": "^2.0.1", - "typescript": "^4.0" - }, - "peerDependencies": { - "ts-jest": "^26.4.0" - }, - "peerDependenciesMeta": { - "ts-jest": { - "optional": true - } + "@formatjs/ecma402-abstract": "1.11.10", + "@formatjs/icu-skeleton-parser": "1.3.12", + "tslib": "2.4.0" } }, - "node_modules/@formatjs/ts-transformer/node_modules/@formatjs/ecma402-abstract": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.5.0.tgz", - "integrity": "sha512-wXv36yo+mfWllweN0Fq7sUs7PUiNopn7I0JpLTe3hGu6ZMR4CV7LqK1llhB18pndwpKoafQKb1et2DCJAOW20Q==", + "node_modules/@formatjs/icu-skeleton-parser": { + "version": "1.3.12", + "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.12.tgz", + "integrity": "sha512-RHf5mi9dUaZIUteuWbK398FV1CkJOIezIubdiD+xEOPHb37ZvjXtwolCiCVVIWHDIeBBqxxAhnzdSFBS3CXfRg==", "dependencies": { - "tslib": "^2.0.1" + "@formatjs/ecma402-abstract": "1.11.10", + "tslib": "2.4.0" } }, - "node_modules/@formatjs/ts-transformer/node_modules/intl-messageformat-parser": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/intl-messageformat-parser/-/intl-messageformat-parser-6.1.2.tgz", - "integrity": "sha512-4GQDEPhl/ZMNDKwMsLqyw1LG2IAWjmLJXdmnRcHKeLQzpgtNYZI6lVw1279pqIkRk2MfKb9aDsVFzm565azK5A==", - "deprecated": "We've written a new parser that's 6x faster and is backwards compatible. Please use @formatjs/icu-messageformat-parser", + "node_modules/@formatjs/intl-localematcher": { + "version": "0.2.30", + "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.2.30.tgz", + "integrity": "sha512-No+D8Q8rlzEMfoKkJ1tk81aphZuAk7ZwY+Vkzbb1TOvlP67TM/YPxdf4JoiUV/Q2GRqdGhaLfgulqIf9ATKHTA==", "dependencies": { - "@formatjs/ecma402-abstract": "1.5.0", - "tslib": "^2.0.1" + "tslib": "2.4.0" } }, "node_modules/@humanwhocodes/config-array": { @@ -3101,6 +3084,14 @@ "@babel/types": "^7.0.0" } }, + "node_modules/@types/babel__helper-plugin-utils": { + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/@types/babel__helper-plugin-utils/-/babel__helper-plugin-utils-7.10.0.tgz", + "integrity": "sha512-60YtHzhQ9HAkToHVV+TB4VLzBn9lrfgrsOjiJMtbv/c1jPdekBxaByd6DMsGBzROXWoIL6U3lEFvvbu69RkUoA==", + "dependencies": { + "@types/babel__core": "*" + } + }, "node_modules/@types/babel__template": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", @@ -3196,14 +3187,6 @@ "@types/range-parser": "*" } }, - "node_modules/@types/fs-extra": { - "version": "9.0.13", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.13.tgz", - "integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", @@ -3260,6 +3243,11 @@ "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==" }, + "node_modules/@types/json-stable-stringify": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/@types/json-stable-stringify/-/json-stable-stringify-1.0.34.tgz", + "integrity": "sha512-s2cfwagOQAS8o06TcwKfr9Wx11dNGbH2E9vJz1cqV+a/LOyhWNLUNd6JSRYNzvB4d29UuJX2M0Dj9vE1T8fRXw==" + }, "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -3310,15 +3298,6 @@ "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==" }, - "node_modules/@types/schema-utils": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@types/schema-utils/-/schema-utils-2.4.0.tgz", - "integrity": "sha512-454hrj5gz/FXcUE20ygfEiN4DxZ1sprUo0V1gqIqkNZ/CzoEzAZEll2uxMsuyz6BYjiQan4Aa65xbTemfzW9hQ==", - "deprecated": "This is a stub types definition. schema-utils provides its own type definitions, so you do not need this installed.", - "dependencies": { - "schema-utils": "*" - } - }, "node_modules/@types/serve-index": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.1.tgz", @@ -4186,12 +4165,12 @@ } }, "node_modules/babel-loader": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.3.tgz", - "integrity": "sha512-n4Zeta8NC3QAsuyiizu0GkmRcQ6clkV9WFUnUf1iXP//IeSKbWjofW3UHyZVwlOB4y039YQKefawyTn64Zwbuw==", + "version": "8.2.5", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.5.tgz", + "integrity": "sha512-OSiFfH89LrEMiWd4pLNqGz4CwJDtbs2ZVc+iGu2HrkRfPxId9F2anQj38IxWpmRfsUY0aBZYi1EFcd3mhtRMLQ==", "dependencies": { "find-cache-dir": "^3.3.1", - "loader-utils": "^1.4.0", + "loader-utils": "^2.0.0", "make-dir": "^3.1.0", "schema-utils": "^2.6.5" }, @@ -4203,30 +4182,6 @@ "webpack": ">=2" } }, - "node_modules/babel-loader/node_modules/json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dependencies": { - "minimist": "^1.2.0" - }, - "bin": { - "json5": "lib/cli.js" - } - }, - "node_modules/babel-loader/node_modules/loader-utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", - "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", - "dependencies": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^1.0.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/babel-loader/node_modules/make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -4266,6 +4221,115 @@ "object.assign": "^4.1.0" } }, + "node_modules/babel-plugin-formatjs": { + "version": "10.3.27", + "resolved": "https://registry.npmjs.org/babel-plugin-formatjs/-/babel-plugin-formatjs-10.3.27.tgz", + "integrity": "sha512-QcZgrI28HEr237GGnEL+Iqu7djWEP9rSazvpLsrmxoMtWkQKRnQSnbkouI0hP6o0fFy3IN2lChqumidIQYFXDw==", + "dependencies": { + "@babel/core": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-jsx": "7", + "@babel/traverse": "7", + "@babel/types": "^7.12.11", + "@formatjs/icu-messageformat-parser": "2.1.6", + "@formatjs/ts-transformer": "3.9.11", + "@types/babel__core": "^7.1.7", + "@types/babel__helper-plugin-utils": "^7.10.0", + "@types/babel__traverse": "^7.1.7", + "tslib": "2.4.0" + } + }, + "node_modules/babel-plugin-formatjs/node_modules/@formatjs/ts-transformer": { + "version": "3.9.11", + "resolved": "https://registry.npmjs.org/@formatjs/ts-transformer/-/ts-transformer-3.9.11.tgz", + "integrity": "sha512-NLp2UHdCTla4uCJkkhffAgYwFiOUdC6LZJE4gcfq4wcrfRINluRRBoLlNM3DqbeEkvz2zOIKEJUHVso1SEjeYA==", + "dependencies": { + "@formatjs/icu-messageformat-parser": "2.1.6", + "@types/json-stable-stringify": "^1.0.32", + "@types/node": "14 || 16 || 17", + "chalk": "^4.0.0", + "json-stable-stringify": "^1.0.1", + "tslib": "2.4.0", + "typescript": "^4.5" + }, + "peerDependencies": { + "ts-jest": "27 || 28" + }, + "peerDependenciesMeta": { + "ts-jest": { + "optional": true + } + } + }, + "node_modules/babel-plugin-formatjs/node_modules/@types/node": { + "version": "17.0.45", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", + "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==" + }, + "node_modules/babel-plugin-formatjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/babel-plugin-formatjs/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/babel-plugin-formatjs/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/babel-plugin-formatjs/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/babel-plugin-formatjs/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-formatjs/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/babel-plugin-istanbul": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", @@ -4331,41 +4395,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/babel-plugin-react-intl": { - "version": "7.9.4", - "resolved": "https://registry.npmjs.org/babel-plugin-react-intl/-/babel-plugin-react-intl-7.9.4.tgz", - "integrity": "sha512-cMKrHEXrw43yT4M89Wbgq8A8N8lffSquj1Piwov/HVukR7jwOw8gf9btXNsQhT27ccyqEwy+M286JQYy0jby2g==", - "deprecated": "this package has been renamed to babel-plugin-formatjs", - "dependencies": { - "@babel/core": "^7.9.0", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/types": "^7.9.5", - "@formatjs/ts-transformer": "^2.6.0", - "@types/babel__core": "^7.1.7", - "@types/fs-extra": "^9.0.1", - "@types/schema-utils": "^2.4.0", - "fs-extra": "^9.0.0", - "intl-messageformat-parser": "^5.3.7", - "schema-utils": "^2.6.6" - } - }, - "node_modules/babel-plugin-react-intl/node_modules/schema-utils": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", - "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", - "dependencies": { - "@types/json-schema": "^7.0.5", - "ajv": "^6.12.4", - "ajv-keywords": "^3.5.2" - }, - "engines": { - "node": ">= 8.9.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/webpack" - } - }, "node_modules/babel-plugin-transform-imports": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-imports/-/babel-plugin-transform-imports-2.0.0.tgz", @@ -10060,15 +10089,6 @@ "node": ">= 0.10" } }, - "node_modules/intl-messageformat-parser": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/intl-messageformat-parser/-/intl-messageformat-parser-5.5.1.tgz", - "integrity": "sha512-TvB3LqF2VtP6yI6HXlRT5TxX98HKha6hCcrg9dwlPwNaedVNuQA9KgBdtWKgiyakyCTYHQ+KJeFEstNKfZr64w==", - "deprecated": "We've written a new parser that's 6x faster and is backwards compatible. Please use @formatjs/icu-messageformat-parser", - "dependencies": { - "@formatjs/intl-numberformat": "^5.5.2" - } - }, "node_modules/into-stream": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz", @@ -12638,6 +12658,14 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, + "node_modules/json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha512-i/J297TW6xyj7sDFa7AmBPkQvLIxWr2kKPWI26tXydnZrzVAocNqn5DMNT1Mzk0vit1V5UkRM7C1KdVNp7Lmcg==", + "dependencies": { + "jsonify": "~0.0.0" + } + }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", @@ -12665,6 +12693,14 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha512-trvBk1ki43VZptdBI5rIlG4YOzyeH/WefQt5rj1grasPn4iiZWKet8nkgc4GlsAylaztn0qZfUYOiTsASJFdNA==", + "engines": { + "node": "*" + } + }, "node_modules/jsx-ast-utils": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.1.tgz", @@ -20015,49 +20051,39 @@ } }, "@formatjs/ecma402-abstract": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.4.0.tgz", - "integrity": "sha512-Mv027hcLFjE45K8UJ8PjRpdDGfR0aManEFj1KzoN8zXNveHGEygpZGfFf/FTTMl+QEVSrPAUlyxaCApvmv47AQ==", + "version": "1.11.10", + "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.11.10.tgz", + "integrity": "sha512-v8nuQpx6pc0xzg4VMCXPWesFx8PxBysdF7q1CGEoet0X9nhbGPGNq0SC+D9g+Kh0pWWITidlEYsepLF7lb8Tqw==", "requires": { - "tslib": "^2.0.1" + "@formatjs/intl-localematcher": "0.2.30", + "tslib": "2.4.0" } }, - "@formatjs/intl-numberformat": { - "version": "5.7.6", - "resolved": "https://registry.npmjs.org/@formatjs/intl-numberformat/-/intl-numberformat-5.7.6.tgz", - "integrity": "sha512-ZlZfYtvbVHYZY5OG3RXizoCwxKxEKOrzEe2YOw9wbzoxF3PmFn0SAgojCFGLyNXkkR6xVxlylhbuOPf1dkIVNg==", + "@formatjs/icu-messageformat-parser": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.1.6.tgz", + "integrity": "sha512-f7jeuomhWzHIAMcH8hGyTdPrKml+yAKKtax5Tks56+5+nT7rdzCOyi/l/F5g0bN33PcnFB/eI9cW/CP0FNezig==", "requires": { - "@formatjs/ecma402-abstract": "1.4.0", - "tslib": "^2.0.1" + "@formatjs/ecma402-abstract": "1.11.10", + "@formatjs/icu-skeleton-parser": "1.3.12", + "tslib": "2.4.0" } }, - "@formatjs/ts-transformer": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/@formatjs/ts-transformer/-/ts-transformer-2.13.0.tgz", - "integrity": "sha512-mu7sHXZk1NWZrQ3eUqugpSYo8x5/tXkrI4uIbFqCEC0eNgQaIcoKgVeDFgDAcgG+cEme2atAUYSFF+DFWC4org==", + "@formatjs/icu-skeleton-parser": { + "version": "1.3.12", + "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.3.12.tgz", + "integrity": "sha512-RHf5mi9dUaZIUteuWbK398FV1CkJOIezIubdiD+xEOPHb37ZvjXtwolCiCVVIWHDIeBBqxxAhnzdSFBS3CXfRg==", "requires": { - "intl-messageformat-parser": "6.1.2", - "tslib": "^2.0.1", - "typescript": "^4.0" - }, - "dependencies": { - "@formatjs/ecma402-abstract": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.5.0.tgz", - "integrity": "sha512-wXv36yo+mfWllweN0Fq7sUs7PUiNopn7I0JpLTe3hGu6ZMR4CV7LqK1llhB18pndwpKoafQKb1et2DCJAOW20Q==", - "requires": { - "tslib": "^2.0.1" - } - }, - "intl-messageformat-parser": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/intl-messageformat-parser/-/intl-messageformat-parser-6.1.2.tgz", - "integrity": "sha512-4GQDEPhl/ZMNDKwMsLqyw1LG2IAWjmLJXdmnRcHKeLQzpgtNYZI6lVw1279pqIkRk2MfKb9aDsVFzm565azK5A==", - "requires": { - "@formatjs/ecma402-abstract": "1.5.0", - "tslib": "^2.0.1" - } - } + "@formatjs/ecma402-abstract": "1.11.10", + "tslib": "2.4.0" + } + }, + "@formatjs/intl-localematcher": { + "version": "0.2.30", + "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.2.30.tgz", + "integrity": "sha512-No+D8Q8rlzEMfoKkJ1tk81aphZuAk7ZwY+Vkzbb1TOvlP67TM/YPxdf4JoiUV/Q2GRqdGhaLfgulqIf9ATKHTA==", + "requires": { + "tslib": "2.4.0" } }, "@humanwhocodes/config-array": { @@ -20873,6 +20899,14 @@ "@babel/types": "^7.0.0" } }, + "@types/babel__helper-plugin-utils": { + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/@types/babel__helper-plugin-utils/-/babel__helper-plugin-utils-7.10.0.tgz", + "integrity": "sha512-60YtHzhQ9HAkToHVV+TB4VLzBn9lrfgrsOjiJMtbv/c1jPdekBxaByd6DMsGBzROXWoIL6U3lEFvvbu69RkUoA==", + "requires": { + "@types/babel__core": "*" + } + }, "@types/babel__template": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", @@ -20968,14 +21002,6 @@ "@types/range-parser": "*" } }, - "@types/fs-extra": { - "version": "9.0.13", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.13.tgz", - "integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==", - "requires": { - "@types/node": "*" - } - }, "@types/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", @@ -21032,6 +21058,11 @@ "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==" }, + "@types/json-stable-stringify": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/@types/json-stable-stringify/-/json-stable-stringify-1.0.34.tgz", + "integrity": "sha512-s2cfwagOQAS8o06TcwKfr9Wx11dNGbH2E9vJz1cqV+a/LOyhWNLUNd6JSRYNzvB4d29UuJX2M0Dj9vE1T8fRXw==" + }, "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -21082,14 +21113,6 @@ "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==" }, - "@types/schema-utils": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@types/schema-utils/-/schema-utils-2.4.0.tgz", - "integrity": "sha512-454hrj5gz/FXcUE20ygfEiN4DxZ1sprUo0V1gqIqkNZ/CzoEzAZEll2uxMsuyz6BYjiQan4Aa65xbTemfzW9hQ==", - "requires": { - "schema-utils": "*" - } - }, "@types/serve-index": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.1.tgz", @@ -21759,34 +21782,16 @@ } }, "babel-loader": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.3.tgz", - "integrity": "sha512-n4Zeta8NC3QAsuyiizu0GkmRcQ6clkV9WFUnUf1iXP//IeSKbWjofW3UHyZVwlOB4y039YQKefawyTn64Zwbuw==", + "version": "8.2.5", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.5.tgz", + "integrity": "sha512-OSiFfH89LrEMiWd4pLNqGz4CwJDtbs2ZVc+iGu2HrkRfPxId9F2anQj38IxWpmRfsUY0aBZYi1EFcd3mhtRMLQ==", "requires": { "find-cache-dir": "^3.3.1", - "loader-utils": "^1.4.0", + "loader-utils": "^2.0.0", "make-dir": "^3.1.0", "schema-utils": "^2.6.5" }, "dependencies": { - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "requires": { - "minimist": "^1.2.0" - } - }, - "loader-utils": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", - "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", - "requires": { - "big.js": "^5.2.2", - "emojis-list": "^3.0.0", - "json5": "^1.0.1" - } - }, "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", @@ -21815,6 +21820,88 @@ "object.assign": "^4.1.0" } }, + "babel-plugin-formatjs": { + "version": "10.3.27", + "resolved": "https://registry.npmjs.org/babel-plugin-formatjs/-/babel-plugin-formatjs-10.3.27.tgz", + "integrity": "sha512-QcZgrI28HEr237GGnEL+Iqu7djWEP9rSazvpLsrmxoMtWkQKRnQSnbkouI0hP6o0fFy3IN2lChqumidIQYFXDw==", + "requires": { + "@babel/core": "^7.10.4", + "@babel/helper-plugin-utils": "^7.10.4", + "@babel/plugin-syntax-jsx": "7", + "@babel/traverse": "7", + "@babel/types": "^7.12.11", + "@formatjs/icu-messageformat-parser": "2.1.6", + "@formatjs/ts-transformer": "3.9.11", + "@types/babel__core": "^7.1.7", + "@types/babel__helper-plugin-utils": "^7.10.0", + "@types/babel__traverse": "^7.1.7", + "tslib": "2.4.0" + }, + "dependencies": { + "@formatjs/ts-transformer": { + "version": "3.9.11", + "resolved": "https://registry.npmjs.org/@formatjs/ts-transformer/-/ts-transformer-3.9.11.tgz", + "integrity": "sha512-NLp2UHdCTla4uCJkkhffAgYwFiOUdC6LZJE4gcfq4wcrfRINluRRBoLlNM3DqbeEkvz2zOIKEJUHVso1SEjeYA==", + "requires": { + "@formatjs/icu-messageformat-parser": "2.1.6", + "@types/json-stable-stringify": "^1.0.32", + "@types/node": "14 || 16 || 17", + "chalk": "^4.0.0", + "json-stable-stringify": "^1.0.1", + "tslib": "2.4.0", + "typescript": "^4.5" + } + }, + "@types/node": { + "version": "17.0.45", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", + "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "babel-plugin-istanbul": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", @@ -21865,35 +21952,6 @@ "@babel/helper-define-polyfill-provider": "^0.3.1" } }, - "babel-plugin-react-intl": { - "version": "7.9.4", - "resolved": "https://registry.npmjs.org/babel-plugin-react-intl/-/babel-plugin-react-intl-7.9.4.tgz", - "integrity": "sha512-cMKrHEXrw43yT4M89Wbgq8A8N8lffSquj1Piwov/HVukR7jwOw8gf9btXNsQhT27ccyqEwy+M286JQYy0jby2g==", - "requires": { - "@babel/core": "^7.9.0", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/types": "^7.9.5", - "@formatjs/ts-transformer": "^2.6.0", - "@types/babel__core": "^7.1.7", - "@types/fs-extra": "^9.0.1", - "@types/schema-utils": "^2.4.0", - "fs-extra": "^9.0.0", - "intl-messageformat-parser": "^5.3.7", - "schema-utils": "^2.6.6" - }, - "dependencies": { - "schema-utils": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz", - "integrity": "sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==", - "requires": { - "@types/json-schema": "^7.0.5", - "ajv": "^6.12.4", - "ajv-keywords": "^3.5.2" - } - } - } - }, "babel-plugin-transform-imports": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-imports/-/babel-plugin-transform-imports-2.0.0.tgz", @@ -26148,14 +26206,6 @@ "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==" }, - "intl-messageformat-parser": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/intl-messageformat-parser/-/intl-messageformat-parser-5.5.1.tgz", - "integrity": "sha512-TvB3LqF2VtP6yI6HXlRT5TxX98HKha6hCcrg9dwlPwNaedVNuQA9KgBdtWKgiyakyCTYHQ+KJeFEstNKfZr64w==", - "requires": { - "@formatjs/intl-numberformat": "^5.5.2" - } - }, "into-stream": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-3.1.0.tgz", @@ -28025,6 +28075,14 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha512-i/J297TW6xyj7sDFa7AmBPkQvLIxWr2kKPWI26tXydnZrzVAocNqn5DMNT1Mzk0vit1V5UkRM7C1KdVNp7Lmcg==", + "requires": { + "jsonify": "~0.0.0" + } + }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", @@ -28044,6 +28102,11 @@ "universalify": "^2.0.0" } }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha512-trvBk1ki43VZptdBI5rIlG4YOzyeH/WefQt5rj1grasPn4iiZWKet8nkgc4GlsAylaztn0qZfUYOiTsASJFdNA==" + }, "jsx-ast-utils": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.1.tgz", diff --git a/package.json b/package.json index 69d22c3fa..7ec9da51a 100644 --- a/package.json +++ b/package.json @@ -39,8 +39,8 @@ "@svgr/webpack": "6.2.1", "autoprefixer": "10.2.6", "babel-jest": "26.6.3", - "babel-loader": "8.2.3", - "babel-plugin-react-intl": "7.9.4", + "babel-loader": "^8.2.5", + "babel-plugin-formatjs": "^10.3.27", "babel-plugin-transform-imports": "2.0.0", "babel-polyfill": "6.26.0", "clean-webpack-plugin": "3.0.0", From e821b3dc44a697df7af97a3e2ab27dd8a7e41f45 Mon Sep 17 00:00:00 2001 From: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com> Date: Wed, 24 Aug 2022 17:12:04 +0500 Subject: [PATCH 2/5] refactor: removed messagesDir --- config/babel-preserve-modules.config.js | 1 - config/babel.config.js | 1 - 2 files changed, 2 deletions(-) diff --git a/config/babel-preserve-modules.config.js b/config/babel-preserve-modules.config.js index 2669bb3e5..23407f7f6 100644 --- a/config/babel-preserve-modules.config.js +++ b/config/babel-preserve-modules.config.js @@ -19,7 +19,6 @@ module.exports = { [ 'formatjs', { - messagesDir: './temp/babel-plugin-formatjs', moduleSourceName: '@edx/frontend-platform/i18n', }, ], diff --git a/config/babel.config.js b/config/babel.config.js index 0263fab58..d22cbdea4 100644 --- a/config/babel.config.js +++ b/config/babel.config.js @@ -35,7 +35,6 @@ module.exports = { [ 'formatjs', { - messagesDir: './temp/babel-plugin-formatjs', moduleSourceName: '@edx/frontend-platform/i18n', }, ], From bb7a8f118ada3a86584ec18fbe6ad222c1ebfd76 Mon Sep 17 00:00:00 2001 From: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com> Date: Wed, 9 Nov 2022 16:39:53 +0500 Subject: [PATCH 3/5] refactor: updated package-lock --- package-lock.json | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index eada105ac..83e9ddf88 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3345,15 +3345,6 @@ "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==", "dev": true }, - "node_modules/@types/schema-utils": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@types/schema-utils/-/schema-utils-2.4.0.tgz", - "integrity": "sha512-454hrj5gz/FXcUE20ygfEiN4DxZ1sprUo0V1gqIqkNZ/CzoEzAZEll2uxMsuyz6BYjiQan4Aa65xbTemfzW9hQ==", - "deprecated": "This is a stub types definition. schema-utils provides its own type definitions, so you do not need this installed.", - "dependencies": { - "schema-utils": "*" - } - }, "node_modules/@types/serve-index": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.1.tgz", @@ -21213,14 +21204,6 @@ "integrity": "sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==", "dev": true }, - "@types/schema-utils": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@types/schema-utils/-/schema-utils-2.4.0.tgz", - "integrity": "sha512-454hrj5gz/FXcUE20ygfEiN4DxZ1sprUo0V1gqIqkNZ/CzoEzAZEll2uxMsuyz6BYjiQan4Aa65xbTemfzW9hQ==", - "requires": { - "schema-utils": "*" - } - }, "@types/serve-index": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.1.tgz", From eb79f4b6d13f0f0f2a3b4072b3c5e2f0563ba41a Mon Sep 17 00:00:00 2001 From: Bilal Qamar <59555732+BilalQamar95@users.noreply.github.com> Date: Thu, 1 Dec 2022 16:22:03 +0500 Subject: [PATCH 4/5] refactor: removed deprecated moduleSourceName --- config/babel.config.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/config/babel.config.js b/config/babel.config.js index d22cbdea4..2c0e1424d 100644 --- a/config/babel.config.js +++ b/config/babel.config.js @@ -34,9 +34,6 @@ module.exports = { plugins: [ [ 'formatjs', - { - moduleSourceName: '@edx/frontend-platform/i18n', - }, ], ], }, From 716370f0a50fe9c2f6e65353f2207e2c28d24b1a Mon Sep 17 00:00:00 2001 From: Abdullah Waheed Date: Fri, 30 Dec 2022 21:22:14 +0500 Subject: [PATCH 5/5] refactor: removed moduleSourceName as suggested because it was redundant --- config/babel-preserve-modules.config.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/config/babel-preserve-modules.config.js b/config/babel-preserve-modules.config.js index 23407f7f6..34bbb2821 100644 --- a/config/babel-preserve-modules.config.js +++ b/config/babel-preserve-modules.config.js @@ -18,9 +18,6 @@ module.exports = { plugins: [ [ 'formatjs', - { - moduleSourceName: '@edx/frontend-platform/i18n', - }, ], ], },