@rushstack/localization-utilities 0.9.62 → 0.10.0

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.
package/CHANGELOG.json CHANGED
@@ -1,6 +1,32 @@
1
1
  {
2
2
  "name": "@rushstack/localization-utilities",
3
3
  "entries": [
4
+ {
5
+ "version": "0.10.0",
6
+ "tag": "@rushstack/localization-utilities_v0.10.0",
7
+ "date": "Mon, 12 Aug 2024 22:16:04 GMT",
8
+ "comments": {
9
+ "minor": [
10
+ {
11
+ "comment": "Update the schema for `.loc.json` files to allow string names that include the `$` character."
12
+ }
13
+ ],
14
+ "dependency": [
15
+ {
16
+ "comment": "Updating dependency \"@rushstack/node-core-library\" to `5.6.0`"
17
+ },
18
+ {
19
+ "comment": "Updating dependency \"@rushstack/terminal\" to `0.13.4`"
20
+ },
21
+ {
22
+ "comment": "Updating dependency \"@rushstack/typings-generator\" to `0.12.63`"
23
+ },
24
+ {
25
+ "comment": "Updating dependency \"@rushstack/heft\" to `0.66.26`"
26
+ }
27
+ ]
28
+ }
29
+ },
4
30
  {
5
31
  "version": "0.9.62",
6
32
  "tag": "@rushstack/localization-utilities_v0.9.62",
package/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # Change Log - @rushstack/localization-utilities
2
2
 
3
- This log was last generated on Fri, 02 Aug 2024 17:26:42 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 12 Aug 2024 22:16:04 GMT and should not be manually modified.
4
+
5
+ ## 0.10.0
6
+ Mon, 12 Aug 2024 22:16:04 GMT
7
+
8
+ ### Minor changes
9
+
10
+ - Update the schema for `.loc.json` files to allow string names that include the `$` character.
4
11
 
5
12
  ## 0.9.62
6
13
  Fri, 02 Aug 2024 17:26:42 GMT
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.47.4"
8
+ "packageVersion": "7.47.5"
9
9
  }
10
10
  ]
11
11
  }
