@crossbind/extension-dmg 0.0.0-stage → 2.0.0-beta.69

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Buğra Sarı and crossbind contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,24 @@
1
- # Temporary Holding Version
1
+ # @crossbind/extension-dmg
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
+ A macOS disk image, which is also what Apple notarizes.
4
+
5
+ An app has it by having `@crossbind/core-app-host`, which lists it as a dependency: there is nothing to install or list.
6
+
7
+ ## Use
8
+
9
+ ```sh
10
+ npx crossbind app build
11
+ ```
12
+
13
+ A macOS build writes a `.dmg` named after the app beside it: a window with the app and a link to Applications, which its
14
+ user drags it to. With a Developer ID and an App Store Connect key, the disk image is what Apple notarizes.
15
+
16
+ ## Platforms
17
+
18
+ macOS.
19
+
20
+ ## Replace or leave out
21
+
22
+ An extension named `dmg` with an installer takes its place, and `app: { without: ['dmg'] }` in `crossbind.config.js` leaves it out. [extensions.md](https://github.com/crossbind/crossbind/blob/main/docs/api/extensions.md#installers) says what one gives.
23
+
24
+ [app.md](https://github.com/crossbind/crossbind/blob/main/docs/api/app.md#installers) has every installer, and `app.installers` names those a build runs, as `['dmg']`.
@@ -0,0 +1,33 @@
1
+ import fs from 'node:fs';
2
+ import os from 'node:os';
3
+ import path from 'node:path';
4
+
5
+ // crossbind's installer of a macOS app: a disk image that holds the app beside a link to /Applications, onto which its
6
+ // user drags it. hdiutil copies a link inside the folder it is given as a link, where it would copy all of
7
+ // /Applications for the link itself. The image is not signed: Gatekeeper would then judge it as well, where the app in
8
+ // it is what Apple notarizes.
9
+ export default function dmg() {
10
+ return {
11
+ name: 'dmg',
12
+ contract: 1,
13
+ root: import.meta.dirname,
14
+ installer: {
15
+ platform: 'macos',
16
+ make(api, { app }) {
17
+ const image = app.replace(/\.app$/, '.dmg');
18
+ const folder = fs.mkdtempSync(path.join(os.tmpdir(), 'crossbind-dmg-'));
19
+ try {
20
+ // The image's root takes the folder's permissions, which mkdtemp keeps to its owner.
21
+ fs.chmodSync(folder, 0o755);
22
+ fs.cpSync(app, path.join(folder, path.basename(app)), { recursive: true, verbatimSymlinks: true });
23
+ fs.symlinkSync('/Applications', path.join(folder, 'Applications'));
24
+ fs.rmSync(image, { force: true });
25
+ api.run(['hdiutil', 'create', '-quiet', '-volname', api.app.name, '-srcfolder', folder, '-fs', 'HFS+', '-format', 'UDZO', image], { cwd: path.dirname(app) });
26
+ } finally {
27
+ fs.rmSync(folder, { recursive: true, force: true });
28
+ }
29
+ return [image];
30
+ },
31
+ },
32
+ };
33
+ }
package/package.json CHANGED
@@ -1,6 +1,28 @@
1
1
  {
2
2
  "name": "@crossbind/extension-dmg",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "2.0.0-beta.69",
4
+ "description": "crossbind app extension: a macOS disk image, which is also what Apple notarizes.",
5
+ "homepage": "https://github.com/crossbind/crossbind/tree/main/extensions/dmg#readme",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/crossbind/crossbind.git"
9
+ },
10
+ "license": "MIT",
11
+ "type": "module",
12
+ "exports": {
13
+ "./crossbind.extension.js": "./crossbind.extension.js"
14
+ },
15
+ "files": [
16
+ "crossbind.extension.js"
17
+ ],
18
+ "crossbind": {
19
+ "extension": "./crossbind.extension.js"
20
+ },
21
+ "keywords": [
22
+ "crossbind-extension",
23
+ "crossbind",
24
+ "dmg",
25
+ "installer",
26
+ "app"
27
+ ]
6
28
  }