@imagina-build/ias-cli 0.1.3 → 0.1.5
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/package.json
CHANGED
|
@@ -129,7 +129,7 @@ function sdkCheck(dir, add) {
|
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
131
|
if (!isCompatible(installed, VERSION)) {
|
|
132
|
-
add('sdk', 'fail', `${SDK_PACKAGE} ${installed}, and ias ${VERSION} works with ${compatibleRange()}`, `ias sdk install installs ${compatibleRange()}, or install
|
|
132
|
+
add('sdk', 'fail', `${SDK_PACKAGE} ${installed}, and ias ${VERSION} works with ${compatibleRange()}`, `ias sdk install installs ${compatibleRange()}, or install an ias of the same ${compatibleRange().startsWith('^0.') ? 'minor' : 'major'} version as the SDK: they must read ias.json the same way`);
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
135
|
const detail = `${SDK_PACKAGE} ${installed}, compatible with ias ${VERSION}`;
|
|
@@ -78,7 +78,9 @@ export function findRunner(vault, signed, query) {
|
|
|
78
78
|
}
|
|
79
79
|
const inList = signed.runners.find((runner) => runner.kid === query);
|
|
80
80
|
if (inList) return { id: null, name: null, status: 'unknown', kid: inList.kid, publicKey: inList.publicKey, platforms: [], registeredAt: null, revokedAt: null, server: false };
|
|
81
|
-
|
|
81
|
+
const known = listed.map((runner) => `«${runner.name}» (${runner.id})`);
|
|
82
|
+
const fix = known.length > 0 ? `the server lists ${known.slice(0, 5).join(', ')}${known.length > 5 ? ` and ${known.length - 5} more` : ''}: give the id, or the name in quotes` : 'the server lists no runner: register one with ias-runner register, with a code of the panel (System › Runners)';
|
|
83
|
+
throw new IasError(`there is no runner «${query}»${RUNNER_ID.test(query) ? '' : ' (a name with spaces goes in quotes)'}`, { fix, code: 'runner_not_found' });
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
/** The runner list the team signed, as GET /vault gives it, checked with the team's key: { serial, runners }. */
|
package/src/sdk.mjs
CHANGED
|
@@ -27,8 +27,15 @@ export function repositorySdk() {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
/**
|
|
31
|
-
|
|
30
|
+
/**
|
|
31
|
+
* The range ias sdk install asks for, the one isCompatible accepts: the same minor while the major is 0 (^0.1.0), the
|
|
32
|
+
* same major from 1 (^1.0.0). Not ^VERSION: the SDK and the CLI raise their versions on their own, so ias 0.1.4 works
|
|
33
|
+
* with @imagina-build/ias 0.1.1.
|
|
34
|
+
*/
|
|
35
|
+
export function compatibleRange(version = VERSION) {
|
|
36
|
+
const [major, minor] = String(version).split('.').map(Number);
|
|
37
|
+
return major === 0 ? `^0.${minor}.0` : `^${major}.0.0`;
|
|
38
|
+
}
|
|
32
39
|
|
|
33
40
|
/** Whether `version` of the SDK speaks the same ias.json as `cliVersion`: the same major, and the same minor while it is 0. */
|
|
34
41
|
export function isCompatible(version, cliVersion = VERSION) {
|