@stacksjs/desktop 0.2.113 → 0.2.115
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/dist/index.d.ts +6 -0
- package/dist/index.js +89 -35
- package/dist/index.js.map +5 -4
- package/dist/packaging.d.ts +23 -0
- package/dist/types.d.ts +3 -0
- package/dist/window.d.ts +13 -5
- package/package.json +3 -8
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type { PackageConfig, PackageResult } from 'craft-native';
|
|
2
|
+
/**
|
|
3
|
+
* Packaging and code signing.
|
|
4
|
+
*
|
|
5
|
+
* Craft owns the native side of this — building the `.app`, the DMG, the MSI,
|
|
6
|
+
* the Linux packages, and the signed `.pkg` the Mac App Store accepts. This
|
|
7
|
+
* module re-exports it so an app reaches packaging through the same import as
|
|
8
|
+
* the rest of the desktop API, rather than depending on Craft directly.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { packageApp } from '@stacksjs/stx/desktop'
|
|
13
|
+
*
|
|
14
|
+
* await packageApp({
|
|
15
|
+
* name: 'Barista',
|
|
16
|
+
* version: '0.1.0',
|
|
17
|
+
* binaryPath: './dist/barista',
|
|
18
|
+
* bundleId: 'org.stacksjs.barista',
|
|
19
|
+
* macos: { menuBarOnly: true, dmg: true },
|
|
20
|
+
* })
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export { pack, packageApp } from 'craft-native';
|
package/dist/types.d.ts
CHANGED
|
@@ -58,6 +58,9 @@ export declare interface WindowOptions {
|
|
|
58
58
|
frameless?: boolean
|
|
59
59
|
titlebarHidden?: boolean
|
|
60
60
|
backgroundColor?: string
|
|
61
|
+
systemTray?: boolean
|
|
62
|
+
hideDockIcon?: boolean
|
|
63
|
+
devTools?: boolean
|
|
61
64
|
nativeSidebar?: boolean
|
|
62
65
|
sidebarWidth?: number
|
|
63
66
|
sidebarConfig?: SidebarConfig
|
package/dist/window.d.ts
CHANGED
|
@@ -32,11 +32,19 @@ export declare function getWindow(id: string): WindowInstance | null;
|
|
|
32
32
|
* Close all active windows
|
|
33
33
|
*/
|
|
34
34
|
export declare function closeAllWindows(): void;
|
|
35
|
+
/**
|
|
36
|
+
* Translate window options into Craft binary arguments.
|
|
37
|
+
*
|
|
38
|
+
* craft-native is a thin wrapper around this command line, so the same options
|
|
39
|
+
* describe a window whether the JS package is installed or not.
|
|
40
|
+
*/
|
|
41
|
+
export declare function craftWindowArguments(url: string, options?: WindowOptions): string[];
|
|
35
42
|
/**
|
|
36
43
|
* Create a native window with URL
|
|
37
44
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
45
|
+
* Prefers the craft-native package for its richer typings, and falls back to
|
|
46
|
+
* spawning the Craft binary directly when it isn't installed — the binary is
|
|
47
|
+
* what craft-native drives anyway, so an app needs only one of the two.
|
|
40
48
|
*
|
|
41
49
|
* ## Window Control
|
|
42
50
|
*
|
|
@@ -57,20 +65,20 @@ export declare function closeAllWindows(): void;
|
|
|
57
65
|
*
|
|
58
66
|
* @param url - URL to load in the window
|
|
59
67
|
* @param options - Window configuration options
|
|
60
|
-
* @returns WindowInstance if successful, null if
|
|
68
|
+
* @returns WindowInstance if successful, null if no Craft runtime is available
|
|
61
69
|
*/
|
|
62
70
|
export declare function createWindow(url: string, options?: WindowOptions): Promise<WindowInstance | null>;
|
|
63
71
|
/**
|
|
64
72
|
* Open a development server window
|
|
65
73
|
* This is specifically for the stx dev server --native flag
|
|
66
74
|
*
|
|
67
|
-
* Uses
|
|
75
|
+
* Uses craft-native to create a native window, falls back to browser if unavailable.
|
|
68
76
|
*/
|
|
69
77
|
export declare function openDevWindow(port: number, options?: WindowOptions): Promise<boolean>;
|
|
70
78
|
/**
|
|
71
79
|
* Create a window with HTML content
|
|
72
80
|
*
|
|
73
|
-
* Uses
|
|
81
|
+
* Uses craft-native to display HTML content in a native window.
|
|
74
82
|
*/
|
|
75
83
|
export declare function createWindowWithHTML(html: string, options?: WindowOptions): Promise<WindowInstance | null>;
|
|
76
84
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/desktop",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.115",
|
|
5
5
|
"description": "Native desktop application framework for stx (powered by Craft)",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -54,12 +54,7 @@
|
|
|
54
54
|
"test:coverage": "bun test --coverage --preload ../../test-utils/happy-dom.ts",
|
|
55
55
|
"typecheck": "bun tsc --noEmit"
|
|
56
56
|
},
|
|
57
|
-
"
|
|
58
|
-
"craft": "
|
|
59
|
-
},
|
|
60
|
-
"peerDependenciesMeta": {
|
|
61
|
-
"craft": {
|
|
62
|
-
"optional": true
|
|
63
|
-
}
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"craft-native": ">=0.0.37"
|
|
64
59
|
}
|
|
65
60
|
}
|