@formatjs/cli 2.10.0 → 2.11.3
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
// /home/longlho/.cache/bazel/_bazel_longlho/576c18efaac10246ec115c72af79fca6/sandbox/linux-sandbox/
|
|
2
|
+
// /home/longlho/.cache/bazel/_bazel_longlho/576c18efaac10246ec115c72af79fca6/sandbox/linux-sandbox/3297/execroot/formatjs/node_modules/@bazel/typescript/internal/ts_project_options_validator.js checked attributes for //packages/cli:dist-base
|
|
3
3
|
// composite: false
|
|
4
4
|
// declaration: true
|
|
5
5
|
// declaration_map: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.3",
|
|
4
4
|
"description": "A CLI for formatjs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"intl",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"url": "git+ssh://git@github.com/formatjs/formatjs.git"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@formatjs/ts-transformer": "^2.
|
|
34
|
+
"@formatjs/ts-transformer": "^2.10.1",
|
|
35
35
|
"@types/json-stable-stringify": "^1.0.32",
|
|
36
36
|
"@types/lodash": "^4.14.150",
|
|
37
37
|
"@types/loud-rejection": "^2.0.0",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"commander": "^6.1.0",
|
|
41
41
|
"fast-glob": "^3.2.4",
|
|
42
42
|
"fs-extra": "^9.0.0",
|
|
43
|
-
"intl-messageformat-parser": "^6.0.
|
|
43
|
+
"intl-messageformat-parser": "^6.0.7",
|
|
44
44
|
"json-stable-stringify": "^1.0.1",
|
|
45
45
|
"lodash": "^4.17.15",
|
|
46
46
|
"loud-rejection": "^2.2.0",
|
package/src/extract.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../../../../../packages/cli/src/extract.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,IAAI,EACJ,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AAKlC,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAC1D;;OAEG;IACH,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,CAAC;CACV;AAED,MAAM,WAAW,0BAA2B,SAAQ,iBAAiB;IACnE;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,oBAAY,iBAAiB,GAAG,IAAI,CAClC,WAAW,EACX,cAAc,GAAG,gBAAgB,GAAG,iBAAiB,CACtD,GAAG;IACF;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,oBAAY,WAAW,GAAG,IAAI,GAAG;IAC/B;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,IAAI,CAAC,IAAI,EAAE,gBAAgB,GAAG,iBAAiB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../../../../../packages/cli/src/extract.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,IAAI,EACJ,iBAA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{
|
|
|
81
81
|
var idInterpolationPattern = _a.idInterpolationPattern, opts = __rest(_a, ["idInterpolationPattern"]);
|
|
82
82
|
var messages = [];
|
|
83
83
|
var meta;
|
|
84
|
+
opts = __assign(__assign({}, opts), { onMsgExtracted: function (_, msgs) {
|
|
85
|
+
if (opts.extractSourceLocation) {
|
|
86
|
+
msgs = msgs.map(function (msg) { return (__assign(__assign({}, msg), calculateLineColFromOffset(source, msg.start))); });
|
|
87
|
+
}
|
|
88
|
+
messages = messages.concat(msgs);
|
|
89
|
+
},
|
|
90
|
+
onMetaExtracted: function (_, m) {
|
|
91
|
+
meta = m;
|
|
92
|
+
} });
|
|
84
93
|
if (!opts.overrideIdFn && idInterpolationPattern) {
|
|
85
94
|
opts = __assign(__assign({}, opts), { overrideIdFn: function (id, defaultMessage, description, fileName) {
|
|
86
95
|
return id ||
|
|
@@ -91,29 +100,28 @@ function processFile(source, fn, _a) {
|
|
|
91
100
|
? defaultMessage + "#" + description
|
|
92
101
|
: defaultMessage,
|
|
93
102
|
});
|
|
94
|
-
}, onMsgExtracted: function (_, msgs) {
|
|
95
|
-
if (opts.extractSourceLocation) {
|
|
96
|
-
msgs = msgs.map(function (msg) { return (__assign(__assign({}, msg), calculateLineColFromOffset(source, msg.start))); });
|
|
97
|
-
}
|
|
98
|
-
messages = messages.concat(msgs);
|
|
99
|
-
},
|
|
100
|
-
onMetaExtracted: function (_, m) {
|
|
101
|
-
meta = m;
|
|
102
103
|
} });
|
|
103
104
|
}
|
|
104
|
-
var output
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
105
|
+
var output;
|
|
106
|
+
try {
|
|
107
|
+
output = typescript_1.default.transpileModule(source, {
|
|
108
|
+
compilerOptions: {
|
|
109
|
+
allowJs: true,
|
|
110
|
+
target: typescript_1.default.ScriptTarget.ESNext,
|
|
111
|
+
noEmit: true,
|
|
112
|
+
experimentalDecorators: true,
|
|
113
|
+
},
|
|
114
|
+
reportDiagnostics: true,
|
|
115
|
+
fileName: fn,
|
|
116
|
+
transformers: {
|
|
117
|
+
before: [ts_transformer_1.transform(opts)],
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
catch (e) {
|
|
122
|
+
e.message = "Error processing file " + fn + " \n" + (e.message || '');
|
|
123
|
+
throw e;
|
|
124
|
+
}
|
|
117
125
|
if (output.diagnostics) {
|
|
118
126
|
var errs = output.diagnostics.filter(function (d) { return d.category === typescript_1.default.DiagnosticCategory.Error; });
|
|
119
127
|
if (errs.length) {
|