@velarscript/cli 0.19.1 → 0.20.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/dist/version.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export declare const VELAR_VERSION = "0.19.1";
1
+ export declare const VELAR_VERSION = "0.20.0";
2
2
  export { VELAR_STANDARD_API_VERSION } from "@velarscript/core";
3
3
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
- export const VELAR_VERSION = "0.19.1";
1
+ export const VELAR_VERSION = "0.20.0";
2
2
  export { VELAR_STANDARD_API_VERSION } from "@velarscript/core";
3
3
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velarscript/cli",
3
- "version": "0.19.1",
3
+ "version": "0.20.0",
4
4
  "description": "The VelarScript command-line compiler, dev server, test runner, and language server.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -30,13 +30,13 @@
30
30
  "velar": "./dist/cli.js"
31
31
  },
32
32
  "dependencies": {
33
- "@velarscript/compiler": "0.19.1",
34
- "@velarscript/core": "0.19.1",
35
- "@velarscript/desktop": "0.19.1",
36
- "@velarscript/node": "0.19.1",
37
- "@velarscript/server": "0.19.1",
38
- "@velarscript/web": "0.19.1",
39
- "create-velar": "0.19.1",
33
+ "@velarscript/compiler": "0.20.0",
34
+ "@velarscript/core": "0.20.0",
35
+ "@velarscript/desktop": "0.20.0",
36
+ "@velarscript/node": "0.20.0",
37
+ "@velarscript/server": "0.20.0",
38
+ "@velarscript/web": "0.20.0",
39
+ "create-velar": "0.20.0",
40
40
  "esbuild": "^0.28.1",
41
41
  "playwright": "^1.58.2"
42
42
  }
@@ -83,14 +83,14 @@ type CreateArticle:
83
83
 
84
84
  export server articles:
85
85
  /// Reports whether this service is ready.
86
- @get(p"/health") => {ok: true}
86
+ @get health(p"/health") => {ok: true}
87
87
 
88
- @get(p"/articles/{id:number}?{details:bool?}"):
88
+ @get readArticle(p"/articles/{id:number}?{details:bool?}"):
89
89
  if id < 1:
90
90
  throw HttpProblem({status: 404, code: "article.not_found", title: "Article not found"})
91
91
  return {id, details: details ?? false}
92
92
 
93
- @post(p"/articles", input: CreateArticle):
93
+ @post createArticle(p"/articles", input: CreateArticle):
94
94
  return created({id: 1, title: input.title})
95
95
 
96
96
  ```
@@ -114,6 +114,12 @@ patterns require `as name` so the compiler never injects identifiers that are
114
114
  hidden inside another declaration. The old `path=` spelling is an error with a
115
115
  mechanical fix to the positional form and `as path`.
116
116
 
117
+ For a public contract, put one stable source identifier between the role and
118
+ the pattern: `@get readArticle(...)` or `@websocket worldRealtime(...)`.
119
+ Operation identities must be unique after composition, survive `prefix`, and
120
+ are emitted verbatim to OpenAPI. Leave the name out only for a local route whose
121
+ method/path-derived OpenAPI identity is sufficient.
122
+
117
123
  On `POST`, `PUT`, or `PATCH`, one concrete Data parameter is the
118
124
  checked JSON body. A `Request` parameter explicitly requests the complete
119
125
  request, including `queryAll` and cooperative `cancellation`. Ambiguous bodies,
@@ -282,7 +288,9 @@ task finishes. `setCookie` and
282
288
  fields. Never start long-lived work by
283
289
  dropping a Promise; use an owned lifecycle, background task, Worker, or process.
284
290
 
285
- `docs` adds a bundled offline UI and OpenAPI 3.1 JSON. Compiler route types
291
+ `docs` adds a bundled offline UI and OpenAPI 3.1 JSON. HTTP and WebSocket
292
+ operations share its `paths` catalog; WebSocket entries use GET, response 101,
293
+ and `x-velar-transport: websocket`. Compiler route types
286
294
  and response helpers supply parameter, body, response, content-type, and static
287
295
  success-status schemas. Applicable framework-generated 400, 401, 413, 415, and
288
296
  422 responses are included automatically; a preceding `///` comment supplies
@@ -317,7 +325,7 @@ session belongs in the route table:
317
325
  import {WebSocketConnection} from "velar/websocket"
318
326
 
319
327
  server realtime:
320
- @websocket(p"/worlds/{worldId:string}/realtime", connection: WebSocketConnection):
328
+ @websocket worldRealtime(p"/worlds/{worldId:string}/realtime", connection: WebSocketConnection):
321
329
  async for message in connection:
322
330
  await connection.send(message)
323
331
  ```
@@ -331,7 +339,8 @@ contains these routes rejects its legacy single `path` option and does not offer
331
339
  accepted sessions through `WebSocketServer.next()`.
332
340
 
333
341
  Set
334
- `maxBodyBytes` to the supplied application value. `origins` contains exact
342
+ `maxBodyBytes` to the supplied application value. `host` is non-empty text of
343
+ at most 255 code units without NUL. `origins` contains exact
335
344
  canonical HTTP/HTTPS origins. The default rejects any upgrade carrying
336
345
  `Origin`; no-Origin non-browser clients remain allowed. Use `["*"]` only for an
337
346
  intentional unrestricted policy. A rejected browser origin receives 403 before
@@ -13,7 +13,7 @@ browser application activates `@velarscript/web`:
13
13
  ```json
14
14
  {
15
15
  "dependencies": {
16
- "@velarscript/server": "0.19.1"
16
+ "@velarscript/server": "0.20.0"
17
17
  }
18
18
  }
19
19
  ```