@valbuild/tanstack 0.132.1 → 0.133.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,72 @@
1
1
  # @valbuild/tanstack
2
2
 
3
+ ## 0.133.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#700](https://github.com/valbuild/val/pull/700) [`802412b`](https://github.com/valbuild/val/commit/802412b92c06bc1abbca78c86885e39c8710dd83) Thanks [@freekh](https://github.com/freekh)! - http mode no longer needs a git repository
8
+
9
+ A Val app can now run in http mode with no commit and no branch — its content
10
+ service is the store of record, and git is an optional mirror of the code. This
11
+ is what `fs` mode has always done: it has never had git, and it works.
12
+
13
+ Before this, `VAL_API_KEY` and `VAL_SECRET` were not enough. `VAL_GIT_COMMIT`
14
+ and `VAL_GIT_BRANCH` were required too, so a deployment with no commit to name
15
+ either threw at boot or fell through to `fs` mode and reached for a working
16
+ tree that was not there.
17
+
18
+ **Breaking, if you pass `http` options in code.** `gitCommit` and `gitBranch`
19
+ are replaced by one optional `git`:
20
+
21
+ ```diff
22
+ initValServer(valModules, config, {
23
+ http: {
24
+ apiKey,
25
+ valSecret,
26
+ - gitCommit: process.env.VAL_GIT_COMMIT,
27
+ - gitBranch: "main",
28
+ + // Only for a project whose content is mirrored into a repository.
29
+ + // Omit it entirely otherwise.
30
+ + git: { commit: process.env.VAL_GIT_COMMIT, branch: "main" },
31
+ },
32
+ })
33
+ ```
34
+
35
+ `VAL_GIT_COMMIT` and `VAL_GIT_BRANCH` still work and are still read; they are
36
+ simply no longer required. Set both or neither — a commit without a branch, or
37
+ a branch without a commit, is refused at startup with a message naming the
38
+ missing half, rather than failing later at a publish.
39
+
40
+ **What a commit is for, where you have one.** Turning pending patches into new
41
+ `.val.ts` text means reading the current text first, and that read goes to the
42
+ content service at that commit. It is the publish path, not the serving path: a
43
+ committed render reads the source compiled into the build and asks the content
44
+ service nothing. With no repository there is nothing to write `.val.ts` into,
45
+ so a publish records the module's data and its schema and skips the file — and
46
+ that data is what history reads, so nothing is lost.
47
+
48
+ **A publish can now be refused by name, before it is attempted.** If a project
49
+ mirrors its commits into a repository but the running deployment was built
50
+ before that repository existed, it has no commit to write the mirror against.
51
+ Publishing anyway would save the content and silently leave the repository
52
+ behind. The Studio now disables Publish and shows why, and `/save` refuses with
53
+ a `no-base` code instead of failing partway.
54
+
55
+ **Also:** `ValCommit` and `HistoricalCommit` have nullable `parentCommitSha`
56
+ and `clientCommitSha`, and `/stat`'s `commitSha` is optional. A root commit has
57
+ no parent, and a publisher with no repository does not report where it was. If
58
+ you read these fields, handle `null`.
59
+
60
+ ### Patch Changes
61
+
62
+ - Updated dependencies [[`2b9a51b`](https://github.com/valbuild/val/commit/2b9a51b7dbe2dff53b7686a4f3b7eb9bc5784fae), [`802412b`](https://github.com/valbuild/val/commit/802412b92c06bc1abbca78c86885e39c8710dd83)]:
63
+ - @valbuild/ui@0.133.0
64
+ - @valbuild/server@0.133.0
65
+ - @valbuild/shared@0.133.0
66
+ - @valbuild/react@0.133.0
67
+ - @valbuild/language-server@0.133.0
68
+ - @valbuild/mcp@0.133.0
69
+
3
70
  ## 0.132.1
4
71
 
5
72
  ### Patch Changes
@@ -158,11 +158,12 @@ export declare function initValContent(config: ValConfig, valModules: ValModules
158
158
  * `process.env.VAL_API_KEY` is undefined in a bundle built separately from
159
159
  * its dependencies.
160
160
  *
161
- * `gitCommit` is what makes this more than bookkeeping here: every read
162
- * fetches the module's path from the content service AT THAT COMMIT, so
163
- * these readers and the API have to be given the same one or a draft
164
- * render resolves a different version of the file than the site is
165
- * running.
161
+ * `git`, where the project has a repository, is what makes this more than
162
+ * bookkeeping: it decides which commit the `.val.ts` mirror is produced
163
+ * against, so these readers and the API have to be given the same one or a
164
+ * publish patches a different version of the file than the site is
165
+ * running. A project with no repository passes no `git` at all, and there
166
+ * is nothing here that can then disagree.
166
167
  */
167
168
  http?: ValHttpMode;
168
169
  }): {
@@ -13,10 +13,20 @@ export type ValHttpMode = {
13
13
  apiKey: string;
14
14
  /** Signs the session cookie. Any sufficiently random string. */
15
15
  valSecret: string;
16
- /** The commit the running code was built from. See the note at the use. */
17
- gitCommit: string;
18
- /** The branch a publish commits to. */
19
- gitBranch: string;
16
+ /**
17
+ * The repository this project's content is mirrored into, if it has one.
18
+ *
19
+ * OPTIONAL, and absent is the normal case for a project whose content
20
+ * service is the store of record: it mints its own commit shas and knows the
21
+ * project's branch, so there is nothing to bake into the build.
22
+ *
23
+ * Where there is one: `commit` is the commit the running code was built
24
+ * from, and it is load bearing. See the note at the use.
25
+ */
26
+ git?: {
27
+ commit: string;
28
+ branch: string;
29
+ };
20
30
  /**
21
31
  * Val's content service, when it is not the real one.
22
32
  *
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = require('./version-b5f813e5.cjs.dev.js');
5
+ var version = require('./version-8deeac5f.cjs.dev.js');
6
6
  var createForOfIteratorHelper = require('./createForOfIteratorHelper-e75681d7.cjs.dev.js');
7
7
  var core = require('@valbuild/core');
8
8
  var stega = require('@valbuild/react/stega');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = require('./version-f063babb.cjs.prod.js');
5
+ var version = require('./version-7d59b1f2.cjs.prod.js');
6
6
  var createForOfIteratorHelper = require('./createForOfIteratorHelper-0324e063.cjs.prod.js');
7
7
  var core = require('@valbuild/core');
8
8
  var stega = require('@valbuild/react/stega');
@@ -1,4 +1,4 @@
1
- import { _ as _asyncToGenerator, a as _regenerator, r as readValEnableCookie, V as VERSION$1 } from './version-c9d3b456.esm.js';
1
+ import { _ as _asyncToGenerator, a as _regenerator, r as readValEnableCookie, V as VERSION$1 } from './version-ed8bd465.esm.js';
2
2
  import { _ as _objectSpread2, a as _slicedToArray, b as _createForOfIteratorHelper } from './createForOfIteratorHelper-485c2ce1.esm.js';
3
3
  import { Internal as Internal$1, initVal as initVal$1, DEFAULT_CONTENT_HOST } from '@valbuild/core';
4
4
  import * as core from '@valbuild/core';
@@ -212,7 +212,7 @@ var packageJson = {
212
212
  "tanstack-router",
213
213
  "react"
214
214
  ],
215
- version: "0.132.1",
215
+ version: "0.133.0",
216
216
  scripts: {
217
217
  typecheck: "tsc --noEmit",
218
218
  test: "jest"
@@ -212,7 +212,7 @@ var packageJson = {
212
212
  "tanstack-router",
213
213
  "react"
214
214
  ],
215
- version: "0.132.1",
215
+ version: "0.133.0",
216
216
  scripts: {
217
217
  typecheck: "tsc --noEmit",
218
218
  test: "jest"
@@ -210,7 +210,7 @@ var packageJson = {
210
210
  "tanstack-router",
211
211
  "react"
212
212
  ],
213
- version: "0.132.1",
213
+ version: "0.133.0",
214
214
  scripts: {
215
215
  typecheck: "tsc --noEmit",
216
216
  test: "jest"
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "tanstack-router",
15
15
  "react"
16
16
  ],
17
- "version": "0.132.1",
17
+ "version": "0.133.0",
18
18
  "main": "dist/valbuild-tanstack.cjs.js",
19
19
  "module": "dist/valbuild-tanstack.esm.js",
20
20
  "exports": {
@@ -42,13 +42,13 @@
42
42
  "exports": true
43
43
  },
44
44
  "dependencies": {
45
- "@valbuild/language-server": "0.132.1",
46
- "@valbuild/mcp": "0.132.1",
47
45
  "@valbuild/core": "0.130.0",
48
- "@valbuild/server": "0.132.1",
49
- "@valbuild/react": "0.132.1",
50
- "@valbuild/shared": "0.130.0",
51
- "@valbuild/ui": "0.132.1"
46
+ "@valbuild/language-server": "0.133.0",
47
+ "@valbuild/mcp": "0.133.0",
48
+ "@valbuild/react": "0.133.0",
49
+ "@valbuild/server": "0.133.0",
50
+ "@valbuild/shared": "0.133.0",
51
+ "@valbuild/ui": "0.133.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@tanstack/react-router": "^1.170.33",
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = require('../../dist/version-b5f813e5.cjs.dev.js');
5
+ var version = require('../../dist/version-8deeac5f.cjs.dev.js');
6
6
  var core = require('@valbuild/core');
7
7
  var createForOfIteratorHelper = require('../../dist/createForOfIteratorHelper-e75681d7.cjs.dev.js');
8
8
  var server = require('@valbuild/server');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = require('../../dist/version-f063babb.cjs.prod.js');
5
+ var version = require('../../dist/version-7d59b1f2.cjs.prod.js');
6
6
  var core = require('@valbuild/core');
7
7
  var createForOfIteratorHelper = require('../../dist/createForOfIteratorHelper-0324e063.cjs.prod.js');
8
8
  var server = require('@valbuild/server');
@@ -1,4 +1,4 @@
1
- import { _ as _asyncToGenerator, a as _regenerator, V as VERSION, s as setValEnableCookieReader } from '../../dist/version-c9d3b456.esm.js';
1
+ import { _ as _asyncToGenerator, a as _regenerator, V as VERSION, s as setValEnableCookieReader } from '../../dist/version-ed8bd465.esm.js';
2
2
  import { Internal } from '@valbuild/core';
3
3
  import { _ as _objectSpread2, a as _slicedToArray, d as _defineProperty } from '../../dist/createForOfIteratorHelper-485c2ce1.esm.js';
4
4
  import { createValApiRouter, createValServer } from '@valbuild/server';