triangulum 0.0.0 → 0.5.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4686b6c73fb424ac994aebece2d8826ce55ae7ab79ddc734e562d3f753eb8696
4
- data.tar.gz: 0bb4bb279c59a25d1d2be510a39635fefa082cd312310064ebf82932b5e61dbe
3
+ metadata.gz: bf5f529931bcb2ad36e67d227429e8e1c73a3b05e1161d74533ad60c62044537
4
+ data.tar.gz: 8113c4b5b1237d029e0a0aeb49bd5b5ec308e2a2aca19d9f8efb8db0d8b369db
5
5
  SHA512:
6
- metadata.gz: 81a2f0ce682c5e7a12bcff6f3cb2358db5673493fd91968fec81c4fd349b0ee134c6ef9e0e5cbeb0a818502b4708a86e97486cf9d56821a2282c104f6143f958
7
- data.tar.gz: 016b56967eb95e89c18bec1c3c507f5baf84a004a900890ca3043ab16cb75b47b15baad4a561fd5457a1fe6cf289ff3281260f8387c829b570df550b361b412d
6
+ metadata.gz: '00835fcec65ae4bad82405a93f4e42783aae5cd632559d48ea7bd5d52bd98a958b0c84d5bac7acd74384250af8d231a8d71b3b281faa9edc3fdf9751256672c6'
7
+ data.tar.gz: 83ecacc5887b723fc182cab4deddd71df57c31e79b024fa87135d4e055906c132a51b9950a877b2c73442d9c670c7215421b0e0016bc70f62a2fc36910c43a99
data/README.md CHANGED
@@ -1,35 +1,77 @@
1
- # Triangulum
1
+ # Triangulum Ruby Gem
2
2
 
3
- TODO: Delete this and the text below, and describe your gem
4
-
5
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/triangulum`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ Ruby bindings for the [Triangulum](https://github.com/code0-tech/triangulum) validation layer. This gem wraps the TypeScript library and a bundled [Bun](https://bun.sh) runtime to validate flows using the TypeScript compiler.
6
4
 
7
5
  ## Installation
8
6
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
- Install the gem and add to the application's Gemfile by executing:
7
+ Add to your Gemfile:
12
8
 
13
- ```bash
14
- bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
9
+ ```ruby
10
+ gem 'triangulum'
15
11
  ```
16
12
 
17
- If bundler is not being used to manage dependencies, install the gem by executing:
13
+ Platform-specific gems are published for:
14
+
15
+ - `arm64-darwin` (macOS Apple Silicon)
16
+ - `x86_64-darwin` (macOS Intel)
17
+ - `x86_64-linux-gnu` (Linux x64)
18
+ - `x86_64-linux-musl` (Linux x64 musl)
19
+ - `aarch64-linux-gnu` (Linux ARM64)
20
+ - `aarch64-linux-musl` (Linux ARM64 musl)
21
+
22
+ If Bundler doesn't automatically select the correct platform gem, add your platform:
18
23
 
19
24
  ```bash
20
- gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
25
+ bundle lock --add-platform x86_64-linux-gnu
21
26
  ```
22
27
 
23
28
  ## Usage
24
29
 
25
- TODO: Write usage instructions here
30
+ ```ruby
31
+ result = Triangulum::Validation.new(flow, runtime_function_definitions, data_types).validate
32
+
33
+ result.valid? # => true / false
34
+ result.return_type # => "void"
35
+ result.diagnostics # => [Triangulum::Validation::Diagnostic, ...]
36
+ ```
37
+
38
+ The arguments are [Tucana](https://github.com/code0-tech/tucana) protobuf objects:
39
+
40
+ - `flow` — `Tucana::Shared::ValidationFlow`
41
+ - `runtime_function_definitions` — `Array<Tucana::Shared::RuntimeFunctionDefinition>`
42
+ - `data_types` — `Array<Tucana::Shared::DefinitionDataType>`
43
+
44
+ ### Diagnostics
45
+
46
+ Each diagnostic contains:
47
+
48
+ | Field | Description |
49
+ |---|---|
50
+ | `message` | Human-readable error description |
51
+ | `code` | TypeScript diagnostic code |
52
+ | `severity` | `"error"` or `"warning"` |
53
+ | `node_id` | ID of the node that caused the error |
54
+ | `parameter_index` | Index of the parameter that caused the error |
26
55
 
27
56
  ## Development
28
57
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
58
+ Prerequisites: [Bun](https://bun.sh) installed locally for building the entrypoint.
59
+
60
+ ```bash
61
+ cd gem
62
+ bundle install
63
+ bundle exec rake prepare_build # downloads bun binaries + builds JS entrypoint
64
+ bundle exec rake # run tests and rubocop
65
+ ```
66
+
67
+ ### Building platform gems
68
+
69
+ ```bash
70
+ bundle exec rake package
71
+ ```
30
72
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
73
+ This will download bun binaries (with SHA256 checksum verification) for all supported platforms and build a `.gem` file for each.
32
74
 
33
- ## Contributing
75
+ ## License
34
76
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/triangulum.
77
+ See [LICENSE](../LICENSE).