@protobase/cli 0.94.4 → 0.94.6

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.
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.94.4";
2
+ var version = "0.94.6";
3
3
  //#endregion
4
4
  export { version };
@@ -35,21 +35,22 @@ const checkInstalled = (projectDir, cliVersion) => {
35
35
  const installed = projectProtobaseVersion(projectDir);
36
36
  if (installed === void 0) return;
37
37
  const range = `^${installed}`;
38
- if (semver.satisfies(cliVersion, range)) return;
38
+ if (semver.satisfies(cliVersion, range, { includePrerelease: true })) return;
39
39
  throw new Error(`This project has Protobase ${installed} installed, and this CLI is Protobase ${cliVersion}: run it with a Protobase ${range} CLI`);
40
40
  };
41
41
  /**
42
42
  * Refuses a project whose Protobase version this CLI does not satisfy, the one version check the CLI makes: the
43
43
  * specifier its package.json lists the @protobase packages at must hold the CLI's version, by semver, and in a locked
44
44
  * project, whose installed copies run, those must be ones the CLI runs. A specifier that is no semver range, such as
45
- * `workspace:*`, says no version, so the installed copies are checked instead. Outside a project, or one that lists no
45
+ * `workspace:*`, says no version, so the installed copies are checked instead. A prerelease CLI, such as a build from main,
46
+ * counts as well, just before its own release: 0.94.4-main.x holds ^0.94.0, 0.95.0-main.x does not. Outside a project, or one that lists no
46
47
  * @protobase package, there is nothing to check.
47
48
  */
48
49
  const checkProjectVersion = (projectDir, cliVersion = protobaseVersion) => {
49
50
  const { mode, specifier } = projectPackages(projectDir);
50
51
  if (specifier === void 0) return;
51
52
  const range = semver.validRange(specifier) !== null;
52
- if (range && !semver.satisfies(cliVersion, specifier)) throw new Error(`This project asks for Protobase ${specifier}, and this CLI is Protobase ${cliVersion}: run it with a CLI whose version ${specifier} holds`);
53
+ if (range && !semver.satisfies(cliVersion, specifier, { includePrerelease: true })) throw new Error(`This project asks for Protobase ${specifier}, and this CLI is Protobase ${cliVersion}: run it with a CLI whose version ${specifier} holds`);
53
54
  if (mode === "locked" || !range) checkInstalled(projectDir, cliVersion);
54
55
  };
55
56
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.94.4",
3
+ "version": "0.94.6",
4
4
  "description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -43,13 +43,13 @@
43
43
  "dependencies": {
44
44
  "@better-auth/core": "^1.7.12",
45
45
  "@hono/node-server": "^2.1.3",
46
- "@protobase/config": "0.94.4",
47
- "@protobase/layout": "0.94.4",
48
- "@protobase/query": "0.94.4",
49
- "@protobase/schema": "0.94.4",
50
- "@protobase/server": "0.94.4",
51
- "@protobase/ui": "0.94.4",
52
- "@protobase/workflows": "0.94.4",
46
+ "@protobase/config": "0.94.6",
47
+ "@protobase/layout": "0.94.6",
48
+ "@protobase/query": "0.94.6",
49
+ "@protobase/schema": "0.94.6",
50
+ "@protobase/server": "0.94.6",
51
+ "@protobase/ui": "0.94.6",
52
+ "@protobase/workflows": "0.94.6",
53
53
  "@react-email/render": "^2.1.0",
54
54
  "@scalar/hono-api-reference": "^0.12.10",
55
55
  "@sentry/vite-plugin": "^11.10.0",
@@ -310,7 +310,7 @@ A plugin is built for one plugin API and a range of Protobase versions, both wri
310
310
  { "engines": { "protobase": ">=0.12.0" } }
311
311
  ```
312
312
 
313
- A range is comparators separated by spaces, all of which must hold: `>=`, `>`, `<=`, `<` or `=` and an `x.y.z` version, such as `>=0.12.0 <2.0.0`. The build checks only the range's form; which versions it holds is the app's to compare when it loads the plugin. If the plugin uses something an older release in its range does not have, it fails to load there and is turned off, as described below.
313
+ A range is comparators separated by spaces, all of which must hold: `>=`, `>`, `<=`, `<` or `=` and an `x.y.z` version, such as `>=0.12.0 <2.0.0`. The build checks only the range's form; which versions it holds is the app's to compare when it loads the plugin, where a prerelease such as a build from main counts too, just before its own release: `0.94.4-main.4f8859dd` is in `>=0.12.9`, and `0.13.0-main.4f8859dd` is in `<0.13.0` but not in `>=0.13.0`. If the plugin uses something an older release in its range does not have, it fails to load there and is turned off, as described below.
314
314
 
315
315
  The app loads a plugin when the plugin's `api` is its own and its version is in the plugin's `protobase` range. Protobase keeps the plugin API through its releases and starts a new one only when a plugin built for the old one could break:
316
316
 
@@ -80,6 +80,8 @@ The CLI makes one version check, when it starts. The project's `package.json` li
80
80
  error: This project asks for Protobase ^0.14.0, and this CLI is Protobase 0.15.0: run it with a CLI whose version ^0.14.0 holds
81
81
  ```
82
82
 
83
+ A prerelease CLI, such as a build from main, is compared the same way, just before its own release: `0.94.4-main.4f8859dd` runs a `^0.94.0` project, and `0.95.0-main.4f8859dd` is refused by it.
84
+
83
85
  In a locked project the installed copies must also be ones the CLI runs: its version in their caret range, which from 1.0 on is the same major and below 1.0, where a minor may break, the same minor, never older. A specifier that is no range, such as `workspace:*`, says no version, so the installed copies are checked instead. A project that lists no `@protobase` package, or has no `package.json`, has nothing to check.
84
86
 
85
87
  Nothing else compares versions: not the build, not the serve runtime. `protobase build` writes the version of the copies it used into [the manifest](cli.md#the-manifest) as `protobase`: the building CLI's own in a bundled project, the `@protobase` packages its lockfile installed in a locked one, and a host serves the bundle on the runtime of that version. The check is `checkProjectVersion` in `packages/cli/src/version/project-version.ts`.