@straitlink/cli 0.1.0 → 0.1.1
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 +1 -1
- package/src/install.mjs +12 -5
package/package.json
CHANGED
package/src/install.mjs
CHANGED
|
@@ -3,14 +3,19 @@
|
|
|
3
3
|
// drift when the site repo sits next to this one).
|
|
4
4
|
//
|
|
5
5
|
// - SDK repos moved to an organisation: change `githubOwner`.
|
|
6
|
-
// - SDKs published to npm / pub.dev / Maven Central: change `source` to "registry"
|
|
6
|
+
// - SDKs published to npm / pub.dev / Maven Central: change `source` to "registry", or per
|
|
7
|
+
// registry { npm, pub, maven } (npm = React Native, pub = Flutter, maven = Android).
|
|
8
|
+
// 16 Oct 2026: npm and pub.dev are published; Android stays on JitPack.
|
|
7
9
|
// Never spell out the owner anywhere else in this package.
|
|
8
10
|
|
|
9
11
|
export const INSTALL = {
|
|
10
|
-
source: 'github',
|
|
12
|
+
source: { npm: 'registry', pub: 'registry', maven: 'github' },
|
|
11
13
|
githubOwner: 'bazingga08',
|
|
12
14
|
};
|
|
13
15
|
|
|
16
|
+
/** The source for one registry: `source` as one word applies to all three. */
|
|
17
|
+
export const sourceFor = (src, registry) => (typeof src.source === 'string' ? src.source : src.source[registry]);
|
|
18
|
+
|
|
14
19
|
/** SDK versions the generated code is written for (site.config.json packages). */
|
|
15
20
|
export const VERSIONS = {
|
|
16
21
|
version: '0.9.2', // Swift (Unity 0.8.5 is not written by this CLI)
|
|
@@ -27,11 +32,13 @@ export const PACKAGES = {
|
|
|
27
32
|
|
|
28
33
|
export function installSpecs(src = INSTALL, v = VERSIONS) {
|
|
29
34
|
const o = src.githubOwner;
|
|
30
|
-
const reg = src.source === 'registry';
|
|
31
35
|
const gh = (repo) => `https://github.com/${o}/${repo}`;
|
|
36
|
+
const regNpm = sourceFor(src, 'npm') === 'registry';
|
|
37
|
+
const regPub = sourceFor(src, 'pub') === 'registry';
|
|
38
|
+
const reg = sourceFor(src, 'maven') === 'registry';
|
|
32
39
|
return {
|
|
33
|
-
reactNative:
|
|
34
|
-
flutterPubspec:
|
|
40
|
+
reactNative: regNpm ? `${PACKAGES.reactNative}@${v.rnVersion}` : `github:${o}/strait-sdk-react-native#v${v.rnVersion}`,
|
|
41
|
+
flutterPubspec: regPub
|
|
35
42
|
? ` ${PACKAGES.flutter}: ^${v.flutterVersion}`
|
|
36
43
|
: ` ${PACKAGES.flutter}:\n git:\n url: ${gh('strait-sdk-flutter')}\n ref: v${v.flutterVersion}`,
|
|
37
44
|
android: reg ? `in.straitlink:${PACKAGES.android}:${v.androidVersion}` : `com.github.${o}:${PACKAGES.android}:v${v.androidVersion}`,
|