@formatjs/cli 6.2.7 → 6.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/formatjs +10 -2
  2. package/package.json +2 -2
package/bin/formatjs CHANGED
@@ -198223,13 +198223,15 @@ function calculateLineColFromOffset(text, start) {
198223
198223
  async function processFile(source, fn, { idInterpolationPattern, ...opts }) {
198224
198224
  let messages = [];
198225
198225
  let meta;
198226
+ const onMsgExtracted = opts.onMsgExtracted;
198227
+ const onMetaExtracted = opts.onMetaExtracted;
198226
198228
  opts = {
198227
198229
  ...opts,
198228
198230
  additionalComponentNames: [
198229
198231
  "$formatMessage",
198230
198232
  ...opts.additionalComponentNames || []
198231
198233
  ],
198232
- onMsgExtracted(_, msgs) {
198234
+ onMsgExtracted(filePath, msgs) {
198233
198235
  if (opts.extractSourceLocation) {
198234
198236
  msgs = msgs.map((msg) => ({
198235
198237
  ...msg,
@@ -198237,9 +198239,15 @@ async function processFile(source, fn, { idInterpolationPattern, ...opts }) {
198237
198239
  }));
198238
198240
  }
198239
198241
  messages = messages.concat(msgs);
198242
+ if (onMsgExtracted) {
198243
+ onMsgExtracted(filePath, msgs);
198244
+ }
198240
198245
  },
198241
- onMetaExtracted(_, m) {
198246
+ onMetaExtracted(filePath, m) {
198242
198247
  meta = m;
198248
+ if (onMetaExtracted) {
198249
+ onMetaExtracted(filePath, m);
198250
+ }
198243
198251
  }
198244
198252
  };
198245
198253
  if (!opts.overrideIdFn && idInterpolationPattern) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formatjs/cli",
3
- "version": "6.2.7",
3
+ "version": "6.2.8",
4
4
  "description": "A CLI for formatjs.",
5
5
  "keywords": [
6
6
  "intl",
@@ -33,7 +33,7 @@
33
33
  "url": "https://github.com/formatjs/formatjs/issues"
34
34
  },
35
35
  "devDependencies": {
36
- "@formatjs/cli-lib": "6.3.6"
36
+ "@formatjs/cli-lib": "6.3.7"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "vue": "^3.3.4"