Skip to content

Commit

Permalink
Merge pull request #41 from BrowserSync/moving-packages
Browse files Browse the repository at this point in the history
better support for conditional building
  • Loading branch information
shakyShane authored Nov 17, 2024
2 parents a1d57d5 + 5ae86c5 commit 39bbce7
Show file tree
Hide file tree
Showing 57 changed files with 759 additions and 2,486 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ jobs:
- name: Npm run build:client
run: npm run build:client

- name: Npm run build:example
run: npm run build:example

- name: Install Playwright Browsers
run: npx playwright install chromium --with-deps

Expand Down
3 changes: 0 additions & 3 deletions crates/bsnext_client/.prettierignore

This file was deleted.

41 changes: 9 additions & 32 deletions crates/bsnext_client/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,22 @@ fn main() {
if env::var("CI").is_ok() {
return;
}
println!("cargo::rerun-if-changed=src/lib.rs");
println!("cargo::rerun-if-changed=inject");
println!("cargo::rerun-if-changed=../bsnext_dto");
println!("cargo::rerun-if-changed=../bsnext_input");
println!("cargo::rerun-if-changed=./src");
println!("cargo::rerun-if-changed=../../inject/src");
println!("cargo::rerun-if-changed=../../inject/vendor/live-reload/src");
println!("cargo::rerun-if-changed=../../ui/src");
println!("cargo::rerun-if-changed=../../ui/styles");
println!("cargo::rerun-if-changed=../../ui/svg");

let curr = current_dir().expect("current dir");
let root = curr
.parent()
.expect("parent")
.parent()
.expect("parent 2")
.to_path_buf();
let output = Command::new("typeshare")
.args([
"crates/bsnext_dto",
"--lang=typescript",
"--output-file=crates/bsnext_client/generated/dto.ts",
])
let output = Command::new("bash")
.args(["gen.sh"])
.current_dir(&root)
.output()
.expect("build types");
Expand All @@ -33,28 +32,6 @@ fn main() {
io::stderr().write_all(&output.stderr).unwrap();

assert!(output.status.success());

let output = Command::new("npm")
.args(["run", "schema"])
.current_dir(root.join("crates").join("bsnext_client"))
.output()
.expect("build schema");

io::stdout().write_all(&output.stdout).unwrap();
io::stderr().write_all(&output.stderr).unwrap();

assert!(output.status.success());

let output = Command::new("npm")
.args(["run", "build:client"])
.current_dir(root)
.output()
.expect("sh command failed to start");

io::stdout().write_all(&output.stdout).unwrap();
io::stderr().write_all(&output.stderr).unwrap();

assert!(output.status.success());
}

#[cfg(target_os = "windows")]
Expand Down
Loading

0 comments on commit 39bbce7

Please sign in to comment.