Skip to content

Commit

Permalink
Update deps, move files around
Browse files Browse the repository at this point in the history
  • Loading branch information
retrixe committed Nov 4, 2024
1 parent 4d78a94 commit dd46549
Show file tree
Hide file tree
Showing 13 changed files with 2,347 additions and 2,298 deletions.
2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ enableGlobalCache: false
packageExtensions:
"@parcel/node-resolver-core@*":
dependencies:
"@parcel/core": 2.9.3
"@parcel/core": 2.12.0
2 changes: 1 addition & 1 deletion utils/flash.go → app/dd.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package utils
package app

import (
"bufio"
Expand Down
2 changes: 1 addition & 1 deletion utils/devices_darwin.go → app/devices_darwin.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package utils
package app

import (
"io/fs"
Expand Down
2 changes: 1 addition & 1 deletion utils/devices_unix.go → app/devices_unix.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build !darwin && !windows

package utils
package app

import (
"io/fs"
Expand Down
2 changes: 1 addition & 1 deletion utils/devices_windows.go → app/devices_windows.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package utils
package app

import (
"io/fs"
Expand Down
2 changes: 1 addition & 1 deletion utils/dd.go → app/execdd.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package utils
package app

import (
"bufio"
Expand Down
2 changes: 1 addition & 1 deletion utils/sudo.go → app/sudo.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package utils
package app

import (
"errors"
Expand Down
2 changes: 1 addition & 1 deletion utils/misc.go → app/utils.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package utils
package app

import "strconv"

Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module github.com/retrixe/writer
go 1.19

require (
github.com/sqweek/dialog v0.0.0-20200911184034-8a3d98e8211d
github.com/webview/webview_go v0.0.0-20230901181450-5a14030a9070
github.com/sqweek/dialog v0.0.0-20240226140203-065105509627
github.com/webview/webview_go v0.0.0-20240831120633-6173450d4dd6
)

require github.com/TheTitanrain/w32 v0.0.0-20180517000239-4f5cfb03fabf // indirect
require github.com/TheTitanrain/w32 v0.0.0-20200114052255-2654d97dbd3d // indirect
12 changes: 8 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
github.com/TheTitanrain/w32 v0.0.0-20180517000239-4f5cfb03fabf h1:FPsprx82rdrX2jiKyS17BH6IrTmUBYqZa/CXT4uvb+I=
github.com/TheTitanrain/w32 v0.0.0-20180517000239-4f5cfb03fabf/go.mod h1:peYoMncQljjNS6tZwI9WVyQB3qZS6u79/N3mBOcnd3I=
github.com/sqweek/dialog v0.0.0-20200911184034-8a3d98e8211d h1:Chay1rwJnXxI27H+pzu7P81BKf647un9GOoRPTdXN18=
github.com/sqweek/dialog v0.0.0-20200911184034-8a3d98e8211d/go.mod h1:/qNPSY91qTz/8TgHEMioAUc6q7+3SOybeKczHMXFcXw=
github.com/webview/webview_go v0.0.0-20230901181450-5a14030a9070 h1:imZLWyo1ondeQjqfb/eHuYgFiOAYg6ugSMCnGfPTPmg=
github.com/webview/webview_go v0.0.0-20230901181450-5a14030a9070/go.mod h1:yE65LFCeWf4kyWD5re+h4XNvOHJEXOCOuJZ4v8l5sgk=
github.com/TheTitanrain/w32 v0.0.0-20200114052255-2654d97dbd3d h1:2xp1BQbqcDDaikHnASWpVZRjibOxu7y9LhAv04whugI=
github.com/TheTitanrain/w32 v0.0.0-20200114052255-2654d97dbd3d/go.mod h1:peYoMncQljjNS6tZwI9WVyQB3qZS6u79/N3mBOcnd3I=
github.com/sqweek/dialog v0.0.0-20240226140203-065105509627 h1:2JL2wmHXWIAxDofCK+AdkFi1KEg3dgkefCsm7isADzQ=
github.com/sqweek/dialog v0.0.0-20240226140203-065105509627/go.mod h1:/qNPSY91qTz/8TgHEMioAUc6q7+3SOybeKczHMXFcXw=
github.com/webview/webview_go v0.0.0-20240220051247-56f456ca3a43 h1:PwbNdNumoKba+ZgrE6ZpSluJfNJfyMuqwVyUB5+iLDI=
github.com/webview/webview_go v0.0.0-20240220051247-56f456ca3a43/go.mod h1:yE65LFCeWf4kyWD5re+h4XNvOHJEXOCOuJZ4v8l5sgk=
github.com/webview/webview_go v0.0.0-20240831120633-6173450d4dd6 h1:VQpB2SpK88C6B5lPHTuSZKb2Qee1QWwiFlC5CKY4AW0=
github.com/webview/webview_go v0.0.0-20240831120633-6173450d4dd6/go.mod h1:yE65LFCeWf4kyWD5re+h4XNvOHJEXOCOuJZ4v8l5sgk=
14 changes: 7 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

_ "embed"

"github.com/retrixe/writer/utils"
"github.com/retrixe/writer/app"
"github.com/sqweek/dialog"
webview "github.com/webview/webview_go"
)
Expand Down Expand Up @@ -54,16 +54,16 @@ func main() {
println("Invalid usage: writer flash <file> <destination> (--use-system-dd)")
os.Exit(1)
}
if err := utils.UnmountDevice(os.Args[3]); err != nil {
if err := app.UnmountDevice(os.Args[3]); err != nil {
log.Println(err)
if !strings.HasSuffix(os.Args[3], "debug.iso") {
os.Exit(1)
}
}
if len(os.Args) > 4 && os.Args[4] == "--use-system-dd" {
utils.RunDd(os.Args[2], os.Args[3])
app.RunDd(os.Args[2], os.Args[3])
} else {
utils.FlashFileToBlockDevice(os.Args[2], os.Args[3])
app.FlashFileToBlockDevice(os.Args[2], os.Args[3])
}
return
}
Expand All @@ -84,15 +84,15 @@ func main() {

// Bind a function to request refresh of devices attached.
w.Bind("refreshDevices", func() {
devices, err := utils.GetDevices()
devices, err := app.GetDevices()
if err != nil {
w.Eval("setDialogReact(" + ParseToJsString("Error: "+err.Error()) + ")")
return
}
if os.Getenv("DEBUG") == "true" {
homedir, err := os.UserHomeDir()
if err == nil {
devices = append(devices, utils.Device{
devices = append(devices, app.Device{
Name: filepath.Join(homedir, "debug.iso"),
Model: "Write to debug ISO in home dir",
Bytes: 10000000000,
Expand Down Expand Up @@ -155,7 +155,7 @@ func main() {
} else {
w.Eval("setFileSizeReact(" + strconv.Itoa(int(stat.Size())) + ")")
}
channel, stdin, err := utils.CopyConvert(file, selectedDevice)
channel, stdin, err := app.CopyConvert(file, selectedDevice)
inputPipe = stdin
if err != nil {
w.Eval("setDialogReact(" + ParseToJsString("Error: "+err.Error()) + ")")
Expand Down
52 changes: 26 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,40 +29,40 @@
"build:go:default": "go build -ldflags=\"-s -w\" -o writer -v",
"build:go:windows": "go build -ldflags=\"-s -w -H windowsgui\" -o writer.exe -v"
},
"packageManager": "yarn@4.0.2",
"packageManager": "yarn@4.5.1",
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.14.18",
"@swc/helpers": "^0.5.3",
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@mui/material": "^6.1.6",
"@swc/helpers": "^0.5.13",
"jsbi": "^4.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@babel/core": "^7.23.3",
"@emotion/babel-plugin": "^11.11.0",
"@tsconfig/vite-react": "^2.0.1",
"@types/react": "^18.2.38",
"@types/react-dom": "^18.2.17",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"@babel/core": "^7.26.0",
"@emotion/babel-plugin": "^11.12.0",
"@tsconfig/vite-react": "^3.0.2",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-config-standard-jsx": "^11.0.0",
"eslint-config-standard-react": "^13.0.0",
"eslint-config-standard-with-typescript": "^40.0.0",
"eslint-config-standard-with-typescript": "^43.0.1",
"eslint-import-resolver-node": "^0.3.9",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-n": "^16.3.1",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"parcel": "^2.10.3",
"prettier": "^3.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-n": "^17.12.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.0",
"parcel": "^2.12.0",
"prettier": "^3.3.3",
"process": "^0.11.10",
"run-script-os": "^1.1.6",
"typescript": "^5.3.2"
"typescript": "^5.6.3"
}
}
Loading

0 comments on commit dd46549

Please sign in to comment.