Skip to content

refactor: move various file generation from tests to a separate crate #774

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/build_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- "site/**"
- "pad/**"
- "tests*/**"
- "generator/**"
- "changelog.md"
- "readme.md"
- ".github/workflows/build_latest.yml"
Expand Down Expand Up @@ -103,16 +104,20 @@ jobs:
run: |
rustup target add wasm32-unknown-unknown
cargo install trunk --locked --root target
cargo install --release --locked --package uiua-generator --root target
- name: Build site
run: |
git checkout site
git branch --set-upstream-to=origin/site
git reset --hard origin/site
git rebase main || { echo "Rebase failed, aborting."; git rebase --abort; exit 1; }
cd site
cargo test -p site gen_blog_html
../target/bin/uiua-generator primitives-json ./primitives.json
../target/bin/uiua-generator format-config-docs ./text/format_config.md
../target/bin/uiua-generator blog-html ./blog/
../target/bin/trunk build --release -d ../docs
git add --all
git add --force primitive.json text/format_config.md
git commit --amend --no-edit
git push --force
git checkout main
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ uiua.tmLanguage.json

# symlink created by `nix build`
result
.direnv
.direnv

site/primitives.json
site/text/format_config.md
26 changes: 20 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ web = ["wasm-bindgen", "js-sys", "web-sys"]
webcam = ["image", "nokhwa"]
window = ["eframe", "rmp-serde", "image", "native-dialog"]
xlsx = ["calamine", "simple_excel_writer"]
internal_fmt_doc = []
# Use system static libraries instead of building them
system = ["libffi?/system"]

Expand All @@ -168,7 +169,7 @@ name = "uiua"
required-features = ["binary"]

[workspace]
members = ["site", "tests_ffi", "pad/editor", "parser"]
members = ["site", "tests_ffi", "pad/editor", "parser", "generator"]

[workspace.lints.clippy]
dbg_macro = "warn"
Expand Down
9 changes: 8 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,15 @@
};
packages = {
default = pkgs.callPackage ./nix/package.nix { inherit craneLib libPath rustPlatform; };
generator = pkgs.callPackage ./nix/generator.nix { inherit craneLib; };
fonts = pkgs.callPackage ./nix/fonts.nix { };
site = pkgs.callPackage ./nix/site.nix { inherit craneLib; };
site = pkgs.callPackage ./nix/site.nix {
inherit craneLib;
inherit (self'.packages) generator;
};
sublime-grammar = pkgs.callPackage ./nix/sublime-grammar.nix {
inherit (self'.packages) generator;
};
toolchain = toolchainFor pkgs;
};
apps.site.program = pkgs.writeShellApplication {
Expand Down
16 changes: 16 additions & 0 deletions generator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "uiua-generator"
version = "0.1.0"
edition = "2024"

[dependencies]
anyhow = "1.0.98"
clap = { version = "4.5.41", features = ["derive"] }
comrak = "0.39.0"
either = "1.15.0"
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.140"
site = { path = "../site", default-features = false, features = ["gen_blog_html"] }
uiua = { path = "..", default-features = false, features = [
"internal_fmt_doc",
] }
Loading
Loading