electron-forge-maker-msix 0.0.1
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 +21 -0
- package/README.md +2 -0
- package/dist/Maker.d.ts +10 -0
- package/dist/Maker.js +56 -0
- package/dist/utils/packager.d.ts +2 -0
- package/dist/utils/packager.js +16 -0
- package/package.json +32 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Christian Grothaus
|
|
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
ADDED
package/dist/Maker.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MakerBase, type MakerOptions } from '@electron-forge/maker-base';
|
|
2
|
+
import type { ForgePlatform } from '@electron-forge/shared-types';
|
|
3
|
+
import { type PackagingOptions } from 'electron-windows-msix';
|
|
4
|
+
type MakerConfig = PackagingOptions;
|
|
5
|
+
export default class Maker extends MakerBase<MakerConfig> {
|
|
6
|
+
defaultPlatforms: ForgePlatform[];
|
|
7
|
+
name: string;
|
|
8
|
+
make({ dir, makeDir, targetArch, packageJSON, appName, }: MakerOptions): Promise<string[]>;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
package/dist/Maker.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const core_utils_1 = require("@electron-forge/core-utils");
|
|
27
|
+
const maker_base_1 = require("@electron-forge/maker-base");
|
|
28
|
+
const electron_windows_msix_1 = require("electron-windows-msix");
|
|
29
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
30
|
+
const os_1 = __importDefault(require("os"));
|
|
31
|
+
const path_1 = __importDefault(require("path"));
|
|
32
|
+
const packager_1 = require("./utils/packager");
|
|
33
|
+
class Maker extends maker_base_1.MakerBase {
|
|
34
|
+
constructor() {
|
|
35
|
+
super(...arguments);
|
|
36
|
+
this.defaultPlatforms = ['win32'];
|
|
37
|
+
this.name = 'msix';
|
|
38
|
+
}
|
|
39
|
+
make(_a) {
|
|
40
|
+
return __awaiter(this, arguments, void 0, function* ({ dir, makeDir, targetArch, packageJSON, appName, }) {
|
|
41
|
+
const _b = this.config, { manifestVariables } = _b, packageOptions = __rest(_b, ["manifestVariables"]);
|
|
42
|
+
const tmpFolder = yield fs_extra_1.default.mkdtemp(path_1.default.resolve(os_1.default.tmpdir(), 'msix-'));
|
|
43
|
+
try {
|
|
44
|
+
const result = yield (0, electron_windows_msix_1.packageMSIX)(Object.assign(Object.assign({}, packageOptions), { manifestVariables: Object.assign({ packageDescription: packageJSON.description, appExecutable: `${appName}.exe`, packageVersion: packageJSON.version, publisher: (0, core_utils_1.getNameFromAuthor)(packageJSON.author), packageIdentity: appName, targetArch: (0, packager_1.toMsixArch)(targetArch) }, manifestVariables), appDir: dir, outputDir: tmpFolder }));
|
|
45
|
+
const outputPath = path_1.default.resolve(makeDir, 'msix', targetArch, `${appName}.msix`);
|
|
46
|
+
yield fs_extra_1.default.mkdirp(path_1.default.dirname(outputPath));
|
|
47
|
+
yield fs_extra_1.default.move(result.msixPackage, outputPath);
|
|
48
|
+
return [outputPath];
|
|
49
|
+
}
|
|
50
|
+
finally {
|
|
51
|
+
fs_extra_1.default.remove(tmpFolder);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.default = Maker;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toMsixArch = void 0;
|
|
4
|
+
const toMsixArch = (arch) => {
|
|
5
|
+
switch (arch) {
|
|
6
|
+
case 'x64':
|
|
7
|
+
return 'x64';
|
|
8
|
+
case 'ia32':
|
|
9
|
+
return 'x86';
|
|
10
|
+
case 'arm64':
|
|
11
|
+
return 'arm64';
|
|
12
|
+
default:
|
|
13
|
+
throw new Error(`Unsupported architecture: ${arch}`);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
exports.toMsixArch = toMsixArch;
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "electron-forge-maker-msix",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "An electron forge MSIX maker",
|
|
5
|
+
"repository": "https://github.com/christiangrothaus/maker-msix",
|
|
6
|
+
"author": "Christian Grothaus",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"main": "dist/MakerMSIX.js",
|
|
9
|
+
"typings": "dist/MakerMSIX.d.ts",
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">= 16.4.0"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@electron-forge/core-utils": "^7.11.1",
|
|
15
|
+
"@electron-forge/maker-base": "^7.11.1",
|
|
16
|
+
"@electron-forge/shared-types": "^7.11.1",
|
|
17
|
+
"cross-spawn": "^7.0.6",
|
|
18
|
+
"electron-windows-msix": "^2.0.4",
|
|
19
|
+
"fs-extra": "^11.3.3",
|
|
20
|
+
"parse-author": "^2.0.0"
|
|
21
|
+
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/fs-extra": "^11.0.4",
|
|
27
|
+
"prettier": "3.8.1"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist/**/*"
|
|
31
|
+
]
|
|
32
|
+
}
|