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

Migrate to npm #395

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/printer/startup.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var startupTemplate = `
{{ if .DisableUI }}

┌─ {{ "DEVELOPMENT MODE" | yellow }} ──────────────────────────────┐
│ UI must be started via {{ "yarn serve" | green }} from ./ui │
│ UI must be started via {{ "npm serve" | green }} from ./ui
│ For more details, check our development guide: │
│ {{ "https://monitoror.com/guides/#development" | blue }} │
└─────────────────────────────────────────────────┘
Expand Down
2 changes: 1 addition & 1 deletion cli/printer/startup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ https://monitoror.com


┌─ DEVELOPMENT MODE ──────────────────────────────┐
│ UI must be started via yarn serve from ./ui │
│ UI must be started via npm serve from ./ui
│ For more details, check our development guide: │
│ https://monitoror.com/guides/#development │
└─────────────────────────────────────────────────┘
Expand Down
10 changes: 5 additions & 5 deletions docs/guides/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ <h3 id="requirements">Requirements</h3>
<ul>
<li>Go v1.14+</li>
<li>Nodejs v10+</li>
<li>Yarn v1.7+</li>
<li>npm v7+</li>
</ul>
</div>

Expand Down Expand Up @@ -262,15 +262,15 @@ <h5 class="m-documentation--configuration-side-title">Start project</h5>
<pre class="language-bash"><code>
# UI
cd ui
yarn
yarn serve
npm install
npm run serve
</code></pre>

<h5 class="m-documentation--configuration-side-title">Build project</h5>
<pre class="language-bash"><code>
cd ui
yarn
yarn run build
npm install
npm run build
cd ..
make install
make build
Expand Down
13 changes: 9 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ go 1.14

require (
github.com/AlekSi/pointer v1.0.0
github.com/GeertJohan/go.rice v1.0.0
github.com/GeertJohan/go.rice v1.0.2
github.com/basgys/goxml2json v1.1.0
github.com/bitly/go-simplejson v0.5.0 // indirect
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
github.com/bradfitz/gomemcache v0.0.0-20190329173943-551aad21a668 // indirect
github.com/daaku/go.zipexe v1.0.1 // indirect
github.com/dustin/go-humanize v1.0.0
github.com/fatih/structs v1.1.0
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/ghodss/yaml v1.0.0
github.com/go-playground/universal-translator v0.17.0 // indirect
github.com/go-playground/validator v9.31.0+incompatible
Expand All @@ -23,6 +25,8 @@ require (
github.com/labstack/echo/v4 v4.1.7
github.com/labstack/gommon v0.2.9
github.com/leodido/go-urn v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mattn/go-isatty v0.0.13 // indirect
github.com/orcaman/concurrent-map v0.0.0-20190314100340-2693aad1ed75
github.com/satori/go.uuid v1.2.0
github.com/shuheiktgw/go-travis v0.2.2
Expand All @@ -31,11 +35,12 @@ require (
github.com/spf13/cobra v1.0.0
github.com/spf13/viper v1.4.0
github.com/stretchr/testify v1.4.0
github.com/valyala/fasttemplate v1.2.1 // indirect
github.com/xanzy/go-gitlab v0.31.0
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 // indirect
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4
golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3 // indirect
golang.org/x/sys v0.0.0-20210525143221-35b2ab0089ea // indirect
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
gopkg.in/yaml.v2 v2.2.2
)
116 changes: 101 additions & 15 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion service/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func InitUI(s *Server) {
// Never use constant or variable according to docs : https://github.com/GeertJohan/go.rice#calling-findbox-and-mustfindbox
uiAssets, err := riceConfig.FindBox("../ui/dist")
if err != nil {
panic("static ui/dist not found. Build them with `cd ui && yarn build` first.")
panic("static ui/dist not found. Build them with `cd ui && npm build` first.")
}

assetHandler := http.FileServer(uiAssets.HTTPBox())
Expand Down
14 changes: 7 additions & 7 deletions ui/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
# Monitoror
# Monitoror UI

## Project setup
```
yarn install
npm install
```

### Compiles and hot-reloads for development
```
yarn serve
npm run serve
```

### Compiles and minifies for production
```
yarn build
npm run build
```

### Run your tests
```
yarn test
npm run test
```

### Lints and fixes files
```
yarn lint
npm run lint
```

### Run your unit tests
```
yarn test:unit
npm run test:unit
```

### Customize configuration
Expand Down