@@ -15,7 +15,7 @@ const LOC_JSON_SCHEMA = node_core_library_1.JsonSchema.fromLoadedObject(locJson_
15
15
  function parseLocJson({ content, filePath, ignoreString }) {
16
16
  const parsedFile = node_core_library_1.JsonFile.parseString(content);
17
17
  try {
18
- LOC_JSON_SCHEMA.validateObject(parsedFile, filePath);
18
+ LOC_JSON_SCHEMA.validateObject(parsedFile, filePath, { ignoreSchemaField: true });
19
19
  }
20
20
  catch (e) {
21
21
  throw new Error(`The loc file is invalid. Error: ${e}`);
@@ -1 +1 @@
1
- {"version":3,"file":"parseLocJson.js","sourceRoot":"","sources":["../../src/parsers/parseLocJson.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;AAE3D,oEAAoE;AAGpE,yFAA2D;AAE3D,MAAM,eAAe,GAAe,8BAAU,CAAC,gBAAgB,CAAC,6BAAa,CAAC,CAAC;AAE/E;;GAEG;AACH,SAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAqB;IACjF,MAAM,UAAU,GAAsB,4BAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACpE,IAAI,CAAC;QACH,eAAe,CAAC,cAAc,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACvD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,aAAa,GAAsB,EAAE,CAAC;QAC5C,KAAK,MAAM,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3D,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC;gBACjC,aAAa,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC;YAClC,CAAC;QACH,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;SAAM,CAAC;QACN,OAAO,UAAU,CAAC;IACpB,CAAC;AACH,CAAC;AApBD,oCAoBC","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 { JsonFile, JsonSchema } from '@rushstack/node-core-library';\n\nimport type { ILocalizationFile, IParseFileOptions } from '../interfaces';\nimport locJsonSchema from '../schemas/locJson.schema.json';\n\nconst LOC_JSON_SCHEMA: JsonSchema = JsonSchema.fromLoadedObject(locJsonSchema);\n\n/**\n * @public\n */\nexport function parseLocJson({ content, filePath, ignoreString }: IParseFileOptions): ILocalizationFile {\n const parsedFile: ILocalizationFile = JsonFile.parseString(content);\n try {\n LOC_JSON_SCHEMA.validateObject(parsedFile, filePath);\n } catch (e) {\n throw new Error(`The loc file is invalid. Error: ${e}`);\n }\n\n if (ignoreString) {\n const newParsedFile: ILocalizationFile = {};\n for (const [key, stringData] of Object.entries(parsedFile)) {\n if (!ignoreString(filePath, key)) {\n newParsedFile[key] = stringData;\n }\n }\n\n return newParsedFile;\n } else {\n return parsedFile;\n }\n}\n"]}
1
+ {"version":3,"file":"parseLocJson.js","sourceRoot":"","sources":["../../src/parsers/parseLocJson.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;;;;;AAE3D,oEAAoE;AAGpE,yFAA2D;AAE3D,MAAM,eAAe,GAAe,8BAAU,CAAC,gBAAgB,CAAC,6BAAa,CAAC,CAAC;AAE/E;;GAEG;AACH,SAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAqB;IACjF,MAAM,UAAU,GAAsB,4BAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACpE,IAAI,CAAC;QACH,eAAe,CAAC,cAAc,CAAC,UAAU,EAAE,QAAQ,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC;IACpF,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,aAAa,GAAsB,EAAE,CAAC;QAC5C,KAAK,MAAM,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3D,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC;gBACjC,aAAa,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC;YAClC,CAAC;QACH,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;SAAM,CAAC;QACN,OAAO,UAAU,CAAC;IACpB,CAAC;AACH,CAAC;AApBD,oCAoBC","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 { JsonFile, JsonSchema } from '@rushstack/node-core-library';\n\nimport type { ILocalizationFile, IParseFileOptions } from '../interfaces';\nimport locJsonSchema from '../schemas/locJson.schema.json';\n\nconst LOC_JSON_SCHEMA: JsonSchema = JsonSchema.fromLoadedObject(locJsonSchema);\n\n/**\n * @public\n */\nexport function parseLocJson({ content, filePath, ignoreString }: IParseFileOptions): ILocalizationFile {\n const parsedFile: ILocalizationFile = JsonFile.parseString(content);\n try {\n LOC_JSON_SCHEMA.validateObject(parsedFile, filePath, { ignoreSchemaField: true });\n } catch (e) {\n throw new Error(`The loc file is invalid. Error: ${e}`);\n }\n\n if (ignoreString) {\n const newParsedFile: ILocalizationFile = {};\n for (const [key, stringData] of Object.entries(parsedFile)) {\n if (!ignoreString(filePath, key)) {\n newParsedFile[key] = stringData;\n }\n }\n\n return newParsedFile;\n } else {\n return parsedFile;\n }\n}\n"]}
@@ -2,14 +2,8 @@
2
2
  "$schema": "http://json-schema.org/draft-04/schema#",
3
3
  "title": "Localizable JSON file",
4
4
 
5
- "properties": {
6
- "$schema": {
7
- "description": "Part of the JSON Schema standard, this optional keyword declares the URL of the schema that the file conforms to. Editors may download the schema and use it to perform syntax highlighting.",
8
- "type": "string"
9
- }
10
- },
11
5
  "patternProperties": {
12
- "^[A-Za-z_][0-9A-Za-z_]*$": {
6
+ "^[A-Za-z_$][0-9A-Za-z_$]*$": {
13
7
  "type": "object",
14
8
  "properties": {
15
9
  "value": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rushstack/localization-utilities",
3
- "version": "0.9.62",
3
+ "version": "0.10.0",
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",
@@ -13,13 +13,13 @@
13
13
  "dependencies": {
14
14
  "pseudolocale": "~1.1.0",
15
15
  "xmldoc": "~1.1.2",
16
- "@rushstack/node-core-library": "5.5.1",
17
- "@rushstack/terminal": "0.13.3",
18
- "@rushstack/typings-generator": "0.12.62"
16
+ "@rushstack/node-core-library": "5.6.0",
17
+ "@rushstack/terminal": "0.13.4",
18
+ "@rushstack/typings-generator": "0.12.63"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/xmldoc": "1.1.4",
22
- "@rushstack/heft": "0.66.25",
22
+ "@rushstack/heft": "0.66.26",
23
23
  "local-node-rig": "1.0.0"
24
24
  },
25
25
  "scripts": {