mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-03-17 13:21:44 +01:00
remove unused Go files and resources; update @types/react dependencies in pnpm-lock.yaml
This commit is contained in:
parent
43ee4f7be0
commit
458c18db08
@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>icon</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>app</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>ninja.nostrudel</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>noStrudel</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>0.41.0</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.41.0</string>
|
||||
</dict>
|
||||
</plist>
|
@ -1,3 +0,0 @@
|
||||
module nostrudel.ninja/m/v2
|
||||
|
||||
go 1.23.2
|
52
exe/main.go
52
exe/main.go
@ -1,52 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
"os/exec"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
//go:embed web/*
|
||||
var webFiles embed.FS
|
||||
|
||||
func openBrowser(url string) {
|
||||
var cmd string
|
||||
var args []string
|
||||
|
||||
switch runtime.GOOS {
|
||||
case "windows":
|
||||
cmd = "cmd"
|
||||
args = []string{"/c", "start"}
|
||||
case "darwin":
|
||||
cmd = "open"
|
||||
default:
|
||||
cmd = "xdg-open"
|
||||
}
|
||||
args = append(args, url)
|
||||
exec.Command(cmd, args...).Start()
|
||||
}
|
||||
|
||||
func main() {
|
||||
// Create a filesystem rooted at the 'web' directory
|
||||
fsys, err := fs.Sub(webFiles, "web")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
// Serve the embedded files
|
||||
http.Handle("/", http.FileServer(http.FS(fsys)))
|
||||
|
||||
port := "3149"
|
||||
fmt.Printf("Starting server at http://localhost:%s\n", port)
|
||||
|
||||
// Open browser automatically
|
||||
openBrowser("http://localhost:" + port)
|
||||
|
||||
// Start server
|
||||
if err := http.ListenAndServe(":"+port, nil); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
77
exe/makefile
77
exe/makefile
@ -1,77 +0,0 @@
|
||||
# Variables
|
||||
VERSION ?= $(shell git describe --tags --always --dirty)
|
||||
BINARY_NAME=noStrudel
|
||||
BUILD_DIR=bin
|
||||
RESOURCES_DIR=resources
|
||||
|
||||
# Build flags
|
||||
LDFLAGS=-ldflags="-X 'main.Version=${VERSION}'"
|
||||
|
||||
# Windows resource file (create this at build time)
|
||||
WINDOWS_SYSO=${BUILD_DIR}/windows_amd64.syso
|
||||
|
||||
# Ensure builds directory exists
|
||||
$(shell mkdir -p ${BUILD_DIR})
|
||||
|
||||
.PHONY: all clean windows linux darwin windows-syso
|
||||
|
||||
all: copy windows linux darwin
|
||||
|
||||
# Build source
|
||||
copy: source
|
||||
cp -r ../dist/* web
|
||||
|
||||
source:
|
||||
cd ../ && \
|
||||
pnpm install && \
|
||||
VITE_COMMIT_HASH=$(shell git rev-parse --short HEAD) \
|
||||
VITE_APP_VERSION=$(shell jq -r .version ../package.json) \
|
||||
pnpm build
|
||||
|
||||
# Generate Windows resource file with icon
|
||||
windows-syso:
|
||||
go install github.com/akavel/rsrc@latest
|
||||
rsrc -ico ${RESOURCES_DIR}/icon.ico -o ${WINDOWS_SYSO}
|
||||
|
||||
# Windows builds
|
||||
windows: windows-syso windows-amd64 windows-arm64
|
||||
|
||||
windows-amd64:
|
||||
GOOS=windows GOARCH=amd64 go build ${LDFLAGS} -o ${BUILD_DIR}/${BINARY_NAME}-windows-amd64.exe
|
||||
|
||||
windows-arm64:
|
||||
GOOS=windows GOARCH=arm64 go build ${LDFLAGS} -o ${BUILD_DIR}/${BINARY_NAME}-windows-arm64.exe
|
||||
|
||||
# Linux builds
|
||||
linux: linux-amd64 linux-arm64
|
||||
|
||||
linux-amd64:
|
||||
GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o ${BUILD_DIR}/${BINARY_NAME}-linux-amd64
|
||||
|
||||
linux-arm64:
|
||||
GOOS=linux GOARCH=arm64 go build ${LDFLAGS} -o ${BUILD_DIR}/${BINARY_NAME}-linux-arm64
|
||||
|
||||
# macOS builds
|
||||
darwin: darwin-amd64 darwin-arm64
|
||||
|
||||
darwin-amd64:
|
||||
GOOS=darwin GOARCH=amd64 go build ${LDFLAGS} -o ${BUILD_DIR}/${BINARY_NAME}-darwin-amd64
|
||||
# Create macOS app bundle for amd64
|
||||
mkdir -p ${BUILD_DIR}/${BINARY_NAME}-darwin-amd64.app/Contents/MacOS
|
||||
mkdir -p ${BUILD_DIR}/${BINARY_NAME}-darwin-amd64.app/Contents/Resources
|
||||
cp ${BUILD_DIR}/${BINARY_NAME}-darwin-amd64 ${BUILD_DIR}/${BINARY_NAME}-darwin-amd64.app/Contents/MacOS/${BINARY_NAME}
|
||||
cp ${RESOURCES_DIR}/icon.icns ${BUILD_DIR}/${BINARY_NAME}-darwin-amd64.app/Contents/Resources/
|
||||
cp Info.plist ${BUILD_DIR}/${BINARY_NAME}-darwin-amd64.app/Contents/
|
||||
|
||||
darwin-arm64:
|
||||
GOOS=darwin GOARCH=arm64 go build ${LDFLAGS} -o ${BUILD_DIR}/${BINARY_NAME}-darwin-arm64
|
||||
# Create macOS app bundle for arm64
|
||||
mkdir -p ${BUILD_DIR}/${BINARY_NAME}-darwin-arm64.app/Contents/MacOS
|
||||
mkdir -p ${BUILD_DIR}/${BINARY_NAME}-darwin-arm64.app/Contents/Resources
|
||||
cp ${BUILD_DIR}/${BINARY_NAME}-darwin-arm64 ${BUILD_DIR}/${BINARY_NAME}-darwin-arm64.app/Contents/MacOS/${BINARY_NAME}
|
||||
cp ${RESOURCES_DIR}/icon.icns ${BUILD_DIR}/${BINARY_NAME}-darwin-arm64.app/Contents/Resources/
|
||||
cp Info.plist ${BUILD_DIR}/${BINARY_NAME}-darwin-arm64.app/Contents/
|
||||
|
||||
# Clean build directory
|
||||
clean:
|
||||
rm -rf ${BUILD_DIR}/*
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 5.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 18 KiB |
4
pnpm-lock.yaml
generated
4
pnpm-lock.yaml
generated
@ -417,10 +417,10 @@ importers:
|
||||
specifier: ^0.6.8
|
||||
version: 0.6.8
|
||||
'@types/react':
|
||||
specifier: ^18.3.18
|
||||
specifier: ^18.2.22
|
||||
version: 18.3.18
|
||||
'@types/react-dom':
|
||||
specifier: ^18.3.5
|
||||
specifier: ^18.2.7
|
||||
version: 18.3.5(@types/react@18.3.18)
|
||||
'@types/react-window':
|
||||
specifier: ^1.8.8
|
||||
|
Loading…
x
Reference in New Issue
Block a user