@straitlink/cli 0.3.0 → 0.3.2
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/README.md +1 -1
- package/package.json +1 -1
- package/src/doctor.mjs +11 -3
- package/src/install.mjs +4 -4
- package/src/version.mjs +1 -1
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ Exit codes: `0` done, `2` usage problem (message on stderr), `1` unexpected erro
|
|
|
66
66
|
npx @straitlink/cli doctor --host acme.strait.link --android com.acme.shop --ios com.acme.shop
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
Runs the same checks, with the same finding ids and wording, as `doctor()` in the Strait SDKs (React Native
|
|
69
|
+
Runs the same checks, with the same finding ids and wording, as `doctor()` in the Strait SDKs (React Native, Flutter, iOS, Android and Unity; contract B23, the shared cases in `test/doctor-vectors.json`). It fetches `https://<host>/.well-known/assetlinks.json` and `apple-app-site-association` once each and tells you whether your package, bundle ID and (with `--cert`) signing certificate are listed, with the fix for each problem:
|
|
70
70
|
|
|
71
71
|
```
|
|
72
72
|
Android (assetlinks.json)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@straitlink/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Strait deep links from the terminal: init sets them up in a React Native, Expo, Flutter or Android app, doctor checks your link host, links creates and lists links and saves QR codes.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"strait",
|
package/src/doctor.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// `strait doctor`: the SDK setup check (contract B23, shared-spec docs/adr/0002-sdk-doctor.md) from a
|
|
2
2
|
// terminal. `doctorFindings` is a line-for-line port of strait-sdk-react-native 0.9.3 src/doctor.ts:
|
|
3
|
-
// same finding ids, severities and wording as every SDK (test/doctor-vectors.json,
|
|
3
|
+
// same finding ids, severities and wording as every SDK (test/doctor-vectors.json, the shared cases).
|
|
4
4
|
|
|
5
5
|
/** The endpoint's host when it is an `https://` URL with a host, else null. */
|
|
6
6
|
export function doctorHost(endpoint) {
|
|
@@ -61,14 +61,22 @@ export function doctorFindings(input) {
|
|
|
61
61
|
return { ok: !findings.some((f) => f.severity === 'error'), findings };
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* A Strait link domain answers 404 {"error":"not configured"} until Apps & stores has this platform's app.
|
|
66
|
+
* Compared byte for byte (what the engine's well-known route sends), so every SDK agrees on any other body.
|
|
67
|
+
*/
|
|
68
|
+
const NOT_CONFIGURED = '{"error":"not configured"}';
|
|
69
|
+
const notConfigured = (file) => file.status === 404 && file.body === NOT_CONFIGURED;
|
|
70
|
+
|
|
64
71
|
function hostFindings(input, host, file) {
|
|
65
72
|
const android = input.platform === 'android';
|
|
66
73
|
if (file.status === undefined)
|
|
67
74
|
return [err('host.unreachable', `Can't reach ${host}`, 'Check that endpoint is your link domain (Dashboard → Get started) and that this device is online.')];
|
|
68
75
|
const apps = file.status === 200 ? listedApps(input.platform, file.body ?? '') : null;
|
|
69
|
-
if (!apps)
|
|
76
|
+
if (!apps && !notConfigured(file))
|
|
70
77
|
return [err('host.file_missing', `${host} doesn't serve ${android ? 'assetlinks.json' : 'apple-app-site-association'}`, 'Use your Strait link domain as endpoint (Dashboard → Get started); Strait serves this file there.')];
|
|
71
|
-
if (!apps
|
|
78
|
+
if (!apps?.size)
|
|
79
|
+
return [err('app.none', `No ${android ? 'Android' : 'iOS'} app is set up for ${host}`, `Fill in Dashboard → Apps & stores (${android ? 'package name and SHA-256 fingerprint' : 'Team ID and bundle ID'}), wait a minute, then check again. Already done? Make sure ${host} is your link domain from Dashboard → Get started.`)];
|
|
72
80
|
|
|
73
81
|
const listed = [...apps.keys()].join(', ');
|
|
74
82
|
const app = input.appId?.trim();
|
package/src/install.mjs
CHANGED
|
@@ -22,10 +22,10 @@ export const sourceFor = (src, registry) => (typeof src.source === 'string' ? sr
|
|
|
22
22
|
* `strait events add` reads them too: its iOS/Android eventId needs these SDKs.
|
|
23
23
|
*/
|
|
24
24
|
export const VERSIONS = {
|
|
25
|
-
version: '0.11.
|
|
26
|
-
rnVersion: '0.
|
|
27
|
-
flutterVersion: '0.10.
|
|
28
|
-
androidVersion: '0.10.
|
|
25
|
+
version: '0.11.1', // Swift (Unity is not written by this CLI)
|
|
26
|
+
rnVersion: '0.11.0',
|
|
27
|
+
flutterVersion: '0.10.2',
|
|
28
|
+
androidVersion: '0.10.1',
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export const PACKAGES = {
|
package/src/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Kept equal to package.json version (test/links.test.mjs checks it). Sent as the API User-Agent.
|
|
2
|
-
export const CLI_VERSION = '0.3.
|
|
2
|
+
export const CLI_VERSION = '0.3.2';
|