@peers-app/peers-sdk 0.19.12 → 0.19.14

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.
@@ -141,6 +141,7 @@ async function createPackage(dataContext, deps, opts) {
141
141
  defaultValue: deps.packagesRootDir,
142
142
  dataContext,
143
143
  });
144
+ await pvar.loadingPromise;
144
145
  pvar(location);
145
146
  // Install the dev bundle
146
147
  const result = await (0, package_installer_1.installPackageFromBundles)(dataContext, deps, packageId, {
@@ -108,13 +108,21 @@ async function installPackageFromBundles(dataContext, deps, packageId, opts) {
108
108
  }
109
109
  }
110
110
  }
111
- // 10. Update package description if info provides one and it differs
111
+ // 10. Update package record if needed (description, first-install activation)
112
112
  const pkg = await (0, packages_1.Packages)(dataContext).get(packageId);
113
- if (pkg && info.description && info.description !== pkg.description) {
114
- await (0, packages_1.Packages)(dataContext).signAndSave({
115
- ...pkg,
116
- description: info.description,
117
- });
113
+ if (pkg) {
114
+ let needsSave = false;
115
+ if (info.description && info.description !== pkg.description) {
116
+ pkg.description = info.description;
117
+ needsSave = true;
118
+ }
119
+ if (!pkg.activePackageVersionId) {
120
+ pkg.activePackageVersionId = savedPv.packageVersionId;
121
+ needsSave = true;
122
+ }
123
+ if (needsSave) {
124
+ await (0, packages_1.Packages)(dataContext).signAndSave(pkg);
125
+ }
118
126
  }
119
127
  // 11. Activate on device (unless skipResolve)
120
128
  if (!opts?.skipResolve && pkg) {
@@ -476,6 +476,7 @@ describe("installPackageFromBundles", () => {
476
476
  packageId,
477
477
  name: "test-pkg",
478
478
  description: "Same description",
479
+ activePackageVersionId: (0, utils_1.newid)(),
479
480
  signature: "",
480
481
  createdBy: "u",
481
482
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peers-app/peers-sdk",
3
- "version": "0.19.12",
3
+ "version": "0.19.14",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/peers-app/peers-sdk.git"