-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
- Loading branch information
Showing
9 changed files
with
276 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package dev | ||
|
||
import "github.com/gnolang/gno/contribs/gnodev/pkg/events" | ||
|
||
const ( | ||
EvtReload events.EventType = "NODE_RELOAD" | ||
EvtReset events.EventType = "NODE_RESET" | ||
) | ||
|
||
type EventReloadData struct{} | ||
|
||
func newReloadEvent() *events.Event { | ||
return &events.Event{ | ||
Type: EvtReload, | ||
Data: &EventReloadData{}, | ||
} | ||
} | ||
|
||
type EventResetdData struct{} | ||
|
||
func newResetEvent() *events.Event { | ||
return &events.Event{ | ||
Type: EvtReload, | ||
Data: &EventResetdData{}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
(function() { | ||
var ws = new WebSocket('ws://{{- .Remote -}}'); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package watcher | ||
|
||
import ( | ||
events "github.com/gnolang/gno/contribs/gnodev/pkg/events" | ||
) | ||
|
||
const ( | ||
EvtPackagesUpdate events.EventType = "PACKAGES_UPDATE" | ||
) | ||
|
||
type PackageUpdate struct { | ||
Package string `json:"package"` | ||
Files []string `json:"files"` | ||
} | ||
|
||
type PackagesUpdate []PackageUpdate | ||
|
||
func (pkgsu PackagesUpdate) PackagesPath() []string { | ||
pkgs := make([]string, len(pkgsu)) | ||
for i, pkg := range pkgsu { | ||
pkgs[i] = pkg.Package | ||
} | ||
return pkgs | ||
} | ||
|
||
type EventPackagesUpdateData struct { | ||
Pkgs []PackageUpdate `json:"packages"` | ||
} | ||
|
||
func newPackagesUpdateEvent(pkgs []PackageUpdate) *events.Event { | ||
return &events.Event{ | ||
Type: EvtPackagesUpdate, | ||
Data: &EventPackagesUpdateData{ | ||
Pkgs: pkgs, | ||
}, | ||
} | ||
} |
Oops, something went wrong.