Skip to content

Commit c9cff25

Browse files
Merge pull request #187 from code0-tech/copilot/drop-rust-reader-crate
Drop Rust reader crate
2 parents 99122ea + 58f0651 commit c9cff25

File tree

11 files changed

+2
-363
lines changed

11 files changed

+2
-363
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -96,31 +96,6 @@ jobs:
9696
- name: "Build project"
9797
run: cargo build --verbose --all-features
9898

99-
package:
100-
name: "[RUST] Package"
101-
needs: build
102-
runs-on: ubuntu-latest
103-
steps:
104-
- name: "Checkout code"
105-
uses: actions/checkout@v6
106-
107-
- name: "Install Rust toolchain"
108-
uses: dtolnay/rust-toolchain@stable
109-
110-
- name: "Cache cargo registry"
111-
uses: actions/cache@v5
112-
with:
113-
path: |
114-
~/.cargo/registry
115-
~/.cargo/git
116-
target
117-
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
118-
restore-keys: |
119-
${{ runner.os }}-cargo-
120-
121-
- name: "Build project"
122-
run: cargo package --allow-dirty --verbose --all-features
123-
12499
report:
125100
name: "[RUST] Report"
126101
needs: [build]

.github/workflows/release.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,6 @@ jobs:
2525
- run: npm run build
2626
- run: npm publish
2727

28-
publish-rs-reader:
29-
runs-on: ubuntu-latest
30-
if: startsWith(github.ref, 'refs/tags/pkg-')
31-
defaults:
32-
run:
33-
working-directory: "./crates/package"
34-
steps:
35-
- name: Checkout Code
36-
uses: actions/checkout@v6
37-
- name: Set version
38-
run: |
39-
VERSION=$(echo "${{ github.ref_name }}" | sed 's/^pkg-//')
40-
sed -i "s/version = \"0.0.0\"/version = \"$VERSION\"/" Cargo.toml
41-
- name: Cargo Login
42-
run: cargo login ${{secrets.CRATES_IO_PUBLISH}}
43-
- name: Publish crate
44-
run: cargo publish --allow-dirty
45-
4628
publish-defintions:
4729
permissions:
4830
contents: write

Cargo.lock

Lines changed: 0 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
2-
members = ["crates/cli", "crates/package"]
2+
members = ["crates/cli"]
33
resolver = "3"
44

55
[workspace.package]

README.md

Lines changed: 1 addition & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Definitions
2-
This repository contains all definitions for Code0. These definitions will be used to create a Flow. It also contains a CLI tool for managing definitions and a reader for reading all definitions.
2+
This repository contains all definitions for Code0. These definitions will be used to create a Flow. It also contains a CLI tool for managing definitions.
33

44
## Definition CLI
55

@@ -88,84 +88,3 @@ for (const feature in features) {
8888
const functions = fearture.runtimeFunctions; //runtimeFunctions of this feature
8989
}
9090
```
91-
92-
## Rust Definition Package
93-
This package is a Rust crate designed to read and parse CodeZero definition files (JSON) from a directory structure. It loads all features, including data-types, flow-types, and runtime-functions, providing them as idiomatic Rust structs.
94-
### Package Resources
95-
Crate: [code0-definition-reader](https://crates.io/crates/code0-definition-reader) on crates.io
96-
### Install Package
97-
```bash
98-
cargo add code0-definition-reader
99-
```
100-
101-
### Basic Usage
102-
103-
```rs
104-
use code0_definition_reader::Reader;
105-
106-
fn main() {
107-
// Create a reader with default configuration
108-
let reader = Reader::configure(
109-
"./path/to/definitions".to_string(), // Path to definitions directory
110-
false, // should_break: continue on errors
111-
Vec::new(), // accepted_features: empty = all features
112-
None // accepted_version: None = all versions
113-
);
114-
115-
// Read all features
116-
match reader.read_features() {
117-
Ok(features) => {
118-
for feature in features {
119-
println!("Loaded feature: {}", feature.name);
120-
println!(" - Data Types: {}", feature.data_types.len());
121-
println!(" - Flow Types: {}", feature.flow_types.len());
122-
println!(" - Functions: {}", feature.functions.len());
123-
}
124-
}
125-
Err(err) => {
126-
eprintln!("Failed to read features: {:?}", err);
127-
}
128-
}
129-
}
130-
```
131-
132-
### Advanced Usage - Filter Specific Features
133-
134-
```rs
135-
use code0_definition_reader::Reader;
136-
137-
fn main() {
138-
let reader = Reader::configure(
139-
"./definitions".to_string(),
140-
false,
141-
vec!["http".to_string(), "database".to_string()], // Only load http and database features
142-
None
143-
);
144-
145-
match reader.read_features() {
146-
Ok(features) => {
147-
for feature in features {
148-
println!("Feature: {}", feature.name);
149-
150-
// Access data types
151-
for data_type in &feature.data_types {
152-
println!(" DataType: {}", data_type.identifier);
153-
}
154-
155-
// Access flow types
156-
for flow_type in &feature.flow_types {
157-
println!(" FlowType: {}", flow_type.identifier);
158-
}
159-
160-
// Access runtime functions
161-
for function in &feature.functions {
162-
println!(" Function: {}", function.runtime_name);
163-
}
164-
}
165-
}
166-
Err(err) => {
167-
eprintln!("Failed to read features: {:?}", err);
168-
}
169-
}
170-
}
171-
```

crates/package/Cargo.toml

Lines changed: 0 additions & 16 deletions
This file was deleted.

crates/package/src/enum/mod.rs

Lines changed: 0 additions & 1 deletion
This file was deleted.

crates/package/src/enum/reader_error.rs

Lines changed: 0 additions & 24 deletions
This file was deleted.

crates/package/src/lib.rs

Lines changed: 0 additions & 174 deletions
This file was deleted.

0 commit comments

Comments
 (0)