@celsian/vura-compiler 0.2.0 → 0.4.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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +29 -4
  3. package/package.json +6 -7
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vura contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,15 +1,40 @@
1
1
  # @celsian/vura-compiler
2
2
 
3
- Compiler for Vura — transforms routes, pages, and API endpoints into optimized build output.
3
+ Pure-JS compiler for [Vura](https://vura.io)regex-based route scanning and JSX transforms.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@celsian/vura-compiler)](https://www.npmjs.com/package/@celsian/vura-compiler)
6
+
7
+ ## What it does
8
+
9
+ `@celsian/vura-compiler` scans route and page source files to extract HTTP methods, route config (`kind`, `schedule`, etc.), and page modes without a full AST parse. It also handles the JSX transform step. This package is the pure-JS path used internally by `@celsian/vura-cli` and `@celsian/vura-vite-plugin` — you do not need to install it directly unless building custom tooling. For projects that need faster scanning, `@celsian/vura-compiler-native` (unpublished prototype) exposes the same API surface using AST-based analysis.
4
10
 
5
11
  ## Install
6
12
 
7
- ```bash
13
+ ```sh
8
14
  npm install @celsian/vura-compiler
9
15
  ```
10
16
 
11
- This package is typically used internally by `@celsian/vura-cli` and `@celsian/vura-vite-plugin`. You don't need to install it directly unless building custom tooling.
17
+ ## Minimal example
18
+
19
+ ```ts
20
+ import { scanRoute } from '@celsian/vura-compiler';
21
+
22
+ const source = `
23
+ export const route = { kind: 'hot' };
24
+ export function websocket(peer, req) {}
25
+ `;
26
+
27
+ const result = scanRoute(source, 'ts');
28
+ // result.kind === 'hot'
29
+ // result.methods === [] (websocket handler, not HTTP methods)
30
+ ```
31
+
32
+ ## Documentation
33
+
34
+ _vura.io docs site launches with v0.5 — until then, see the repo README and CHANGELOG._
35
+
36
+ - [Compiler internals — /reference/compiler/](https://vura.io/reference/compiler/)
12
37
 
13
38
  ## License
14
39
 
15
- MIT
40
+ MIT — and [it will stay MIT](https://github.com/CelsianJs/vura/blob/main/GOVERNANCE.md).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celsian/vura-compiler",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Pure JS compiler fallback for Vura — route scanning and JSX transforms",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -15,11 +15,6 @@
15
15
  "files": [
16
16
  "dist"
17
17
  ],
18
- "scripts": {
19
- "test": "vitest run",
20
- "build": "tsc -b",
21
- "prepack": "pnpm run build"
22
- },
23
18
  "license": "MIT",
24
19
  "publishConfig": {
25
20
  "access": "public"
@@ -41,5 +36,9 @@
41
36
  ],
42
37
  "engines": {
43
38
  "node": ">=20 <23"
39
+ },
40
+ "scripts": {
41
+ "test": "vitest run",
42
+ "build": "tsc -b"
44
43
  }
45
- }
44
+ }