portapack 0.3.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/desktop/README.md +112 -0
- package/desktop/app.go +61 -0
- package/desktop/frontend/README.md +8 -0
- package/desktop/frontend/index.html +13 -0
- package/desktop/frontend/package-lock.json +873 -0
- package/desktop/frontend/package.json +18 -0
- package/desktop/frontend/src/App.vue +805 -0
- package/desktop/frontend/src/assets/fonts/OFL.txt +93 -0
- package/desktop/frontend/src/assets/fonts/nunito-v16-latin-regular.woff2 +0 -0
- package/desktop/frontend/src/main.js +5 -0
- package/desktop/frontend/src/style.css +26 -0
- package/desktop/frontend/vite.config.js +7 -0
- package/desktop/go.mod +38 -0
- package/desktop/go.sum +79 -0
- package/desktop/main.go +36 -0
- package/desktop/wails.json +14 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# [0.4.0](https://github.com/manicinc/portapack/compare/v0.3.3...v0.4.0) (2025-06-07)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* add initial Vue 3 frontend with Wails integration and project structure ([0a4edd8](https://github.com/manicinc/portapack/commit/0a4edd8b7c14a15acaaf8554536fa1792eec8049))
|
7
|
+
|
1
8
|
## [0.3.3](https://github.com/manicinc/portapack/compare/v0.3.2...v0.3.3) (2025-04-20)
|
2
9
|
|
3
10
|
|
@@ -0,0 +1,112 @@
|
|
1
|
+
# 📦 Portapack Desktop GUI – Documentation
|
2
|
+
|
3
|
+
## 📖 Overview
|
4
|
+
|
5
|
+
**Portapack Desktop GUI** is a Wails-based cross-platform desktop application with a Vue.js frontend. It provides a user-friendly graphical interface to the `portapack` CLI tool, allowing users to run it with various options through an intuitive UI.
|
6
|
+
|
7
|
+
**GitHub Repository:**
|
8
|
+
👉 [https://github.com/manicinc/portapack.git](https://github.com/manicinc/portapack.git)
|
9
|
+
|
10
|
+
---
|
11
|
+
|
12
|
+
## 🧰 Prerequisites
|
13
|
+
|
14
|
+
Install the following tools before using the application:
|
15
|
+
|
16
|
+
| Tool | Install Command |
|
17
|
+
| ----------------------------- | ---------------------------------------------------------- |
|
18
|
+
| Go ≥ 1.20 | [https://golang.org/dl/](https://golang.org/dl/) |
|
19
|
+
| Node.js ≥ 18.x (includes npm) | [https://nodejs.org/](https://nodejs.org/) |
|
20
|
+
| Wails CLI | `go install github.com/wailsapp/wails/v2/cmd/wails@latest` |
|
21
|
+
| Portapack CLI | `npm install -g portapack` |
|
22
|
+
|
23
|
+
---
|
24
|
+
|
25
|
+
## 🚀 Getting Started
|
26
|
+
|
27
|
+
### 1. Clone the Repository
|
28
|
+
|
29
|
+
```bash
|
30
|
+
git clone https://github.com/manicinc/portapack.git
|
31
|
+
cd portapack/desktop
|
32
|
+
```
|
33
|
+
|
34
|
+
### 2. Run the App in Development Mode
|
35
|
+
|
36
|
+
```bash
|
37
|
+
wails dev
|
38
|
+
```
|
39
|
+
|
40
|
+
Wails will automatically install frontend dependencies and launch the app with hot-reloading.
|
41
|
+
|
42
|
+
---
|
43
|
+
|
44
|
+
## 🏗️ Build for Production
|
45
|
+
|
46
|
+
To generate a distributable binary:
|
47
|
+
|
48
|
+
```bash
|
49
|
+
wails build
|
50
|
+
```
|
51
|
+
|
52
|
+
This creates a standalone executable in `build/bin/` for your platform with all assets embedded.
|
53
|
+
|
54
|
+
---
|
55
|
+
|
56
|
+
## ⚙️ Features
|
57
|
+
|
58
|
+
* Full support for `portapack` CLI options via GUI
|
59
|
+
* Input/output paths, recursive crawling, and minification toggles
|
60
|
+
* Toggle dark/light mode
|
61
|
+
* View real-time command output
|
62
|
+
* Responsive, theme-aware layout
|
63
|
+
|
64
|
+
---
|
65
|
+
|
66
|
+
## 🎛️ CLI Options Mapped to UI
|
67
|
+
|
68
|
+
| UI Control | CLI Flag(s) |
|
69
|
+
| ----------------------- | ---------------------- |
|
70
|
+
| Input HTML/URL | `<input>` |
|
71
|
+
| Output File Path | `-o`, `--output` |
|
72
|
+
| Enable All Minification | `-m`, `--minify` |
|
73
|
+
| Disable Minify (HTML) | `--no-minify-html` |
|
74
|
+
| Disable Minify (CSS) | `--no-minify-css` |
|
75
|
+
| Disable Minify (JS) | `--no-minify-js` |
|
76
|
+
| Embed Assets | `-e`, `--embed-assets` |
|
77
|
+
| Recursive Crawl | `-r`, `--recursive` |
|
78
|
+
| Max Depth | (argument to `-r`) |
|
79
|
+
| Base URL | `-b`, `--base-url` |
|
80
|
+
| Dry Run | `-d`, `--dry-run` |
|
81
|
+
| Verbose Logging | `-v`, `--verbose` |
|
82
|
+
| Log Level | `--log-level <level>` |
|
83
|
+
|
84
|
+
---
|
85
|
+
|
86
|
+
## 🐛 Troubleshooting
|
87
|
+
|
88
|
+
### Portapack not found?
|
89
|
+
|
90
|
+
Make sure it's globally installed:
|
91
|
+
|
92
|
+
```bash
|
93
|
+
npm install -g portapack
|
94
|
+
```
|
95
|
+
|
96
|
+
And accessible in your shell:
|
97
|
+
|
98
|
+
```bash
|
99
|
+
portapack --help
|
100
|
+
```
|
101
|
+
|
102
|
+
If it still fails, you may need to add the npm global bin directory to your PATH:
|
103
|
+
|
104
|
+
```bash
|
105
|
+
export PATH="$PATH:$(npm bin -g)"
|
106
|
+
```
|
107
|
+
|
108
|
+
---
|
109
|
+
|
110
|
+
## 🪪 License
|
111
|
+
|
112
|
+
Font: **Nunito** – licensed under the [SIL Open Font License v1.1](https://scripts.sil.org/OFL) (included in the repo).
|
package/desktop/app.go
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
package main
|
2
|
+
|
3
|
+
import (
|
4
|
+
"context"
|
5
|
+
"fmt"
|
6
|
+
"os/exec" // For spawning subprocesses
|
7
|
+
"strings" // For joining command arguments
|
8
|
+
)
|
9
|
+
|
10
|
+
// App struct
|
11
|
+
type App struct {
|
12
|
+
ctx context.Context
|
13
|
+
}
|
14
|
+
|
15
|
+
// NewApp creates a new App application struct
|
16
|
+
func NewApp() *App {
|
17
|
+
return &App{}
|
18
|
+
}
|
19
|
+
|
20
|
+
// startup is called when the app starts.
|
21
|
+
// The context is saved
|
22
|
+
// so we can call the runtime methods
|
23
|
+
func (a *App) startup(ctx context.Context) {
|
24
|
+
a.ctx = ctx
|
25
|
+
}
|
26
|
+
|
27
|
+
// Greet returns a greeting for the given name (keeping existing method)
|
28
|
+
func (a *App) Greet(name string) string {
|
29
|
+
return fmt.Sprintf("Hello %s, It's show time!", name)
|
30
|
+
}
|
31
|
+
|
32
|
+
// RunPortapack executes the portapack CLI command with given arguments
|
33
|
+
func (a *App) RunPortapack(args []string) (string, error) {
|
34
|
+
// Prepend "portapack" to the arguments slice
|
35
|
+
cmdArgs := append([]string{}, args...) // Create a new slice to avoid modifying the original 'args'
|
36
|
+
|
37
|
+
// Construct the command
|
38
|
+
cmd := exec.Command("portapack", cmdArgs...) // "portapack" is the command itself
|
39
|
+
|
40
|
+
// Capture stdout and stderr
|
41
|
+
var stdout, stderr strings.Builder
|
42
|
+
cmd.Stdout = &stdout
|
43
|
+
cmd.Stderr = &stderr
|
44
|
+
|
45
|
+
fmt.Printf("Executing command: portapack %s\n", strings.Join(cmdArgs, " "))
|
46
|
+
|
47
|
+
// Run the command
|
48
|
+
err := cmd.Run()
|
49
|
+
|
50
|
+
// Combine output for display
|
51
|
+
output := stdout.String()
|
52
|
+
if stderr.Len() > 0 {
|
53
|
+
output += "\nError:\n" + stderr.String()
|
54
|
+
}
|
55
|
+
|
56
|
+
if err != nil {
|
57
|
+
return output, fmt.Errorf("portapack command failed: %w - %s", err, output)
|
58
|
+
}
|
59
|
+
|
60
|
+
return output, nil
|
61
|
+
}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Vue 3 + Vite
|
2
|
+
|
3
|
+
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs,
|
4
|
+
check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
5
|
+
|
6
|
+
## Recommended IDE Setup
|
7
|
+
|
8
|
+
- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8"/>
|
5
|
+
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
6
|
+
<title>desktop</title>
|
7
|
+
</head>
|
8
|
+
<body>
|
9
|
+
<div id="app"></div>
|
10
|
+
<script src="./src/main.js" type="module"></script>
|
11
|
+
</body>
|
12
|
+
</html>
|
13
|
+
|