diff --git a/.github/actions/extend-space/action.yaml b/.github/actions/extend-space/action.yaml index 09d316a3a..36b34f48d 100644 --- a/.github/actions/extend-space/action.yaml +++ b/.github/actions/extend-space/action.yaml @@ -1,6 +1,5 @@ # Extends disk space on github hosted runners - name: "Extend space" description: "Teases out as much free space as possible" @@ -58,4 +57,4 @@ runs: -o lowerdir=${HOME}_lower,upperdir=$EXTENDED_PATH/home/upper,workdir=$EXTENDED_PATH/home/work \ $HOME sudo chown $(id -u):$(id -g) $HOME - df -h \ No newline at end of file + df -h diff --git a/.github/workflows/check-offline.yaml b/.github/workflows/check-offline.yaml deleted file mode 100644 index 7d116b091..000000000 --- a/.github/workflows/check-offline.yaml +++ /dev/null @@ -1,30 +0,0 @@ -name: "check-lockfile" -on: - # Trigger the workflow on push or pull request, - # but only for the main branch - push: - branches: [ main, develop, holochain-0.1, holochain-0.2 ] - pull_request: - branches: [ main, develop, holochain-0.1, holochain-0.2 ] - -jobs: - check-lockfile: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Install nix - uses: cachix/install-nix-action@v18 - with: - install_url: https://releases.nixos.org/nix/nix-2.12.0/install - extra_nix_config: | - experimental-features = flakes nix-command - - - uses: cachix/cachix-action@v10 - with: - name: holochain-ci - - - name: Install - run: | - nix develop --command bash -c "cargo build --locked" - diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1f4352810..233a4b31b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,7 +15,6 @@ jobs: - name: Extend space uses: ./.github/actions/extend-space - - name: Install nix uses: cachix/install-nix-action@v23 with: diff --git a/.gitignore b/.gitignore index 89a98ca76..971de4a60 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,4 @@ yarn-error.log* *.sln *.sw? result* -.cargo \ No newline at end of file +.cargo diff --git a/Cargo.lock b/Cargo.lock index 9a1e5fc74..64e0bf211 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1703,6 +1703,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "errno" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.45.0", +] + [[package]] name = "errno-dragonfly" version = "0.1.2" @@ -2684,6 +2695,7 @@ dependencies = [ "holochain_util", "ignore", "include_dir", + "itertools 0.10.5", "json_value_merge", "mr_bundle", "path-clean", @@ -4006,6 +4018,12 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +[[package]] +name = "linux-raw-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd550e73688e6d578f0ac2119e32b797a327631a42f9433e59d02e139c8df60d" + [[package]] name = "lock_api" version = "0.3.4" diff --git a/Cargo.toml b/Cargo.toml index f2c4b19ae..27f50dbd5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,6 +52,7 @@ serde = "1" json_value_merge = "1.1.2" temp-dir = "0.1" semver = "1.0" +itertools = "0.10" [dev-dependencies] assert_cmd = "1.0" diff --git a/README.md b/README.md index 4c8d51193..3e7a14a54 100644 --- a/README.md +++ b/README.md @@ -7,15 +7,16 @@ CLI to easily generate and edit holochain apps. The easiest way to start using the scaffolding tool is through holonix: ```bash -nix-shell https://holochain.love -hc-scaffold --version +nix run github:holochain/holochain#hc-scaffold -- --version ``` Should print the version of the scaffolding tool. ## Usage -These are the commands that you can run with the scaffolding tool: +Refer to [the holochain developer instructions](https://developer.holochain.org/get-building/) to know how you can use the scaffolding tool to create your own apps. + +These are the commands that you can run with the scaffolding tool inside of a holonix develop shell: ```bash # Scaffold an example app diff --git a/flake.lock b/flake.lock index 5d955675e..7de0b0392 100644 --- a/flake.lock +++ b/flake.lock @@ -207,11 +207,11 @@ ] }, "locked": { - "lastModified": 1695063947, - "narHash": "sha256-zjMJ0vEV37BupAkTfhT4E+/fjhYI9mt/XdnlUwrUd4U=", + "lastModified": 1695190832, + "narHash": "sha256-zLKW0gt0XBHlUWf/OHnNZrBb1ufYZVVJ9VKAtx0UP+E=", "owner": "holochain", "repo": "holochain", - "rev": "2e98f34947005482472cb64f8d6c9a59d0cc941c", + "rev": "281bad89f2f712e7397d038047f02ed8174aa06a", "type": "github" }, "original": { @@ -288,11 +288,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1694767346, - "narHash": "sha256-5uH27SiVFUwsTsqC5rs3kS7pBoNhtoy9QfTP9BmknGk=", + "lastModified": 1694959747, + "narHash": "sha256-CXQ2MuledDVlVM5dLC4pB41cFlBWxRw4tCBsFrq3cRk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ace5093e36ab1e95cb9463863491bee90d5a4183", + "rev": "970a59bd19eff3752ce552935687100c46e820a5", "type": "github" }, "original": { @@ -393,11 +393,11 @@ ] }, "locked": { - "lastModified": 1695003086, - "narHash": "sha256-d1/ZKuBRpxifmUf7FaedCqhy0lyVbqj44Oc2s+P5bdA=", + "lastModified": 1695175880, + "narHash": "sha256-TBR5/K3jkrd+U5mjxvRvUhlcT1Hw9jFywz1TjAGZRm4=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "b87a14abea512d956f0b89d0d8a1e9b41f3e20ff", + "rev": "e054ca37ee416efe9d8fc72d249ec332ef74b6d4", "type": "github" }, "original": { @@ -409,11 +409,11 @@ "scaffolding": { "flake": false, "locked": { - "lastModified": 1692147670, - "narHash": "sha256-jFt4LTUaUZTiOg2DLlbUqyeV2edfUxiJSljRjVJlObE=", + "lastModified": 1695069964, + "narHash": "sha256-QtX2sZgBZ6pxtPrJp9RslJD0LU1KILp+Y0OVldapImA=", "owner": "holochain", "repo": "scaffolding", - "rev": "8a63d356a0856643769adc567e078796c6509511", + "rev": "f0b878cdc75bb7b2748cb5f1564d4a4632504ca8", "type": "github" }, "original": { @@ -447,11 +447,11 @@ }, "locked": { "dir": "versions/0_2", - "lastModified": 1695063947, - "narHash": "sha256-zjMJ0vEV37BupAkTfhT4E+/fjhYI9mt/XdnlUwrUd4U=", + "lastModified": 1695190832, + "narHash": "sha256-zLKW0gt0XBHlUWf/OHnNZrBb1ufYZVVJ9VKAtx0UP+E=", "owner": "holochain", "repo": "holochain", - "rev": "2e98f34947005482472cb64f8d6c9a59d0cc941c", + "rev": "281bad89f2f712e7397d038047f02ed8174aa06a", "type": "github" }, "original": { diff --git a/run_test.sh b/run_test.sh index fb9b1d38d..0fcb14db9 100755 --- a/run_test.sh +++ b/run_test.sh @@ -1,6 +1,18 @@ #!/usr/bin/env bash set -e +rm -rf /tmp/hello-world +cd /tmp + +hc-scaffold example hello-world +cd hello-world + +nix develop --command bash -c " +set -e +npm i +npm t +" + rm -rf /tmp/forum-svelte cd /tmp diff --git a/src/cli.rs b/src/cli.rs index 65c0b4616..5d8143bdd 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,7 +1,5 @@ use crate::error::{ScaffoldError, ScaffoldResult}; -use crate::file_tree::{ - dir_content, file_content, insert_file, load_directory_into_memory, FileTree, -}; +use crate::file_tree::{dir_content, file_content, load_directory_into_memory, FileTree}; use crate::scaffold::app::cargo::exec_metadata; use crate::scaffold::app::nix::setup_nix_developer_environment; use crate::scaffold::app::AppFileTree; @@ -72,6 +70,9 @@ pub enum HcScaffold { /// If "--templates-url" is given, the template must be located at the ".templates/