@axis-ds/cli 1.5.2 → 1.5.3
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 +37 -4
- package/dist/registry/index.json +1 -1
- package/dist/registry/registry.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4875,6 +4875,31 @@ function bundledFallbackMessage(version, reason, kind = "access", label = DEFAUL
|
|
|
4875
4875
|
function fallbackKindOf(error) {
|
|
4876
4876
|
return error instanceof RegistryAccessError ? "access" : "invalid";
|
|
4877
4877
|
}
|
|
4878
|
+
function registryContentDiff(remote, bundled) {
|
|
4879
|
+
const r = new Map(remote.items.map((i) => [i.name, i.sha256]));
|
|
4880
|
+
const b = new Map(bundled.items.map((i) => [i.name, i.sha256]));
|
|
4881
|
+
const differ = [];
|
|
4882
|
+
let comparable = true;
|
|
4883
|
+
for (const name of [.../* @__PURE__ */ new Set([...r.keys(), ...b.keys()])].sort()) {
|
|
4884
|
+
if (!r.has(name) || !b.has(name)) {
|
|
4885
|
+
differ.push(name);
|
|
4886
|
+
continue;
|
|
4887
|
+
}
|
|
4888
|
+
const rs = r.get(name);
|
|
4889
|
+
const bs = b.get(name);
|
|
4890
|
+
if (rs === void 0 || bs === void 0) {
|
|
4891
|
+
comparable = false;
|
|
4892
|
+
continue;
|
|
4893
|
+
}
|
|
4894
|
+
if (rs !== bs) differ.push(name);
|
|
4895
|
+
}
|
|
4896
|
+
return { comparable, differ };
|
|
4897
|
+
}
|
|
4898
|
+
function contentMismatchMessage(remoteVersion, bundledVersion, differ, label = DEFAULT_BUNDLED_LABEL) {
|
|
4899
|
+
const shown = differ.slice(0, 5).join(", ");
|
|
4900
|
+
const more = differ.length > 5 ? ` \uC678 ${differ.length - 5}\uAC1C` : "";
|
|
4901
|
+
return `\uC6D0\uACA9 \uB808\uC9C0\uC2A4\uD2B8\uB9AC(version ${remoteVersion})\uC640 ${label}(version ${bundledVersion})\uC758 \uB0B4\uC6A9\uC774 \uB2E4\uB978 \uD56D\uBAA9\uC774 ${differ.length}\uAC1C \uC788\uC2B5\uB2C8\uB2E4(${shown}${more}). \uC6D0\uACA9 \uB808\uC9C0\uC2A4\uD2B8\uB9AC\uB97C \uC6B0\uC120 \uC0AC\uC6A9\uD569\uB2C8\uB2E4.`;
|
|
4902
|
+
}
|
|
4878
4903
|
function versionMismatchMessage(remoteVersion, bundledVersion, label = DEFAULT_BUNDLED_LABEL) {
|
|
4879
4904
|
return `\uC6D0\uACA9 \uB808\uC9C0\uC2A4\uD2B8\uB9AC(version ${remoteVersion})\uC640 ${label}(version ${bundledVersion})\uC758 version \uC774 \uB2E4\uB985\uB2C8\uB2E4. \uC6D0\uACA9 \uB808\uC9C0\uC2A4\uD2B8\uB9AC\uB97C \uC6B0\uC120 \uC0AC\uC6A9\uD569\uB2C8\uB2E4.`;
|
|
4880
4905
|
}
|
|
@@ -4980,7 +5005,7 @@ var RegistryClient = class {
|
|
|
4980
5005
|
const data = await fetchRegistryJson(`${this.baseUrl}/index.json`, this.fetchOptions());
|
|
4981
5006
|
const index = validateRegistryIndex(data, `${this.baseUrl}/index.json`);
|
|
4982
5007
|
this.mode = "remote";
|
|
4983
|
-
this.warnVersionMismatch(index
|
|
5008
|
+
this.warnVersionMismatch(index);
|
|
4984
5009
|
return index;
|
|
4985
5010
|
} catch (error) {
|
|
4986
5011
|
remoteError = messageOf(error);
|
|
@@ -5002,10 +5027,18 @@ var RegistryClient = class {
|
|
|
5002
5027
|
return { error: messageOf(error) };
|
|
5003
5028
|
}
|
|
5004
5029
|
}
|
|
5005
|
-
warnVersionMismatch(
|
|
5030
|
+
warnVersionMismatch(remote) {
|
|
5006
5031
|
const bundled = this.loadBundledIndex();
|
|
5007
|
-
if ("index" in bundled
|
|
5008
|
-
|
|
5032
|
+
if (!("index" in bundled)) return;
|
|
5033
|
+
const diff = registryContentDiff(remote, bundled.index);
|
|
5034
|
+
if (diff.comparable) {
|
|
5035
|
+
if (diff.differ.length > 0) {
|
|
5036
|
+
this.notify(contentMismatchMessage(remote.version, bundled.index.version, diff.differ, this.bundledLabel));
|
|
5037
|
+
}
|
|
5038
|
+
return;
|
|
5039
|
+
}
|
|
5040
|
+
if (bundled.index.version !== remote.version) {
|
|
5041
|
+
this.notify(versionMismatchMessage(remote.version, bundled.index.version, this.bundledLabel));
|
|
5009
5042
|
}
|
|
5010
5043
|
}
|
|
5011
5044
|
async switchToBundled(reason, kind = "access") {
|
package/dist/registry/index.json
CHANGED