discourse/package.json
Loïc Guitaut 301713ef96 DEV: Upgrade the MessageFormat library (JS)
This patch upgrades the MessageFormat library to version 3.3.0 from
0.1.5.

Our `I18n.messageFormat` method signature is unchanged, and now uses the
new API under the hood.

We don’t need dedicated locale files for handling pluralization rules
anymore as everything is now included by the library itself.

The compilation of the messages now happens through our
`messageformat-wrapper` gem. It then outputs an ES module that includes
all its needed dependencies.

Most of the changes happen in `JsLocaleHelper` and in the `ExtraLocales`
controller.

A new method called `.output_MF` has been introduced in
`JsLocaleHelper`. It handles all the fetching, compiling and
transpiling to generate the proper MF messages in JS. Overrides and
fallbacks are also handled directly in this method.

The other main change is that now the MF translations are served through
the `ExtraLocales` controller instead of being statically compiled in a
JS file, then having to patch the messages using overrides and
fallbacks. Now the MF translations are just another bundle that is
created on the fly and cached by the client.
2024-07-10 09:51:25 +02:00

88 lines
3.9 KiB
JSON

{
"name": "discourse",
"private": true,
"repository": "https://github.com/discourse/discourse",
"author": "Discourse",
"license": "GPL-2.0-only",
"devDependencies": {
"@discourse/lint-configs": "^1.3.9",
"@discourse/moment-timezone-names-translations": "^1.0.0",
"@fortawesome/fontawesome-free": "5.15.4",
"@glint/core": "^1.4.0",
"@glint/environment-ember-loose": "^1.4.0",
"@glint/environment-ember-template-imports": "^1.4.0",
"@glint/template": "^1.4.0",
"@json-editor/json-editor": "2.10.0",
"@messageformat/core": "^3.3.0",
"@mixer/parallel-prettier": "^2.0.3",
"chart.js": "3.5.1",
"chartjs-plugin-datalabels": "2.2.0",
"chrome-launcher": "^1.1.2",
"chrome-remote-interface": "^0.33.2",
"concurrently": "^8.2.2",
"ember-template-lint": "^5.13.0",
"esbuild": "^0.23.0",
"eslint": "^8.57.0",
"jsdoc": "^4.0.0",
"lefthook": "^1.7.1",
"lint-to-the-future": "^2.0.0",
"lint-to-the-future-ember-template": "^1.1.1",
"lint-to-the-future-eslint": "^2.0.1",
"magnific-popup": "1.1.0",
"moment": "2.30.1",
"moment-timezone": "0.5.45",
"patch-package": "^8.0.0",
"pikaday": "1.8.2",
"postinstall-postinstall": "^2.1.0",
"prettier": "^2.8.8",
"puppeteer-core": "^22.12.1",
"squoosh": "discourse/squoosh#dc9649d",
"typescript": "^5.5.3"
},
"scripts": {
"dev": "concurrently \"bin/ember-cli server --environment=development\" \"RAILS_ENV=development bin/rails server\"",
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
"lint:fix": "concurrently \"npm:lint:*:fix\" --names \"fix:\"",
"lint:js": "eslint ./app/assets/javascripts --cache",
"lint:js-plugins": "eslint ./plugins --cache",
"lint:js:fix": "eslint --fix ./app/assets/javascripts",
"lint:js-plugins:fix": "eslint --fix ./plugins",
"lint:hbs": "ember-template-lint 'app/assets/javascripts/**/*.{gjs,hbs}' 'plugins/**/assets/javascripts/**/*.{gjs,hbs}' --no-error-on-unmatched-pattern",
"lint:hbs:fix": "ember-template-lint 'app/assets/javascripts/**/*.{gjs,hbs}' 'plugins/**/assets/javascripts/**/*.{gjs,hbs}' --no-error-on-unmatched-pattern --fix",
"lint:prettier": "yarn pprettier --list-different 'app/assets/stylesheets/**/*.scss' 'app/assets/javascripts/**/*.{js,gjs,hbs}' 'plugins/**/assets/stylesheets/**/*.scss' 'plugins/**/assets/javascripts/**/*.{js,gjs,hbs}'",
"lint:prettier:fix": "yarn prettier -w 'app/assets/stylesheets/**/*.scss' 'app/assets/javascripts/**/*.{js,gjs,hbs}' 'plugins/**/assets/stylesheets/**/*.scss' 'plugins/**/assets/javascripts/**/*.{js,gjs,hbs}'",
"lttf:ignore": "lint-to-the-future ignore",
"lttf:output": "lint-to-the-future output -o ./lint-progress/",
"lint-progress": "yarn lttf:output && npx html-pages ./lint-progress --no-cache",
"postinstall": "./app/assets/javascripts/run-patch-package && rm -rf app/assets/javascripts/node_modules"
},
"workspaces": [
"app/assets/javascripts/admin",
"app/assets/javascripts/custom-proxy",
"app/assets/javascripts/deprecation-silencer",
"app/assets/javascripts/dialog-holder",
"app/assets/javascripts/discourse",
"app/assets/javascripts/discourse-common",
"app/assets/javascripts/discourse-hbr",
"app/assets/javascripts/discourse-i18n",
"app/assets/javascripts/discourse-markdown-it",
"app/assets/javascripts/discourse-plugins",
"app/assets/javascripts/discourse-widget-hbs",
"app/assets/javascripts/ember-cli-progress-ci",
"app/assets/javascripts/ember-production-deprecations",
"app/assets/javascripts/float-kit",
"app/assets/javascripts/pretty-text",
"app/assets/javascripts/select-kit",
"app/assets/javascripts/theme-transpiler",
"app/assets/javascripts/truth-helpers"
],
"resolutions": {
"**/unset-value": "2.0.1"
},
"engines": {
"node": ">= 18",
"npm": "please-use-yarn",
"yarn": ">= 1.21.1"
}
}