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

Publish Crates, Npm Package and Usage Docs #21

Merged
merged 8 commits into from
May 24, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Change script name
appcypher committed May 24, 2022
commit f6a43d7257bc44c30c7b279b5bac2225a8567429
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -180,23 +180,23 @@ async fn main() {

</details>

- **The _wnfs_ Command**
- **The _rs-wnfs_ Command**

You can optionally set up the `wnfs` script.
You can optionally set up the `rs-wnfs` script.

<details>
<summary>Read more</summary>

- Install it using the following command:

```bash
sh script/wnfs.sh setup
sh script/rs-wnfs.sh setup
```

- This lets you run the `wnfs.sh` script as a command.
- This lets you run the `rs-wnfs.sh` script as a command.

```bash
wnfs help
rs-wnfs help
```

</details>
@@ -217,28 +217,28 @@ async fn main() {

- Build the project

Check [REQUIREMENTS](#requirements) on how to set up the `wnfs` command.
Check [REQUIREMENTS](#requirements) on how to set up the `rs-wnfs` command.

```bash
wnfs build --all
rs-wnfs build --all
```

- You can also build for specific crates

```bash
wnfs build --wasm
rs-wnfs build --wasm
```

## Testing the Project

- Run all tests

```bash
wnfs test --all
rs-wnfs test --all
```

- Show code coverage

```bash
wnfs coverage
rs-wnfs coverage
```
2 changes: 1 addition & 1 deletion crates/wasm/README.md
Original file line number Diff line number Diff line change
@@ -116,7 +116,7 @@ console.log("Files in /pictures directory:", result);
- Build the project

```bash
wnfs build --wasm
rs-wnfs build --wasm
```

- Publish from the `pkg` directory
40 changes: 20 additions & 20 deletions scripts/wnfs.sh → scripts/rs-wnfs.sh
Original file line number Diff line number Diff line change
@@ -59,21 +59,21 @@ main() {
# Prints the help info.
#
# USAGE:
# wnfs build
# rs-wnfs build
#
help() {
echo ""
echo "Rust WNFS Utility Script"
echo ""
echo "USAGE:"
echo " wnfs [COMMAND] [...args]"
echo " rs-wnfs [COMMAND] [...args]"
echo ""
echo "COMMAND:"
echo " * build [--wnfs|--wasm|--all] - build projects"
echo " * test [--wnfs|--wasm|--all] - run tests"
echo " * publish [--wnfs|--wasm|--all] - publish packages"
echo " * coverage [--wnfs|--wasm|--all] - show code coverage"
echo " * setup - install wnfs script"
echo " * build [--fs|--wasm|--all] - build projects"
echo " * test [--fs|--wasm|--all] - run tests"
echo " * publish [--fs|--wasm|--all] - publish packages"
echo " * coverage [--fs|--wasm|--all] - show code coverage"
echo " * setup - install rs-wnfs script"
echo " * help - print this help message"
echo ""
echo ""
@@ -87,20 +87,20 @@ help() {
# Builds the project.
#
# USAGE:
# wnfs build [--wnfs|--wasm|--all]
# rs-wnfs build [--fs|--wasm|--all]
#
build() {
if check_flag --wnfs; then
build_wnfs
if check_flag --fs; then
build_fs
elif check_flag --wasm; then
build_wasm
else
build_wnfs
build_fs
build_wasm
fi
}

build_wnfs() {
build_fs() {
display_header "💿 | BUILDING WNFS PROJECT | 💿"
cargo build --release
}
@@ -118,20 +118,20 @@ build_wasm() {
# Runs tests.
#
# USAGE:
# wnfs test [--wnfs|--wasm|--all]
# rs-wnfs test [--fs|--wasm|--all]
#
test() {
if check_flag --wnfs; then
test_wnfs
if check_flag --fs; then
test_fs
elif check_flag --wasm; then
test_wasm
else
test_wnfs
test_fs
test_wasm
fi
}

test_wnfs() {
test_fs() {
display_header "🧪 | RUNNING WNFS TESTS | 🧪"
cargo test -p wnfs --release -- --nocapture
}
@@ -147,7 +147,7 @@ test_wasm() {
# Shows the code coverage of the project
#
# USAGE:
# wnfs coverage [--wnfs|--wasm|--all]
# rs-wnfs coverage [--fs|--wasm|--all]
#
coverage() {
errorln "coverage command not implemented yet"
@@ -158,7 +158,7 @@ coverage() {
# Publishes the project.
#
# USAGE:
# wnfs publish [--wnfs|--wasm|--all]
# rs-wnfs publish [--fs|--wasm|--all]
#
publish() {
errorln "publish command not implemented yet"
@@ -233,7 +233,7 @@ setup() {
chmod u+x $script_path

displayln "Drop a link to it in /usr/local/bin"
if ln -s $script_path /usr/local/bin/wnfs; then
if ln -s $script_path /usr/local/bin/rs-wnfs; then
successln "Successfully installed"
else
local result=$?