@happy-nut/monacori 0.1.20 → 0.1.22
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/assets/icon.icns +0 -0
- package/dist/app-main.js +441 -158
- package/dist/assets.js +8 -1
- package/dist/build.d.ts +1 -0
- package/dist/build.js +13 -7
- package/dist/diff.d.ts +2 -1
- package/dist/diff.js +3 -3
- package/dist/i18n.js +56 -8
- package/dist/preload.cjs +15 -0
- package/dist/render.d.ts +5 -0
- package/dist/render.js +154 -29
- package/dist/util.d.ts +5 -0
- package/dist/util.js +21 -0
- package/dist/viewer.client.js +582 -153
- package/dist/viewer.client.min.js +1 -0
- package/dist/viewer.css +202 -72
- package/package.json +10 -2
- package/scripts/patch-electron-name.mjs +23 -14
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happy-nut/monacori",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "Validation control plane for AI-generated code changes.",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"main": "dist/app-main.js",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "git+https://github.com/happy-nut/monacori.git"
|
|
@@ -35,7 +36,9 @@
|
|
|
35
36
|
"prepare": "npm run build",
|
|
36
37
|
"smoke": "npm run build && node dist/cli.js --help",
|
|
37
38
|
"pretest": "npm run build",
|
|
38
|
-
"test": "node --test test/*.test.mjs"
|
|
39
|
+
"test": "node --test test/*.test.mjs",
|
|
40
|
+
"dist:mac": "npm run build && electron-packager . Monacori --platform=darwin --arch=arm64 --icon=assets/icon.icns --app-bundle-id=dev.happynut.monacori --app-category-type=public.app-category.developer-tools --out=release --overwrite --no-asar --ignore=/src/ --ignore=/test/ --ignore=/release --ignore=/.git --ignore=/.github --ignore=/.omc --ignore=/openspec --ignore=/node_modules/electron/ --ignore=/node_modules/@electron --ignore=/node_modules/typescript --ignore=/node_modules/jsdom",
|
|
41
|
+
"dist:mac:dmg": "npm run dist:mac && create-dmg --overwrite --no-code-sign --dmg-title=Monacori 'release/Monacori-darwin-arm64/Monacori.app' release/ || true"
|
|
39
42
|
},
|
|
40
43
|
"keywords": [
|
|
41
44
|
"ai",
|
|
@@ -47,8 +50,10 @@
|
|
|
47
50
|
"author": "happy-nut <happynut.dev@gmail.com>",
|
|
48
51
|
"license": "MIT",
|
|
49
52
|
"devDependencies": {
|
|
53
|
+
"@electron/packager": "^20.0.1",
|
|
50
54
|
"@types/node": "^22.15.21",
|
|
51
55
|
"jsdom": "^29.1.1",
|
|
56
|
+
"terser": "^5.48.0",
|
|
52
57
|
"typescript": "^5.8.3"
|
|
53
58
|
},
|
|
54
59
|
"engines": {
|
|
@@ -62,5 +67,8 @@
|
|
|
62
67
|
"electron": "^42.4.1",
|
|
63
68
|
"highlight.js": "^11.11.1",
|
|
64
69
|
"node-pty": "^1.1.0"
|
|
70
|
+
},
|
|
71
|
+
"optionalDependencies": {
|
|
72
|
+
"create-dmg": "^8.1.0"
|
|
65
73
|
}
|
|
66
74
|
}
|
|
@@ -29,36 +29,45 @@ function main() {
|
|
|
29
29
|
const oldExe = join(macosDir, "Electron");
|
|
30
30
|
const newExe = join(macosDir, APP_NAME);
|
|
31
31
|
const pathTxt = join(root, "path.txt");
|
|
32
|
-
if (!existsSync(plistPath))
|
|
32
|
+
if (!existsSync(plistPath)) {
|
|
33
|
+
console.warn('monacori: Electron.app not found at ' + appDir + ' — skipping rebrand (Dock/menu may show "Electron")');
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
33
36
|
|
|
34
37
|
try {
|
|
38
|
+
let changed = false;
|
|
35
39
|
// 1. Bundle metadata: name, display name, AND executable -> monacori.
|
|
36
40
|
const before = readFileSync(plistPath, "utf8");
|
|
37
41
|
const after = before
|
|
38
42
|
.replace(/(<key>CFBundleName<\/key>\s*<string>)[^<]*(<\/string>)/, "$1" + APP_NAME + "$2")
|
|
39
43
|
.replace(/(<key>CFBundleDisplayName<\/key>\s*<string>)[^<]*(<\/string>)/, "$1" + APP_NAME + "$2")
|
|
40
44
|
.replace(/(<key>CFBundleExecutable<\/key>\s*<string>)[^<]*(<\/string>)/, "$1" + APP_NAME + "$2");
|
|
41
|
-
if (after !== before) writeFileSync(plistPath, after);
|
|
45
|
+
if (after !== before) { writeFileSync(plistPath, after); changed = true; }
|
|
42
46
|
|
|
43
47
|
// 2. Rename the executable so the directly-spawned process is "monacori" (idempotent).
|
|
44
|
-
if (existsSync(oldExe) && !existsSync(newExe)) renameSync(oldExe, newExe);
|
|
48
|
+
if (existsSync(oldExe) && !existsSync(newExe)) { renameSync(oldExe, newExe); changed = true; }
|
|
45
49
|
|
|
46
50
|
// 3. Repoint electron's path.txt at the renamed binary so require("electron") resolves it.
|
|
47
51
|
if (existsSync(pathTxt)) {
|
|
48
52
|
const pt = readFileSync(pathTxt, "utf8");
|
|
49
53
|
const fixed = pt.replace("MacOS/Electron", "MacOS/" + APP_NAME);
|
|
50
|
-
if (fixed !== pt) writeFileSync(pathTxt, fixed);
|
|
54
|
+
if (fixed !== pt) { writeFileSync(pathTxt, fixed); changed = true; }
|
|
51
55
|
}
|
|
52
|
-
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
|
|
57
|
+
// Only when something actually changed: refresh LaunchServices so the Dock / Cmd+Tab show "monacori"
|
|
58
|
+
// instead of a cached "Electron". Skipping it when already-branded keeps the startup re-run cheap.
|
|
59
|
+
if (changed) {
|
|
60
|
+
spawnSync(
|
|
61
|
+
"/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister",
|
|
62
|
+
["-f", appDir],
|
|
63
|
+
{ stdio: "ignore" },
|
|
64
|
+
);
|
|
65
|
+
console.log('monacori: branded Electron app + executable as "' + APP_NAME + '"');
|
|
66
|
+
}
|
|
67
|
+
} catch (e) {
|
|
68
|
+
// Surface the reason (perms / read-only) instead of failing SILENTLY — otherwise the Dock/Cmd+Tab/menu
|
|
69
|
+
// keep showing "Electron" with no hint why. Non-fatal: app-main.ts re-runs this at startup.
|
|
70
|
+
console.warn('monacori: could not rebrand the Electron app to "' + APP_NAME + '". Dock/Cmd+Tab/menu may stay "Electron". Reason: ' + (e && e.message ? e.message : e));
|
|
62
71
|
}
|
|
63
72
|
}
|
|
64
73
|
|