inskea 0.0.0-stage → 2.1.2

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/README.md CHANGED
@@ -1,3 +1,27 @@
1
- # Temporary Holding Version
1
+ # Inskea
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Infinite-canvas vector drawing application for sketching shapes, freehand strokes, and text.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g inskea
9
+ ```
10
+
11
+ ## Run
12
+
13
+ ```bash
14
+ inskea
15
+ ```
16
+
17
+ Or open a specific drawing:
18
+
19
+ ```bash
20
+ inskea my-sketch.skea
21
+ ```
22
+
23
+ ## Instant Trial (No install)
24
+
25
+ ```bash
26
+ npx inskea
27
+ ```
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
3
+ <mime-type type="application/x-inskea">
4
+ <comment>Inskea drawing</comment>
5
+ <icon name="inskea"/>
6
+ <glob pattern="*.skea"/>
7
+ </mime-type>
8
+ </mime-info>
@@ -0,0 +1,10 @@
1
+ [Desktop Entry]
2
+ Type=Application
3
+ Name=Inskea
4
+ Comment=An infinite canvas for your ideas
5
+ Exec=inskea %F
6
+ Icon=inskea
7
+ Terminal=false
8
+ Categories=Graphics;Office;
9
+ MimeType=application/x-inskea;
10
+ StartupWMClass=inskea
Binary file
package/bin/inskea.js ADDED
@@ -0,0 +1,87 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawn } = require('child_process');
4
+ const path = require('path');
5
+ const fs = require('fs');
6
+
7
+ const key = `${process.platform}-${process.arch}`;
8
+
9
+ // Resolve platform package name from optionalDependencies in package.json
10
+ let pkgName;
11
+ try {
12
+ const rootPkg = require(path.join(__dirname, '..', 'package.json'));
13
+ const optionalDeps = Object.keys(rootPkg.optionalDependencies || {});
14
+ pkgName = optionalDeps.find(name => name.endsWith(`-${key}`));
15
+ } catch (_) {}
16
+
17
+ if (!pkgName) {
18
+ pkgName = `@quippy/inskea-${key}`;
19
+ }
20
+
21
+ if (process.platform !== 'linux' && process.platform !== 'win32') {
22
+ console.error(`[inskea] Unsupported platform: ${process.platform}`);
23
+ console.error('Currently supported platforms: linux-x64, win32-x64');
24
+ process.exit(1);
25
+ }
26
+
27
+ function resolveBinary() {
28
+ const binaryName = process.platform === 'win32' ? 'inskea.exe' : 'inskea';
29
+
30
+ // 1. Try require.resolve for the scoped platform package
31
+ try {
32
+ const pkgJson = require.resolve(`${pkgName}/package.json`);
33
+ const candidate = path.join(path.dirname(pkgJson), 'bin', binaryName);
34
+ if (fs.existsSync(candidate)) {
35
+ return candidate;
36
+ }
37
+ } catch (_) {}
38
+
39
+ // 2. Search common node_modules layouts (flat, hoisted, or nested)
40
+ const searchPaths = [
41
+ path.join(__dirname, '..', 'node_modules', pkgName, 'bin', binaryName),
42
+ path.join(__dirname, '..', '..', pkgName, 'bin', binaryName),
43
+ path.join(__dirname, '..', '..', '..', pkgName, 'bin', binaryName),
44
+ path.join(__dirname, '..', '..', '..', '..', pkgName, 'bin', binaryName)
45
+ ];
46
+
47
+ for (const candidate of searchPaths) {
48
+ if (fs.existsSync(candidate)) {
49
+ return candidate;
50
+ }
51
+ }
52
+
53
+ return null;
54
+ }
55
+
56
+ const binaryPath = resolveBinary();
57
+ if (!binaryPath) {
58
+ console.error(
59
+ `[inskea] Could not locate native executable for ${key}.\n` +
60
+ `Expected package "${pkgName}" to be installed. Please try reinstalling with:\n` +
61
+ ` npm install -g inskea`
62
+ );
63
+ process.exit(1);
64
+ }
65
+
66
+ // Ensure execution permissions on Unix
67
+ if (process.platform !== 'win32') {
68
+ try {
69
+ fs.chmodSync(binaryPath, 0o755);
70
+ } catch (_) {}
71
+ }
72
+
73
+ const isCliCheck = process.argv.some(arg =>
74
+ arg === '--help' || arg === '-h' || arg === '--version' || arg === '-V'
75
+ );
76
+
77
+ const child = spawn(binaryPath, process.argv.slice(2), {
78
+ stdio: isCliCheck ? 'inherit' : 'ignore',
79
+ detached: !isCliCheck
80
+ });
81
+
82
+ if (!isCliCheck) {
83
+ child.unref();
84
+ process.exit(0);
85
+ } else {
86
+ child.on('exit', (code) => process.exit(code ?? 0));
87
+ }
package/package.json CHANGED
@@ -1,6 +1,33 @@
1
1
  {
2
2
  "name": "inskea",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "2.1.2",
4
+ "description": "Inskea - infinite-canvas vector illustration app",
5
+ "bin": {
6
+ "inskea": "bin/inskea.js"
7
+ },
8
+ "scripts": {
9
+ "postinstall": "node scripts/postinstall.js",
10
+ "preuninstall": "node scripts/preuninstall.js"
11
+ },
12
+ "optionalDependencies": {
13
+ "@quippy/inskea-linux-x64": "2.1.2",
14
+ "@quippy/inskea-win32-x64": "2.1.2"
15
+ },
16
+ "keywords": [
17
+ "inskea",
18
+ "drawing",
19
+ "vector",
20
+ "canvas",
21
+ "illustration",
22
+ "sketch",
23
+ "tauri",
24
+ "desktop"
25
+ ],
26
+ "author": "Quippy22",
27
+ "license": "MIT",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/Quippy22/Inskea"
31
+ },
32
+ "homepage": "https://github.com/Quippy22/Inskea#readme"
6
33
  }
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env node
2
+
3
+ const os = require('os');
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const { execSync } = require('child_process');
7
+
8
+ function installLinux() {
9
+ const home = os.homedir();
10
+ const appsDir = path.join(home, '.local', 'share', 'applications');
11
+ const iconsDir = path.join(home, '.local', 'share', 'icons', 'hicolor', '128x128', 'apps');
12
+ const mimeDir = path.join(home, '.local', 'share', 'mime', 'packages');
13
+
14
+ fs.mkdirSync(appsDir, { recursive: true });
15
+ fs.mkdirSync(iconsDir, { recursive: true });
16
+ fs.mkdirSync(mimeDir, { recursive: true });
17
+
18
+ const assetsDir = path.join(__dirname, '..', 'assets');
19
+
20
+ // Copy icon
21
+ const iconSrc = path.join(assetsDir, 'inskea.png');
22
+ const iconDest = path.join(iconsDir, 'inskea.png');
23
+ if (fs.existsSync(iconSrc)) {
24
+ fs.copyFileSync(iconSrc, iconDest);
25
+ }
26
+
27
+ // Copy MIME XML
28
+ const mimeSrc = path.join(assetsDir, 'inskea-mime.xml');
29
+ const mimeDest = path.join(mimeDir, 'inskea.xml');
30
+ if (fs.existsSync(mimeSrc)) {
31
+ fs.copyFileSync(mimeSrc, mimeDest);
32
+ try {
33
+ execSync(`update-mime-database "${path.join(home, '.local', 'share', 'mime')}"`, { stdio: 'ignore' });
34
+ } catch (_) {}
35
+ }
36
+
37
+ // Copy .desktop file
38
+ const desktopSrc = path.join(assetsDir, 'inskea.desktop');
39
+ const desktopDest = path.join(appsDir, 'inskea.desktop');
40
+ if (fs.existsSync(desktopSrc)) {
41
+ fs.copyFileSync(desktopSrc, desktopDest);
42
+ try {
43
+ execSync(`update-desktop-database "${appsDir}"`, { stdio: 'ignore' });
44
+ } catch (_) {}
45
+ }
46
+
47
+ console.log('[inskea] Registered desktop launcher and file associations in ~/.local/share');
48
+ }
49
+
50
+ function installWindows() {
51
+ const appData = process.env.APPDATA;
52
+ if (!appData) return;
53
+
54
+ const startMenuDir = path.join(appData, 'Microsoft', 'Windows', 'Start Menu', 'Programs');
55
+ if (!fs.existsSync(startMenuDir)) return;
56
+
57
+ const shortcutPath = path.join(startMenuDir, 'Inskea.lnk');
58
+ const npmCmd = path.join(appData, 'npm', 'inskea.cmd');
59
+
60
+ const psCommand = `
61
+ $ws = New-Object -ComObject WScript.Shell;
62
+ $s = $ws.CreateShortcut('${shortcutPath.replace(/'/g, "''")}');
63
+ $s.TargetPath = '${npmCmd.replace(/'/g, "''")}';
64
+ $s.Description = 'Inskea vector illustration app';
65
+ $s.Save();
66
+ `.replace(/\r?\n\s*/g, ' ');
67
+
68
+ try {
69
+ execSync(`powershell -NoProfile -Command "${psCommand}"`, { stdio: 'ignore' });
70
+ console.log('[inskea] Registered Windows Start Menu shortcut');
71
+ } catch (_) {}
72
+ }
73
+
74
+ try {
75
+ if (process.platform === 'linux') {
76
+ installLinux();
77
+ } else if (process.platform === 'win32') {
78
+ installWindows();
79
+ }
80
+ } catch (err) {
81
+ // Never fail npm install if desktop integration encounters permission/missing command warnings
82
+ console.warn('[inskea] Notice: Could not register desktop shortcut automatically:', err.message);
83
+ }
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env node
2
+
3
+ const os = require('os');
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const { execSync } = require('child_process');
7
+
8
+ function removeLinux() {
9
+ const home = os.homedir();
10
+ const desktopFile = path.join(home, '.local', 'share', 'applications', 'inskea.desktop');
11
+ const iconFile = path.join(home, '.local', 'share', 'icons', 'hicolor', '128x128', 'apps', 'inskea.png');
12
+ const mimeFile = path.join(home, '.local', 'share', 'mime', 'packages', 'inskea.xml');
13
+
14
+ if (fs.existsSync(desktopFile)) {
15
+ try {
16
+ fs.unlinkSync(desktopFile);
17
+ execSync(`update-desktop-database "${path.join(home, '.local', 'share', 'applications')}"`, { stdio: 'ignore' });
18
+ } catch (_) {}
19
+ }
20
+
21
+ if (fs.existsSync(iconFile)) {
22
+ try { fs.unlinkSync(iconFile); } catch (_) {}
23
+ }
24
+
25
+ if (fs.existsSync(mimeFile)) {
26
+ try {
27
+ fs.unlinkSync(mimeFile);
28
+ execSync(`update-mime-database "${path.join(home, '.local', 'share', 'mime')}"`, { stdio: 'ignore' });
29
+ } catch (_) {}
30
+ }
31
+ }
32
+
33
+ function removeWindows() {
34
+ const appData = process.env.APPDATA;
35
+ if (!appData) return;
36
+
37
+ const shortcutPath = path.join(appData, 'Microsoft', 'Windows', 'Start Menu', 'Programs', 'Inskea.lnk');
38
+ if (fs.existsSync(shortcutPath)) {
39
+ try { fs.unlinkSync(shortcutPath); } catch (_) {}
40
+ }
41
+ }
42
+
43
+ try {
44
+ if (process.platform === 'linux') {
45
+ removeLinux();
46
+ } else if (process.platform === 'win32') {
47
+ removeWindows();
48
+ }
49
+ } catch (_) {}