@l10nmonster/helpers-java 1.0.0 → 3.0.0-alpha.10
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/.releaserc.json +31 -0
- package/CHANGELOG.md +6 -0
- package/filter.js +2 -2
- package/index.js +6 -6
- package/package.json +16 -15
package/.releaserc.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"branches": [
|
|
3
|
+
"main",
|
|
4
|
+
{
|
|
5
|
+
"name": "next",
|
|
6
|
+
"prerelease": "alpha"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"name": "beta",
|
|
10
|
+
"prerelease": "beta"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"tagFormat": "@l10nmonster/helpers-java@${version}",
|
|
14
|
+
"plugins": [
|
|
15
|
+
"@semantic-release/commit-analyzer",
|
|
16
|
+
"@semantic-release/release-notes-generator",
|
|
17
|
+
{
|
|
18
|
+
"path": "@semantic-release/changelog",
|
|
19
|
+
"changelogFile": "CHANGELOG.md"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"path": "@semantic-release/npm",
|
|
23
|
+
"npmPublish": true
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"path": "@semantic-release/git",
|
|
27
|
+
"assets": ["CHANGELOG.md", "package.json"],
|
|
28
|
+
"message": "chore(release): @l10nmonster/helpers-java@${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
package/CHANGELOG.md
ADDED
package/filter.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { parseToEntries, stringifyFromEntries } from '@js.properties/properties';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export default class JavaPropertiesFilter {
|
|
4
4
|
async parseResource({ resource }) {
|
|
5
5
|
const parsedResource = parseToEntries(resource, { sep: true, eol: true, all: true, original: true, location: true });
|
|
6
6
|
const segments = [];
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { regex } from '@l10nmonster/core';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
export { default as PropertiesFilter } from './filter.js';
|
|
4
4
|
|
|
5
5
|
const javaControlCharsToDecode = {
|
|
6
6
|
t: '\t',
|
|
@@ -9,7 +9,7 @@ const javaControlCharsToDecode = {
|
|
|
9
9
|
r: '\r',
|
|
10
10
|
f: '\f',
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
export const escapesDecoder = regex.decoderMaker(
|
|
13
13
|
'javaEscapesDecoder',
|
|
14
14
|
/(?<node>\\(?<escapedChar>['"\\])|\\(?<escapedControl>[tbnrf])|\\u(?<codePoint>[0-9A-Za-z]{4}))/g,
|
|
15
15
|
(groups) => (groups.escapedChar ??
|
|
@@ -21,7 +21,7 @@ exports.escapesDecoder = regex.decoderMaker(
|
|
|
21
21
|
);
|
|
22
22
|
|
|
23
23
|
// TODO: do we need to escape also those escapedChar that we decoded?
|
|
24
|
-
|
|
24
|
+
export const escapesEncoder = regex.encoderMaker(
|
|
25
25
|
'javaEscapesEncoder',
|
|
26
26
|
// eslint-disable-next-line prefer-named-capture-group
|
|
27
27
|
/(\t)|(\n)|(\r)|(\f)|(\u00a0)/g,
|
|
@@ -34,14 +34,14 @@ exports.escapesEncoder = regex.encoderMaker(
|
|
|
34
34
|
}
|
|
35
35
|
);
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
export const MFQuotesDecoder = regex.decoderMaker(
|
|
38
38
|
'javaMFQuotesDecoder',
|
|
39
39
|
/(?:(?<quote>')'|(?:'(?<quoted>[^']+)'))/g,
|
|
40
40
|
groups => groups.quote ?? groups.quoted
|
|
41
41
|
);
|
|
42
42
|
|
|
43
43
|
// need to be smart about detecting whether MessageFormat was used or not based on presence of {vars}
|
|
44
|
-
|
|
44
|
+
export const MFQuotesEncoder = regex.encoderMaker(
|
|
45
45
|
'javaMFQuotesEncoder',
|
|
46
46
|
// eslint-disable-next-line prefer-named-capture-group
|
|
47
47
|
/(')/g,
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
2
|
+
"name": "@l10nmonster/helpers-java",
|
|
3
|
+
"version": "3.0.0-alpha.10",
|
|
4
|
+
"description": "Helpers to deal with Java file formats",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "node --test"
|
|
9
|
+
},
|
|
10
|
+
"author": "Diego Lagunas",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@js.properties/properties": "^0.5.4"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"@l10nmonster/core": "^3.0.0-alpha.0"
|
|
17
|
+
}
|
|
17
18
|
}
|