appclean 2.0.0 → 2.0.3
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/.github/workflows/npm-publish.yml +104 -0
- package/DEVELOPMENT.md +84 -0
- package/RELEASE_GUIDE.md +257 -0
- package/RELEASE_QUICK_START.md +176 -0
- package/assets/logo.svg +48 -32
- package/dist/index.js +1 -1
- package/dist/ui/client/api/client.d.ts.map +1 -1
- package/dist/ui/client/api/client.js +5 -1
- package/dist/ui/client/api/client.js.map +1 -1
- package/dist/ui/client/app.d.ts +1 -1
- package/dist/ui/client/app.d.ts.map +1 -1
- package/dist/ui/client/app.js +10 -6
- package/dist/ui/client/app.js.map +1 -1
- package/dist/ui/client/index.html +103 -46
- package/dist/ui/client/pages/appSearch.js +12 -1
- package/dist/ui/client/pages/appSearch.js.map +1 -1
- package/dist/ui/client/pages/dashboard.d.ts.map +1 -1
- package/dist/ui/client/pages/dashboard.js +26 -5
- package/dist/ui/client/pages/dashboard.js.map +1 -1
- package/dist/ui/client/state/appStore.d.ts.map +1 -1
- package/dist/ui/client/state/appStore.js +21 -12
- package/dist/ui/client/state/appStore.js.map +1 -1
- package/dist/ui/client/state/dashboardStore.d.ts.map +1 -1
- package/dist/ui/client/state/dashboardStore.js +9 -3
- package/dist/ui/client/state/dashboardStore.js.map +1 -1
- package/dist/ui/client/styles/animations.css +384 -2
- package/dist/ui/client/styles/base.css +347 -73
- package/dist/ui/client/styles/components.css +566 -189
- package/dist/ui/client/styles/layout.css +618 -1
- package/dist/ui/client/styles/responsive.css +388 -0
- package/dist/ui/client/styles/variables.css +163 -69
- package/dist/ui/guiServer.d.ts +3 -0
- package/dist/ui/guiServer.d.ts.map +1 -1
- package/dist/ui/guiServer.js +48 -1
- package/dist/ui/guiServer.js.map +1 -1
- package/dist/utils/upgrade.d.ts +2 -1
- package/dist/utils/upgrade.d.ts.map +1 -1
- package/dist/utils/upgrade.js +14 -1
- package/dist/utils/upgrade.js.map +1 -1
- package/package.json +1 -1
- package/scripts/publish-npm.sh +64 -0
- package/src/index.ts +1 -1
- package/src/ui/client/api/client.ts +6 -1
- package/src/ui/client/app.ts +15 -11
- package/src/ui/client/index.html +103 -46
- package/src/ui/client/pages/appSearch.ts +14 -1
- package/src/ui/client/pages/dashboard.ts +27 -5
- package/src/ui/client/state/appStore.ts +24 -12
- package/src/ui/client/state/dashboardStore.ts +13 -3
- package/src/ui/client/styles/animations.css +384 -2
- package/src/ui/client/styles/base.css +347 -73
- package/src/ui/client/styles/components.css +566 -189
- package/src/ui/client/styles/layout.css +618 -1
- package/src/ui/client/styles/responsive.css +388 -0
- package/src/ui/client/styles/variables.css +163 -69
- package/src/ui/guiServer.ts +67 -1
- package/src/utils/upgrade.ts +18 -1
package/src/ui/guiServer.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { readFileSync, existsSync } from 'fs';
|
|
|
8
8
|
import { join } from 'path';
|
|
9
9
|
import { fileURLToPath } from 'url';
|
|
10
10
|
import { dirname } from 'path';
|
|
11
|
+
import { execFile, spawn, type ChildProcess } from 'child_process';
|
|
11
12
|
import { Logger } from '../utils/logger.js';
|
|
12
13
|
import { sendJson, sendError, parseQueryParams } from './server/middleware/errorHandler.js';
|
|
13
14
|
import { handleAppRoutes } from './server/routes/apps.js';
|
|
@@ -22,6 +23,7 @@ export class GUIServer {
|
|
|
22
23
|
private port: number = 3000;
|
|
23
24
|
private server: any;
|
|
24
25
|
private spaHtml: string | null = null;
|
|
26
|
+
private browserProcess: ChildProcess | null = null;
|
|
25
27
|
|
|
26
28
|
constructor(port: number = 3000) {
|
|
27
29
|
this.port = port;
|
|
@@ -41,9 +43,13 @@ export class GUIServer {
|
|
|
41
43
|
});
|
|
42
44
|
|
|
43
45
|
return new Promise((resolve) => {
|
|
44
|
-
this.server.listen(this.port, () => {
|
|
46
|
+
this.server.listen(this.port, async () => {
|
|
45
47
|
Logger.success(`✨ AppClean GUI running at http://localhost:${this.port}`);
|
|
46
48
|
Logger.info('Press Ctrl+C to stop the server');
|
|
49
|
+
|
|
50
|
+
// Open the default browser
|
|
51
|
+
await this.openBrowser();
|
|
52
|
+
|
|
47
53
|
resolve();
|
|
48
54
|
});
|
|
49
55
|
});
|
|
@@ -53,12 +59,72 @@ export class GUIServer {
|
|
|
53
59
|
* Stop GUI server
|
|
54
60
|
*/
|
|
55
61
|
async stop(): Promise<void> {
|
|
62
|
+
// Close the browser
|
|
63
|
+
await this.closeBrowser();
|
|
64
|
+
|
|
56
65
|
if (this.server) {
|
|
57
66
|
this.server.close();
|
|
58
67
|
Logger.info('GUI server stopped');
|
|
59
68
|
}
|
|
60
69
|
}
|
|
61
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Open the default browser
|
|
73
|
+
*/
|
|
74
|
+
private async openBrowser(): Promise<void> {
|
|
75
|
+
const url = `http://localhost:${this.port}`;
|
|
76
|
+
|
|
77
|
+
try {
|
|
78
|
+
const platform = process.platform;
|
|
79
|
+
|
|
80
|
+
if (platform === 'darwin') {
|
|
81
|
+
// macOS
|
|
82
|
+
this.browserProcess = execFile('open', [url]);
|
|
83
|
+
} else if (platform === 'win32') {
|
|
84
|
+
// Windows
|
|
85
|
+
this.browserProcess = execFile('cmd', ['/c', 'start', url]);
|
|
86
|
+
} else {
|
|
87
|
+
// Linux and other Unix-like systems
|
|
88
|
+
this.browserProcess = execFile('xdg-open', [url]);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
this.browserProcess.on('error', (error) => {
|
|
92
|
+
Logger.warn(`Could not open browser: ${error.message}`);
|
|
93
|
+
});
|
|
94
|
+
} catch (error) {
|
|
95
|
+
Logger.warn(`Failed to open browser: ${(error as Error).message}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Close the browser
|
|
101
|
+
*/
|
|
102
|
+
private async closeBrowser(): Promise<void> {
|
|
103
|
+
if (!this.browserProcess) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
try {
|
|
108
|
+
const platform = process.platform;
|
|
109
|
+
|
|
110
|
+
if (platform === 'win32') {
|
|
111
|
+
// Windows: kill the process
|
|
112
|
+
if (this.browserProcess.pid) {
|
|
113
|
+
process.kill(this.browserProcess.pid, 'SIGTERM');
|
|
114
|
+
}
|
|
115
|
+
} else {
|
|
116
|
+
// macOS and Linux: kill the process
|
|
117
|
+
if (this.browserProcess.pid) {
|
|
118
|
+
process.kill(this.browserProcess.pid);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
this.browserProcess = null;
|
|
123
|
+
} catch (error) {
|
|
124
|
+
Logger.debug(`Note: Could not close browser process: ${(error as Error).message}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
62
128
|
/**
|
|
63
129
|
* Main request handler
|
|
64
130
|
*/
|
package/src/utils/upgrade.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { execSync } from 'child_process';
|
|
2
2
|
import { Logger } from './logger.js';
|
|
3
|
+
import { readFileSync } from 'fs';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { dirname, join } from 'path';
|
|
3
6
|
|
|
4
7
|
export interface VersionInfo {
|
|
5
8
|
current: string;
|
|
@@ -9,7 +12,21 @@ export interface VersionInfo {
|
|
|
9
12
|
|
|
10
13
|
export class UpgradeManager {
|
|
11
14
|
private readonly packageName = 'appclean';
|
|
12
|
-
private
|
|
15
|
+
private currentVersion: string;
|
|
16
|
+
|
|
17
|
+
constructor() {
|
|
18
|
+
// Dynamically read version from package.json
|
|
19
|
+
try {
|
|
20
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
21
|
+
const __dirname = dirname(__filename);
|
|
22
|
+
const packagePath = join(__dirname, '../../package.json');
|
|
23
|
+
const packageData = JSON.parse(readFileSync(packagePath, 'utf-8'));
|
|
24
|
+
this.currentVersion = packageData.version || '2.0.0';
|
|
25
|
+
} catch (error) {
|
|
26
|
+
Logger.debug('Failed to read version from package.json, using fallback');
|
|
27
|
+
this.currentVersion = '2.0.0';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
13
30
|
|
|
14
31
|
/**
|
|
15
32
|
* Get version information from npm registry
|