@acrylblends/blends-frame 0.1.5 → 0.1.6
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/lib/client.js +49 -7
- package/lib/client.js.map +1 -1
- package/lib/contract.d.ts +3 -0
- package/lib/index.js +3 -2
- package/lib/index.js.map +1 -1
- package/lib/types/client/registry-list.d.ts +6 -4
- package/lib/types/contract.d.ts +3 -0
- package/package.json +2 -2
package/lib/contract.d.ts
CHANGED
|
@@ -331,6 +331,8 @@ export interface AppReloadView {
|
|
|
331
331
|
/** @throws an Error naming the field when the answer is not an app reload view. */
|
|
332
332
|
export declare function parseAppReloadView(value: unknown): AppReloadView;
|
|
333
333
|
/** What a plugin of the registry offers, as the registry's index lists it (`https://cordisplugins.github.io/registry/index.json`, formatVersion 1). */
|
|
334
|
+
/** Official: released from one of the project's organisations; community: from anyone else. The registry decides it from the repository owner's GitHub id. */
|
|
335
|
+
export type RegistryOrigin = 'official' | 'community';
|
|
334
336
|
export interface RegistryEntryView {
|
|
335
337
|
/** The plugin's name; a scoped name keeps its scope. */
|
|
336
338
|
readonly name: string;
|
|
@@ -344,6 +346,7 @@ export interface RegistryEntryView {
|
|
|
344
346
|
readonly published?: string;
|
|
345
347
|
/** Where it runs: `ACRYL` (needs an ACRYL service), `Both`, or `DSH stock` (a Harness plugin, which an app of this kind cannot run). */
|
|
346
348
|
readonly compatibility: string;
|
|
349
|
+
readonly origin: RegistryOrigin;
|
|
347
350
|
/** The source a pull takes: `github:<owner>/<repo>@<version>`. */
|
|
348
351
|
readonly source: string;
|
|
349
352
|
/** This app already has a plugin of this name or pulled from this source. */
|
package/lib/index.js
CHANGED
|
@@ -1302,7 +1302,7 @@ function registryEntries(index, marks) {
|
|
|
1302
1302
|
const entries = [];
|
|
1303
1303
|
for (const entry of index.entries) {
|
|
1304
1304
|
if (!isRecord$1(entry)) continue;
|
|
1305
|
-
const { name, description, repo, version, published, compatibility, acrylPull, install, native } = entry;
|
|
1305
|
+
const { name, description, repo, version, published, compatibility, origin, acrylPull, install, native } = entry;
|
|
1306
1306
|
const pull = typeof acrylPull === "string" ? acrylPull : typeof install === "string" ? install : void 0;
|
|
1307
1307
|
if (typeof name !== "string" || typeof repo !== "string" || typeof version !== "string" || pull === void 0) continue;
|
|
1308
1308
|
const source = SOURCE.exec(pull)?.[0];
|
|
@@ -1319,13 +1319,14 @@ function registryEntries(index, marks) {
|
|
|
1319
1319
|
version,
|
|
1320
1320
|
...typeof published === "string" && /^\d{4}-\d{2}-\d{2}$/u.test(published) ? { published } : {},
|
|
1321
1321
|
compatibility: typeof compatibility === "string" ? compatibility : "DSH stock",
|
|
1322
|
+
origin: origin === "official" ? "official" : "community",
|
|
1322
1323
|
source,
|
|
1323
1324
|
installed: marks.names.has(bareName(name)) || repository !== void 0 && marks.repos.has(repository),
|
|
1324
1325
|
mine: marks.accounts.has(owner.toLowerCase()),
|
|
1325
1326
|
...download === void 0 ? {} : { download }
|
|
1326
1327
|
});
|
|
1327
1328
|
}
|
|
1328
|
-
return entries.sort((a, b) => Number(b.mine) - Number(a.mine) || (b.published ?? "").localeCompare(a.published ?? "") || a.name.localeCompare(b.name));
|
|
1329
|
+
return entries.sort((a, b) => Number(b.mine) - Number(a.mine) || Number(b.origin === "official") - Number(a.origin === "official") || (b.published ?? "").localeCompare(a.published ?? "") || a.name.localeCompare(b.name));
|
|
1329
1330
|
}
|
|
1330
1331
|
/** The raw index, read once in a while: a fresh copy within `ttlMs`, else a new read, else the copy read before with the time it was read. */
|
|
1331
1332
|
function createRegistryReader(fetcher, options = {}) {
|