Skip to content

Commit

Permalink
dev: Add mage target for serve dev webui tool
Browse files Browse the repository at this point in the history
  • Loading branch information
kschiffer committed Oct 9, 2024
1 parent b16c4c1 commit acd78eb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,10 @@ The development server runs on `http://localhost:8080` and will proxy all API ca

#### Interactive development stack launcher tool

In order to easily launch development environments in different deployment contexts, this script configures and starts a development environment for The Things Stack, allowing users to choose between local and staging environments, enable branding, and configure cloud-hosted mock setups. You can launch it via:
In order to easily launch development environments in different deployment contexts, this mage target configures and starts a development environment for The Things Stack, allowing users to choose between local and staging environments, enable branding, and configure cloud-hosted mock setups. You can launch it via:

```bash
$ node tools/js/serve-dev-stack.js
$ tools/bin/mage dev:serveDevWebui
```

It will interactively guide you through the desired setup and launches the The Things Stack Enterprise as well as a frontend development server wia webpack.
Expand Down
3 changes: 0 additions & 3 deletions tools/js/serve-dev-stack.js → tools/js/serve-dev-webui.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,6 @@ if (relevantSetEnvs.length > 0) {
}
envConfig += stagingConfig
}
} else {
// Cypress setup
envConfig = baseConfig + localConfig
}

const envVars = envConfig
Expand Down
7 changes: 7 additions & 0 deletions tools/mage/dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,13 @@ func (Dev) StartDevStack() error {
return execGo(logFile, logFile, "run", "./cmd/ttn-lw-stack", "start", "--log.format=json")
}

func (Dev) ServeDevWebui() error {
if mg.Verbose() {
fmt.Println("Starting the webui with interactive configs")
}
return sh.RunV("node", "tools/js/serve-dev-webui.js")
}

func init() {
initDeps = append(initDeps, Dev.Certificates, Dev.InitDeviceRepo)
}
Expand Down

0 comments on commit acd78eb

Please sign in to comment.