@imagina-build/ias-cli 0.1.4 → 0.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imagina-build/ias-cli",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "The command line of Imagina Application Services (IAS): ias.json, OTA updates, internal distribution and the checks of a project.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -121,7 +121,7 @@ function sdkCheck(dir, add) {
121
121
  const { declared, installed, plugin } = state;
122
122
  if (!declared && !installed) {
123
123
  if (plugin === 'yes') add('sdk', 'fail', `app.json has the plugin of ${SDK_PACKAGE}, but the app does not have the package`, 'ias sdk install installs it: expo config and the builds fail without it');
124
- else add('sdk', 'warn', `the app does not use ${SDK_PACKAGE}`, `ias sdk install, if it uses ias.sync, ias.push or ias.updates, or takes its configuration from ias.json`);
124
+ else add('sdk', 'warn', `the app does not use ${SDK_PACKAGE}`, `ias sdk install, if it uses ias.sync or ias.push, or takes its configuration from ias.json`);
125
125
  return;
126
126
  }
127
127
  if (!installed) {
@@ -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 the ias of the same version as the SDK: they must read ias.json the same way`);
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}`;
package/src/sdk.mjs CHANGED
@@ -27,8 +27,15 @@ export function repositorySdk() {
27
27
  }
28
28
  }
29
29
 
30
- /** The range ias sdk install asks for: ^VERSION, the same minor while the major is 0. */
31
- export const compatibleRange = (version = VERSION) => `^${version}`;
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) {