goblin-malin 0.1.2 → 0.1.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.
@@ -87,6 +87,7 @@ import dotenv from "dotenv";
87
87
  import path from "path";
88
88
  import os from "os";
89
89
  import { fileURLToPath } from "url";
90
+ import { createRequire } from "module";
90
91
  var __filename = fileURLToPath(import.meta.url);
91
92
  var __dirname = path.dirname(__filename);
92
93
  var PROJECT_ROOT = path.join(__dirname, "..");
@@ -106,6 +107,16 @@ var DEFAULT_APP_DATA_DIR = IS_DEV ? path.join(PROJECT_ROOT, "data") : getPlatfor
106
107
  dotenv.config({
107
108
  path: path.join(DEFAULT_APP_DATA_DIR, ".env")
108
109
  });
110
+ function resolveAppVersion() {
111
+ try {
112
+ return "0.1.3";
113
+ } catch {
114
+ const _req = createRequire(import.meta.url);
115
+ return _req("../package.json").version;
116
+ }
117
+ }
118
+ __name(resolveAppVersion, "resolveAppVersion");
119
+ var APP_VERSION = resolveAppVersion();
109
120
 
110
121
  // src/settings/appSettings.ts
111
122
  var DEFAULT_APP_SETTINGS = {
@@ -114,7 +125,8 @@ var DEFAULT_APP_SETTINGS = {
114
125
  appDataDir: DEFAULT_APP_DATA_DIR,
115
126
  animationsEnabled: false,
116
127
  theme: "dark",
117
- showWelcomeTutorial: true
128
+ showWelcomeTutorial: true,
129
+ checkForUpdates: true
118
130
  },
119
131
  keybindings: {}
120
132
  };
@@ -460,6 +472,7 @@ __name(moveFile, "moveFile");
460
472
  export {
461
473
  __name,
462
474
  DEFAULT_APP_DATA_DIR,
475
+ APP_VERSION,
463
476
  deepMerge,
464
477
  SETTINGS_PATH,
465
478
  SettingsStore,
package/dist/cli.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  start
4
- } from "./chunk-Y4ZGX5NZ.js";
5
- import "./chunk-ZZ35YTR2.js";
4
+ } from "./chunk-UKXZ4MCQ.js";
5
+ import "./chunk-ZQ7B4MTU.js";
6
6
 
7
7
  // src/cli.ts
8
8
  start();
package/dist/index.js CHANGED
@@ -2,8 +2,8 @@ import {
2
2
  src_default,
3
3
  start,
4
4
  withFullScreen
5
- } from "./chunk-Y4ZGX5NZ.js";
6
- import "./chunk-ZZ35YTR2.js";
5
+ } from "./chunk-UKXZ4MCQ.js";
6
+ import "./chunk-ZQ7B4MTU.js";
7
7
  export {
8
8
  src_default as default,
9
9
  start,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  cleanAndTagFlac,
3
3
  moveFile
4
- } from "./chunk-ZZ35YTR2.js";
4
+ } from "./chunk-ZQ7B4MTU.js";
5
5
  export {
6
6
  cleanAndTagFlac,
7
7
  moveFile
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "goblin-malin",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "A keyboard-driven terminal UI for downloading and tagging music tracks with metadata from Spotify and YouTube",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -37,7 +37,8 @@
37
37
  },
38
38
  "files": [
39
39
  "dist",
40
- "README.md"
40
+ "README.md",
41
+ "scripts/save-install-source.mjs"
41
42
  ],
42
43
  "scripts": {
43
44
  "dev": "tsx src/cli.ts",
@@ -47,6 +48,8 @@
47
48
  "lint": "eslint src/",
48
49
  "format": "prettier --write src/",
49
50
  "format:check": "prettier --check src/",
51
+ "postinstall": "node scripts/save-install-source.mjs",
52
+ "package:win": "node scripts/build-sea.mjs",
50
53
  "prepack": "node scripts/patch-readme.mjs",
51
54
  "postpack": "git checkout -- README.md",
52
55
  "prepublishOnly": "tsup"
@@ -68,6 +71,11 @@
68
71
  ],
69
72
  "author": "Tetraxel",
70
73
  "license": "SEE LICENSE IN LICENSE",
74
+ "pkg": {
75
+ "assets": [
76
+ "node_modules/yoga-layout/dist/binaries/yoga-wasm-base64-esm.js"
77
+ ]
78
+ },
71
79
  "repository": {
72
80
  "type": "git",
73
81
  "url": "git+https://github.com/Tetraxel/goblin-malin.git"
@@ -83,9 +91,11 @@
83
91
  "@types/ink-text-input": "^2.0.5",
84
92
  "@types/node": "^25.6.2",
85
93
  "@types/react": "^19.2.14",
94
+ "@yao-pkg/pkg": "^6.20.0",
86
95
  "eslint": "^9.39.4",
87
96
  "eslint-plugin-react": "^7.37.5",
88
97
  "eslint-plugin-react-hooks": "^7.1.1",
98
+ "postject": "^1.0.0-alpha.6",
89
99
  "prettier": "^3.8.3",
90
100
  "ts-node": "^10.9.2",
91
101
  "tsup": "^8.0.0",
@@ -0,0 +1,40 @@
1
+ import { writeFileSync, mkdirSync, existsSync } from "fs";
2
+ import { join, dirname } from "path";
3
+ import { fileURLToPath } from "url";
4
+ import os from "os";
5
+ import { execFileSync } from "child_process";
6
+
7
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8
+
9
+ function detectInstaller() {
10
+ const ua = process.env.npm_config_user_agent ?? "";
11
+ if (ua.startsWith("yarn")) return "yarn";
12
+ if (ua.startsWith("pnpm")) return "pnpm";
13
+ if (ua.startsWith("npm")) return "npm";
14
+ return undefined;
15
+ }
16
+
17
+ // MUST reflects the paths in src\constants.ts
18
+ function getAppDataDir() {
19
+ switch (process.platform) {
20
+ case "win32":
21
+ return join(process.env.APPDATA ?? join(os.homedir(), "AppData", "Roaming"), "goblin-malin");
22
+ case "darwin":
23
+ return join(os.homedir(), "Library", "Application Support", "goblin-malin");
24
+ default:
25
+ return join(process.env.XDG_DATA_HOME ?? join(os.homedir(), ".local", "share"), "goblin-malin");
26
+ }
27
+ }
28
+
29
+ const configDir = getAppDataDir();
30
+ mkdirSync(configDir, { recursive: true });
31
+ writeFileSync(
32
+ join(configDir, "install.json"),
33
+ JSON.stringify({ installer: detectInstaller(), installedAt: new Date().toISOString() })
34
+ );
35
+
36
+ // Run compat patch only in dev (script won't exist in published package)
37
+ const patchScript = join(__dirname, "patch-pkg-compat.mjs");
38
+ if (existsSync(patchScript)) {
39
+ execFileSync(process.execPath, [patchScript], { stdio: "inherit" });
40
+ }
package/.env.example DELETED
@@ -1,6 +0,0 @@
1
- # https://developer.spotify.com/dashboard
2
- SPOTIFY_API_CLIENT_ID=
3
- SPOTIFY_API_CLIENT_SECRET=
4
- # https://www.slsknet.org/
5
- SOULSEEK_USERNAME=
6
- SOULSEEK_PASSWORD=