Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move generating_json_schema to generate crate #608

Merged
merged 6 commits into from
Jul 10, 2024

Conversation

wkazmierczak
Copy link
Collaborator

@wkazmierczak wkazmierczak commented Jul 3, 2024

Move generate_json_schema and generate_docs to generate crate.
Substitute commands responsible for generating json schema and docs with one command cargo run generate_from_type - it updates both docs and schema. Run with --check checks if json schema hasn't changed.

@wkazmierczak wkazmierczak linked an issue Jul 3, 2024 that may be closed by this pull request
@wkazmierczak wkazmierczak marked this pull request as draft July 5, 2024 08:45
@wkazmierczak wkazmierczak force-pushed the @wkazmierczak/move-generating-json-schema branch 2 times, most recently from 60a4526 to e13c113 Compare July 9, 2024 14:57
@wkazmierczak wkazmierczak changed the title move-generating-json-schema-to-generate-crate Move generating_json_schema to generate crate Jul 10, 2024
@wkazmierczak wkazmierczak marked this pull request as ready for review July 10, 2024 08:50
@wkazmierczak wkazmierczak requested a review from wkozyra95 July 10, 2024 08:50
Copy link
Member

@wkozyra95 wkozyra95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -7,7 +7,7 @@ on:
paths:
- "docs/**"
- "schemas/**"
- "src/bin/generate_docs/**"
- "src/bin/generate/generate_docs/**"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong path

@@ -7,9 +7,10 @@ license = "BUSL-1.1"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
live_compositor = { path = ".." }
live_compositor = { path = "..", features=["decklink"] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this work for you if you run locally cargo clippy --allow-dirty --allow-staged --workspace --all-targets?
I assume it will fail on decklink compilation on macOS.

Verify that, but if I'm correct you will need to add feature to this crate that optionally enable feature on live_compositor crate. Similiar to https://github.com/membraneframework/live_compositor/blob/master/Cargo.toml#L22

@wkazmierczak wkazmierczak force-pushed the @wkazmierczak/move-generating-json-schema branch from 587014f to d279f56 Compare July 10, 2024 11:41
@wkazmierczak wkazmierczak force-pushed the @wkazmierczak/move-generating-json-schema branch from d279f56 to c8c388d Compare July 10, 2024 12:01
@wkazmierczak wkazmierczak requested a review from wkozyra95 July 10, 2024 12:36
mod schema_parser;

fn main() {
pub fn generate_docs() {
tracing_subscriber::fmt().init();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move that init outside to the main function

Comment on lines 13 to 15
.parent()
.unwrap()
.join("docs/pages/api/generated");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.parent()
.unwrap()
.join("docs/pages/api/generated");
.join("../docs/pages/api/generated");

Comment on lines 81 to 83
.parent()
.unwrap()
.join(format!("schemas/{}.schema.json", name));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.parent()
.unwrap()
.join(format!("schemas/{}.schema.json", name));
.join(format!("../schemas/{}.schema.json", name));

@wkazmierczak wkazmierczak force-pushed the @wkazmierczak/move-generating-json-schema branch from c8c388d to 377746c Compare July 10, 2024 13:41
@wkazmierczak wkazmierczak force-pushed the @wkazmierczak/move-generating-json-schema branch from 377746c to 4f6d13b Compare July 10, 2024 13:46
@wkazmierczak wkazmierczak merged commit ef56167 into master Jul 10, 2024
2 checks passed
@wkazmierczak wkazmierczak deleted the @wkazmierczak/move-generating-json-schema branch July 10, 2024 14:13
Copy link
Member

@WojciechBarczynski WojciechBarczynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move generating json schema and markdown files to generate crate
3 participants