Skip to content

Commit

Permalink
chore: add minimal readme
Browse files Browse the repository at this point in the history
Signed-off-by: gfanton <[email protected]>
  • Loading branch information
gfanton committed Dec 11, 2024
1 parent db59650 commit 4b1dd8a
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 14 deletions.
13 changes: 13 additions & 0 deletions gno.land/cmd/gnoweb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# gnoweb

The gno.land web interface.

Live demo: https://gno.land/

## Install `gnoweb`

Install and run a local [`gnoland`](../gnoland) instance first.

$> git clone [email protected]:gnolang/gno.git
$> cd ./gno/gno.land
$> make install.gnoweb
20 changes: 6 additions & 14 deletions gno.land/pkg/gnoweb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ CHAIN_ID ?= test3
COMPONENTS_FOLDER := ./components

tools_run := go run -modfile ./tools/go.mod
tools_install := go install -modfile ./tools/go.mod

run_air := $(tools_run) github.com/air-verse/air
run_reflex := $(tools_run) github.com/cespare/reflex
Expand All @@ -29,6 +28,7 @@ output_statics := ./public
# Esbuild config
input_js := ./frontend/js/**/*.ts
output_js := ./public/js
esbuild_version := 0.24.0

#############
# Targets
Expand All @@ -38,9 +38,6 @@ output_js := ./public/js
# Install dependencies
all: generate

install: generate
go install -v .

# Generate process
generate: clean css ts fonts
css:
Expand Down Expand Up @@ -76,25 +73,20 @@ dev.gnoweb: | .cache

# Tailwind CSS in development mode
dev.css: | public
npx tailwindcss@$(tw_version) -c $(tw_config_path) --verbose -i $(input_css) -o $(output_css) --watch \
npx -y tailwindcss@$(tw_version) -c $(tw_config_path) --verbose -i $(input_css) -o $(output_css) --watch \
2>&1 | $(run_logname) tailwind

# XXX: add versioning on esbuild
# TS in development mode
dev.ts: | public
npx -y esbuild $(input_js) \
--bundle \
--outdir=$(output_js) \
--format=esm \
--watch \
--minify
npx -y esbuild@$(esbuild_version) $(input_js) --bundle --outdir=$(output_js) --format=esm --minify --watch \
2>&1 | $(run_logname) esbuild

# Cleanup
clean:
rm -rf public tmp
fclean: clean
rm -rf node_modules .cache
rm -rf .cache

# Dirs
.cache:; mkdir -p $@
public:; mkdir -p $@
.cache public:; mkdir -p $@
70 changes: 70 additions & 0 deletions gno.land/pkg/gnoweb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
```markdown
# Gnoweb

This README provides instructions on how to set up and run Gnoweb for development purposes.

## Prerequisites

Before you begin, ensure you have the following software installed on your machine:

- **Node.js**: Required for running JavaScript and CSS build tools.
- **Go**: Required for building `gnoweb`

## Development

To start the development environment, which runs multiple development tools in parallel,
use the following command:

```sh
make dev
```

This will:

- Start a Go server in development mode and watch for any Go files change.
- Enable Tailwind CSS in watch mode to automatically compile CSS changes.
- Use esbuild in watch mode to automatically bundle JavaScript changes.

You can customize the behavior of the Go server using the `DEV_REMOTE` and
`CHAIN_ID` environment variables. For example, to use `portal-loop` as the
target, run:

```sh
CHAIN_ID=portal-loop DEV_REMOTE=https://rpc.gno.land make dev
```

## Generate

To generate the public assets for the project, including CSS and JavaScript
files, run the following command. This should be used while editing CSS, JS, or
any asset files:

```sh
make generate
```

## Fmt

To format all supported files in the project, use the following command:

```sh
make fmt
```

This ensures that your code follows standard formatting conventions.

## Cleanup

To clean up build artifacts, you can use the following commands:

- To remove the `public` and `tmp` directories:

```sh
make clean
```

For a full clean, which also removes `.cache`, use:

```sh
make fclean
```

0 comments on commit 4b1dd8a

Please sign in to comment.