@forthtilliath/expo-release-updates 0.4.0 → 0.4.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,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Compares two "x.y.z" version strings, segment by segment.
|
|
3
|
-
*
|
|
4
|
-
* @returns -1 if `a` < `b`, 0 if they're equal, 1 if `a` > `b`.
|
|
5
|
-
*/
|
|
6
|
-
export declare function compareVersions(a: string, b: string): number;
|
|
1
|
+
export { compareVersions } from "@forthtilliath/ts-kit/version/compareVersions";
|
|
7
2
|
//# sourceMappingURL=compareVersions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compareVersions.d.ts","sourceRoot":"","sources":["../src/compareVersions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compareVersions.d.ts","sourceRoot":"","sources":["../src/compareVersions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC"}
|
package/dist/compareVersions.js
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export function compareVersions(a, b) {
|
|
7
|
-
const partsA = a.split(".").map(Number);
|
|
8
|
-
const partsB = b.split(".").map(Number);
|
|
9
|
-
const length = Math.max(partsA.length, partsB.length);
|
|
10
|
-
for (let i = 0; i < length; i++) {
|
|
11
|
-
const numA = partsA[i] ?? 0;
|
|
12
|
-
const numB = partsB[i] ?? 0;
|
|
13
|
-
if (numA !== numB)
|
|
14
|
-
return numA > numB ? 1 : -1;
|
|
15
|
-
}
|
|
16
|
-
return 0;
|
|
17
|
-
}
|
|
1
|
+
// Framework-agnostic — actually implemented (and tested/documented) in
|
|
2
|
+
// ts-kit, re-exported here so this package's deep-import path
|
|
3
|
+
// (`@forthtilliath/expo-release-updates/compareVersions`) and root barrel
|
|
4
|
+
// export keep working.
|
|
5
|
+
export { compareVersions } from "@forthtilliath/ts-kit/version/compareVersions";
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
bold: boolean;
|
|
4
|
-
}
|
|
5
|
-
export type ChangelogBlock = {
|
|
6
|
-
type: "heading";
|
|
7
|
-
text: string;
|
|
8
|
-
} | {
|
|
9
|
-
type: "item";
|
|
10
|
-
segments: ChangelogSegment[];
|
|
11
|
-
} | {
|
|
12
|
-
type: "text";
|
|
13
|
-
segments: ChangelogSegment[];
|
|
14
|
-
};
|
|
15
|
-
export declare function parseChangelogNotes(notes: string): ChangelogBlock[];
|
|
1
|
+
export type { ChangelogBlock, ChangelogSegment, } from "@forthtilliath/ts-kit/markdown/parseChangelogNotes";
|
|
2
|
+
export { parseChangelogNotes } from "@forthtilliath/ts-kit/markdown/parseChangelogNotes";
|
|
16
3
|
//# sourceMappingURL=parseChangelogNotes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseChangelogNotes.d.ts","sourceRoot":"","sources":["../src/parseChangelogNotes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parseChangelogNotes.d.ts","sourceRoot":"","sources":["../src/parseChangelogNotes.ts"],"names":[],"mappings":"AAIA,YAAY,EACV,cAAc,EACd,gBAAgB,GACjB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAC"}
|
|
@@ -1,43 +1 @@
|
|
|
1
|
-
|
|
2
|
-
// ("### Heading", "- item", "**bold**"). Rendered as-is in a plain <Text>,
|
|
3
|
-
// the raw syntax shows up unstyled — this parser turns it into a small set
|
|
4
|
-
// of typed blocks a UI layer can render (heading / bullet item / plain
|
|
5
|
-
// text), without pulling in a full Markdown dependency for this narrow use
|
|
6
|
-
// case.
|
|
7
|
-
function parseInlineSegments(text) {
|
|
8
|
-
const segments = [];
|
|
9
|
-
const boldPattern = /\*\*(.+?)\*\*/g;
|
|
10
|
-
let lastIndex = 0;
|
|
11
|
-
let match;
|
|
12
|
-
while ((match = boldPattern.exec(text)) !== null) {
|
|
13
|
-
if (match.index > lastIndex) {
|
|
14
|
-
segments.push({ text: text.slice(lastIndex, match.index), bold: false });
|
|
15
|
-
}
|
|
16
|
-
// The capture group is mandatory in the pattern, so it always matches —
|
|
17
|
-
// the `?? ""` fallback is only here to satisfy `noUncheckedIndexedAccess`.
|
|
18
|
-
segments.push({ text: match[1] ?? "", bold: true });
|
|
19
|
-
lastIndex = boldPattern.lastIndex;
|
|
20
|
-
}
|
|
21
|
-
if (lastIndex < text.length) {
|
|
22
|
-
segments.push({ text: text.slice(lastIndex), bold: false });
|
|
23
|
-
}
|
|
24
|
-
return segments;
|
|
25
|
-
}
|
|
26
|
-
export function parseChangelogNotes(notes) {
|
|
27
|
-
return notes
|
|
28
|
-
.split("\n")
|
|
29
|
-
.map((line) => line.trim())
|
|
30
|
-
.filter((line) => line.length > 0)
|
|
31
|
-
.map((line) => {
|
|
32
|
-
if (line.startsWith("### ")) {
|
|
33
|
-
return { type: "heading", text: line.slice(4).trim() };
|
|
34
|
-
}
|
|
35
|
-
if (line.startsWith("- ")) {
|
|
36
|
-
return {
|
|
37
|
-
type: "item",
|
|
38
|
-
segments: parseInlineSegments(line.slice(2).trim()),
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
return { type: "text", segments: parseInlineSegments(line) };
|
|
42
|
-
});
|
|
43
|
-
}
|
|
1
|
+
export { parseChangelogNotes } from "@forthtilliath/ts-kit/markdown/parseChangelogNotes";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forthtilliath/expo-release-updates",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -24,13 +24,18 @@
|
|
|
24
24
|
"expo-file-system": ">=54.0.0",
|
|
25
25
|
"expo-intent-launcher": ">=12.0.0"
|
|
26
26
|
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@forthtilliath/ts-kit": "0.5.0"
|
|
29
|
+
},
|
|
27
30
|
"devDependencies": {
|
|
31
|
+
"@vitest/coverage-v8": "4.1.10",
|
|
28
32
|
"eslint": "10.7.0",
|
|
29
33
|
"expo-file-system": "~57.0.2",
|
|
30
34
|
"expo-intent-launcher": "~57.0.1",
|
|
31
35
|
"typescript": "^5.9.3",
|
|
32
36
|
"vitest": "^4.1.10",
|
|
33
|
-
"@forthtilliath/eslint-config": "0.
|
|
37
|
+
"@forthtilliath/eslint-config": "0.5.0",
|
|
38
|
+
"@forthtilliath/test-kit": "0.2.0",
|
|
34
39
|
"@forthtilliath/typescript-config": "0.0.0"
|
|
35
40
|
},
|
|
36
41
|
"scripts": {
|
|
@@ -40,6 +45,7 @@
|
|
|
40
45
|
"dev": "tsc --watch -p tsconfig.build.json",
|
|
41
46
|
"build": "pnpm run clean && tsc -p tsconfig.build.json",
|
|
42
47
|
"test": "vitest run",
|
|
43
|
-
"test:watch": "vitest"
|
|
48
|
+
"test:watch": "vitest",
|
|
49
|
+
"coverage": "vitest run --coverage"
|
|
44
50
|
}
|
|
45
51
|
}
|