@peers-app/peers-ui 0.33.2 → 0.33.4

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.
@@ -4,6 +4,11 @@ import { type DataContext, type IPackage, type IPackageVersion } from "@peers-ap
4
4
  * the group's, checked with `assertPackageVersionRunnable`. A refusal is logged and gives
5
5
  * undefined, so the package's app links, routes and screens are left out rather than loaded.
6
6
  *
7
+ * A dev version is shown only when this device selected it, in every context. That is the rule
8
+ * `resolveDevicePackageVersion` runs packages by; `assertPackageVersionRunnable` applies it in
9
+ * groups only, so without this check a dev build made on another of the user's devices would show
10
+ * its screens in the personal context while its package never starts here.
11
+ *
7
12
  * The check reads the package's stored row rather than using `pkg`: the loaders pass copies
8
13
  * with fields added (`appNavs`), and the row's signature covers only the row as it was signed.
9
14
  *
@@ -7,6 +7,11 @@ const peers_sdk_1 = require("@peers-app/peers-sdk");
7
7
  * the group's, checked with `assertPackageVersionRunnable`. A refusal is logged and gives
8
8
  * undefined, so the package's app links, routes and screens are left out rather than loaded.
9
9
  *
10
+ * A dev version is shown only when this device selected it, in every context. That is the rule
11
+ * `resolveDevicePackageVersion` runs packages by; `assertPackageVersionRunnable` applies it in
12
+ * groups only, so without this check a dev build made on another of the user's devices would show
13
+ * its screens in the personal context while its package never starts here.
14
+ *
10
15
  * The check reads the package's stored row rather than using `pkg`: the loaders pass copies
11
16
  * with fields added (`appNavs`), and the row's signature covers only the row as it was signed.
12
17
  *
@@ -18,20 +23,25 @@ async function resolveRunnableVersion(pkg) {
18
23
  const stored = await (0, peers_sdk_1.Packages)(dataContext).get(pkg.packageId);
19
24
  if (!stored)
20
25
  return undefined;
21
- let pvId = stored.activePackageVersionId;
26
+ let devicePvId;
22
27
  try {
23
28
  const pvar = (0, peers_sdk_1.packagePrefsVar)(stored.packageId);
24
29
  await pvar.loadingPromise;
25
- pvId = pvar()?.activePackageVersionId ?? pvId;
30
+ devicePvId = pvar()?.activePackageVersionId;
26
31
  }
27
32
  catch {
28
33
  /* use group default */
29
34
  }
35
+ const pvId = devicePvId ?? stored.activePackageVersionId;
30
36
  if (!pvId)
31
37
  return undefined;
32
38
  const pv = await (0, peers_sdk_1.PackageVersions)(dataContext).get(pvId);
33
39
  if (!pv)
34
40
  return undefined;
41
+ if (pv.versionTag === "dev" && !devicePvId) {
42
+ // Same reason resolveDevicePackageVersion unloads it with.
43
+ throw new Error(`Only a dev version (v${pv.version}) is selected; activate it on this device to run it`);
44
+ }
35
45
  await (0, peers_sdk_1.assertPackageVersionRunnable)(stored, pv, dataContext);
36
46
  return { pv, dataContext };
37
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peers-app/peers-ui",
3
- "version": "0.33.2",
3
+ "version": "0.33.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/peers-app/peers-ui.git"
@@ -36,7 +36,7 @@
36
36
  "lint:fix": "biome check --write ."
37
37
  },
38
38
  "peerDependencies": {
39
- "@peers-app/peers-sdk": "^0.33.2",
39
+ "@peers-app/peers-sdk": "^0.33.4",
40
40
  "bootstrap": "^5.3.3",
41
41
  "react": "^18.0.0",
42
42
  "react-dom": "^18.0.0"
@@ -47,7 +47,7 @@
47
47
  "@babel/preset-react": "^7.24.1",
48
48
  "@babel/preset-typescript": "^7.27.1",
49
49
  "@biomejs/biome": "2.3.11",
50
- "@peers-app/peers-sdk": "0.33.2",
50
+ "@peers-app/peers-sdk": "0.33.4",
51
51
  "@testing-library/dom": "^10.4.0",
52
52
  "@testing-library/jest-dom": "^6.6.3",
53
53
  "@testing-library/react": "^16.3.0",