Skip to content

Commit

Permalink
Merge pull request #273 from kinode-dao/develop
Browse files Browse the repository at this point in the history
v0.8.5
  • Loading branch information
nick1udwig authored Nov 23, 2024
2 parents 3252df7 + ed4b903 commit 47cdf82
Show file tree
Hide file tree
Showing 12 changed files with 1,028 additions and 7 deletions.
6 changes: 5 additions & 1 deletion Cargo.lock

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

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kit"
version = "0.8.4"
version = "0.8.5"
edition = "2021"

[build-dependencies]
Expand Down Expand Up @@ -39,13 +39,17 @@ fs-err = "2.11"
hex = "0.4"
kinode_process_lib = { git = "https://github.com/kinode-dao/process_lib.git", rev = "9ac9e51" }
nix = { version = "0.27", features = ["process", "signal", "term"] }
proc-macro2 = "1.0"
regex = "1"
reqwest = { version = "0.12", features = ["json"] }
rpassword = "7"
semver = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
sha2 = "0.10.8"
syn = { version = "2.0", features = ["full", "visit", "extra-traits"] }
#syn = { version = "2.0", features = ["full", "visit"] }
thiserror = "1.0"
tokio = { version = "1.28", features = [
"macros",
"process",
Expand All @@ -55,6 +59,7 @@ tokio = { version = "1.28", features = [
"time",
] }
toml = "0.8"
toml_edit = "0.22"
tracing = "0.1"
tracing-appender = "0.2"
tracing-error = "0.2"
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Tool**kit** for developing on [Kinode OS](https://github.com/kinode-dao/kinode).

Documentation in the [Kinode Book](https://book.kinode.org/kit-dev-toolkit.html); example usage [here](https://book.kinode.org/my_first_app/chapter_1.html).
Documentation in the [Kinode Book](https://book.kinode.org/kit/kit-dev-toolkit.html); example usage [here](https://book.kinode.org/my_first_app/chapter_1.html).

## Installing

Expand Down Expand Up @@ -71,7 +71,10 @@ kit boot-fake-node --runtime-path ~/git/kinode
```

`kit` also contains tools for running tests.
For details and examples, please see [https://github.com/kinode-dao/core_tests](https://github.com/kinode-dao/core_tests).
For details and examples, please see
1. [Kinode Book's example code](https://github.com/kinode-dao/kinode-book/tree/main/code).
2. `kit`s templates, available through `kit new` or [here](https://github.com/kinode-dao/kit/tree/master/src/new/templates/rust).
3. [https://github.com/kinode-dao/core_tests](https://github.com/kinode-dao/core_tests).

## UI Development

Expand Down
30 changes: 28 additions & 2 deletions src/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ use crate::setup::{
use crate::view_api;
use crate::KIT_CACHE;

mod rewrite;
use rewrite::copy_and_rewrite_package;

const PY_VENV_NAME: &str = "process_env";
const JAVASCRIPT_SRC_PATH: &str = "src/lib.js";
const PYTHON_SRC_PATH: &str = "src/lib.py";
Expand Down Expand Up @@ -1155,6 +1158,7 @@ async fn fetch_dependencies(
default_world: Option<&str>,
include: &HashSet<PathBuf>,
exclude: &HashSet<PathBuf>,
rewrite: bool,
force: bool,
verbose: bool,
) -> Result<()> {
Expand All @@ -1171,6 +1175,7 @@ async fn fetch_dependencies(
default_world,
vec![], // TODO: what about deps-of-deps?
vec![],
rewrite,
false,
force,
verbose,
Expand Down Expand Up @@ -1207,6 +1212,7 @@ async fn fetch_dependencies(
default_world,
local_dep_deps,
vec![],
rewrite,
false,
force,
verbose,
Expand Down Expand Up @@ -1522,6 +1528,7 @@ async fn compile_package(
add_paths_to_api: &Vec<PathBuf>,
include: &HashSet<PathBuf>,
exclude: &HashSet<PathBuf>,
rewrite: bool,
force: bool,
verbose: bool,
ignore_deps: bool, // for internal use; may cause problems when adding recursive deps
Expand All @@ -1544,6 +1551,7 @@ async fn compile_package(
default_world,
include,
exclude,
rewrite,
force,
verbose,
)
Expand Down Expand Up @@ -1651,6 +1659,7 @@ pub async fn execute(
default_world: Option<&str>,
local_dependencies: Vec<PathBuf>,
add_paths_to_api: Vec<PathBuf>,
rewrite: bool,
reproducible: bool,
force: bool,
verbose: bool,
Expand Down Expand Up @@ -1734,7 +1743,16 @@ pub async fn execute(

check_process_lib_version(&package_dir.join("Cargo.toml"))?;

let ui_dirs = get_ui_dirs(package_dir, &include, &exclude)?;
// live_dir is the "dir that is being built" or is "live";
// if `!rewrite`, that is just `package_dir`;
// else, it is the modified copy that is in `target/rewrite/`
let live_dir = if !rewrite {
PathBuf::from(package_dir)
} else {
copy_and_rewrite_package(package_dir)?
};

let ui_dirs = get_ui_dirs(&live_dir, &include, &exclude)?;
if !no_ui && !ui_dirs.is_empty() {
if !skip_deps_check {
let mut recv_kill = make_fake_kill_chan();
Expand All @@ -1749,7 +1767,7 @@ pub async fn execute(

if !ui_only {
compile_package(
package_dir,
&live_dir,
skip_deps_check,
features,
url,
Expand All @@ -1759,13 +1777,21 @@ pub async fn execute(
&add_paths_to_api,
&include,
&exclude,
rewrite,
force,
verbose,
ignore_deps,
)
.await?;
}

if rewrite {
if package_dir.join("pkg").exists() {
fs::remove_dir_all(package_dir.join("pkg"))?;
}
copy_dir(live_dir.join("pkg"), package_dir.join("pkg"))?;
}

let metadata = read_metadata(package_dir)?;
let pkg_publisher = make_pkg_publisher(&metadata);
let (_zip_filename, hash_string) = zip_pkg(package_dir, &pkg_publisher)?;
Expand Down
Loading

0 comments on commit 47cdf82

Please sign in to comment.