@acryldev/launcher-desktop 0.1.4 → 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 +4 -0
- package/lib/client.js.map +1 -1
- package/lib/index.js +13 -3
- package/lib/index.js.map +1 -1
- package/lib/page.js +1 -1
- package/lib/types/contract.d.ts +2 -0
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -172,14 +172,18 @@ async function readBlends(fetchImpl = (input, init) => fetch(input, init), url =
|
|
|
172
172
|
const source = text$2(entry.source);
|
|
173
173
|
if (!BLEND_SOURCE.test(source)) continue;
|
|
174
174
|
ids.add(entry.id);
|
|
175
|
+
const placement = record$1(entry.placement);
|
|
176
|
+
const category = text$2(placement?.category) === "" ? text$2(entry.category) : [text$2(placement?.category), text$2(placement?.subcategory)].filter(Boolean).join(" › ");
|
|
177
|
+
const publisher = text$2(entry.publisher);
|
|
175
178
|
blends.push({
|
|
176
179
|
id: entry.id,
|
|
177
180
|
name: text$2(entry.name) || entry.id,
|
|
178
181
|
version: text$2(entry.version),
|
|
179
|
-
category
|
|
182
|
+
category,
|
|
180
183
|
description: text$2(entry.description),
|
|
181
184
|
origin: "community",
|
|
182
|
-
source
|
|
185
|
+
source,
|
|
186
|
+
...publisher === "" ? {} : { publisher }
|
|
183
187
|
});
|
|
184
188
|
}
|
|
185
189
|
return blends.sort((a, b) => a.name.localeCompare(b.name));
|
|
@@ -545,6 +549,8 @@ var LauncherService = class {
|
|
|
545
549
|
#job;
|
|
546
550
|
#blends;
|
|
547
551
|
#signIn;
|
|
552
|
+
/** Apps just made whose `npm install` is running (`#install`), by id. */
|
|
553
|
+
#installing = /* @__PURE__ */ new Map();
|
|
548
554
|
/** The tools apps need: being fetched (the first start on a computer without them), ready, or not had (apps then try the computer's own). */
|
|
549
555
|
#tools = { state: "ready" };
|
|
550
556
|
constructor(ports) {
|
|
@@ -592,7 +598,8 @@ var LauncherService = class {
|
|
|
592
598
|
#view(entry) {
|
|
593
599
|
const started = this.#started.get(entry.id);
|
|
594
600
|
const missing = inspectApp(entry).state === "missing";
|
|
595
|
-
const
|
|
601
|
+
const installing = this.#installing.get(entry.id);
|
|
602
|
+
const state = missing ? "missing" : started === void 0 ? installing !== void 0 ? "starting" : "stopped" : started.address === void 0 ? "starting" : "running";
|
|
596
603
|
const failure = this.#failures.get(entry.id);
|
|
597
604
|
const blend = entry.blend === "" ? blendOf(entry.path) : entry.blend;
|
|
598
605
|
const version = missing ? "" : blendVersionOf(entry.path);
|
|
@@ -610,6 +617,7 @@ var LauncherService = class {
|
|
|
610
617
|
...version !== "" && latest !== void 0 && newerVersion(latest, version) ? { update: latest } : {},
|
|
611
618
|
...started?.address === void 0 ? {} : { address: started.address },
|
|
612
619
|
...started === void 0 || started.address !== void 0 || started.output === "" ? {} : { output: started.output.trimEnd() },
|
|
620
|
+
...started === void 0 && installing !== void 0 && installing.output !== "" ? { output: installing.output.trimEnd() } : {},
|
|
613
621
|
...failure === void 0 || state !== "stopped" ? {} : { failure },
|
|
614
622
|
...github === void 0 ? {} : { github }
|
|
615
623
|
};
|
|
@@ -1136,6 +1144,7 @@ var LauncherService = class {
|
|
|
1136
1144
|
}
|
|
1137
1145
|
/** `npm install` in the new app's folder, as the job's second step; the job is still running while it does, and says so. */
|
|
1138
1146
|
#install(appId, folder, job) {
|
|
1147
|
+
this.#installing.set(appId, job);
|
|
1139
1148
|
job.step = "Step 2 of 3: installing its dependencies (npm install, about a minute). Next: starting it.";
|
|
1140
1149
|
job.output = "";
|
|
1141
1150
|
const run = this.#ports.runner({
|
|
@@ -1155,6 +1164,7 @@ var LauncherService = class {
|
|
|
1155
1164
|
job.output = output;
|
|
1156
1165
|
});
|
|
1157
1166
|
run.onEnd((end) => {
|
|
1167
|
+
this.#installing.delete(appId);
|
|
1158
1168
|
if (job.run !== run) return;
|
|
1159
1169
|
if (end.notFound) {
|
|
1160
1170
|
job.status = "failed";
|