@valbuild/server 0.148.8 → 0.149.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/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # @valbuild/server
2
2
 
3
+ ## 0.149.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [#910](https://github.com/valbuild/val/pull/910) [`32b3210`](https://github.com/valbuild/val/commit/32b3210c11bbd526c1882177c1870aa0be1d3ca4) Thanks [@freekh](https://github.com/freekh)! - When a proposal changes its dependencies without a lockfile to match, its Build button now reads **Compute lockfile** and computes it. Afterwards, the button shows the proposal's dependencies being built, or says why they could not be built.
8
+
9
+ - [#911](https://github.com/valbuild/val/pull/911) [`bf24bc0`](https://github.com/valbuild/val/commit/bf24bc00e8f8c2a08538d59218d9da005943ac03) Thanks [@freekh](https://github.com/freekh)! - **Upgrade your site's dependencies from the Studio.** When newer versions of your site's packages are available, an **Upgrade** button appears in the Studio's top bar (on a phone, in the account sheet). It is marked when the upgrade fixes a vulnerability.
10
+
11
+ - **Pick a kind:** fix vulnerabilities, move to the latest version within each major, or move to new major versions. For majors, you can untick any package to leave it out.
12
+ - **Upgrade in a proposal:** this opens a proposal with the upgrade in it, and the Studio follows it there:
13
+ - computing the upgrade;
14
+ - building the new dependencies;
15
+ - typechecking your code against them;
16
+ - building the proposal.
17
+ - **Publish:** offered once the upgrade adds no type errors and the proposal is built. If it adds type errors, they are listed by file and the proposal stays open, so you can fix them there.
18
+ - **Settings → Updates** offers the same choice. "Update site", which published the template's dependencies straight to the live site, is gone.
19
+
20
+ A proposal whose dependencies change is typechecked automatically, and it can't be published until the typecheck finds no new errors. The **Typecheck** check in the Publish dialog runs it on request.
21
+
22
+ - Updated dependencies [[`32b3210`](https://github.com/valbuild/val/commit/32b3210c11bbd526c1882177c1870aa0be1d3ca4), [`bf24bc0`](https://github.com/valbuild/val/commit/bf24bc00e8f8c2a08538d59218d9da005943ac03)]:
23
+ - @valbuild/ui@0.149.0
24
+
3
25
  ## 0.148.8
4
26
 
5
27
  ### Patch Changes
@@ -257,9 +257,10 @@ export declare class ValOpsHttp extends ValOps {
257
257
  * An allow list rather than a prefix check, because this method holds a
258
258
  * credential and the browser chooses the path. `/publish/{id}` and its three
259
259
  * steps are the publish conversation; `/build-target` is what a build needs
260
- * to know before it starts; `/project-source` is what it builds;
261
- * `/update-target` is the same question as `/build-target` for a managed
262
- * project moving onto its template's current dependencies.
260
+ * to know before it starts; `/project-source` is what it builds. Not
261
+ * `/update-target` any more: a managed project's dependencies are upgraded
262
+ * in a proposal (valbuild/home `docs/adept.md`, step 7), not by publishing
263
+ * its template's.
263
264
  *
264
265
  * `/project-source` is here rather than on a route of its own because it is
265
266
  * one of the three things a publish asks for and none of them are useful
@@ -294,7 +295,9 @@ export declare class ValOpsHttp extends ValOps {
294
295
  */
295
296
  private static proposalsApiAllowed;
296
297
  /**
297
- * A write to a proposal's FILES -- staging code, serving a build of it
298
+ * A write to a proposal's FILES -- staging code, computing its lockfile
299
+ * (valbuild/home `docs/adept.md`, step 6), reporting the typecheck of
300
+ * them (step 7, decision 20), serving a build of it
298
301
  * (valbuild/home `docs/hosted-publishing.md`, step 7), or moving it onto the
299
302
  * site's code (step 8, "Update from the site") -- is made by the
300
303
  * proposal's own server and nobody else's: the file tools act on the
@@ -5736,9 +5736,10 @@ class ValOpsHttp extends ValRouterCore.ValOps {
5736
5736
  * An allow list rather than a prefix check, because this method holds a
5737
5737
  * credential and the browser chooses the path. `/publish/{id}` and its three
5738
5738
  * steps are the publish conversation; `/build-target` is what a build needs
5739
- * to know before it starts; `/project-source` is what it builds;
5740
- * `/update-target` is the same question as `/build-target` for a managed
5741
- * project moving onto its template's current dependencies.
5739
+ * to know before it starts; `/project-source` is what it builds. Not
5740
+ * `/update-target` any more: a managed project's dependencies are upgraded
5741
+ * in a proposal (valbuild/home `docs/adept.md`, step 7), not by publishing
5742
+ * its template's.
5742
5743
  *
5743
5744
  * `/project-source` is here rather than on a route of its own because it is
5744
5745
  * one of the three things a publish asks for and none of them are useful
@@ -5756,10 +5757,14 @@ class ValOpsHttp extends ValRouterCore.ValOps {
5756
5757
  if (/^\/publish-jobs\/[A-Za-z0-9_-]{1,100}\/merge-prepare$/.test(path)) {
5757
5758
  return true;
5758
5759
  }
5759
- if (path === "/build-target" || path === "/project-source" || path === "/update-target" || path === "/publish" ||
5760
+ if (path === "/build-target" || path === "/project-source" || path === "/publish" ||
5760
5761
  // Where "View run" goes, for a connected build CI reported failed.
5761
5762
  // Read only: reporting a run is CI's, with its own token.
5762
- path === "/ci-runs/newest") {
5763
+ path === "/ci-runs/newest" ||
5764
+ // Whether there is anything to upgrade, and the site's lockfile the
5765
+ // typecheck of an upgrade compares against (valbuild/home
5766
+ // `docs/adept.md`, step 7). Both read only.
5767
+ path === "/upgrades" || path === "/dependency-files") {
5763
5768
  return true;
5764
5769
  }
5765
5770
  /*
@@ -5823,11 +5828,13 @@ class ValOpsHttp extends ValRouterCore.ValOps {
5823
5828
  const one = /^\/[0-9a-f]{20}$/.test(path);
5824
5829
  if (one) return method === "GET" || method === "PATCH";
5825
5830
  if (method === "GET") return /^\/[0-9a-f]{20}\/(merge-checks|files|merge-trees|build-target)$/.test(path);
5826
- return method === "POST" && /^\/[0-9a-f]{20}\/(close|reopen|setup\/retry|merge|files|build|update-from-site|restore-code)$/.test(path);
5831
+ return method === "POST" && /^\/[0-9a-f]{20}\/(close|reopen|setup\/retry|merge|files|lockfile|typecheck|build|update-from-site|restore-code)$/.test(path);
5827
5832
  }
5828
5833
 
5829
5834
  /**
5830
- * A write to a proposal's FILES -- staging code, serving a build of it
5835
+ * A write to a proposal's FILES -- staging code, computing its lockfile
5836
+ * (valbuild/home `docs/adept.md`, step 6), reporting the typecheck of
5837
+ * them (step 7, decision 20), serving a build of it
5831
5838
  * (valbuild/home `docs/hosted-publishing.md`, step 7), or moving it onto the
5832
5839
  * site's code (step 8, "Update from the site") -- is made by the
5833
5840
  * proposal's own server and nobody else's: the file tools act on the
@@ -5838,7 +5845,7 @@ class ValOpsHttp extends ValRouterCore.ValOps {
5838
5845
  static proposalFilesWrite(method, path) {
5839
5846
  var _exec;
5840
5847
  if (method !== "POST") return null;
5841
- return ((_exec = /^\/([0-9a-f]{20})\/(files|build|update-from-site|restore-code)$/.exec(path)) === null || _exec === void 0 ? void 0 : _exec[1]) ?? null;
5848
+ return ((_exec = /^\/([0-9a-f]{20})\/(files|lockfile|typecheck|build|update-from-site|restore-code)$/.exec(path)) === null || _exec === void 0 ? void 0 : _exec[1]) ?? null;
5842
5849
  }
5843
5850
 
5844
5851
  /**
@@ -5853,6 +5860,11 @@ class ValOpsHttp extends ValRouterCore.ValOps {
5853
5860
  if (path === "/build-target" || path === "/project-source" || path === "/publish") {
5854
5861
  return true;
5855
5862
  }
5863
+ // An upgrade proposal's typecheck compares against the site's lockfile,
5864
+ // and its chrome asks whether there is anything to upgrade. Read only.
5865
+ if (method === "GET" && (path === "/upgrades" || path === "/dependency-files")) {
5866
+ return true;
5867
+ }
5856
5868
  if (/^\/publish\/[A-Za-z0-9_-]+\/artifacts$/.test(path)) return true;
5857
5869
  if (ValOpsHttp.adeptPathAllowed(path)) return true;
5858
5870
  // Where its press is -- read only: a POST there is the site's Try again.
@@ -5736,9 +5736,10 @@ class ValOpsHttp extends ValRouterCore.ValOps {
5736
5736
  * An allow list rather than a prefix check, because this method holds a
5737
5737
  * credential and the browser chooses the path. `/publish/{id}` and its three
5738
5738
  * steps are the publish conversation; `/build-target` is what a build needs
5739
- * to know before it starts; `/project-source` is what it builds;
5740
- * `/update-target` is the same question as `/build-target` for a managed
5741
- * project moving onto its template's current dependencies.
5739
+ * to know before it starts; `/project-source` is what it builds. Not
5740
+ * `/update-target` any more: a managed project's dependencies are upgraded
5741
+ * in a proposal (valbuild/home `docs/adept.md`, step 7), not by publishing
5742
+ * its template's.
5742
5743
  *
5743
5744
  * `/project-source` is here rather than on a route of its own because it is
5744
5745
  * one of the three things a publish asks for and none of them are useful
@@ -5756,10 +5757,14 @@ class ValOpsHttp extends ValRouterCore.ValOps {
5756
5757
  if (/^\/publish-jobs\/[A-Za-z0-9_-]{1,100}\/merge-prepare$/.test(path)) {
5757
5758
  return true;
5758
5759
  }
5759
- if (path === "/build-target" || path === "/project-source" || path === "/update-target" || path === "/publish" ||
5760
+ if (path === "/build-target" || path === "/project-source" || path === "/publish" ||
5760
5761
  // Where "View run" goes, for a connected build CI reported failed.
5761
5762
  // Read only: reporting a run is CI's, with its own token.
5762
- path === "/ci-runs/newest") {
5763
+ path === "/ci-runs/newest" ||
5764
+ // Whether there is anything to upgrade, and the site's lockfile the
5765
+ // typecheck of an upgrade compares against (valbuild/home
5766
+ // `docs/adept.md`, step 7). Both read only.
5767
+ path === "/upgrades" || path === "/dependency-files") {
5763
5768
  return true;
5764
5769
  }
5765
5770
  /*
@@ -5823,11 +5828,13 @@ class ValOpsHttp extends ValRouterCore.ValOps {
5823
5828
  const one = /^\/[0-9a-f]{20}$/.test(path);
5824
5829
  if (one) return method === "GET" || method === "PATCH";
5825
5830
  if (method === "GET") return /^\/[0-9a-f]{20}\/(merge-checks|files|merge-trees|build-target)$/.test(path);
5826
- return method === "POST" && /^\/[0-9a-f]{20}\/(close|reopen|setup\/retry|merge|files|build|update-from-site|restore-code)$/.test(path);
5831
+ return method === "POST" && /^\/[0-9a-f]{20}\/(close|reopen|setup\/retry|merge|files|lockfile|typecheck|build|update-from-site|restore-code)$/.test(path);
5827
5832
  }
5828
5833
 
5829
5834
  /**
5830
- * A write to a proposal's FILES -- staging code, serving a build of it
5835
+ * A write to a proposal's FILES -- staging code, computing its lockfile
5836
+ * (valbuild/home `docs/adept.md`, step 6), reporting the typecheck of
5837
+ * them (step 7, decision 20), serving a build of it
5831
5838
  * (valbuild/home `docs/hosted-publishing.md`, step 7), or moving it onto the
5832
5839
  * site's code (step 8, "Update from the site") -- is made by the
5833
5840
  * proposal's own server and nobody else's: the file tools act on the
@@ -5838,7 +5845,7 @@ class ValOpsHttp extends ValRouterCore.ValOps {
5838
5845
  static proposalFilesWrite(method, path) {
5839
5846
  var _exec;
5840
5847
  if (method !== "POST") return null;
5841
- return ((_exec = /^\/([0-9a-f]{20})\/(files|build|update-from-site|restore-code)$/.exec(path)) === null || _exec === void 0 ? void 0 : _exec[1]) ?? null;
5848
+ return ((_exec = /^\/([0-9a-f]{20})\/(files|lockfile|typecheck|build|update-from-site|restore-code)$/.exec(path)) === null || _exec === void 0 ? void 0 : _exec[1]) ?? null;
5842
5849
  }
5843
5850
 
5844
5851
  /**
@@ -5853,6 +5860,11 @@ class ValOpsHttp extends ValRouterCore.ValOps {
5853
5860
  if (path === "/build-target" || path === "/project-source" || path === "/publish") {
5854
5861
  return true;
5855
5862
  }
5863
+ // An upgrade proposal's typecheck compares against the site's lockfile,
5864
+ // and its chrome asks whether there is anything to upgrade. Read only.
5865
+ if (method === "GET" && (path === "/upgrades" || path === "/dependency-files")) {
5866
+ return true;
5867
+ }
5856
5868
  if (/^\/publish\/[A-Za-z0-9_-]+\/artifacts$/.test(path)) return true;
5857
5869
  if (ValOpsHttp.adeptPathAllowed(path)) return true;
5858
5870
  // Where its press is -- read only: a POST there is the site's Try again.
@@ -5700,9 +5700,10 @@ class ValOpsHttp extends ValOps {
5700
5700
  * An allow list rather than a prefix check, because this method holds a
5701
5701
  * credential and the browser chooses the path. `/publish/{id}` and its three
5702
5702
  * steps are the publish conversation; `/build-target` is what a build needs
5703
- * to know before it starts; `/project-source` is what it builds;
5704
- * `/update-target` is the same question as `/build-target` for a managed
5705
- * project moving onto its template's current dependencies.
5703
+ * to know before it starts; `/project-source` is what it builds. Not
5704
+ * `/update-target` any more: a managed project's dependencies are upgraded
5705
+ * in a proposal (valbuild/home `docs/adept.md`, step 7), not by publishing
5706
+ * its template's.
5706
5707
  *
5707
5708
  * `/project-source` is here rather than on a route of its own because it is
5708
5709
  * one of the three things a publish asks for and none of them are useful
@@ -5720,10 +5721,14 @@ class ValOpsHttp extends ValOps {
5720
5721
  if (/^\/publish-jobs\/[A-Za-z0-9_-]{1,100}\/merge-prepare$/.test(path)) {
5721
5722
  return true;
5722
5723
  }
5723
- if (path === "/build-target" || path === "/project-source" || path === "/update-target" || path === "/publish" ||
5724
+ if (path === "/build-target" || path === "/project-source" || path === "/publish" ||
5724
5725
  // Where "View run" goes, for a connected build CI reported failed.
5725
5726
  // Read only: reporting a run is CI's, with its own token.
5726
- path === "/ci-runs/newest") {
5727
+ path === "/ci-runs/newest" ||
5728
+ // Whether there is anything to upgrade, and the site's lockfile the
5729
+ // typecheck of an upgrade compares against (valbuild/home
5730
+ // `docs/adept.md`, step 7). Both read only.
5731
+ path === "/upgrades" || path === "/dependency-files") {
5727
5732
  return true;
5728
5733
  }
5729
5734
  /*
@@ -5787,11 +5792,13 @@ class ValOpsHttp extends ValOps {
5787
5792
  const one = /^\/[0-9a-f]{20}$/.test(path);
5788
5793
  if (one) return method === "GET" || method === "PATCH";
5789
5794
  if (method === "GET") return /^\/[0-9a-f]{20}\/(merge-checks|files|merge-trees|build-target)$/.test(path);
5790
- return method === "POST" && /^\/[0-9a-f]{20}\/(close|reopen|setup\/retry|merge|files|build|update-from-site|restore-code)$/.test(path);
5795
+ return method === "POST" && /^\/[0-9a-f]{20}\/(close|reopen|setup\/retry|merge|files|lockfile|typecheck|build|update-from-site|restore-code)$/.test(path);
5791
5796
  }
5792
5797
 
5793
5798
  /**
5794
- * A write to a proposal's FILES -- staging code, serving a build of it
5799
+ * A write to a proposal's FILES -- staging code, computing its lockfile
5800
+ * (valbuild/home `docs/adept.md`, step 6), reporting the typecheck of
5801
+ * them (step 7, decision 20), serving a build of it
5795
5802
  * (valbuild/home `docs/hosted-publishing.md`, step 7), or moving it onto the
5796
5803
  * site's code (step 8, "Update from the site") -- is made by the
5797
5804
  * proposal's own server and nobody else's: the file tools act on the
@@ -5802,7 +5809,7 @@ class ValOpsHttp extends ValOps {
5802
5809
  static proposalFilesWrite(method, path) {
5803
5810
  var _exec;
5804
5811
  if (method !== "POST") return null;
5805
- return ((_exec = /^\/([0-9a-f]{20})\/(files|build|update-from-site|restore-code)$/.exec(path)) === null || _exec === void 0 ? void 0 : _exec[1]) ?? null;
5812
+ return ((_exec = /^\/([0-9a-f]{20})\/(files|lockfile|typecheck|build|update-from-site|restore-code)$/.exec(path)) === null || _exec === void 0 ? void 0 : _exec[1]) ?? null;
5806
5813
  }
5807
5814
 
5808
5815
  /**
@@ -5817,6 +5824,11 @@ class ValOpsHttp extends ValOps {
5817
5824
  if (path === "/build-target" || path === "/project-source" || path === "/publish") {
5818
5825
  return true;
5819
5826
  }
5827
+ // An upgrade proposal's typecheck compares against the site's lockfile,
5828
+ // and its chrome asks whether there is anything to upgrade. Read only.
5829
+ if (method === "GET" && (path === "/upgrades" || path === "/dependency-files")) {
5830
+ return true;
5831
+ }
5820
5832
  if (/^\/publish\/[A-Za-z0-9_-]+\/artifacts$/.test(path)) return true;
5821
5833
  if (ValOpsHttp.adeptPathAllowed(path)) return true;
5822
5834
  // Where its press is -- read only: a POST there is the site's Try again.
package/package.json CHANGED
@@ -27,7 +27,7 @@
27
27
  ],
28
28
  "exports": true
29
29
  },
30
- "version": "0.148.8",
30
+ "version": "0.149.0",
31
31
  "devDependencies": {
32
32
  "@prettier/sync": "^0.6.1",
33
33
  "@types/jest": "^30.0.0",
@@ -41,8 +41,8 @@
41
41
  "typescript": "^6.0.3",
42
42
  "zod": "^4.4.3",
43
43
  "zod-validation-error": "^5.0.0",
44
- "@valbuild/ui": "0.148.8",
45
44
  "@valbuild/core": "0.148.7",
45
+ "@valbuild/ui": "0.149.0",
46
46
  "@valbuild/shared": "0.148.7"
47
47
  },
48
48
  "engines": {