@valbuild/cli 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,69 @@
|
|
|
1
1
|
# @valbuild/cli
|
|
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 [[`802412b`](https://github.com/valbuild/val/commit/802412b92c06bc1abbca78c86885e39c8710dd83)]:
|
|
63
|
+
- @valbuild/server@0.133.0
|
|
64
|
+
- @valbuild/shared@0.133.0
|
|
65
|
+
- @valbuild/language-server@0.133.0
|
|
66
|
+
|
|
3
67
|
## 0.132.1
|
|
4
68
|
|
|
5
69
|
### Patch Changes
|
|
@@ -1196,7 +1196,10 @@ async function createDebugContext(options) {
|
|
|
1196
1196
|
authKind: "pat" in auth ? "pat" : "api-key",
|
|
1197
1197
|
contentUrl,
|
|
1198
1198
|
filesDirectory,
|
|
1199
|
-
serverOps: new server.ValOpsHttp(contentUrl, project,
|
|
1199
|
+
serverOps: new server.ValOpsHttp(contentUrl, project, {
|
|
1200
|
+
commit,
|
|
1201
|
+
branch
|
|
1202
|
+
}, auth, valModules, {
|
|
1200
1203
|
root: config.root,
|
|
1201
1204
|
config
|
|
1202
1205
|
})
|
|
@@ -1196,7 +1196,10 @@ async function createDebugContext(options) {
|
|
|
1196
1196
|
authKind: "pat" in auth ? "pat" : "api-key",
|
|
1197
1197
|
contentUrl,
|
|
1198
1198
|
filesDirectory,
|
|
1199
|
-
serverOps: new server.ValOpsHttp(contentUrl, project,
|
|
1199
|
+
serverOps: new server.ValOpsHttp(contentUrl, project, {
|
|
1200
|
+
commit,
|
|
1201
|
+
branch
|
|
1202
|
+
}, auth, valModules, {
|
|
1200
1203
|
root: config.root,
|
|
1201
1204
|
config
|
|
1202
1205
|
})
|
|
@@ -1164,7 +1164,10 @@ async function createDebugContext(options) {
|
|
|
1164
1164
|
authKind: "pat" in auth ? "pat" : "api-key",
|
|
1165
1165
|
contentUrl,
|
|
1166
1166
|
filesDirectory,
|
|
1167
|
-
serverOps: new ValOpsHttp(contentUrl, project,
|
|
1167
|
+
serverOps: new ValOpsHttp(contentUrl, project, {
|
|
1168
|
+
commit,
|
|
1169
|
+
branch
|
|
1170
|
+
}, auth, valModules, {
|
|
1168
1171
|
root: config.root,
|
|
1169
1172
|
config
|
|
1170
1173
|
})
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valbuild/cli",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.133.0",
|
|
5
5
|
"description": "Val CLI tools",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"jszip": "^3.10.1",
|
|
25
25
|
"meow": "^9.0.0",
|
|
26
26
|
"picocolors": "^1.1.1",
|
|
27
|
-
"@valbuild/core": "0.130.0",
|
|
28
27
|
"@valbuild/eslint-plugin": "0.125.0",
|
|
29
|
-
"@valbuild/language-server": "0.
|
|
30
|
-
"@valbuild/server": "0.
|
|
31
|
-
"@valbuild/shared": "0.
|
|
28
|
+
"@valbuild/language-server": "0.133.0",
|
|
29
|
+
"@valbuild/server": "0.133.0",
|
|
30
|
+
"@valbuild/shared": "0.133.0",
|
|
31
|
+
"@valbuild/core": "0.130.0"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"prettier": "*",
|
package/src/debug/context.ts
CHANGED