@grove-dev/core 0.17.0 → 0.18.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/dist/build-data.d.ts.map +1 -1
- package/dist/build-data.js +2 -0
- package/dist/build-data.js.map +1 -1
- package/dist/candidate-collector.d.ts +61 -0
- package/dist/candidate-collector.d.ts.map +1 -0
- package/dist/candidate-collector.js +545 -0
- package/dist/candidate-collector.js.map +1 -0
- package/dist/candidate-discovery.d.ts +92 -0
- package/dist/candidate-discovery.d.ts.map +1 -0
- package/dist/candidate-discovery.js +488 -0
- package/dist/candidate-discovery.js.map +1 -0
- package/dist/candidate-schema.d.ts +209 -0
- package/dist/candidate-schema.d.ts.map +1 -0
- package/dist/candidate-schema.js +84 -0
- package/dist/candidate-schema.js.map +1 -0
- package/dist/github-cache.d.ts +87 -1
- package/dist/github-cache.d.ts.map +1 -1
- package/dist/github-cache.js +19 -1
- package/dist/github-cache.js.map +1 -1
- package/dist/image-probe.d.ts +27 -0
- package/dist/image-probe.d.ts.map +1 -0
- package/dist/image-probe.js +124 -0
- package/dist/image-probe.js.map +1 -0
- package/dist/index-policy.d.ts +48 -0
- package/dist/index-policy.d.ts.map +1 -0
- package/dist/index-policy.js +58 -0
- package/dist/index-policy.js.map +1 -0
- package/dist/index.d.ts +16 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/page-document.d.ts +48 -0
- package/dist/page-document.d.ts.map +1 -1
- package/dist/page-document.js +93 -8
- package/dist/page-document.js.map +1 -1
- package/dist/prepare.d.ts.map +1 -1
- package/dist/prepare.js +31 -10
- package/dist/prepare.js.map +1 -1
- package/dist/record-candidates.d.ts +61 -0
- package/dist/record-candidates.d.ts.map +1 -0
- package/dist/record-candidates.js +261 -0
- package/dist/record-candidates.js.map +1 -0
- package/dist/schema.d.ts +78 -18
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +55 -2
- package/dist/schema.js.map +1 -1
- package/dist/sitemap.d.ts +3 -0
- package/dist/sitemap.d.ts.map +1 -1
- package/dist/sitemap.js +2 -0
- package/dist/sitemap.js.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +14 -2
- package/dist/validate.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers for candidate collection: which repository files are
|
|
3
|
+
* worth reading, and what the files and package indexes say. The
|
|
4
|
+
* network side is in `candidate-collector.ts`; nothing here fetches.
|
|
5
|
+
*/
|
|
6
|
+
export interface TreeFile {
|
|
7
|
+
path: string;
|
|
8
|
+
/** Git blob SHA. */
|
|
9
|
+
sha: string;
|
|
10
|
+
/** Size in bytes, as the git tree reports it. */
|
|
11
|
+
size?: number;
|
|
12
|
+
}
|
|
13
|
+
/** True when a path runs through a dependency, docs, test or build directory. */
|
|
14
|
+
export declare function isExcludedPath(path: string): boolean;
|
|
15
|
+
export interface FastlaneFiles {
|
|
16
|
+
/** Directory holding `fastlane/`, e.g. `` or `mobile/android`. */
|
|
17
|
+
root: string;
|
|
18
|
+
locale: string;
|
|
19
|
+
icon?: TreeFile;
|
|
20
|
+
screenshots: TreeFile[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The fastlane (F-Droid / Play) metadata of the repository: its icon
|
|
24
|
+
* and phone screenshots in one locale (en-US first). The shallowest
|
|
25
|
+
* fastlane directory wins when there are several.
|
|
26
|
+
*/
|
|
27
|
+
export declare function findFastlane(files: readonly TreeFile[], maxScreenshots?: number): FastlaneFiles | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Gradle build files of Android app modules, the ones next to a
|
|
30
|
+
* fastlane directory first. They hold the `applicationId` F-Droid
|
|
31
|
+
* lists the app under.
|
|
32
|
+
*/
|
|
33
|
+
export declare function findGradleAppFiles(files: readonly TreeFile[], fastlaneRoot?: string, max?: number): TreeFile[];
|
|
34
|
+
/** Every `applicationId` a Gradle file declares (default config and flavors). */
|
|
35
|
+
export declare function parseGradleApplicationIds(text: string): string[];
|
|
36
|
+
/** AppStream metainfo files, shallowest first. */
|
|
37
|
+
export declare function findMetainfoFiles(files: readonly TreeFile[], max?: number): TreeFile[];
|
|
38
|
+
export interface AppstreamFacts {
|
|
39
|
+
id?: string;
|
|
40
|
+
/** `<icon type="remote">` URLs. */
|
|
41
|
+
icons: string[];
|
|
42
|
+
/** `<screenshot><image>` URLs, source images preferred over thumbnails. */
|
|
43
|
+
screenshots: string[];
|
|
44
|
+
}
|
|
45
|
+
/** The app id, remote icons and screenshots an AppStream metainfo file declares. */
|
|
46
|
+
export declare function parseAppstream(text: string, fileName?: string): AppstreamFacts;
|
|
47
|
+
/** Web app manifests under a web root (`public/`, `static/`, `web/`, …), shallowest first. */
|
|
48
|
+
export declare function findWebManifests(files: readonly TreeFile[], max?: number): TreeFile[];
|
|
49
|
+
/**
|
|
50
|
+
* The best icon a web app manifest declares, resolved to a repository
|
|
51
|
+
* path: `/x.png` against the manifest's directory (the web root), a
|
|
52
|
+
* relative `src` against the same directory. Maskable-only and
|
|
53
|
+
* monochrome icons are skipped; SVG, then the largest size, wins.
|
|
54
|
+
*/
|
|
55
|
+
export declare function pickManifestIcon(text: string, manifestPath: string): string | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Files that look like the app's own logo: `logo*` / `icon*` /
|
|
58
|
+
* `<repo>-logo*` PNG, SVG or WebP inside an asset directory
|
|
59
|
+
* (`assets/`, `public/`, `branding/`, …). Favicon-sized files, banners
|
|
60
|
+
* and anything under a dependency, docs or test directory are skipped.
|
|
61
|
+
* SVG first, then shallower paths.
|
|
62
|
+
*/
|
|
63
|
+
export declare function findAssetLogos(files: readonly TreeFile[], repo: string, max?: number): TreeFile[];
|
|
64
|
+
/** Installable release assets grouped by platform, names sorted. */
|
|
65
|
+
export declare function installableAssets(names: readonly string[]): Map<string, string[]>;
|
|
66
|
+
export interface RepologyPackage {
|
|
67
|
+
repo?: string;
|
|
68
|
+
srcname?: string;
|
|
69
|
+
binname?: string;
|
|
70
|
+
visiblename?: string;
|
|
71
|
+
version?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface RepologyChannel {
|
|
74
|
+
type: string;
|
|
75
|
+
platform: string;
|
|
76
|
+
label: string;
|
|
77
|
+
url: string;
|
|
78
|
+
/** Repology repository id. */
|
|
79
|
+
repository: string;
|
|
80
|
+
packageName: string;
|
|
81
|
+
version?: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* One channel per package repository Grove knows how to link to
|
|
85
|
+
* (Homebrew, AUR, Nixpkgs, Scoop, winget, Chocolatey, Snapcraft,
|
|
86
|
+
* Flathub, F-Droid); every other repository Repology tracks is left
|
|
87
|
+
* out. Sorted by repository id.
|
|
88
|
+
*/
|
|
89
|
+
export declare function repologyChannels(packages: readonly RepologyPackage[]): RepologyChannel[];
|
|
90
|
+
/** Compare a release tag with a package version, ignoring a leading `v`. */
|
|
91
|
+
export declare function sameVersion(tag: string | undefined, version: string | undefined): boolean;
|
|
92
|
+
//# sourceMappingURL=candidate-discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"candidate-discovery.d.ts","sourceRoot":"","sources":["../src/candidate-discovery.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AA8ED,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGpD;AAoCD,MAAM,WAAW,aAAa;IAC5B,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,WAAW,EAAE,QAAQ,EAAE,CAAC;CACzB;AA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M,EAAE,CAAC,CAYjF;AAID,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA2ED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,SAAS,eAAe,EAAE,GAAG,eAAe,EAAE,CA0BxF;AAED,4EAA4E;AAC5E,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAQzF"}
|
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers for candidate collection: which repository files are
|
|
3
|
+
* worth reading, and what the files and package indexes say. The
|
|
4
|
+
* network side is in `candidate-collector.ts`; nothing here fetches.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Directories never searched: dependencies and vendored code (their
|
|
8
|
+
* icons belong to someone else), docs and `.github` (README images),
|
|
9
|
+
* tests, examples and build output.
|
|
10
|
+
*/
|
|
11
|
+
const EXCLUDED_DIRS = new Set([
|
|
12
|
+
'node_modules',
|
|
13
|
+
'bower_components',
|
|
14
|
+
'jspm_packages',
|
|
15
|
+
'vendor',
|
|
16
|
+
'vendors',
|
|
17
|
+
'third_party',
|
|
18
|
+
'third-party',
|
|
19
|
+
'thirdparty',
|
|
20
|
+
'external',
|
|
21
|
+
'externals',
|
|
22
|
+
'deps',
|
|
23
|
+
'pods',
|
|
24
|
+
'carthage',
|
|
25
|
+
'.github',
|
|
26
|
+
'.gitlab',
|
|
27
|
+
'docs',
|
|
28
|
+
'doc',
|
|
29
|
+
'documentation',
|
|
30
|
+
'wiki',
|
|
31
|
+
'test',
|
|
32
|
+
'tests',
|
|
33
|
+
'__tests__',
|
|
34
|
+
'__mocks__',
|
|
35
|
+
'spec',
|
|
36
|
+
'fixtures',
|
|
37
|
+
'testdata',
|
|
38
|
+
'example',
|
|
39
|
+
'examples',
|
|
40
|
+
'sample',
|
|
41
|
+
'samples',
|
|
42
|
+
'demo',
|
|
43
|
+
'demos',
|
|
44
|
+
'dist',
|
|
45
|
+
'build',
|
|
46
|
+
'out',
|
|
47
|
+
'target',
|
|
48
|
+
'.dart_tool',
|
|
49
|
+
'.yarn',
|
|
50
|
+
'.git',
|
|
51
|
+
]);
|
|
52
|
+
/** Words in a file name that mark a banner, card or README image, never a logo. */
|
|
53
|
+
const EXCLUDED_NAME = /banner|screenshot|screen[-_]?shot|readme|social|og[-_]?image|opengraph|preview|cover|header|hero|splash|feature[-_]?graphic|promo|sponsor|badge|wallpaper|mockup|showcase|tv[-_]?banner/i;
|
|
54
|
+
/** Directories an app keeps its own brand assets in. */
|
|
55
|
+
const ASSET_DIRS = new Set([
|
|
56
|
+
'assets',
|
|
57
|
+
'asset',
|
|
58
|
+
'public',
|
|
59
|
+
'static',
|
|
60
|
+
'resources',
|
|
61
|
+
'branding',
|
|
62
|
+
'brand',
|
|
63
|
+
'logo',
|
|
64
|
+
'logos',
|
|
65
|
+
'icons',
|
|
66
|
+
'packaging',
|
|
67
|
+
'art',
|
|
68
|
+
'artwork',
|
|
69
|
+
'media',
|
|
70
|
+
]);
|
|
71
|
+
const IMAGE_EXT = /\.(png|svg|webp)$/i;
|
|
72
|
+
const SCREENSHOT_EXT = /\.(png|jpe?g|webp)$/i;
|
|
73
|
+
function segments(path) {
|
|
74
|
+
return path.split('/');
|
|
75
|
+
}
|
|
76
|
+
/** True when a path runs through a dependency, docs, test or build directory. */
|
|
77
|
+
export function isExcludedPath(path) {
|
|
78
|
+
const parts = segments(path);
|
|
79
|
+
return parts.slice(0, -1).some((part) => EXCLUDED_DIRS.has(part.toLowerCase()));
|
|
80
|
+
}
|
|
81
|
+
function basename(path) {
|
|
82
|
+
return path.slice(path.lastIndexOf('/') + 1);
|
|
83
|
+
}
|
|
84
|
+
function dirname(path) {
|
|
85
|
+
const i = path.lastIndexOf('/');
|
|
86
|
+
return i < 0 ? '' : path.slice(0, i);
|
|
87
|
+
}
|
|
88
|
+
function depth(path) {
|
|
89
|
+
return segments(path).length;
|
|
90
|
+
}
|
|
91
|
+
function escapeRegex(text) {
|
|
92
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
93
|
+
}
|
|
94
|
+
const LOGO_MODIFIER = '(?:\\d+(?:x\\d+)?|\\d+px|@?\\dx|light|dark|colou?r(?:ed)?|full|square|round(?:ed)?|mark|white|black|transparent|large|mono(?:chrome)?|text|horizontal|vertical|wordmark|primary|default|rounded)';
|
|
95
|
+
function logoNamePattern(repo) {
|
|
96
|
+
const name = escapeRegex(repo.toLowerCase());
|
|
97
|
+
return new RegExp(`^(?:${name}[-_ ]?)?(?:app[-_ ]?)?(?:logo|icon|logomark|logo[-_]mark)(?:[-_.@ ]?${LOGO_MODIFIER})*$`, 'i');
|
|
98
|
+
}
|
|
99
|
+
/** A size encoded in a file name (`icon-32`, `logo_16x16`), when there is one. */
|
|
100
|
+
function namedSize(name) {
|
|
101
|
+
const match = /(?:^|[-_.@x])(\d{2,4})(?:x\d{2,4})?(?:px)?(?:$|[-_.@])/i.exec(name);
|
|
102
|
+
return match ? Number(match[1]) : undefined;
|
|
103
|
+
}
|
|
104
|
+
const FASTLANE = /^(?:(.*)\/)?fastlane\/metadata\/android\/([^/]+)\/images\/(.+)$/;
|
|
105
|
+
const LOCALE_PREFERENCE = ['en-US', 'en-GB', 'en'];
|
|
106
|
+
function pickLocale(locales) {
|
|
107
|
+
for (const preferred of LOCALE_PREFERENCE)
|
|
108
|
+
if (locales.includes(preferred))
|
|
109
|
+
return preferred;
|
|
110
|
+
return [...locales].sort()[0];
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* The fastlane (F-Droid / Play) metadata of the repository: its icon
|
|
114
|
+
* and phone screenshots in one locale (en-US first). The shallowest
|
|
115
|
+
* fastlane directory wins when there are several.
|
|
116
|
+
*/
|
|
117
|
+
export function findFastlane(files, maxScreenshots = 8) {
|
|
118
|
+
const byRoot = new Map();
|
|
119
|
+
for (const file of files) {
|
|
120
|
+
const match = FASTLANE.exec(file.path);
|
|
121
|
+
if (!match || isExcludedPath(file.path))
|
|
122
|
+
continue;
|
|
123
|
+
const root = match[1] ?? '';
|
|
124
|
+
const locale = match[2] ?? '';
|
|
125
|
+
const rest = match[3] ?? '';
|
|
126
|
+
const locales = byRoot.get(root) ?? new Map();
|
|
127
|
+
byRoot.set(root, locales);
|
|
128
|
+
const bucket = locales.get(locale) ?? { screenshots: [] };
|
|
129
|
+
locales.set(locale, bucket);
|
|
130
|
+
if (/^icon\.(png|jpe?g|webp)$/i.test(rest))
|
|
131
|
+
bucket.icon = file;
|
|
132
|
+
else if (/^phoneScreenshots\/[^/]+$/.test(rest) && SCREENSHOT_EXT.test(rest)) {
|
|
133
|
+
bucket.screenshots.push(file);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
const roots = [...byRoot.keys()].sort((a, b) => depth(a) - depth(b) || a.localeCompare(b));
|
|
137
|
+
for (const root of roots) {
|
|
138
|
+
const locales = byRoot.get(root);
|
|
139
|
+
if (!locales)
|
|
140
|
+
continue;
|
|
141
|
+
const withContent = [...locales.entries()].filter(([, bucket]) => bucket.icon || bucket.screenshots.length > 0);
|
|
142
|
+
const locale = pickLocale(withContent.map(([name]) => name));
|
|
143
|
+
const bucket = locale ? locales.get(locale) : undefined;
|
|
144
|
+
if (!locale || !bucket)
|
|
145
|
+
continue;
|
|
146
|
+
const screenshots = [...bucket.screenshots]
|
|
147
|
+
.sort((a, b) => a.path.localeCompare(b.path, 'en', { numeric: true }))
|
|
148
|
+
.slice(0, maxScreenshots);
|
|
149
|
+
return { root, locale, ...(bucket.icon ? { icon: bucket.icon } : {}), screenshots };
|
|
150
|
+
}
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Gradle build files of Android app modules, the ones next to a
|
|
155
|
+
* fastlane directory first. They hold the `applicationId` F-Droid
|
|
156
|
+
* lists the app under.
|
|
157
|
+
*/
|
|
158
|
+
export function findGradleAppFiles(files, fastlaneRoot, max = 2) {
|
|
159
|
+
const all = files.filter((file) => {
|
|
160
|
+
if (isExcludedPath(file.path))
|
|
161
|
+
return false;
|
|
162
|
+
if (!/(^|\/)build\.gradle(\.kts)?$/.test(file.path))
|
|
163
|
+
return false;
|
|
164
|
+
const dir = dirname(file.path);
|
|
165
|
+
return basename(dir) === 'app' || /(^|\/)android(\/|$)/.test(dir);
|
|
166
|
+
});
|
|
167
|
+
// `applicationId` lives in the app module; a root build file is
|
|
168
|
+
// only worth reading when there is no `app/` module at all.
|
|
169
|
+
const appModules = all.filter((file) => basename(dirname(file.path)) === 'app');
|
|
170
|
+
const gradle = appModules.length > 0 ? appModules : all;
|
|
171
|
+
const near = (path) => fastlaneRoot !== undefined && (fastlaneRoot === '' || path.startsWith(`${fastlaneRoot}/`))
|
|
172
|
+
? 0
|
|
173
|
+
: 1;
|
|
174
|
+
const isAppModule = (path) => (basename(dirname(path)) === 'app' ? 0 : 1);
|
|
175
|
+
return gradle
|
|
176
|
+
.sort((a, b) => near(a.path) - near(b.path) ||
|
|
177
|
+
isAppModule(a.path) - isAppModule(b.path) ||
|
|
178
|
+
depth(a.path) - depth(b.path) ||
|
|
179
|
+
a.path.localeCompare(b.path))
|
|
180
|
+
.slice(0, max);
|
|
181
|
+
}
|
|
182
|
+
/** Every `applicationId` a Gradle file declares (default config and flavors). */
|
|
183
|
+
export function parseGradleApplicationIds(text) {
|
|
184
|
+
const ids = new Set();
|
|
185
|
+
const pattern = /\bapplicationId\s*(?:=\s*)?\(?\s*["']([A-Za-z][\w]*(?:\.[A-Za-z_][\w]*)+)["']/g;
|
|
186
|
+
for (const match of text.matchAll(pattern))
|
|
187
|
+
if (match[1])
|
|
188
|
+
ids.add(match[1]);
|
|
189
|
+
return [...ids];
|
|
190
|
+
}
|
|
191
|
+
const METAINFO = /\.(metainfo|appdata)\.xml(\.in)?$/i;
|
|
192
|
+
/** AppStream metainfo files, shallowest first. */
|
|
193
|
+
export function findMetainfoFiles(files, max = 2) {
|
|
194
|
+
return files
|
|
195
|
+
.filter((file) => METAINFO.test(file.path) && !isExcludedPath(file.path))
|
|
196
|
+
.sort((a, b) => depth(a.path) - depth(b.path) || a.path.localeCompare(b.path))
|
|
197
|
+
.slice(0, max);
|
|
198
|
+
}
|
|
199
|
+
function decodeXml(text) {
|
|
200
|
+
return text
|
|
201
|
+
.replace(/<!\[CDATA\[([\s\S]*?)\]\]>/g, '$1')
|
|
202
|
+
.replace(/&/g, '&')
|
|
203
|
+
.replace(/</g, '<')
|
|
204
|
+
.replace(/>/g, '>')
|
|
205
|
+
.replace(/"/g, '"')
|
|
206
|
+
.replace(/'/g, "'")
|
|
207
|
+
.trim();
|
|
208
|
+
}
|
|
209
|
+
/** The app id, remote icons and screenshots an AppStream metainfo file declares. */
|
|
210
|
+
export function parseAppstream(text, fileName = '') {
|
|
211
|
+
const withoutComments = text.replace(/<!--[\s\S]*?-->/g, '');
|
|
212
|
+
const rawId = /<id(?:\s[^>]*)?>([^<]+)<\/id>/.exec(withoutComments)?.[1];
|
|
213
|
+
const fromFile = basename(fileName).replace(METAINFO, '');
|
|
214
|
+
const id = (rawId ? decodeXml(rawId) : fromFile).replace(/\.desktop$/, '') || undefined;
|
|
215
|
+
const icons = [];
|
|
216
|
+
for (const match of withoutComments.matchAll(/<icon\b([^>]*)>([^<]+)<\/icon>/g)) {
|
|
217
|
+
if (/type\s*=\s*["']remote["']/.test(match[1] ?? '') && match[2])
|
|
218
|
+
icons.push(decodeXml(match[2]));
|
|
219
|
+
}
|
|
220
|
+
const screenshots = [];
|
|
221
|
+
for (const shot of withoutComments.matchAll(/<screenshot\b[^>]*>([\s\S]*?)<\/screenshot>/g)) {
|
|
222
|
+
const images = [...(shot[1] ?? '').matchAll(/<image\b([^>]*)>([^<]+)<\/image>/g)];
|
|
223
|
+
const source = images.find((m) => !/type\s*=\s*["']thumbnail["']/.test(m[1] ?? ''));
|
|
224
|
+
const url = source?.[2] ?? images[0]?.[2];
|
|
225
|
+
if (url)
|
|
226
|
+
screenshots.push(decodeXml(url));
|
|
227
|
+
}
|
|
228
|
+
return {
|
|
229
|
+
...(id && /^[\w.-]+$/.test(id) ? { id } : {}),
|
|
230
|
+
icons: [...new Set(icons)].filter((u) => /^https?:\/\//.test(u)),
|
|
231
|
+
screenshots: [...new Set(screenshots)].filter((u) => /^https?:\/\//.test(u)),
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
const MANIFEST = /(^|\/)(manifest\.json|manifest\.webmanifest|site\.webmanifest|[\w.-]+\.webmanifest)$/i;
|
|
235
|
+
/** Web app manifests under a web root (`public/`, `static/`, `web/`, …), shallowest first. */
|
|
236
|
+
export function findWebManifests(files, max = 2) {
|
|
237
|
+
return files
|
|
238
|
+
.filter((file) => {
|
|
239
|
+
if (!MANIFEST.test(file.path) || isExcludedPath(file.path))
|
|
240
|
+
return false;
|
|
241
|
+
if (/\.webmanifest$/i.test(file.path))
|
|
242
|
+
return true;
|
|
243
|
+
// `manifest.json` is also a browser-extension and tooling file
|
|
244
|
+
// name; only look at the ones in a web root.
|
|
245
|
+
return segments(file.path)
|
|
246
|
+
.slice(0, -1)
|
|
247
|
+
.some((part) => ['public', 'static', 'web', 'www', 'app'].includes(part.toLowerCase()));
|
|
248
|
+
})
|
|
249
|
+
.sort((a, b) => depth(a.path) - depth(b.path) || a.path.localeCompare(b.path))
|
|
250
|
+
.slice(0, max);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* The best icon a web app manifest declares, resolved to a repository
|
|
254
|
+
* path: `/x.png` against the manifest's directory (the web root), a
|
|
255
|
+
* relative `src` against the same directory. Maskable-only and
|
|
256
|
+
* monochrome icons are skipped; SVG, then the largest size, wins.
|
|
257
|
+
*/
|
|
258
|
+
export function pickManifestIcon(text, manifestPath) {
|
|
259
|
+
let json;
|
|
260
|
+
try {
|
|
261
|
+
json = JSON.parse(text);
|
|
262
|
+
}
|
|
263
|
+
catch {
|
|
264
|
+
return undefined;
|
|
265
|
+
}
|
|
266
|
+
const manifest = json;
|
|
267
|
+
if (!manifest || typeof manifest !== 'object' || 'manifest_version' in manifest)
|
|
268
|
+
return undefined;
|
|
269
|
+
if (!Array.isArray(manifest.icons))
|
|
270
|
+
return undefined;
|
|
271
|
+
const root = dirname(manifestPath);
|
|
272
|
+
let best;
|
|
273
|
+
for (const raw of manifest.icons) {
|
|
274
|
+
const icon = raw;
|
|
275
|
+
const src = typeof icon?.src === 'string' ? icon.src.split(/[?#]/)[0] : undefined;
|
|
276
|
+
if (!src || /^[a-z]+:/i.test(src) || src.startsWith('//'))
|
|
277
|
+
continue;
|
|
278
|
+
// Splash screens and tiles ride along in generated manifests.
|
|
279
|
+
if (!IMAGE_EXT.test(src) || EXCLUDED_NAME.test(basename(src)))
|
|
280
|
+
continue;
|
|
281
|
+
const purpose = typeof icon.purpose === 'string' ? icon.purpose.split(/\s+/) : ['any'];
|
|
282
|
+
if (!purpose.includes('any'))
|
|
283
|
+
continue;
|
|
284
|
+
const sizes = typeof icon.sizes === 'string' ? icon.sizes : '';
|
|
285
|
+
const largest = Math.max(0, ...sizes.split(/\s+/).map((s) => Number(/^(\d+)x\d+$/i.exec(s)?.[1] ?? 0)));
|
|
286
|
+
const score = /\.svg$/i.test(src) || sizes === 'any' ? 100_000 : largest;
|
|
287
|
+
const joined = src.startsWith('/') ? `${root}${src}` : `${root}/${src}`;
|
|
288
|
+
const path = normalizePath(joined);
|
|
289
|
+
if (!best || score > best.score)
|
|
290
|
+
best = { path, score };
|
|
291
|
+
}
|
|
292
|
+
return best?.path;
|
|
293
|
+
}
|
|
294
|
+
/** The path up to the first asset directory: the package a file belongs to. */
|
|
295
|
+
function packageRoot(path) {
|
|
296
|
+
const parts = segments(path).slice(0, -1);
|
|
297
|
+
const i = parts.findIndex((part) => ASSET_DIRS.has(part.toLowerCase()));
|
|
298
|
+
return parts.slice(0, i < 0 ? parts.length : i).join('/');
|
|
299
|
+
}
|
|
300
|
+
function normalizePath(path) {
|
|
301
|
+
const out = [];
|
|
302
|
+
for (const part of path.split('/')) {
|
|
303
|
+
if (part === '' || part === '.')
|
|
304
|
+
continue;
|
|
305
|
+
if (part === '..')
|
|
306
|
+
out.pop();
|
|
307
|
+
else
|
|
308
|
+
out.push(part);
|
|
309
|
+
}
|
|
310
|
+
return out.join('/');
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Files that look like the app's own logo: `logo*` / `icon*` /
|
|
314
|
+
* `<repo>-logo*` PNG, SVG or WebP inside an asset directory
|
|
315
|
+
* (`assets/`, `public/`, `branding/`, …). Favicon-sized files, banners
|
|
316
|
+
* and anything under a dependency, docs or test directory are skipped.
|
|
317
|
+
* SVG first, then shallower paths.
|
|
318
|
+
*/
|
|
319
|
+
export function findAssetLogos(files, repo, max = 3) {
|
|
320
|
+
const pattern = logoNamePattern(repo);
|
|
321
|
+
const matches = files.filter((file) => {
|
|
322
|
+
if (!IMAGE_EXT.test(file.path) || isExcludedPath(file.path))
|
|
323
|
+
return false;
|
|
324
|
+
const name = basename(file.path).replace(IMAGE_EXT, '');
|
|
325
|
+
if (EXCLUDED_NAME.test(name) || !pattern.test(name))
|
|
326
|
+
return false;
|
|
327
|
+
const size = namedSize(name);
|
|
328
|
+
if (size !== undefined && size < 128)
|
|
329
|
+
return false;
|
|
330
|
+
const dirs = segments(file.path).slice(0, -1);
|
|
331
|
+
return dirs.some((part) => ASSET_DIRS.has(part.toLowerCase()));
|
|
332
|
+
});
|
|
333
|
+
// The same file name in three or more sibling packages
|
|
334
|
+
// (`addons/*/resources/icon.png`, `apps/*/public/logo.svg`) is a
|
|
335
|
+
// plugin or package convention, not the app's logo.
|
|
336
|
+
const parents = new Map();
|
|
337
|
+
for (const file of matches) {
|
|
338
|
+
const name = basename(file.path).toLowerCase();
|
|
339
|
+
const set = parents.get(name) ?? new Set();
|
|
340
|
+
set.add(packageRoot(file.path));
|
|
341
|
+
parents.set(name, set);
|
|
342
|
+
}
|
|
343
|
+
return matches
|
|
344
|
+
.filter((file) => (parents.get(basename(file.path).toLowerCase())?.size ?? 0) < 3)
|
|
345
|
+
.sort((a, b) => {
|
|
346
|
+
const svg = (path) => (/\.svg$/i.test(path) ? 0 : 1);
|
|
347
|
+
return (svg(a.path) - svg(b.path) || depth(a.path) - depth(b.path) || a.path.localeCompare(b.path));
|
|
348
|
+
})
|
|
349
|
+
.slice(0, max);
|
|
350
|
+
}
|
|
351
|
+
// ── Release assets ─────────────────────────────────────────────────
|
|
352
|
+
const INSTALLABLE = [
|
|
353
|
+
[/\.apk$/i, 'android'],
|
|
354
|
+
[/\.ipa$/i, 'ios'],
|
|
355
|
+
[/\.(dmg|pkg)$/i, 'macos'],
|
|
356
|
+
[/\.(msi|msix|exe)$/i, 'windows'],
|
|
357
|
+
[/\.(appimage|deb|rpm|flatpak|snap)$/i, 'linux'],
|
|
358
|
+
];
|
|
359
|
+
/** Assets that are not for end users even with an installable extension. */
|
|
360
|
+
const NOT_FOR_USERS = /debug|symbols|unsigned|uninstall|\.blockmap$/i;
|
|
361
|
+
/** Installable release assets grouped by platform, names sorted. */
|
|
362
|
+
export function installableAssets(names) {
|
|
363
|
+
const byPlatform = new Map();
|
|
364
|
+
for (const name of names) {
|
|
365
|
+
if (NOT_FOR_USERS.test(name))
|
|
366
|
+
continue;
|
|
367
|
+
const platform = INSTALLABLE.find(([pattern]) => pattern.test(name))?.[1];
|
|
368
|
+
if (!platform)
|
|
369
|
+
continue;
|
|
370
|
+
const list = byPlatform.get(platform) ?? [];
|
|
371
|
+
list.push(name);
|
|
372
|
+
byPlatform.set(platform, list);
|
|
373
|
+
}
|
|
374
|
+
for (const list of byPlatform.values())
|
|
375
|
+
list.sort();
|
|
376
|
+
return byPlatform;
|
|
377
|
+
}
|
|
378
|
+
const REPOLOGY_REPOS = {
|
|
379
|
+
homebrew: {
|
|
380
|
+
type: 'package-manager',
|
|
381
|
+
platform: 'macos',
|
|
382
|
+
label: 'Homebrew',
|
|
383
|
+
url: (n) => `https://formulae.brew.sh/formula/${n}`,
|
|
384
|
+
},
|
|
385
|
+
homebrew_casks: {
|
|
386
|
+
type: 'package-manager',
|
|
387
|
+
platform: 'macos',
|
|
388
|
+
label: 'Homebrew Cask',
|
|
389
|
+
url: (n) => `https://formulae.brew.sh/cask/${n}`,
|
|
390
|
+
},
|
|
391
|
+
aur: {
|
|
392
|
+
type: 'package-manager',
|
|
393
|
+
platform: 'linux',
|
|
394
|
+
label: 'AUR',
|
|
395
|
+
url: (n) => `https://aur.archlinux.org/packages/${n}`,
|
|
396
|
+
},
|
|
397
|
+
arch: {
|
|
398
|
+
type: 'package-manager',
|
|
399
|
+
platform: 'linux',
|
|
400
|
+
label: 'Arch Linux',
|
|
401
|
+
url: (n) => `https://archlinux.org/packages/?q=${n}`,
|
|
402
|
+
},
|
|
403
|
+
nix_unstable: {
|
|
404
|
+
type: 'package-manager',
|
|
405
|
+
platform: 'linux',
|
|
406
|
+
label: 'Nixpkgs',
|
|
407
|
+
url: (n) => `https://search.nixos.org/packages?channel=unstable&query=${n}`,
|
|
408
|
+
},
|
|
409
|
+
scoop: {
|
|
410
|
+
type: 'package-manager',
|
|
411
|
+
platform: 'windows',
|
|
412
|
+
label: 'Scoop',
|
|
413
|
+
url: (n) => `https://scoop.sh/#/apps?q=${n}`,
|
|
414
|
+
},
|
|
415
|
+
chocolatey: {
|
|
416
|
+
type: 'package-manager',
|
|
417
|
+
platform: 'windows',
|
|
418
|
+
label: 'Chocolatey',
|
|
419
|
+
url: (n) => `https://community.chocolatey.org/packages/${n}`,
|
|
420
|
+
},
|
|
421
|
+
winget: {
|
|
422
|
+
type: 'package-manager',
|
|
423
|
+
platform: 'windows',
|
|
424
|
+
label: 'winget',
|
|
425
|
+
url: (n) => `https://github.com/microsoft/winget-pkgs/tree/master/manifests/${n.charAt(0).toLowerCase()}/${n.replace(/\./g, '/')}`,
|
|
426
|
+
},
|
|
427
|
+
snapcraft: {
|
|
428
|
+
type: 'snapcraft',
|
|
429
|
+
platform: 'linux',
|
|
430
|
+
label: 'Snapcraft',
|
|
431
|
+
url: (n) => `https://snapcraft.io/${n}`,
|
|
432
|
+
},
|
|
433
|
+
flathub: {
|
|
434
|
+
type: 'flathub',
|
|
435
|
+
platform: 'linux',
|
|
436
|
+
label: 'Flathub',
|
|
437
|
+
url: (n) => `https://flathub.org/apps/${n}`,
|
|
438
|
+
},
|
|
439
|
+
fdroid: {
|
|
440
|
+
type: 'fdroid',
|
|
441
|
+
platform: 'android',
|
|
442
|
+
label: 'F-Droid',
|
|
443
|
+
url: (n) => `https://f-droid.org/packages/${n}/`,
|
|
444
|
+
},
|
|
445
|
+
};
|
|
446
|
+
/**
|
|
447
|
+
* One channel per package repository Grove knows how to link to
|
|
448
|
+
* (Homebrew, AUR, Nixpkgs, Scoop, winget, Chocolatey, Snapcraft,
|
|
449
|
+
* Flathub, F-Droid); every other repository Repology tracks is left
|
|
450
|
+
* out. Sorted by repository id.
|
|
451
|
+
*/
|
|
452
|
+
export function repologyChannels(packages) {
|
|
453
|
+
const byRepo = new Map();
|
|
454
|
+
const sorted = [...packages].sort((a, b) => (a.repo ?? '').localeCompare(b.repo ?? '') ||
|
|
455
|
+
(a.srcname ?? a.binname ?? '').localeCompare(b.srcname ?? b.binname ?? ''));
|
|
456
|
+
for (const pkg of sorted) {
|
|
457
|
+
const repo = pkg.repo ?? '';
|
|
458
|
+
const known = REPOLOGY_REPOS[repo];
|
|
459
|
+
if (!known || byRepo.has(repo))
|
|
460
|
+
continue;
|
|
461
|
+
// AUR, Arch and Nixpkgs are searched by binary name; the others by source name.
|
|
462
|
+
const byBinary = repo === 'aur' || repo === 'arch' || repo === 'nix_unstable';
|
|
463
|
+
const name = byBinary ? (pkg.binname ?? pkg.srcname) : (pkg.srcname ?? pkg.binname);
|
|
464
|
+
if (!name || !/^[\w@.+-]+$/.test(name))
|
|
465
|
+
continue;
|
|
466
|
+
byRepo.set(repo, {
|
|
467
|
+
type: known.type,
|
|
468
|
+
platform: known.platform,
|
|
469
|
+
label: known.label,
|
|
470
|
+
url: known.url(name),
|
|
471
|
+
repository: repo,
|
|
472
|
+
packageName: name,
|
|
473
|
+
...(pkg.version ? { version: pkg.version } : {}),
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
return [...byRepo.values()];
|
|
477
|
+
}
|
|
478
|
+
/** Compare a release tag with a package version, ignoring a leading `v`. */
|
|
479
|
+
export function sameVersion(tag, version) {
|
|
480
|
+
if (!tag || !version)
|
|
481
|
+
return false;
|
|
482
|
+
const clean = (v) => v
|
|
483
|
+
.trim()
|
|
484
|
+
.replace(/^v(?=\d)/i, '')
|
|
485
|
+
.toLowerCase();
|
|
486
|
+
return clean(tag) === clean(version) || clean(tag).endsWith(`-${clean(version)}`);
|
|
487
|
+
}
|
|
488
|
+
//# sourceMappingURL=candidate-discovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"candidate-discovery.js","sourceRoot":"","sources":["../src/candidate-discovery.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH;;;;GAIG;AACH,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,cAAc;IACd,kBAAkB;IAClB,eAAe;IACf,QAAQ;IACR,SAAS;IACT,aAAa;IACb,aAAa;IACb,YAAY;IACZ,UAAU;IACV,WAAW;IACX,MAAM;IACN,MAAM;IACN,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