Skip to content

Commit

Permalink
chore: update structure to include packages
Browse files Browse the repository at this point in the history
  • Loading branch information
olup committed Nov 3, 2022
1 parent 8ca31a7 commit b6577dc
Show file tree
Hide file tree
Showing 34 changed files with 1,983 additions and 124 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build-next.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ jobs:
cache: true

- name: Set up Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
run: go install github.com/wailsapp/wails/v2/cmd/wails@master

- name: Build
working-directory: ./cmd/app
env:
CGO_LDFLAGS: "-LD:/a/lunii-admin/lunii-admin/bindings/windows/lib"
CGO_CFLAGS: "-ID:/a/lunii-admin/lunii-admin/bindings/windows/include"
Expand Down Expand Up @@ -73,9 +74,10 @@ jobs:
cache: true

- name: Set up Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
run: go install github.com/wailsapp/wails/v2/cmd/wails@master

- name: Build
working-directory: ./cmd/app
run: wails build -ldflags "-X main.NR_LICENCE=$NR_LICENCE -X main.version=$(git describe --tags --abbrev=0)" -debug -skipbindings -o lunii-admin_linux_amd64

- uses: ncipollo/release-action@v1
Expand Down Expand Up @@ -110,9 +112,10 @@ jobs:
cache: true

- name: Set up Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
run: go install github.com/wailsapp/wails/v2/cmd/wails@master

- name: Build
working-directory: ./cmd/app
run: wails build -ldflags "-X main.NR_LICENCE=$NR_LICENCE -X main.version=$(git describe --tags --abbrev=0)" -debug -skipbindings

- name: Create Zip
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/build-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ jobs:
cache: true

- name: Set up Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
run: go install github.com/wailsapp/wails/v2/cmd/wails@master

- name: Build
working-directory: ./cmd/app
env:
CGO_LDFLAGS: "-LD:/a/lunii-admin/lunii-admin/bindings/windows/lib"
CGO_CFLAGS: "-ID:/a/lunii-admin/lunii-admin/bindings/windows/include"
Expand Down Expand Up @@ -69,9 +70,10 @@ jobs:
cache: true

- name: Set up Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
run: go install github.com/wailsapp/wails/v2/cmd/wails@master

- name: Build
working-directory: ./cmd/app
run: wails build -ldflags "-X main.NR_LICENCE=$NR_LICENCE -X main.version=$(git describe --tags --abbrev=0)" -skipbindings -o lunii-admin_linux_amd64

- uses: ncipollo/release-action@v1
Expand Down Expand Up @@ -104,9 +106,10 @@ jobs:
cache: true

- name: Set up Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
run: go install github.com/wailsapp/wails/v2/cmd/wails@master

- name: Build
working-directory: ./cmd/app
run: wails build -ldflags "-X main.NR_LICENCE=$NR_LICENCE -X main.version=$(git describe --tags --abbrev=0)" -skipbindings

- name: Create Zip
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ dist/

