diff --git a/gno.land/cmd/gnoweb/README.md b/gno.land/cmd/gnoweb/README.md new file mode 100644 index 00000000000..6379d3f6c43 --- /dev/null +++ b/gno.land/cmd/gnoweb/README.md @@ -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 git@github.com:gnolang/gno.git + $> cd ./gno/gno.land + $> make install.gnoweb diff --git a/gno.land/pkg/gnoweb/Makefile b/gno.land/pkg/gnoweb/Makefile index 47758665db1..e2c478a5883 100644 --- a/gno.land/pkg/gnoweb/Makefile +++ b/gno.land/pkg/gnoweb/Makefile @@ -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 @@ -29,6 +28,7 @@ output_statics := ./public # Esbuild config input_js := ./frontend/js/**/*.ts output_js := ./public/js +esbuild_version := 0.24.0 ############# # Targets @@ -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: @@ -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 $@ diff --git a/gno.land/pkg/gnoweb/README.md b/gno.land/pkg/gnoweb/README.md new file mode 100644 index 00000000000..cd177f8fec5 --- /dev/null +++ b/gno.land/pkg/gnoweb/README.md @@ -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 +```