@gabrielbryk/jq-ts 1.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) [year] [fullname]
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,58 @@
1
+ # jq-ts
2
+
3
+ Pure TypeScript implementation of a deterministic, zero-dependency subset of the **jq query language**. Safe for V8 isolates (no Node.js built-ins, no filesystem/network), making it compatible with Temporal Workflows and other sandboxed runtimes.
4
+
5
+ ## Features
6
+
7
+ - Parser → validator → interpreter pipeline with span-rich errors.
8
+ - Deterministic evaluation: stable object key ordering, limit tracking for steps/depth/outputs; zero runtime dependencies.
9
+ - jq-compatible builtins for the current milestone (type/tostring/tonumber/length/keys/has, sort/sort_by, unique/unique_by, map/select, to_entries/from_entries/with_entries, split/join/startswith/endswith/contains).
10
+ - **Advanced features**: `reduce`, `foreach`, `try/catch`, recursive descent (`..`), and path operations (`paths`, `getpath`, `setpath`, `delpaths`).
11
+ - Dual ESM/CJS builds via `tsdown` and `.d.ts` types.
12
+
13
+ ## Quick Start
14
+
15
+ ```bash
16
+ git clone https://github.com/gabrielbryk/jq-ts.git
17
+ cd jq-ts
18
+ pnpm install
19
+ pnpm run build
20
+ ```
21
+
22
+ ## Usage
23
+
24
+ ```ts
25
+ import { run } from 'jq-ts'
26
+
27
+ const [result] = run('.foo // "fallback"', { foo: null })
28
+ // result === "fallback"
29
+ ```
30
+
31
+ ## Docs
32
+
33
+ - `planning-docs/requirements.md` — determinism and compatibility constraints
34
+ - `planning-docs/workflow-dsl.md` — how jq maps to your Workflow DSL `${...}` expressions
35
+ - `planning-docs/subset.md` — supported syntax/builtins by milestone
36
+ - `planning-docs/design.md` — interpreter/VM design and safety limits
37
+ - `planning-docs/roadmap.md` — milestones
38
+ - `planning-docs/testing.md` — conformance strategy (incl. jq integration fixtures)
39
+
40
+ ## Development
41
+
42
+ Key commands:
43
+
44
+ - `pnpm run dev` — Vitest watch
45
+ - `pnpm run test` — full test suite (includes jq integration; auto-skips if `jq` missing)
46
+ - `pnpm run test:coverage` — tests with coverage
47
+ - `pnpm run lint` — ESLint
48
+ - `pnpm run format:write` — Prettier formatting
49
+ - `pnpm run build` — build CJS/ESM + types
50
+ - `pnpm run ci` — build + format check + exports + lint + tests
51
+
52
+ ## Contributing
53
+
54
+ See [CONTRIBUTING.md](CONTRIBUTING.md). We follow Conventional Commits and require `pnpm run ci` before PRs. Contributor guide: [AGENTS.md](AGENTS.md).
55
+
56
+ ## License
57
+
58
+ MIT