@rushstack/localization-utilities 0.7.3 → 0.8.2
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,4 +1,5 @@
|
|
|
1
1
|
import { ITerminal } from '@rushstack/node-core-library';
|
|
2
|
+
import { ITypingsGeneratorBaseOptions } from '@rushstack/typings-generator';
|
|
2
3
|
import { NewlineKind } from '@rushstack/node-core-library';
|
|
3
4
|
import { StringValuesTypingsGenerator } from '@rushstack/typings-generator';
|
|
4
5
|
|
|
@@ -85,12 +86,8 @@ export declare interface IPseudolocaleOptions {
|
|
|
85
86
|
/**
|
|
86
87
|
* @public
|
|
87
88
|
*/
|
|
88
|
-
export declare interface ITypingsGeneratorOptions {
|
|
89
|
-
srcFolder: string;
|
|
90
|
-
generatedTsFolder: string;
|
|
91
|
-
terminal?: ITerminal;
|
|
89
|
+
export declare interface ITypingsGeneratorOptions extends ITypingsGeneratorBaseOptions {
|
|
92
90
|
exportAsDefault?: boolean;
|
|
93
|
-
globsToIgnore?: string[];
|
|
94
91
|
resxNewlineNormalization?: NewlineKind | undefined;
|
|
95
92
|
ignoreMissingResxComments?: boolean | undefined;
|
|
96
93
|
ignoreString?: IgnoreStringFunction;
|
package/dist/tsdoc-metadata.json
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import { StringValuesTypingsGenerator } from '@rushstack/typings-generator';
|
|
2
|
-
import {
|
|
1
|
+
import { StringValuesTypingsGenerator, ITypingsGeneratorBaseOptions } from '@rushstack/typings-generator';
|
|
2
|
+
import { NewlineKind } from '@rushstack/node-core-library';
|
|
3
3
|
import type { IgnoreStringFunction } from './interfaces';
|
|
4
4
|
/**
|
|
5
5
|
* @public
|
|
6
6
|
*/
|
|
7
|
-
export interface ITypingsGeneratorOptions {
|
|
8
|
-
srcFolder: string;
|
|
9
|
-
generatedTsFolder: string;
|
|
10
|
-
terminal?: ITerminal;
|
|
7
|
+
export interface ITypingsGeneratorOptions extends ITypingsGeneratorBaseOptions {
|
|
11
8
|
exportAsDefault?: boolean;
|
|
12
|
-
globsToIgnore?: string[];
|
|
13
9
|
resxNewlineNormalization?: NewlineKind | undefined;
|
|
14
10
|
ignoreMissingResxComments?: boolean | undefined;
|
|
15
11
|
ignoreString?: IgnoreStringFunction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypingsGenerator.d.ts","sourceRoot":"","sources":["../src/TypingsGenerator.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"TypingsGenerator.d.ts","sourceRoot":"","sources":["../src/TypingsGenerator.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,4BAA4B,EAE5B,4BAA4B,EAC7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,KAAK,EAAE,oBAAoB,EAAqB,MAAM,cAAc,CAAC;AAG5E;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,4BAA4B;IAC5E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,wBAAwB,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IACnD,yBAAyB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChD,YAAY,CAAC,EAAE,oBAAoB,CAAC;IACpC,cAAc,CAAC,EAAE,CACf,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,KACf,MAAM,GAAG,SAAS,CAAC;CACzB;AAED;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,4BAA4B;gBAC7C,OAAO,EAAE,wBAAwB;CAkCrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypingsGenerator.js","sourceRoot":"","sources":["../src/TypingsGenerator.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,
|
|
1
|
+
{"version":3,"file":"TypingsGenerator.js","sourceRoot":"","sources":["../src/TypingsGenerator.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;AAE3D,oEAIsC;AAItC,mDAA+C;AAiB/C;;;;GAIG;AACH,MAAa,gBAAiB,SAAQ,gDAA4B;IAChE,YAAmB,OAAiC;QAClD,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC;QACjD,KAAK,CAAC;YACJ,GAAG,OAAO;YACV,cAAc,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,CAAC;YAChE,uBAAuB,EAAE,CAAC,YAAoB,EAAE,QAAgB,EAAE,YAAoB,EAAE,EAAE;gBACxF,MAAM,WAAW,GAAsB,IAAA,4BAAY,EAAC;oBAClD,QAAQ,EAAE,QAAQ;oBAClB,OAAO,EAAE,YAAY;oBACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAS;oBACjC,wBAAwB,EAAE,OAAO,CAAC,wBAAwB;oBAC1D,yBAAyB,EAAE,OAAO,CAAC,yBAAyB;oBAC5D,YAAY;iBACb,CAAC,CAAC;gBAEH,MAAM,OAAO,GAAyB,EAAE,CAAC;gBAEzC,wCAAwC;gBACxC,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE;oBACpC,IAAI,OAAO,GAAuB,WAAW,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC;oBAClE,IAAI,cAAc,EAAE;wBAClB,OAAO,GAAG,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;qBAC7D;oBAED,OAAO,CAAC,IAAI,CAAC;wBACX,UAAU,EAAE,UAAU;wBACtB,OAAO;qBACR,CAAC,CAAC;iBACJ;gBAED,OAAO,EAAE,OAAO,EAAE,CAAC;YACrB,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAnCD,4CAmCC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport {\n StringValuesTypingsGenerator,\n IStringValueTyping,\n ITypingsGeneratorBaseOptions\n} from '@rushstack/typings-generator';\nimport { NewlineKind } from '@rushstack/node-core-library';\n\nimport type { IgnoreStringFunction, ILocalizationFile } from './interfaces';\nimport { parseLocFile } from './LocFileParser';\n\n/**\n * @public\n */\nexport interface ITypingsGeneratorOptions extends ITypingsGeneratorBaseOptions {\n exportAsDefault?: boolean;\n resxNewlineNormalization?: NewlineKind | undefined;\n ignoreMissingResxComments?: boolean | undefined;\n ignoreString?: IgnoreStringFunction;\n processComment?: (\n comment: string | undefined,\n resxFilePath: string,\n stringName: string\n ) => string | undefined;\n}\n\n/**\n * This is a simple tool that generates .d.ts files for .loc.json, .resx.json, .resjson, and .resx files.\n *\n * @public\n */\nexport class TypingsGenerator extends StringValuesTypingsGenerator {\n public constructor(options: ITypingsGeneratorOptions) {\n const { ignoreString, processComment } = options;\n super({\n ...options,\n fileExtensions: ['.resx', '.resx.json', '.loc.json', '.resjson'],\n parseAndGenerateTypings: (fileContents: string, filePath: string, resxFilePath: string) => {\n const locFileData: ILocalizationFile = parseLocFile({\n filePath: filePath,\n content: fileContents,\n terminal: this._options.terminal!,\n resxNewlineNormalization: options.resxNewlineNormalization,\n ignoreMissingResxComments: options.ignoreMissingResxComments,\n ignoreString\n });\n\n const typings: IStringValueTyping[] = [];\n\n // eslint-disable-next-line guard-for-in\n for (const stringName in locFileData) {\n let comment: string | undefined = locFileData[stringName].comment;\n if (processComment) {\n comment = processComment(comment, resxFilePath, stringName);\n }\n\n typings.push({\n exportName: stringName,\n comment\n });\n }\n\n return { typings };\n }\n });\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rushstack/localization-utilities",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "This plugin contains some useful functions for localization.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "dist/localization-utilities.d.ts",
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
"directory": "libraries/localization-utilities"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@rushstack/node-core-library": "3.
|
|
15
|
-
"@rushstack/typings-generator": "0.
|
|
14
|
+
"@rushstack/node-core-library": "3.47.0",
|
|
15
|
+
"@rushstack/typings-generator": "0.7.2",
|
|
16
16
|
"pseudolocale": "~1.1.0",
|
|
17
17
|
"xmldoc": "~1.1.2"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@rushstack/eslint-config": "2.6.1",
|
|
21
|
-
"@rushstack/heft": "0.45.
|
|
22
|
-
"@rushstack/heft-node-rig": "1.9.
|
|
21
|
+
"@rushstack/heft": "0.45.13",
|
|
22
|
+
"@rushstack/heft-node-rig": "1.9.14",
|
|
23
23
|
"@types/heft-jest": "1.0.1",
|
|
24
24
|
"@types/node": "12.20.24",
|
|
25
25
|
"@types/xmldoc": "1.1.4"
|