@valbuild/language-server 0.140.2 → 0.141.1
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 +77 -0
- package/dist/declarations/src/commands.d.ts +1 -1
- package/dist/declarations/src/completionContext.d.ts +1 -1
- package/dist/declarations/src/completions.d.ts +1 -1
- package/dist/declarations/src/diagnostics.d.ts +5 -3
- package/dist/declarations/src/publicValFiles.d.ts +11 -4
- package/dist/valbuild-language-server.cjs.dev.js +238 -138
- package/dist/valbuild-language-server.cjs.prod.js +238 -138
- package/dist/valbuild-language-server.esm.js +238 -138
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,82 @@
|
|
|
1
1
|
# @valbuild/language-server
|
|
2
2
|
|
|
3
|
+
## 0.141.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`14b18d7`](https://github.com/valbuild/val/commit/14b18d7cb145cec1bc1cd832b9ca857ff4b45adc)]:
|
|
8
|
+
- @valbuild/server@0.141.1
|
|
9
|
+
|
|
10
|
+
## 0.141.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [#802](https://github.com/valbuild/val/pull/802) [`199e214`](https://github.com/valbuild/val/commit/199e21471d98806fb34c579cb876560078c928b9) Thanks [@freekh](https://github.com/freekh)! - New: `files: { remote: true }` in `val.config.ts` stores every image, file and video on Val's remote content host.
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
const { s, c, val, config } = initVal({
|
|
18
|
+
project: "myorg/myproject",
|
|
19
|
+
files: { remote: true },
|
|
20
|
+
});
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
With it, `s.image()`, `s.file()`, `s.video()`, `s.imageset()`, `s.fileset()`, `s.videoset()` and `s.richtext({ img: true })` behave as though `.remote()` had been written on them. Images already in the project are reported as `image:upload-remote` until they are uploaded; `npx val validate --fix` does that.
|
|
24
|
+
|
|
25
|
+
**Required in the Val app.** A project running there (`VAL_ENV=app`) refuses to start without it, with an error that says what to add, and `val publish` refuses before it builds.
|
|
26
|
+
|
|
27
|
+
**Breaking:** `files.directory` has been removed from `val.config.ts`. Local files that have no `dir` of their own are stored in `/public/val`, which was the default.
|
|
28
|
+
|
|
29
|
+
- [#779](https://github.com/valbuild/val/pull/779) [`ba3f330`](https://github.com/valbuild/val/commit/ba3f3300a3dd8649e154097cdfca3b64db209d89) Thanks [@freekh](https://github.com/freekh)! - New: `s.video()`, for mp4/WebM files and HLS streams.
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
const schema = s.object({
|
|
33
|
+
intro: s.video({ stream: { type: "hls" } }),
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
- **Upload and play in the Studio.** A video field shows a player, the file's size and length, and progress while it uploads.
|
|
38
|
+
- **HLS streaming without a video service.** With `stream: { type: "hls" }`, the Studio converts an upload to an HLS stream in the editor's browser before it uploads it. It makes one H.264 rendition per height (1080p, 720p and 480p by default, and never larger than the upload) and stores them as a folder of files next to your other uploads. Nothing is installed in your app for this: the converter ships inside the Studio and is only downloaded when someone uploads to a streaming field. A browser that can't convert (no WebCodecs, or a non-https address) uploads the original file and says so.
|
|
39
|
+
- **Poster:** pause on a frame and choose "Use current frame". The frame is saved as an image, and `posterTime` records where it was taken.
|
|
40
|
+
- **Start and end:** play part of a video without cutting the file.
|
|
41
|
+
- **Focal point:** marks what must stay in frame when the page crops the video.
|
|
42
|
+
- **Description:** text for people who can't see the video.
|
|
43
|
+
- **Captions:** one WebVTT file per language. `.srt` files are converted on upload.
|
|
44
|
+
- **`<ValVideo>`** in `@valbuild/next` and `@valbuild/tanstack` renders all of the above and is click-to-edit. For HLS in browsers that can't play it natively, pass `hls={() => import("hls.js")}`. It is only loaded when it's needed.
|
|
45
|
+
- **Rename** a video in the Studio. An HLS stream is renamed as a whole: every playlist and segment moves to the new folder.
|
|
46
|
+
- `npx val validate --fix` fills in `mimeType`, `width`, `height` and `duration` for a hand-written `.mp4`, `.mov`, `.webm`, `.mkv` or HLS video, on disk or on Val Remote. A remote video is not downloaded: only its headers are read, usually in one to three small requests.
|
|
47
|
+
- `.remote()` works for videos. `npx val validate --fix` moves a video to Val Remote, or back into the project, together with its poster, captions and every file of an HLS stream.
|
|
48
|
+
|
|
49
|
+
A video value always has a `mimeType`: it is how a page knows whether it has an `.mp4` or an `.m3u8`.
|
|
50
|
+
|
|
51
|
+
New: `s.videoset()`, a collection of videos, like `s.imageset()` for images.
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
const videosVal = c.define(
|
|
55
|
+
"/content/videos.val.ts",
|
|
56
|
+
s.videoset({ dir: "/public/val/videos", stream: { type: "hls" } }),
|
|
57
|
+
{},
|
|
58
|
+
);
|
|
59
|
+
const schema = s.object({ intro: s.video(videosVal) });
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- **Upload once, set it up once, use anywhere.** A set's entry holds what is true of the file (its type, size and length) and, as defaults, a description, poster, start and end, focal point and captions. A field that picks from the set (`s.video(videosVal)`) gets all of those, and can override any of them on its own. For example, the same clip can open one page at 0:02 and every other page where the set says.
|
|
63
|
+
- **Media in the Studio.** A set is listed under Media and opens as a gallery of videos, with each video's poster as its thumbnail. Hovering a video previews it, and the selected video plays in a real player (HLS streams too) beside the poster, times, focal point and captions you edit for it. You can upload into the set (with `stream`, uploads become HLS streams, and each upload gets a poster), rename a video, and delete a video that nothing uses. Renaming a video updates every field that uses it. An HLS stream is one entry, and renaming or deleting it moves or removes all of its files.
|
|
64
|
+
- **Picking.** A set-backed field picks from the set, or uploads into it. Each value the set provides is marked "From gallery · Override", and once overridden, "Overridden · Use gallery's".
|
|
65
|
+
- `useVal` and `fetchVal` fill in what the set holds (`mimeType`, `width`, `height`, `duration`, and every default the field does not override), so `<ValVideo>` works the same either way.
|
|
66
|
+
- `.remote()` works for sets. `npx val validate --fix` fills in missing metadata for an entry, adds untracked videos found in the set's directory, and moves a set's videos to Val Remote.
|
|
67
|
+
|
|
68
|
+
Image and file galleries use the same new gallery layout: a grid or list of entries, with the selected one open in a panel beside it.
|
|
69
|
+
|
|
70
|
+
- An `s.imageset()` entry can hold a default focal point, as well as its description. An `s.image(galleryVal)` field shows both, and can override either.
|
|
71
|
+
- Fixed: outside draft mode, `useVal` and `fetchVal` now fill a gallery-backed image or file from its gallery (dimensions, mime type, description). Before, a published page got only the `path`.
|
|
72
|
+
|
|
73
|
+
### Patch Changes
|
|
74
|
+
|
|
75
|
+
- Updated dependencies [[`199e214`](https://github.com/valbuild/val/commit/199e21471d98806fb34c579cb876560078c928b9), [`ba3f330`](https://github.com/valbuild/val/commit/ba3f3300a3dd8649e154097cdfca3b64db209d89)]:
|
|
76
|
+
- @valbuild/core@0.141.0
|
|
77
|
+
- @valbuild/server@0.141.0
|
|
78
|
+
- @valbuild/shared@0.141.0
|
|
79
|
+
|
|
3
80
|
## 0.140.2
|
|
4
81
|
|
|
5
82
|
### Patch Changes
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { type ModuleFilePath, type SourcePath, type ValidationFix } from "@valbuild/core";
|
|
20
20
|
import { type Connection } from "vscode-languageserver";
|
|
21
|
-
import
|
|
21
|
+
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
22
22
|
import type { ValProject } from "./ValProject.js";
|
|
23
23
|
/** Names advertised in `executeCommandProvider.commands`. */
|
|
24
24
|
export declare const VAL_LOGIN_COMMAND = "val.login";
|
|
@@ -35,7 +35,7 @@ export type ValStringValueContext = {
|
|
|
35
35
|
*/
|
|
36
36
|
export declare function getValCompletionContext(sourceFile: ts.SourceFile, offset: number): ValCompletionContext | undefined;
|
|
37
37
|
/** The properties Val computes from a file's bytes. */
|
|
38
|
-
export declare const MEDIA_METADATA_KEYS: readonly ["width", "height", "mimeType"];
|
|
38
|
+
export declare const MEDIA_METADATA_KEYS: readonly ["width", "height", "mimeType", "duration"];
|
|
39
39
|
export type MediaMetadataKey = (typeof MEDIA_METADATA_KEYS)[number];
|
|
40
40
|
export type MediaPathObject = {
|
|
41
41
|
/** Offset to insert missing metadata properties after. */
|
|
@@ -18,7 +18,7 @@ export type ValCompletionItemData = {
|
|
|
18
18
|
ref: string;
|
|
19
19
|
/** Absolute path of the chosen file. */
|
|
20
20
|
filePath: string;
|
|
21
|
-
mediaType: "image" | "file";
|
|
21
|
+
mediaType: "image" | "file" | "video";
|
|
22
22
|
/**
|
|
23
23
|
* True when the field is backed by a gallery, in which case the dimensions
|
|
24
24
|
* and mime type live there and must not be written here too.
|
|
@@ -207,7 +207,9 @@ export declare function galleryCheckKey(sourcePath: string, error: ValidationErr
|
|
|
207
207
|
* A gallery-backed field pointing at something the gallery does not have.
|
|
208
208
|
*
|
|
209
209
|
* `ImageSchema.validate` reports this (`packages/core/src/schema/image.ts`:
|
|
210
|
-
* "The gallery does not have an image at '…'")
|
|
210
|
+
* "The gallery does not have an image at '…'"), and `VideoSchema.validate` the
|
|
211
|
+
* same for a field picked from an `s.videoset()` ("The set does not have a
|
|
212
|
+
* video at '…'"), but neither attaches a `ValidationFix`,
|
|
211
213
|
* because the remedy is not a change to this module: either the gallery gains an
|
|
212
214
|
* entry, or the file moves into the gallery's directory. Both are edits to
|
|
213
215
|
* somewhere else, which is not what a `ValidationFix` describes.
|
|
@@ -223,8 +225,8 @@ export type GalleryMembership = {
|
|
|
223
225
|
dir?: string;
|
|
224
226
|
/** The path the field currently holds. */
|
|
225
227
|
path: string;
|
|
226
|
-
/** `image` or `
|
|
227
|
-
mediaType: "image" | "file";
|
|
228
|
+
/** `image`, `file` or `video`, for wording and for which metadata to read. */
|
|
229
|
+
mediaType: "image" | "file" | "video";
|
|
228
230
|
};
|
|
229
231
|
export declare function galleryMembershipAt({ sourcePath, content, snapshot, }: {
|
|
230
232
|
sourcePath: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Lists the files a Val module may reference.
|
|
3
3
|
*
|
|
4
|
-
* Val stores referenced files under `/public/val` by convention
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Val stores referenced files under `/public/val` by convention, and a
|
|
5
|
+
* reference is written as the path *including* the `/public` prefix — so this
|
|
6
|
+
* returns Val-style refs directly.
|
|
7
7
|
*/
|
|
8
|
-
/**
|
|
8
|
+
/** Where Val stores the files a module references. */
|
|
9
9
|
export declare const DEFAULT_FILES_DIRECTORY = "/public/val";
|
|
10
10
|
export type PublicValFile = {
|
|
11
11
|
/** Val-style reference, for example `/public/val/images/logo.png`. */
|
|
@@ -20,6 +20,13 @@ export type PublicValFiles = {
|
|
|
20
20
|
list(directory?: string): PublicValFile[];
|
|
21
21
|
/** As {@link list}, but only files whose mime type starts with `image/`. */
|
|
22
22
|
images(directory?: string): PublicValFile[];
|
|
23
|
+
/**
|
|
24
|
+
* As {@link list}, but only what an `s.video()` path can name: a `video/*`
|
|
25
|
+
* file, or the master playlist of an HLS stream the Studio wrote. A
|
|
26
|
+
* rendition's own playlist (`720p.m3u8`) is not a video on its own, so only
|
|
27
|
+
* a `master.m3u8` is offered.
|
|
28
|
+
*/
|
|
29
|
+
videos(directory?: string): PublicValFile[];
|
|
23
30
|
invalidate(): void;
|
|
24
31
|
};
|
|
25
32
|
export declare function createPublicValFiles({ valRoot, directory, now, }: {
|