@stackable-labs/cli-app-extension 1.73.0 → 1.75.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/index.js +161 -54
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -145,8 +145,12 @@ var compareSemver = (a, b) => {
|
|
|
145
145
|
const pa = a.split(".").map(Number);
|
|
146
146
|
const pb = b.split(".").map(Number);
|
|
147
147
|
for (let i = 0; i < 3; i++) {
|
|
148
|
-
if ((pa[i] ?? 0) > (pb[i] ?? 0))
|
|
149
|
-
|
|
148
|
+
if ((pa[i] ?? 0) > (pb[i] ?? 0)) {
|
|
149
|
+
return 1;
|
|
150
|
+
}
|
|
151
|
+
if ((pa[i] ?? 0) < (pb[i] ?? 0)) {
|
|
152
|
+
return -1;
|
|
153
|
+
}
|
|
150
154
|
}
|
|
151
155
|
return 0;
|
|
152
156
|
};
|
|
@@ -154,7 +158,9 @@ var VersionRow = ({ currentVersion, value, onChange, onFocusChange, onConfirm, o
|
|
|
154
158
|
const { isFocused } = useFocus();
|
|
155
159
|
const { focusPrevious, focusNext } = useFocusManager();
|
|
156
160
|
useInput((_, key) => {
|
|
157
|
-
if (!isFocused)
|
|
161
|
+
if (!isFocused) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
158
164
|
if (key.upArrow) {
|
|
159
165
|
focusPrevious();
|
|
160
166
|
return;
|
|
@@ -165,9 +171,14 @@ var VersionRow = ({ currentVersion, value, onChange, onFocusChange, onConfirm, o
|
|
|
165
171
|
}
|
|
166
172
|
if (key.return) {
|
|
167
173
|
const isValid2 = /^\d+\.\d+\.\d+$/.test(value) && compareSemver(value, currentVersion) > 0;
|
|
168
|
-
if (!isValid2)
|
|
169
|
-
|
|
170
|
-
|
|
174
|
+
if (!isValid2) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (selected === "y") {
|
|
178
|
+
onConfirm();
|
|
179
|
+
} else {
|
|
180
|
+
onCancel();
|
|
181
|
+
}
|
|
171
182
|
}
|
|
172
183
|
});
|
|
173
184
|
useEffect(() => {
|
|
@@ -214,7 +225,9 @@ var Confirm = ({
|
|
|
214
225
|
const [selected, setSelected] = useState("y");
|
|
215
226
|
const [overrideFocused, setOverrideFocused] = useState(false);
|
|
216
227
|
useInput((input, key) => {
|
|
217
|
-
if (overrideFocused)
|
|
228
|
+
if (overrideFocused) {
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
218
231
|
if (key.leftArrow || key.rightArrow) {
|
|
219
232
|
setSelected((s) => s === "y" ? "n" : "y");
|
|
220
233
|
return;
|
|
@@ -229,8 +242,12 @@ var Confirm = ({
|
|
|
229
242
|
}
|
|
230
243
|
if (key.return) {
|
|
231
244
|
if (selected === "y") {
|
|
232
|
-
if (newVersion && extensionVersion && !/^\d+\.\d+\.\d+$/.test(newVersion))
|
|
233
|
-
|
|
245
|
+
if (newVersion && extensionVersion && !/^\d+\.\d+\.\d+$/.test(newVersion)) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
if (newVersion && extensionVersion && compareSemver(newVersion, extensionVersion) <= 0) {
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
234
251
|
onConfirm();
|
|
235
252
|
} else {
|
|
236
253
|
onCancel();
|
|
@@ -429,9 +446,15 @@ var FieldRow = ({ label, value, onChange, onSubmit, onConfirm, placeholder, auto
|
|
|
429
446
|
const { isFocused } = useFocus({ autoFocus });
|
|
430
447
|
const { focusNext, focusPrevious } = useFocusManager();
|
|
431
448
|
useInput((_input, key) => {
|
|
432
|
-
if (!isFocused)
|
|
433
|
-
|
|
434
|
-
|
|
449
|
+
if (!isFocused) {
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
if (key.downArrow && !isLast) {
|
|
453
|
+
focusNext();
|
|
454
|
+
}
|
|
455
|
+
if (key.upArrow && !isFirst) {
|
|
456
|
+
focusPrevious();
|
|
457
|
+
}
|
|
435
458
|
});
|
|
436
459
|
return /* @__PURE__ */ jsxs(Box, { gap: 2, children: [
|
|
437
460
|
/* @__PURE__ */ jsx(Text, { dimColor: true, children: label }),
|
|
@@ -444,7 +467,9 @@ var FieldRow = ({ label, value, onChange, onSubmit, onConfirm, placeholder, auto
|
|
|
444
467
|
onChange,
|
|
445
468
|
onSubmit: (val) => {
|
|
446
469
|
const result = onSubmit(val);
|
|
447
|
-
if (result)
|
|
470
|
+
if (result) {
|
|
471
|
+
onConfirm(...result);
|
|
472
|
+
}
|
|
448
473
|
},
|
|
449
474
|
placeholder,
|
|
450
475
|
focus: isFocused
|
|
@@ -459,13 +484,17 @@ var SettingsPrompt = ({ defaultDir, onSubmit, onBack }) => {
|
|
|
459
484
|
const [outputDir, setOutputDir] = useState(defaultDir);
|
|
460
485
|
const handleConfirm = (resolvedExtPort, resolvedPrevPort, resolvedDir) => {
|
|
461
486
|
const dir = resolvedDir.trim();
|
|
462
|
-
if (!dir)
|
|
487
|
+
if (!dir) {
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
463
490
|
onSubmit(parseInt(resolvedExtPort, 10), parseInt(resolvedPrevPort, 10), dir);
|
|
464
491
|
};
|
|
465
492
|
const handleExtensionPortSubmit = (value) => {
|
|
466
493
|
const trimmed = value.trim();
|
|
467
494
|
const port = trimmed === "" ? DEFAULT_EXTENSION_PORT : parseInt(trimmed, 10);
|
|
468
|
-
if (isNaN(port) || port < 1024 || port > 65535)
|
|
495
|
+
if (isNaN(port) || port < 1024 || port > 65535) {
|
|
496
|
+
return false;
|
|
497
|
+
}
|
|
469
498
|
const newExtPort = String(port);
|
|
470
499
|
const newPrevPort = String(port + 1);
|
|
471
500
|
setExtensionPort(newExtPort);
|
|
@@ -476,14 +505,18 @@ var SettingsPrompt = ({ defaultDir, onSubmit, onBack }) => {
|
|
|
476
505
|
const extPort = parseInt(extensionPort, 10);
|
|
477
506
|
const trimmed = value.trim();
|
|
478
507
|
const port = trimmed === "" ? extPort + 1 : parseInt(trimmed, 10);
|
|
479
|
-
if (isNaN(port) || port < 1024 || port > 65535)
|
|
508
|
+
if (isNaN(port) || port < 1024 || port > 65535) {
|
|
509
|
+
return false;
|
|
510
|
+
}
|
|
480
511
|
const newPrevPort = String(port);
|
|
481
512
|
setPreviewPort(newPrevPort);
|
|
482
513
|
return [extensionPort, newPrevPort, outputDir];
|
|
483
514
|
};
|
|
484
515
|
const handleOutputDirSubmit = (value) => {
|
|
485
516
|
const trimmed = value.trim();
|
|
486
|
-
if (trimmed.length === 0)
|
|
517
|
+
if (trimmed.length === 0) {
|
|
518
|
+
return false;
|
|
519
|
+
}
|
|
487
520
|
setOutputDir(trimmed);
|
|
488
521
|
return [extensionPort, previewPort, trimmed];
|
|
489
522
|
};
|
|
@@ -606,14 +639,18 @@ var ManifestReviewPrompt = ({
|
|
|
606
639
|
}
|
|
607
640
|
if (key.tab && !key.shift) {
|
|
608
641
|
setCursor((c) => {
|
|
609
|
-
if (c < domainSectionStart && domainItems.length > 0)
|
|
642
|
+
if (c < domainSectionStart && domainItems.length > 0) {
|
|
643
|
+
return domainSectionStart;
|
|
644
|
+
}
|
|
610
645
|
return c;
|
|
611
646
|
});
|
|
612
647
|
return;
|
|
613
648
|
}
|
|
614
649
|
if (key.tab && key.shift) {
|
|
615
650
|
setCursor((c) => {
|
|
616
|
-
if (c >= domainSectionStart)
|
|
651
|
+
if (c >= domainSectionStart) {
|
|
652
|
+
return 0;
|
|
653
|
+
}
|
|
617
654
|
return c;
|
|
618
655
|
});
|
|
619
656
|
return;
|
|
@@ -665,13 +702,19 @@ var FieldRow2 = ({ label, value, onChange, placeholder, autoFocus, isFirst, isLa
|
|
|
665
702
|
const { isFocused } = useFocus({ autoFocus });
|
|
666
703
|
const { focusNext, focusPrevious } = useFocusManager();
|
|
667
704
|
useInput((_, key) => {
|
|
668
|
-
if (!isFocused)
|
|
705
|
+
if (!isFocused) {
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
669
708
|
if (key.downArrow) {
|
|
670
|
-
if (!isLast)
|
|
709
|
+
if (!isLast) {
|
|
710
|
+
focusNext();
|
|
711
|
+
}
|
|
671
712
|
return;
|
|
672
713
|
}
|
|
673
714
|
if (key.upArrow) {
|
|
674
|
-
if (!isFirst)
|
|
715
|
+
if (!isFirst) {
|
|
716
|
+
focusPrevious();
|
|
717
|
+
}
|
|
675
718
|
return;
|
|
676
719
|
}
|
|
677
720
|
if (key.return) {
|
|
@@ -688,7 +731,9 @@ var TargetToggleRow = ({ targets, availableTargets, onToggle, autoFocus, isLast,
|
|
|
688
731
|
const { focusNext, focusPrevious } = useFocusManager();
|
|
689
732
|
const [cursor, setCursor] = useState(0);
|
|
690
733
|
useInput((input, key) => {
|
|
691
|
-
if (!isFocused)
|
|
734
|
+
if (!isFocused) {
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
692
737
|
if (key.downArrow) {
|
|
693
738
|
if (cursor < availableTargets.length - 1) {
|
|
694
739
|
setCursor((c) => c + 1);
|
|
@@ -733,9 +778,13 @@ var EnabledToggleRow = ({ enabled, onToggle, autoFocus, isLast, onSubmitAll }) =
|
|
|
733
778
|
const { isFocused } = useFocus({ autoFocus });
|
|
734
779
|
const { focusNext, focusPrevious } = useFocusManager();
|
|
735
780
|
useInput((input, key) => {
|
|
736
|
-
if (!isFocused)
|
|
781
|
+
if (!isFocused) {
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
737
784
|
if (key.downArrow) {
|
|
738
|
-
if (!isLast)
|
|
785
|
+
if (!isLast) {
|
|
786
|
+
focusNext();
|
|
787
|
+
}
|
|
739
788
|
return;
|
|
740
789
|
}
|
|
741
790
|
if (key.upArrow) {
|
|
@@ -760,9 +809,13 @@ var ForceMajorToggleRow = ({ forceMajor, onToggle, autoFocus, isLast, onSubmitAl
|
|
|
760
809
|
const { isFocused } = useFocus({ autoFocus });
|
|
761
810
|
const { focusPrevious, focusNext } = useFocusManager();
|
|
762
811
|
useInput((input, key) => {
|
|
763
|
-
if (!isFocused)
|
|
812
|
+
if (!isFocused) {
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
764
815
|
if (key.downArrow) {
|
|
765
|
-
if (!isLast)
|
|
816
|
+
if (!isLast) {
|
|
817
|
+
focusNext();
|
|
818
|
+
}
|
|
766
819
|
return;
|
|
767
820
|
}
|
|
768
821
|
if (key.upArrow) {
|
|
@@ -803,7 +856,9 @@ var UpdateSettingsPrompt = ({
|
|
|
803
856
|
setTargetsValue((prev) => prev.includes(target) ? prev.filter((t) => t !== target) : [...prev, target]);
|
|
804
857
|
};
|
|
805
858
|
const handleSubmitAll = () => {
|
|
806
|
-
if (targetsValue.length === 0)
|
|
859
|
+
if (targetsValue.length === 0) {
|
|
860
|
+
return;
|
|
861
|
+
}
|
|
807
862
|
onSubmit({
|
|
808
863
|
name: nameValue,
|
|
809
864
|
targets: targetsValue,
|
|
@@ -1077,7 +1132,9 @@ var resolveAppForExtension = async (token, extensionId) => {
|
|
|
1077
1132
|
const res = await fetch(`${publicBaseUrl}/extensions/${app.id}`, {
|
|
1078
1133
|
headers: authHeaders(token)
|
|
1079
1134
|
});
|
|
1080
|
-
if (!res.ok)
|
|
1135
|
+
if (!res.ok) {
|
|
1136
|
+
continue;
|
|
1137
|
+
}
|
|
1081
1138
|
const extensions = await res.json();
|
|
1082
1139
|
const ext = extensions[extensionId];
|
|
1083
1140
|
if (ext) {
|
|
@@ -1146,7 +1203,9 @@ var AppSelect = ({ token, userId, orgId, onSubmit }) => {
|
|
|
1146
1203
|
fetchApps(token).then(setApps).catch((err) => setError(err instanceof Error ? err.message : String(err))).finally(() => setLoading(false));
|
|
1147
1204
|
}, [token]);
|
|
1148
1205
|
useInput((_, key) => {
|
|
1149
|
-
if (loading || error || apps.length === 0)
|
|
1206
|
+
if (loading || error || apps.length === 0) {
|
|
1207
|
+
return;
|
|
1208
|
+
}
|
|
1150
1209
|
if (key.upArrow) {
|
|
1151
1210
|
setCursor((c) => Math.max(0, c - 1));
|
|
1152
1211
|
} else if (key.downArrow) {
|
|
@@ -1268,13 +1327,21 @@ var computeActiveSteps = (conditions) => {
|
|
|
1268
1327
|
const { command, initialName, initialExtensionId, templateFlavor, studioProject, options } = conditions;
|
|
1269
1328
|
const base = STEPS[command];
|
|
1270
1329
|
const skipped = /* @__PURE__ */ new Set();
|
|
1271
|
-
if (command === "create" /* CREATE */ && initialName)
|
|
1272
|
-
|
|
1330
|
+
if (command === "create" /* CREATE */ && initialName) {
|
|
1331
|
+
skipped.add("name");
|
|
1332
|
+
}
|
|
1333
|
+
if (command === "create" /* CREATE */ && options?.template) {
|
|
1334
|
+
skipped.add("template");
|
|
1335
|
+
}
|
|
1273
1336
|
if (command === "create" /* CREATE */ && TEMPLATE_FLAVOR_META[templateFlavor].skipTargetStep) {
|
|
1274
1337
|
skipped.add("targets");
|
|
1275
1338
|
}
|
|
1276
|
-
if (options?.extensionPort || options?.previewPort)
|
|
1277
|
-
|
|
1339
|
+
if (options?.extensionPort || options?.previewPort) {
|
|
1340
|
+
skipped.add("settings");
|
|
1341
|
+
}
|
|
1342
|
+
if (options?.appId) {
|
|
1343
|
+
skipped.add("app");
|
|
1344
|
+
}
|
|
1278
1345
|
if (initialExtensionId && (command === "update" /* UPDATE */ || command === "scaffold" /* SCAFFOLD */)) {
|
|
1279
1346
|
skipped.add("app");
|
|
1280
1347
|
skipped.add("extensionSelect");
|
|
@@ -1734,7 +1801,9 @@ var patchViteAllowedHosts = async (rootDir) => {
|
|
|
1734
1801
|
} catch {
|
|
1735
1802
|
continue;
|
|
1736
1803
|
}
|
|
1737
|
-
if (content.includes("allowedHosts"))
|
|
1804
|
+
if (content.includes("allowedHosts")) {
|
|
1805
|
+
continue;
|
|
1806
|
+
}
|
|
1738
1807
|
const patched = content.replace(
|
|
1739
1808
|
/server:\s*\{/,
|
|
1740
1809
|
"server: {\n allowedHosts: true,"
|
|
@@ -1978,7 +2047,9 @@ var App = ({ command, token, userId, orgId, initialName, initialExtensionId, opt
|
|
|
1978
2047
|
goForward();
|
|
1979
2048
|
};
|
|
1980
2049
|
useEffect(() => {
|
|
1981
|
-
if (!options?.appId)
|
|
2050
|
+
if (!options?.appId) {
|
|
2051
|
+
return;
|
|
2052
|
+
}
|
|
1982
2053
|
fetchApps(token).then((apps) => {
|
|
1983
2054
|
const app = apps.find((a) => a.id === options.appId);
|
|
1984
2055
|
if (app) {
|
|
@@ -1993,8 +2064,12 @@ var App = ({ command, token, userId, orgId, initialName, initialExtensionId, opt
|
|
|
1993
2064
|
});
|
|
1994
2065
|
}, []);
|
|
1995
2066
|
useEffect(() => {
|
|
1996
|
-
if (options?.appId || !initialExtensionId)
|
|
1997
|
-
|
|
2067
|
+
if (options?.appId || !initialExtensionId) {
|
|
2068
|
+
return;
|
|
2069
|
+
}
|
|
2070
|
+
if (command !== "update" /* UPDATE */ && command !== "scaffold" /* SCAFFOLD */) {
|
|
2071
|
+
return;
|
|
2072
|
+
}
|
|
1998
2073
|
resolveAppForExtension(token, initialExtensionId).then((result) => {
|
|
1999
2074
|
if (result) {
|
|
2000
2075
|
handleAppSelect(result.app);
|
|
@@ -2082,14 +2157,24 @@ var App = ({ command, token, userId, orgId, initialName, initialExtensionId, opt
|
|
|
2082
2157
|
};
|
|
2083
2158
|
const computeVersionBump = (currentVersion, newName, newTargets, newBundleUrl, isForceMajor) => {
|
|
2084
2159
|
const [major, minor, patch] = currentVersion.split(".").map(Number);
|
|
2085
|
-
if (!initialExtension)
|
|
2086
|
-
|
|
2160
|
+
if (!initialExtension) {
|
|
2161
|
+
return `${major}.${minor}.${patch + 1}`;
|
|
2162
|
+
}
|
|
2163
|
+
if (isForceMajor) {
|
|
2164
|
+
return `${major + 1}.0.0`;
|
|
2165
|
+
}
|
|
2087
2166
|
const bundleUrlChanged = newBundleUrl !== initialExtension.bundleUrl;
|
|
2088
|
-
if (bundleUrlChanged)
|
|
2167
|
+
if (bundleUrlChanged) {
|
|
2168
|
+
return `${major + 1}.0.0`;
|
|
2169
|
+
}
|
|
2089
2170
|
const targetsChanged = newTargets.length !== initialExtension.targets.length || newTargets.some((t) => !initialExtension.targets.includes(t));
|
|
2090
|
-
if (targetsChanged)
|
|
2171
|
+
if (targetsChanged) {
|
|
2172
|
+
return `${major}.${minor + 1}.0`;
|
|
2173
|
+
}
|
|
2091
2174
|
const nameChanged = newName !== initialExtension.name;
|
|
2092
|
-
if (nameChanged)
|
|
2175
|
+
if (nameChanged) {
|
|
2176
|
+
return `${major}.${minor}.${patch + 1}`;
|
|
2177
|
+
}
|
|
2093
2178
|
return `${major}.${minor}.${patch + 1}`;
|
|
2094
2179
|
};
|
|
2095
2180
|
const handleConfirm = async () => {
|
|
@@ -2582,7 +2667,9 @@ var DevDashboard = ({
|
|
|
2582
2667
|
};
|
|
2583
2668
|
}, [onQuit]);
|
|
2584
2669
|
const devParamBlob = useMemo(() => {
|
|
2585
|
-
if (!tunnelUrl || !devSessionToken)
|
|
2670
|
+
if (!tunnelUrl || !devSessionToken) {
|
|
2671
|
+
return "";
|
|
2672
|
+
}
|
|
2586
2673
|
return toBase64Url(JSON.stringify({ url: tunnelUrl, token: devSessionToken }));
|
|
2587
2674
|
}, [tunnelUrl, devSessionToken]);
|
|
2588
2675
|
useInput((input, key) => {
|
|
@@ -2735,7 +2822,9 @@ var DevApp = ({ token, userId, orgId, options = {} }) => {
|
|
|
2735
2822
|
});
|
|
2736
2823
|
}, [options.dir]);
|
|
2737
2824
|
const handleSetupReady = useCallback(async (resolved) => {
|
|
2738
|
-
if (!devContext)
|
|
2825
|
+
if (!devContext) {
|
|
2826
|
+
return;
|
|
2827
|
+
}
|
|
2739
2828
|
setResolvedContext(resolved);
|
|
2740
2829
|
console.log(`[dev] Saving context: appId=${resolved.appId} extensionId=${resolved.extensionId}`);
|
|
2741
2830
|
await writeDevContext(devContext.projectRoot, {
|
|
@@ -2758,10 +2847,18 @@ var DevApp = ({ token, userId, orgId, options = {} }) => {
|
|
|
2758
2847
|
const missingDomains = [...localDomains].filter((d) => !registryDomains.has(d));
|
|
2759
2848
|
const extraDomains = [...registryDomains].filter((d) => !localDomains.has(d));
|
|
2760
2849
|
const warnings = [];
|
|
2761
|
-
if (missingPerms.length > 0)
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
if (
|
|
2850
|
+
if (missingPerms.length > 0) {
|
|
2851
|
+
warnings.push(`Permissions in local but not registry: ${missingPerms.join(", ")}`);
|
|
2852
|
+
}
|
|
2853
|
+
if (extraPerms.length > 0) {
|
|
2854
|
+
warnings.push(`Permissions in registry but not local: ${extraPerms.join(", ")}`);
|
|
2855
|
+
}
|
|
2856
|
+
if (missingDomains.length > 0) {
|
|
2857
|
+
warnings.push(`Domains in local but not registry: ${missingDomains.join(", ")}`);
|
|
2858
|
+
}
|
|
2859
|
+
if (extraDomains.length > 0) {
|
|
2860
|
+
warnings.push(`Domains in registry but not local: ${extraDomains.join(", ")}`);
|
|
2861
|
+
}
|
|
2765
2862
|
if (warnings.length > 0) {
|
|
2766
2863
|
setManifestWarnings(warnings);
|
|
2767
2864
|
}
|
|
@@ -2816,7 +2913,9 @@ var DevApp = ({ token, userId, orgId, options = {} }) => {
|
|
|
2816
2913
|
}
|
|
2817
2914
|
}, [state, devContext, handleSetupReady]);
|
|
2818
2915
|
const handleQuit = async () => {
|
|
2819
|
-
if (!devContext || !resolvedContext || shuttingDown.current)
|
|
2916
|
+
if (!devContext || !resolvedContext || shuttingDown.current) {
|
|
2917
|
+
return;
|
|
2918
|
+
}
|
|
2820
2919
|
shuttingDown.current = true;
|
|
2821
2920
|
setState("stopping");
|
|
2822
2921
|
console.log("[dev] Shutting down...");
|
|
@@ -2892,7 +2991,9 @@ var DEFAULT_STATIC_CDN_URL = "https://static.stackablelabs.io";
|
|
|
2892
2991
|
var AI_DOCS_FILENAME = "extension-ai-docs.zip";
|
|
2893
2992
|
var getStaticCdnBaseUrl = () => process.env.STATIC_CDN_BASE_URL ?? DEFAULT_STATIC_CDN_URL;
|
|
2894
2993
|
var isValidManifest = (data) => {
|
|
2895
|
-
if (!data || typeof data !== "object")
|
|
2994
|
+
if (!data || typeof data !== "object") {
|
|
2995
|
+
return false;
|
|
2996
|
+
}
|
|
2896
2997
|
const m = data;
|
|
2897
2998
|
return typeof m.name === "string" && m.name.length > 0 && typeof m.version === "string" && Array.isArray(m.targets) && Array.isArray(m.permissions) && Array.isArray(m.allowedDomains);
|
|
2898
2999
|
};
|
|
@@ -2924,7 +3025,9 @@ var downloadAndExtractAiDocs = async (targetDir, version2) => {
|
|
|
2924
3025
|
const entries = zip.getEntries();
|
|
2925
3026
|
const extractedFiles = [];
|
|
2926
3027
|
for (const entry of entries) {
|
|
2927
|
-
if (entry.isDirectory)
|
|
3028
|
+
if (entry.isDirectory) {
|
|
3029
|
+
continue;
|
|
3030
|
+
}
|
|
2928
3031
|
const targetPath = join(targetDir, entry.entryName);
|
|
2929
3032
|
await mkdir(dirname(targetPath), { recursive: true });
|
|
2930
3033
|
await writeFile(targetPath, entry.getData());
|
|
@@ -3232,8 +3335,12 @@ var isNewer = (a, b) => {
|
|
|
3232
3335
|
const pa = a.split(".").map(Number);
|
|
3233
3336
|
const pb = b.split(".").map(Number);
|
|
3234
3337
|
for (let i = 0; i < 3; i++) {
|
|
3235
|
-
if ((pa[i] ?? 0) > (pb[i] ?? 0))
|
|
3236
|
-
|
|
3338
|
+
if ((pa[i] ?? 0) > (pb[i] ?? 0)) {
|
|
3339
|
+
return true;
|
|
3340
|
+
}
|
|
3341
|
+
if ((pa[i] ?? 0) < (pb[i] ?? 0)) {
|
|
3342
|
+
return false;
|
|
3343
|
+
}
|
|
3237
3344
|
}
|
|
3238
3345
|
return false;
|
|
3239
3346
|
};
|