node_modules
.DS_Store
build/bin
build/darwin
build
!build/appicon.png
version.txt
39 changes: 26 additions & 13 deletions build/darwin/Info.plist
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
<!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>CFBundleName</key><string>{{.Info.ProductName}}</string>
<key>CFBundleExecutable</key><string>{{.Name}}</string>
<key>CFBundleIdentifier</key><string>com.wails.{{.Name}}</string>
<key>CFBundleVersion</key><string>{{.Info.ProductVersion}}</string>
<key>CFBundleGetInfoString</key><string>{{.Info.Comments}}</string>
<key>CFBundleShortVersionString</key><string>{{.Info.ProductVersion}}</string>
<key>CFBundleIconFile</key><string>iconfile</string>
<key>LSMinimumSystemVersion</key><string>10.13.0</string>
<key>NSHighResolutionCapable</key><string>true</string>
<key>NSHumanReadableCopyright</key><string>{{.Info.Copyright}}</string>
</dict></plist>
<plist version="1.0">
<dict>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleName</key>
<string>{{.Info.ProductName}}</string>
<key>CFBundleExecutable</key>
<string>{{.Name}}</string>
<key>CFBundleIdentifier</key>
<string>com.wails.{{.Name}}</string>
<key>CFBundleVersion</key>
<string>{{.Info.ProductVersion}}</string>
<key>CFBundleGetInfoString</key>
<string>{{.Info.Comments}}</string>
<key>CFBundleShortVersionString</key>
<string>{{.Info.ProductVersion}}</string>
<key>CFBundleIconFile</key>
<string>iconfile</string>
<key>LSMinimumSystemVersion</key>
<string>10.13.0</string>
<key>NSHighResolutionCapable</key>
<string>true</string>
<key>NSHumanReadableCopyright</key>
<string>{{.Info.Copyright}}</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions app.go → cmd/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (
"github.com/newrelic/go-agent/v3/newrelic"
"github.com/rhysd/go-github-selfupdate/selfupdate"

"github.com/olup/lunii-cli/pkg/lunii"
studiopackbuilder "github.com/olup/lunii-cli/pkg/pack-builder"
"github.com/olup/lunii-admin/pkg/lunii"
studiopackbuilder "github.com/olup/lunii-admin/pkg/pack-builder"
"github.com/wailsapp/wails/v2/pkg/runtime"

log "github.com/sirupsen/logrus"
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions main.go → cmd/app/main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"github.com/olup/lunii-admin/frontend"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/options"
)
Expand All @@ -13,11 +14,10 @@ func main() {

// Create application with options
err = wails.Run(&options.App{
Title: "lunii-admin",
Width: 1024,
Height: 768,
Assets: assets,
//BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1},
Title: "lunii-admin",
Width: 1024,
Height: 768,
Assets: frontend.Assets,
OnStartup: app.startup,
Bind: []interface{}{
app,
Expand Down
3 changes: 3 additions & 0 deletions wails.json → cmd/app/wails.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"$schema": "https://wails.io/schemas/config.v2.json",
"name": "lunii-admin",
"outputfilename": "lunii-admin",
"build:dir": "../../build",
"frontend:dir": "../../frontend",
"frontend:install": "npm install",
"frontend:build": "npm run build",
"frontend:dev:watcher": "npm run dev",
Expand Down
7 changes: 0 additions & 7 deletions embed-empty.go

This file was deleted.

8 changes: 0 additions & 8 deletions embed.go

This file was deleted.

6 changes: 6 additions & 0 deletions frontend/asset.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package frontend

import "embed"

//go:embed all:dist
var Assets embed.FS
78 changes: 39 additions & 39 deletions frontend/wailsjs/go/models.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,3 @@
export namespace main {

export class CheckUpdateResponse {
canUpdate: boolean;
latestVersion: string;
releaseNotes: string;

static createFrom(source: any = {}) {
return new CheckUpdateResponse(source);
}

constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.canUpdate = source["canUpdate"];
this.latestVersion = source["latestVersion"];
this.releaseNotes = source["releaseNotes"];
}
}
export class Infos {
version: string;
machineId: string;
os: string;
arch: string;

static createFrom(source: any = {}) {
return new Infos(source);
}

constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.version = source["version"];
this.machineId = source["machineId"];
this.os = source["os"];
this.arch = source["arch"];
}
}

}

export namespace lunii {

export class DiskUsage {
Expand Down Expand Up @@ -127,3 +88,42 @@ export namespace lunii {

}

export namespace main {

export class CheckUpdateResponse {
canUpdate: boolean;
latestVersion: string;
releaseNotes: string;

static createFrom(source: any = {}) {
return new CheckUpdateResponse(source);
}

constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.canUpdate = source["canUpdate"];
this.latestVersion = source["latestVersion"];
this.releaseNotes = source["releaseNotes"];
}
}
export class Infos {
version: string;
machineId: string;
os: string;
arch: string;

static createFrom(source: any = {}) {
return new Infos(source);
}

constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.version = source["version"];
this.machineId = source["machineId"];
this.os = source["os"];
this.arch = source["arch"];
}
}

}

Empty file modified frontend/wailsjs/runtime/package.json
100755 → 100644
Empty file.
12 changes: 8 additions & 4 deletions frontend/wailsjs/runtime/runtime.d.ts
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,24 @@ export interface EnvironmentInfo {
export function EventsEmit(eventName: string, ...data: any): void;

// [EventsOn](https://wails.io/docs/reference/runtime/events#eventson) sets up a listener for the given event name.
export function EventsOn(eventName: string, callback: (...data: any) => void): void;
export function EventsOn(eventName: string, callback: (...data: any) => void): () => void;

// [EventsOnMultiple](https://wails.io/docs/reference/runtime/events#eventsonmultiple)
// sets up a listener for the given event name, but will only trigger a given number times.
export function EventsOnMultiple(eventName: string, callback: (...data: any) => void, maxCallbacks: number): void;
export function EventsOnMultiple(eventName: string, callback: (...data: any) => void, maxCallbacks: number): () => void;

// [EventsOnce](https://wails.io/docs/reference/runtime/events#eventsonce)
// sets up a listener for the given event name, but will only trigger once.
export function EventsOnce(eventName: string, callback: (...data: any) => void): void;
export function EventsOnce(eventName: string, callback: (...data: any) => void): () => void;

// [EventsOff](https://wails.io/docs/reference/runtime/events#eventsff)
// [EventsOff](https://wails.io/docs/reference/runtime/events#eventsoff)
// unregisters the listener for the given event name.
export function EventsOff(eventName: string, ...additionalEventNames: string[]): void;

// [EventsOffAll](https://wails.io/docs/reference/runtime/events#eventsoffall)
// unregisters all listeners.
export function EventsOffAll(): void;

// [LogPrint](https://wails.io/docs/reference/runtime/log#logprint)
// logs the given message as a raw message
export function LogPrint(message: string): void;
Expand Down
Empty file modified frontend/wailsjs/runtime/runtime.js
100755 → 100644
Empty file.
Loading

0 comments on commit b6577dc

Please sign in to comment.