@xanots/xanoscript 0.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Xano, Inc.
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 ADDED
@@ -0,0 +1,69 @@
1
+ # @xanots/xanoscript
2
+
3
+ Renders a [XanoTS](https://github.com/xanots/sdk) workspace to **XanoScript** —
4
+ the language the Xano engine actually runs.
5
+
6
+ > **Status: private, pre-release.** The plugin entry, the published docs and the
7
+ > npm release land in later units of the extraction. Today this repo is the
8
+ > emitter, its vendored engine data, its tooling and its corpus.
9
+
10
+ ## What it is
11
+
12
+ The emitter is a **file-for-file port of the Xano engine's own JSON → XanoScript
13
+ encoder**, pinned to one engine commit. Its contract is not "looks right" — it is
14
+ **byte equality with the engine**, proven against 1,280 of the engine's own
15
+ golden fixtures on every run.
16
+
17
+ That is what makes a committed `xanoscript/` tree worth reading: a backend change
18
+ shows up in review as the XanoScript the engine will run, one file per object,
19
+ beside the TypeScript that produced it.
20
+
21
+ ## Quick start (maintainers)
22
+
23
+ ```bash
24
+ npm install
25
+ npx vitest run # the full suite, corpus included
26
+ npm run xs:report # the corpus, as pass/fail counts grouped by reason
27
+ npm run typecheck
28
+ npm run lint
29
+ ```
30
+
31
+ `npm run xs:report` should print **1279 passed, 1 failed** — that one failure is
32
+ a documented corpus artifact, recorded with its reason in
33
+ `test/corpus-known-failures.json`.
34
+
35
+ ## Layout
36
+
37
+ | Path | What it is |
38
+ |---|---|
39
+ | `src/index.ts` | the emitter entry (`emitXanoScript`, `createScriptContext`) |
40
+ | `src/engine/` | the encoder core — parsers, kinds, values, coercion semantics |
41
+ | `src/transform/` | one class per statement kind |
42
+ | `src/multidoc.ts` | workspace → multidoc assembly |
43
+ | `src/tree.ts` | multidoc → one-file-per-object placement |
44
+ | `src/writer.ts` | the committed `xanoscript/` tree: write, check, README, placeholders |
45
+ | `src/render-def.ts` | one def rendered alone — the only file needing the `@xanots/sdk` peer |
46
+ | `src/diff.ts` | document-aware comparison of two multidocs |
47
+ | `vendor/xs-engine/` | generated engine data and the commit lock (never hand-edited) |
48
+ | `scripts/xs-engine/` | the drift loop — vendor, sync, drift, report |
49
+
50
+ ## The emitter takes no peer
51
+
52
+ Everything under `src/` imports nothing from `@xanots/sdk` except
53
+ `render-def.ts`. The `.` entry builds and its suite passes with the peer absent,
54
+ and `test/peer-free.test.ts` asserts it. That isolation is why this package can
55
+ follow the engine's release cadence instead of the SDK's.
56
+
57
+ ## Contributing
58
+
59
+ Read `AGENTS.md` in the repository first — **especially the disclosure block at
60
+ the top**. It carries the drift loop, the porting order, the coercion-semantics
61
+ rule, and the redaction procedure for a credential found in the corpus.
62
+
63
+ `AGENTS.md` is deliberately NOT in the published tarball: it describes the
64
+ engine's internal layout, which belongs in the repository and not on a public
65
+ registry. See the disclosure block for what that constrains.
66
+
67
+ ## License
68
+
69
+ MIT