@bscotch/gamemaker-releases 0.1.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/README.md +64 -0
- package/dist/browser.d.ts +7 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +6 -0
- package/dist/browser.js.map +1 -0
- package/dist/constants.d.ts +3 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +5 -0
- package/dist/constants.js.map +1 -0
- package/dist/feeds.d.ts +5 -0
- package/dist/feeds.d.ts.map +1 -0
- package/dist/feeds.js +78 -0
- package/dist/feeds.js.map +1 -0
- package/dist/feeds.lib.d.ts +4 -0
- package/dist/feeds.lib.d.ts.map +1 -0
- package/dist/feeds.lib.js +53 -0
- package/dist/feeds.lib.js.map +1 -0
- package/dist/feeds.types.d.ts +548 -0
- package/dist/feeds.types.d.ts.map +1 -0
- package/dist/feeds.types.js +69 -0
- package/dist/feeds.types.js.map +1 -0
- package/dist/fetch.d.ts +6 -0
- package/dist/fetch.d.ts.map +1 -0
- package/dist/fetch.js +37 -0
- package/dist/fetch.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/notes.d.ts +16 -0
- package/dist/notes.d.ts.map +1 -0
- package/dist/notes.js +141 -0
- package/dist/notes.js.map +1 -0
- package/dist/notes.type.d.ts +2 -0
- package/dist/notes.type.d.ts.map +1 -0
- package/dist/notes.type.js +2 -0
- package/dist/notes.type.js.map +1 -0
- package/dist/urls.d.ts +13 -0
- package/dist/urls.d.ts.map +1 -0
- package/dist/urls.js +20 -0
- package/dist/urls.js.map +1 -0
- package/dist/utils.d.ts +9 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +44 -0
- package/dist/utils.js.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,+BAA+B,EAAE,MAAM,kBAAkB,CAAC;AACnE,YAAY,EACV,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,+BAA+B,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/notes.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Pathy } from '@bscotch/pathy';
|
|
2
|
+
import { GameMakerRelease } from './feeds.types.js';
|
|
3
|
+
export declare function listReleaseNotes(releases: GameMakerRelease[], cache?: Pathy | string): Promise<Record<string, {
|
|
4
|
+
version: string;
|
|
5
|
+
url: string;
|
|
6
|
+
title: string | null;
|
|
7
|
+
type: "ide" | "runtime";
|
|
8
|
+
changes: {
|
|
9
|
+
since: string | null;
|
|
10
|
+
groups: {
|
|
11
|
+
title: string;
|
|
12
|
+
changes: string[];
|
|
13
|
+
}[];
|
|
14
|
+
};
|
|
15
|
+
}>>;
|
|
16
|
+
//# sourceMappingURL=notes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notes.d.ts","sourceRoot":"","sources":["../src/notes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAGvC,OAAO,EAEL,gBAAgB,EAIjB,MAAM,kBAAkB,CAAC;AAI1B,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,KAAK,GAAE,KAAK,GAAG,MAA8B;;;;;;;;;;;;IA8B9C"}
|
package/dist/notes.js
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { Pathy } from '@bscotch/pathy';
|
|
2
|
+
import { assert } from '@bscotch/utility/browser';
|
|
3
|
+
import { defaultNotesCachePath } from './constants.js';
|
|
4
|
+
import { rawReleaseNotesCacheSchema, rawReleaseNoteSchema, } from './feeds.types.js';
|
|
5
|
+
import { fetchJson } from './fetch.js';
|
|
6
|
+
import { countNonUnique, findMax } from './utils.js';
|
|
7
|
+
export async function listReleaseNotes(releases, cache = defaultNotesCachePath) {
|
|
8
|
+
const cachePath = Pathy.asInstance(cache).withValidator(rawReleaseNotesCacheSchema);
|
|
9
|
+
assert(cachePath.hasExtension('json'), `Cache path must have a .json extension`);
|
|
10
|
+
const cacheData = await cachePath.read({ fallback: {} });
|
|
11
|
+
for (const release of releases) {
|
|
12
|
+
for (const type of ['ide', 'runtime']) {
|
|
13
|
+
const url = release[type].notesUrl;
|
|
14
|
+
if (cacheData[url]) {
|
|
15
|
+
if (!cacheData[url].type) {
|
|
16
|
+
cacheData[url].type = type;
|
|
17
|
+
await cachePath.write(cacheData);
|
|
18
|
+
}
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
console.info('Notes cache miss:', url);
|
|
22
|
+
const note = await fetchJson(url, rawReleaseNoteSchema);
|
|
23
|
+
cacheData[url] = {
|
|
24
|
+
type,
|
|
25
|
+
...rawReleaseNoteSchema.parse(note),
|
|
26
|
+
};
|
|
27
|
+
await cachePath.write(cacheData);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return cleanNotes(cacheData);
|
|
31
|
+
}
|
|
32
|
+
function cleanNotes(cachedNotes) {
|
|
33
|
+
const rawNotes = Object.entries(cachedNotes).map(([url, note]) => ({
|
|
34
|
+
...note,
|
|
35
|
+
url,
|
|
36
|
+
}));
|
|
37
|
+
// As of writing, all versions from downloaded notes are unique.
|
|
38
|
+
// We'll assume that moving forward, but also throw if that assumption is broken.
|
|
39
|
+
const versions = rawNotes.map((note) => `${note.version} (${note.type})`);
|
|
40
|
+
assert(countNonUnique(versions) === 0, `Duplicate versions found in release notes`);
|
|
41
|
+
// Convert each note into a well-defined structured document.
|
|
42
|
+
const cleanedNotes = rawNotes.map(cleanNote);
|
|
43
|
+
// Try to normalize "since" versions, since they're often only the *last* digits
|
|
44
|
+
for (const note of cleanedNotes) {
|
|
45
|
+
if (!note.changes.since?.match(/^\d+$/)) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const possibleMatches = versions.filter((v) => v.endsWith(`.${note.changes.since}`));
|
|
49
|
+
if (possibleMatches.length === 1) {
|
|
50
|
+
note.changes.since = possibleMatches[0];
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (!possibleMatches.length) {
|
|
54
|
+
// Then just replace the current version with those digits
|
|
55
|
+
note.changes.since = note.version.replace(/\d+$/, note.changes.since);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
// Score matches by digits in common
|
|
59
|
+
const versionParts = note.version.split('.');
|
|
60
|
+
note.changes.since = findMax(possibleMatches, (possibleMatch) => {
|
|
61
|
+
const matchParts = possibleMatch.split('.');
|
|
62
|
+
let score = 0;
|
|
63
|
+
for (let j = 0; j < matchParts.length; j++) {
|
|
64
|
+
score += matchParts[j] === versionParts[j] ? 1 : 0;
|
|
65
|
+
}
|
|
66
|
+
return score;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
// Re-organize into a map for indexing by notes-URL, so that these can be merged
|
|
70
|
+
// into the release feed data.
|
|
71
|
+
const notesByUrl = cleanedNotes.reduce((acc, note) => {
|
|
72
|
+
acc[note.url] = note;
|
|
73
|
+
return acc;
|
|
74
|
+
}, {});
|
|
75
|
+
return notesByUrl;
|
|
76
|
+
}
|
|
77
|
+
function cleanNote(note) {
|
|
78
|
+
assert(note.type, 'Note type must be set');
|
|
79
|
+
const { body, title } = parseHeader(note.release_notes.join(''));
|
|
80
|
+
const groups = parseBody(body);
|
|
81
|
+
const sinceVersion = relativeToVersion(title);
|
|
82
|
+
// Normalize the HTML
|
|
83
|
+
return {
|
|
84
|
+
version: note.version,
|
|
85
|
+
url: note.url,
|
|
86
|
+
title,
|
|
87
|
+
type: note.type,
|
|
88
|
+
changes: {
|
|
89
|
+
since: sinceVersion,
|
|
90
|
+
groups,
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function relativeToVersion(title) {
|
|
95
|
+
if (!title) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
const sinceMatch = title.match(/([0-9.]+)/i);
|
|
99
|
+
return sinceMatch?.[1] || null;
|
|
100
|
+
}
|
|
101
|
+
function parseBody(html) {
|
|
102
|
+
// Split on h3 elements, and then pull out the lists within each
|
|
103
|
+
const parts = html.split(/<h3>\s*(.+?)\s*<\/h3>\s*<ul>\s*(.+?)\s*<\/ul>/g);
|
|
104
|
+
const changes = [];
|
|
105
|
+
for (let groupIdx = 0; groupIdx < parts.length - 2; groupIdx += 3) {
|
|
106
|
+
const [title, list] = [parts[groupIdx + 1], parts[groupIdx + 2]];
|
|
107
|
+
changes.push({ title, changes: parseList(list) });
|
|
108
|
+
}
|
|
109
|
+
return changes;
|
|
110
|
+
}
|
|
111
|
+
function parseList(htmlList) {
|
|
112
|
+
const parts = htmlList.split(/<li>\s*(.+?)\s*<\/li>/g);
|
|
113
|
+
const changes = [];
|
|
114
|
+
for (let groupIdx = 0; groupIdx < parts.length - 1; groupIdx += 2) {
|
|
115
|
+
const change = parts[groupIdx + 1];
|
|
116
|
+
changes.push(change);
|
|
117
|
+
}
|
|
118
|
+
return changes;
|
|
119
|
+
}
|
|
120
|
+
function parseHeader(html) {
|
|
121
|
+
// Remove changelogs from other versions (if there are additional h2 headings, remove
|
|
122
|
+
// those and all below them)
|
|
123
|
+
html = html.trim();
|
|
124
|
+
// If there is an h2 with the word "since" in it (otherwise the first h2), treat that
|
|
125
|
+
// one as the one describing this version and remove everything above and all headers
|
|
126
|
+
// below it.
|
|
127
|
+
const h2s = html.match(/<h2>\s*(.+?)\s*<\/h2>/g);
|
|
128
|
+
if (!h2s?.length) {
|
|
129
|
+
return { title: null, body: html };
|
|
130
|
+
}
|
|
131
|
+
const thisVersionH2 = h2s.find((h2) => h2.match(/\bsince\b/i)) || h2s[0];
|
|
132
|
+
let [, after] = html.split(thisVersionH2);
|
|
133
|
+
const firstH2Index = after.indexOf('<h2>');
|
|
134
|
+
if (firstH2Index > 0) {
|
|
135
|
+
after = after.slice(0, firstH2Index);
|
|
136
|
+
}
|
|
137
|
+
assert(!after.includes('<h2>'), `Somehow still has an h2 after parsing`);
|
|
138
|
+
const [, title] = thisVersionH2.match(/^<h2>\s*(?<title>.+?)\s*<\/h2>/ms);
|
|
139
|
+
return { title, body: after };
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=notes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notes.js","sourceRoot":"","sources":["../src/notes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAIL,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,QAA4B,EAC5B,QAAwB,qBAAqB;IAE7C,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CA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,CAAC;IACnB,qFAAqF;IACrF,qFAAqF;IACrF,YAAY;IACZ,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACjD,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE;QAChB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;KACpC;IACD,MAAM,aAAa,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;IACzE,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,YAAY,GAAG,CAAC,EAAE;QACpB,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;KACtC;IACD,MAAM,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,uCAAuC,CAAC,CAAC;IACzE,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,aAAa,CAAC,KAAK,CAAC,kCAAkC,CAAE,CAAC;IAC3E,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notes.type.d.ts","sourceRoot":"","sources":["../src/notes.type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notes.type.js","sourceRoot":"","sources":["../src/notes.type.ts"],"names":[],"mappings":""}
|
package/dist/urls.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function ideFeedUrls(): {
|
|
2
|
+
lts: "https://gms.yoyogames.com/update-win-LTS.rss";
|
|
3
|
+
stable: "https://gms.yoyogames.com/update-win.rss";
|
|
4
|
+
beta: "https://gms.yoyogames.com/update-win-NuBeta.rss";
|
|
5
|
+
unstable: "https://gms.yoyogames.com/update-win-NuBeta-I.rss";
|
|
6
|
+
};
|
|
7
|
+
export declare function runtimeFeedUrls(): {
|
|
8
|
+
lts: "https://gms.yoyogames.com/Zeus-Runtime-LTS.rss";
|
|
9
|
+
stable: "https://gms.yoyogames.com/Zeus-Runtime.rss";
|
|
10
|
+
beta: "https://gms.yoyogames.com/Zeus-Runtime-NuBeta.rss";
|
|
11
|
+
unstable: "https://gms.yoyogames.com/Zeus-Runtime-NuBeta-I.rss";
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=urls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urls.d.ts","sourceRoot":"","sources":["../src/urls.ts"],"names":[],"mappings":"AAGA,wBAAgB,WAAW;;;;;EAQ1B;AAED,wBAAgB,eAAe;;;;;EAQ9B"}
|
package/dist/urls.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { literal } from '@bscotch/utility/browser';
|
|
2
|
+
export function ideFeedUrls() {
|
|
3
|
+
const prefix = `https://gms.yoyogames.com/update-win`;
|
|
4
|
+
return literal({
|
|
5
|
+
lts: `${prefix}-LTS.rss`,
|
|
6
|
+
stable: `${prefix}.rss`,
|
|
7
|
+
beta: `${prefix}-NuBeta.rss`,
|
|
8
|
+
unstable: `${prefix}-NuBeta-I.rss`,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export function runtimeFeedUrls() {
|
|
12
|
+
const prefix = `https://gms.yoyogames.com/Zeus-Runtime`;
|
|
13
|
+
return literal({
|
|
14
|
+
lts: `${prefix}-LTS.rss`,
|
|
15
|
+
stable: `${prefix}.rss`,
|
|
16
|
+
beta: `${prefix}-NuBeta.rss`,
|
|
17
|
+
unstable: `${prefix}-NuBeta-I.rss`,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=urls.js.map
|
package/dist/urls.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urls.js","sourceRoot":"","sources":["../src/urls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAGnD,MAAM,UAAU,WAAW;IACzB,MAAM,MAAM,GAAG,sCAAsC,CAAC;IACtD,OAAO,OAAO,CAAC;QACb,GAAG,EAAE,GAAG,MAAM,UAAU;QACxB,MAAM,EAAE,GAAG,MAAM,MAAM;QACvB,IAAI,EAAE,GAAG,MAAM,aAAa;QAC5B,QAAQ,EAAE,GAAG,MAAM,eAAe;KACnC,CAAsC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,MAAM,MAAM,GAAG,wCAAwC,CAAC;IACxD,OAAO,OAAO,CAAC;QACb,GAAG,EAAE,GAAG,MAAM,UAAU;QACxB,MAAM,EAAE,GAAG,MAAM,MAAM;QACvB,IAAI,EAAE,GAAG,MAAM,aAAa;QAC5B,QAAQ,EAAE,GAAG,MAAM,eAAe;KACnC,CAAsC,CAAC;AAC1C,CAAC"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export type ArrayItemScore<T> = (item: T, idx: number, items: T[]) => number;
|
|
3
|
+
export declare function findMax<T>(items: T[]): T;
|
|
4
|
+
export declare function findMax<T>(items: T[], byProperty: keyof T): T;
|
|
5
|
+
export declare function findMax<T>(items: T[], score: ArrayItemScore<T>): T;
|
|
6
|
+
export declare function htmlString(): z.ZodEffects<z.ZodString, string, string>;
|
|
7
|
+
export declare function countNonUnique(arr: any[]): number;
|
|
8
|
+
export declare function isError(thing: unknown): thing is Error;
|
|
9
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,MAAM,CAAC;AAC7E,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AAC1C,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;AAC/D,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAwBpE,wBAAgB,UAAU,8CAezB;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,MAAM,CAEjD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAEtD"}
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { assert } from '@bscotch/utility/browser';
|
|
2
|
+
import { decode } from 'entities';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export function findMax(items, propOrFunc) {
|
|
5
|
+
assert(items.length, 'Cannot find max of empty array');
|
|
6
|
+
const score = (item, idx) => propOrFunc === undefined
|
|
7
|
+
? item
|
|
8
|
+
: typeof propOrFunc === 'function'
|
|
9
|
+
? propOrFunc(item, idx, items)
|
|
10
|
+
: item[propOrFunc];
|
|
11
|
+
let maxScore = score(items[0], 0);
|
|
12
|
+
let maxIdx = 0;
|
|
13
|
+
for (let i = 1; i < items.length; i++) {
|
|
14
|
+
const itemScore = score(items[i], i);
|
|
15
|
+
if (itemScore > maxScore) {
|
|
16
|
+
maxScore = itemScore;
|
|
17
|
+
maxIdx = i;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return items[maxIdx];
|
|
21
|
+
}
|
|
22
|
+
export function htmlString() {
|
|
23
|
+
return z.string().transform((s) => {
|
|
24
|
+
if (!s || typeof s !== 'string') {
|
|
25
|
+
return s;
|
|
26
|
+
}
|
|
27
|
+
// decode HTML entities
|
|
28
|
+
s = decode(s.trim());
|
|
29
|
+
// remove anchor targets
|
|
30
|
+
s = s.replace(/\btarget=[^\s>]+/g, '');
|
|
31
|
+
// remove excess space
|
|
32
|
+
s = s.replace(/ +/g, ' ');
|
|
33
|
+
s = s.replace(/\r/g, '');
|
|
34
|
+
s = s.replace(/[\t ]*\n[\t ]*(\n[\t ]*)+/g, '\n\n');
|
|
35
|
+
return s;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export function countNonUnique(arr) {
|
|
39
|
+
return arr.length - new Set(arr).size;
|
|
40
|
+
}
|
|
41
|
+
export function isError(thing) {
|
|
42
|
+
return thing instanceof Error;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,MAAM,UAAU,OAAO,CACrB,KAAU,EACV,UAAwC;IAExC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,gCAAgC,CAAC,CAAC;IACvD,MAAM,KAAK,GAAG,CAAC,IAAO,EAAE,GAAW,EAAE,EAAE,CACrC,UAAU,KAAK,SAAS;QACtB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,OAAO,UAAU,KAAK,UAAU;YAClC,CAAC,CAAC,UAAU,CAAC,IAA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;IACvC,OAAO,GAAG,CAAC,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,KAAc;IACpC,OAAO,KAAK,YAAY,KAAK,CAAC;AAChC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bscotch/gamemaker-releases",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Utility for combining GameMaker release data into a single feed.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"gamemaker",
|
|
7
|
+
"game-maker",
|
|
8
|
+
"release",
|
|
9
|
+
"release-notes",
|
|
10
|
+
"patchnotes",
|
|
11
|
+
"patch-notes",
|
|
12
|
+
"changelog",
|
|
13
|
+
"yoyo",
|
|
14
|
+
"bscotch",
|
|
15
|
+
"stitch",
|
|
16
|
+
"rss",
|
|
17
|
+
"feed"
|
|
18
|
+
],
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/bscotch/gamemaker-info.git",
|
|
22
|
+
"directory": "packages/releases"
|
|
23
|
+
},
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"author": "Butterscotch Shenanigans",
|
|
26
|
+
"type": "module",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"import": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts"
|
|
31
|
+
},
|
|
32
|
+
"./browser": {
|
|
33
|
+
"import": "./dist/browser.js",
|
|
34
|
+
"types": "./dist/browser.d.ts"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"main": "dist/index.js",
|
|
38
|
+
"types": "dist/index.d.ts",
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsc --build",
|
|
41
|
+
"clean": "rimraf build dist *.tsbuildinfo **/*.tsbuildinfo",
|
|
42
|
+
"test": "mocha --config ../../config/.mocharc.cjs",
|
|
43
|
+
"test:dev": "mocha --config ../../config/.mocharc.cjs --forbid-only=false --parallel=false --timeout=9999999999",
|
|
44
|
+
"watch": "tsc --build --watch"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@bscotch/pathy": "^2.5.1",
|
|
48
|
+
"@bscotch/utility": "^6.7.0",
|
|
49
|
+
"entities": "^4.4.0",
|
|
50
|
+
"fast-xml-parser": "^4.0.12",
|
|
51
|
+
"node-fetch": "^3.3.0",
|
|
52
|
+
"tslib": "^2.4.1",
|
|
53
|
+
"zod": "^3.19.1"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@types/chai": "^4",
|
|
57
|
+
"@types/mocha": "^10.0.1",
|
|
58
|
+
"@types/rimraf": "^3",
|
|
59
|
+
"chai": "^4.3.7",
|
|
60
|
+
"mocha": "^10.1.0",
|
|
61
|
+
"rimraf": "^3.0.2",
|
|
62
|
+
"typescript": "^4.9.3"
|
|
63
|
+
},
|
|
64
|
+
"packageManager": "yarn@3.2.4",
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"access": "public"
|
|
67
|
+
}
|
|
68
|
+
}
|