wugren 3 年 前
コミット
8485dde54e
共有70 個のファイルを変更した3873 個の追加1 個の削除を含む
  1. 0 1
      .gitignore
  2. 2 0
      dist/bin/build.d.ts
  3. 122 0
      dist/bin/build.js
  4. 1 0
      dist/bin/build.js.map
  5. 2 0
      dist/bin/run.d.ts
  6. 95 0
      dist/bin/run.js
  7. 1 0
      dist/bin/run.js.map
  8. 58 0
      dist/lib/Builder.d.ts
  9. 1139 0
      dist/lib/Builder.js
  10. 1 0
      dist/lib/Builder.js.map
  11. 20 0
      dist/lib/Downloader.d.ts
  12. 187 0
      dist/lib/Downloader.js
  13. 1 0
      dist/lib/Downloader.js.map
  14. 30 0
      dist/lib/FFmpegDownloader.d.ts
  15. 159 0
      dist/lib/FFmpegDownloader.js
  16. 1 0
      dist/lib/FFmpegDownloader.js.map
  17. 19 0
      dist/lib/Runner.d.ts
  18. 179 0
      dist/lib/Runner.js
  19. 1 0
      dist/lib/Runner.js.map
  20. 30 0
      dist/lib/common/DownloaderBase.d.ts
  21. 209 0
      dist/lib/common/DownloaderBase.js
  22. 1 0
      dist/lib/common/DownloaderBase.js.map
  23. 7 0
      dist/lib/common/Event.d.ts
  24. 19 0
      dist/lib/common/Event.js
  25. 1 0
      dist/lib/common/Event.js.map
  26. 39 0
      dist/lib/common/NsisVersionInfo.d.ts
  27. 226 0
      dist/lib/common/NsisVersionInfo.js
  28. 1 0
      dist/lib/common/NsisVersionInfo.js.map
  29. 3 0
      dist/lib/common/index.d.ts
  30. 9 0
      dist/lib/common/index.js
  31. 1 0
      dist/lib/common/index.js.map
  32. 23 0
      dist/lib/config/BuildConfig.d.ts
  33. 81 0
      dist/lib/config/BuildConfig.js
  34. 1 0
      dist/lib/config/BuildConfig.js.map
  35. 3 0
      dist/lib/config/LinuxConfig.d.ts
  36. 20 0
      dist/lib/config/LinuxConfig.js
  37. 1 0
      dist/lib/config/LinuxConfig.js.map
  38. 11 0
      dist/lib/config/MacConfig.d.ts
  39. 28 0
      dist/lib/config/MacConfig.js
  40. 1 0
      dist/lib/config/MacConfig.js.map
  41. 9 0
      dist/lib/config/NsisConfig.d.ts
  42. 26 0
      dist/lib/config/NsisConfig.js
  43. 1 0
      dist/lib/config/NsisConfig.js.map
  44. 16 0
      dist/lib/config/WinConfig.d.ts
  45. 28 0
      dist/lib/config/WinConfig.js
  46. 1 0
      dist/lib/config/WinConfig.js.map
  47. 5 0
      dist/lib/config/index.d.ts
  48. 11 0
      dist/lib/config/index.js
  49. 1 0
      dist/lib/config/index.js.map
  50. 5 0
      dist/lib/index.d.ts
  51. 12 0
      dist/lib/index.js
  52. 1 0
      dist/lib/index.js.map
  53. 6 0
      dist/lib/nsis-gen/Nsis7Zipper.d.ts
  54. 67 0
      dist/lib/nsis-gen/Nsis7Zipper.js
  55. 1 0
      dist/lib/nsis-gen/Nsis7Zipper.js.map
  56. 30 0
      dist/lib/nsis-gen/NsisComposer.d.ts
  57. 179 0
      dist/lib/nsis-gen/NsisComposer.js
  58. 1 0
      dist/lib/nsis-gen/NsisComposer.js.map
  59. 10 0
      dist/lib/nsis-gen/NsisDiffer.d.ts
  60. 135 0
      dist/lib/nsis-gen/NsisDiffer.js
  61. 1 0
      dist/lib/nsis-gen/NsisDiffer.js.map
  62. 7 0
      dist/lib/nsis-gen/index.d.ts
  63. 85 0
      dist/lib/nsis-gen/index.js
  64. 1 0
      dist/lib/nsis-gen/index.js.map
  65. 5 0
      dist/lib/util/archive.d.ts
  66. 150 0
      dist/lib/util/archive.js
  67. 1 0
      dist/lib/util/archive.js.map
  68. 26 0
      dist/lib/util/index.d.ts
  69. 318 0
      dist/lib/util/index.js
  70. 1 0
      dist/lib/util/index.js.map

+ 0 - 1
.gitignore

@@ -5,4 +5,3 @@ node_modules
 /packages/nsis-compat-tester/dist
 /assets/project/dist
 /caches
-/dist

+ 2 - 0
dist/bin/build.d.ts

@@ -0,0 +1,2 @@
+#!/usr/bin/env node
+export {};

+ 122 - 0
dist/bin/build.js

@@ -0,0 +1,122 @@
+#!/usr/bin/env node
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+    return new (P || (P = Promise))(function (resolve, reject) {
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+        step((generator = generator.apply(thisArg, _arguments || [])).next());
+    });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+    function verb(n) { return function (v) { return step([n, v]); }; }
+    function step(op) {
+        if (f) throw new TypeError("Generator is already executing.");
+        while (_) try {
+            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+            if (y = 0, t) op = [op[0] & 2, t.value];
+            switch (op[0]) {
+                case 0: case 1: t = op; break;
+                case 4: _.label++; return { value: op[1], done: false };
+                case 5: _.label++; y = op[1]; op = [0]; continue;
+                case 7: op = _.ops.pop(); _.trys.pop(); continue;
+                default:
+                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+                    if (t[2]) _.ops.pop();
+                    _.trys.pop(); continue;
+            }
+            op = body.call(thisArg, _);
+        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+    }
+};
+var _this = this;
+Object.defineProperty(exports, "__esModule", { value: true });
+var debug = require('debug')('build:commandline:build');
+var lib_1 = require("../lib");
+var argv = require('yargs')
+    .option('win', {
+    type: 'boolean',
+    describe: 'Build for Windows platform',
+    default: lib_1.Builder.DEFAULT_OPTIONS.win,
+    alias: 'w',
+})
+    .option('mac', {
+    type: 'boolean',
+    describe: 'Build for macOS platform',
+    default: lib_1.Builder.DEFAULT_OPTIONS.mac,
+    alias: 'm',
+})
+    .option('linux', {
+    type: 'boolean',
+    describe: 'Build for Linux platform',
+    default: lib_1.Builder.DEFAULT_OPTIONS.linux,
+    alias: 'l',
+})
+    .option('x86', {
+    type: 'boolean',
+    describe: 'Build for x86 arch',
+    default: lib_1.Builder.DEFAULT_OPTIONS.x86,
+})
+    .option('x64', {
+    type: 'boolean',
+    describe: 'Build for x64 arch',
+    default: lib_1.Builder.DEFAULT_OPTIONS.x64,
+})
+    .option('tasks', {
+    type: 'string',
+    describe: 'List of <PLATFORM>-<ARCH> to build, separated by comma.',
+    default: '',
+})
+    .option('chrome-app', {
+    type: 'boolean',
+    describe: 'Build from Chrome App',
+    default: lib_1.Builder.DEFAULT_OPTIONS.chromeApp,
+})
+    .option('mirror', {
+    describe: 'Modify NW.js mirror',
+    default: lib_1.Builder.DEFAULT_OPTIONS.mirror,
+})
+    .option('concurrent', {
+    type: 'boolean',
+    describe: 'Build concurrently',
+    default: lib_1.Builder.DEFAULT_OPTIONS.concurrent,
+})
+    .help()
+    .argv;
+(function () { return __awaiter(_this, void 0, void 0, function () {
+    var builder;
+    return __generator(this, function (_a) {
+        switch (_a.label) {
+            case 0:
+                debug('in commandline', 'argv', argv);
+                builder = new lib_1.Builder({
+                    win: argv.win,
+                    mac: argv.mac,
+                    linux: argv.linux,
+                    x86: argv.x86,
+                    x64: argv.x64,
+                    tasks: argv.tasks.split(','),
+                    chromeApp: argv['chrome-app'],
+                    mirror: argv.mirror,
+                    concurrent: argv.concurrent,
+                    mute: false,
+                }, argv._.shift());
+                return [4 /*yield*/, builder.build()];
+            case 1:
+                _a.sent();
+                process.exitCode = 0;
+                return [2 /*return*/];
+        }
+    });
+}); })()
+    .catch(function (err) {
+    console.error(err);
+    process.exitCode = -1;
+});
+//# sourceMappingURL=build.js.map

ファイルの差分が大きいため隠しています
+ 1 - 0
dist/bin/build.js.map


+ 2 - 0
dist/bin/run.d.ts

@@ -0,0 +1,2 @@
+#!/usr/bin/env node
+export {};

+ 95 - 0
dist/bin/run.js

@@ -0,0 +1,95 @@
+#!/usr/bin/env node
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+    return new (P || (P = Promise))(function (resolve, reject) {
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+        step((generator = generator.apply(thisArg, _arguments || [])).next());
+    });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+    function verb(n) { return function (v) { return step([n, v]); }; }
+    function step(op) {
+        if (f) throw new TypeError("Generator is already executing.");
+        while (_) try {
+            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+            if (y = 0, t) op = [op[0] & 2, t.value];
+            switch (op[0]) {
+                case 0: case 1: t = op; break;
+                case 4: _.label++; return { value: op[1], done: false };
+                case 5: _.label++; y = op[1]; op = [0]; continue;
+                case 7: op = _.ops.pop(); _.trys.pop(); continue;
+                default:
+                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+                    if (t[2]) _.ops.pop();
+                    _.trys.pop(); continue;
+            }
+            op = body.call(thisArg, _);
+        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+    }
+};
+var _this = this;
+Object.defineProperty(exports, "__esModule", { value: true });
+var debug = require('debug')('build:commandline:run');
+var lib_1 = require("../lib");
+var argv = require('yargs')
+    .option('x86', {
+    type: 'boolean',
+    describe: 'Build for x86 arch',
+    default: lib_1.Runner.DEFAULT_OPTIONS.x86,
+})
+    .option('x64', {
+    type: 'boolean',
+    describe: 'Build for x64 arch',
+    default: lib_1.Runner.DEFAULT_OPTIONS.x64,
+})
+    .option('chrome-app', {
+    type: 'boolean',
+    describe: 'Build from Chrome App',
+    default: lib_1.Runner.DEFAULT_OPTIONS.chromeApp,
+})
+    .option('mirror', {
+    describe: 'Modify NW.js mirror',
+    default: lib_1.Runner.DEFAULT_OPTIONS.mirror,
+})
+    .option('detached', {
+    describe: 'Detach after launching',
+    type: 'boolean',
+    default: lib_1.Runner.DEFAULT_OPTIONS.detached,
+})
+    .help()
+    .argv;
+(function () { return __awaiter(_this, void 0, void 0, function () {
+    var runner, code;
+    return __generator(this, function (_a) {
+        switch (_a.label) {
+            case 0:
+                debug('in commandline', 'argv', argv);
+                runner = new lib_1.Runner({
+                    x86: argv.x86,
+                    x64: argv.x64,
+                    chromeApp: argv['chrome-app'],
+                    mirror: argv.mirror,
+                    detached: argv.detached,
+                    mute: false,
+                }, argv._);
+                return [4 /*yield*/, runner.run()];
+            case 1:
+                code = _a.sent();
+                process.exitCode = code;
+                return [2 /*return*/];
+        }
+    });
+}); })()
+    .catch(function (err) {
+    console.error(err);
+    process.exitCode = -1;
+});
+//# sourceMappingURL=run.js.map

ファイルの差分が大きいため隠しています
+ 1 - 0
dist/bin/run.js.map


+ 58 - 0
dist/lib/Builder.d.ts

@@ -0,0 +1,58 @@
+import { BuildConfig } from './config';
+import { NsisVersionInfo } from './common';
+export interface IParseOutputPatternOptions {
+    name: string;
+    version: string;
+    platform: string;
+    arch: string;
+}
+export interface IBuilderOptions {
+    win?: boolean;
+    mac?: boolean;
+    linux?: boolean;
+    x86?: boolean;
+    x64?: boolean;
+    tasks?: string[];
+    chromeApp?: boolean;
+    mirror?: string;
+    concurrent?: boolean;
+    mute?: boolean;
+    forceCaches?: boolean;
+    destination?: string;
+}
+export declare class Builder {
+    dir: string;
+    static DEFAULT_OPTIONS: IBuilderOptions;
+    options: IBuilderOptions;
+    constructor(options: IBuilderOptions, dir: string);
+    build(): Promise<void>;
+    protected getTimeDiff(started: number): string;
+    protected writeStrippedManifest(path: string, pkg: any, config: BuildConfig): Promise<void>;
+    protected parseOutputPattern(pattern: string, options: IParseOutputPatternOptions, pkg: any, config: BuildConfig): string;
+    protected combineExecutable(executable: string, nwFile: string): Promise<{}>;
+    protected readPlist(path: string): Promise<any>;
+    protected writePlist(path: string, p: any): Promise<void>;
+    protected updateWinResources(targetDir: string, appRoot: string, pkg: any, config: BuildConfig): Promise<{}>;
+    protected renameWinApp(targetDir: string, appRoot: string, pkg: any, config: BuildConfig): Promise<void>;
+    protected updatePlist(targetDir: string, appRoot: string, pkg: any, config: BuildConfig): Promise<void>;
+    protected updateHelperPlist(targetDir: string, appRoot: string, pkg: any, config: BuildConfig): Promise<void>;
+    protected updateMacIcons(targetDir: string, appRoot: string, pkg: any, config: BuildConfig): Promise<void>;
+    protected fixMacMeta(targetDir: string, appRoot: string, pkg: any, config: BuildConfig): Promise<void>;
+    protected renameMacApp(targetDir: string, appRoot: string, pkg: any, config: BuildConfig): Promise<void>;
+    protected renameMacHelperApp(targetDir: string, appRoot: string, pkg: any, config: BuildConfig): Promise<void>;
+    protected canRenameMacHelperApp(pkg: any, config: BuildConfig): boolean;
+    protected findMacHelperApp(targetDir: string): Promise<string>;
+    protected fixLinuxMode(targetDir: string, appRoot: string, pkg: any, config: BuildConfig): Promise<void>;
+    protected renameLinuxApp(targetDir: string, appRoot: string, pkg: any, config: BuildConfig): Promise<void>;
+    protected prepareWinBuild(targetDir: string, appRoot: string, pkg: any, config: BuildConfig): Promise<void>;
+    protected prepareMacBuild(targetDir: string, appRoot: string, pkg: any, config: BuildConfig): Promise<void>;
+    protected prepareLinuxBuild(targetDir: string, appRoot: string, pkg: any, config: BuildConfig): Promise<void>;
+    protected copyFiles(platform: string, targetDir: string, appRoot: string, pkg: any, config: BuildConfig): Promise<void>;
+    protected integrateFFmpeg(platform: string, arch: string, targetDir: string, pkg: any, config: BuildConfig): Promise<void>;
+    protected buildNsisDiffUpdater(platform: string, arch: string, versionInfo: NsisVersionInfo, fromVersion: string, toVersion: string, pkg: any, config: BuildConfig): Promise<void>;
+    protected buildDirTarget(platform: string, arch: string, runtimeDir: string, pkg: any, config: BuildConfig): Promise<string>;
+    protected buildArchiveTarget(type: string, sourceDir: string): Promise<string>;
+    protected buildNsisTarget(platform: string, arch: string, sourceDir: string, pkg: any, config: BuildConfig): Promise<void>;
+    protected buildNsis7zTarget(platform: string, arch: string, sourceDir: string, pkg: any, config: BuildConfig): Promise<void>;
+    protected buildTask(platform: string, arch: string, pkg: any, config: BuildConfig): Promise<void>;
+}

ファイルの差分が大きいため隠しています
+ 1139 - 0
dist/lib/Builder.js


ファイルの差分が大きいため隠しています
+ 1 - 0
dist/lib/Builder.js.map


+ 20 - 0
dist/lib/Downloader.d.ts

@@ -0,0 +1,20 @@
+import { DownloaderBase } from './common/DownloaderBase';
+export interface IDownloaderOptions {
+    platform?: string;
+    arch?: string;
+    version?: string;
+    flavor?: string;
+    mirror?: string;
+    useCaches?: boolean;
+    showProgress?: boolean;
+    forceCaches?: boolean;
+    destination?: string;
+}
+export declare class Downloader extends DownloaderBase {
+    static DEFAULT_OPTIONS: IDownloaderOptions;
+    options: IDownloaderOptions;
+    constructor(options: IDownloaderOptions);
+    fetch(): Promise<string>;
+    protected handleVersion(version: string): Promise<any>;
+    protected extensionByPlatform(platform: string): "tar.gz" | "zip";
+}

+ 187 - 0
dist/lib/Downloader.js

@@ -0,0 +1,187 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = Object.setPrototypeOf ||
+        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+    return new (P || (P = Promise))(function (resolve, reject) {
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+        step((generator = generator.apply(thisArg, _arguments || [])).next());
+    });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+    function verb(n) { return function (v) { return step([n, v]); }; }
+    function step(op) {
+        if (f) throw new TypeError("Generator is already executing.");
+        while (_) try {
+            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+            if (y = 0, t) op = [op[0] & 2, t.value];
+            switch (op[0]) {
+                case 0: case 1: t = op; break;
+                case 4: _.label++; return { value: op[1], done: false };
+                case 5: _.label++; y = op[1]; op = [0]; continue;
+                case 7: op = _.ops.pop(); _.trys.pop(); continue;
+                default:
+                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+                    if (t[2]) _.ops.pop();
+                    _.trys.pop(); continue;
+            }
+            op = body.call(thisArg, _);
+        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+    }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var path_1 = require("path");
+var debug = require('debug')('build:downloader');
+var DownloaderBase_1 = require("./common/DownloaderBase");
+var util_1 = require("./util");
+var Downloader = /** @class */ (function (_super) {
+    __extends(Downloader, _super);
+    function Downloader(options) {
+        var _this = _super.call(this) || this;
+        _this.options = util_1.mergeOptions(Downloader.DEFAULT_OPTIONS, options);
+        if (_this.options.destination !== _this.destination) {
+            _this.setDestination(_this.options.destination);
+        }
+        if (process.env.NWJS_MIRROR) {
+            _this.options.mirror = process.env.NWJS_MIRROR;
+        }
+        debug('in constructor', 'options', _this.options);
+        return _this;
+    }
+    Downloader.prototype.fetch = function () {
+        return __awaiter(this, void 0, void 0, function () {
+            var _a, mirror, platform, arch, version, flavor, showProgress, partVersion, partFlavor, partPlatform, partArch, partExtension, url, filename, path, _b, _c, err_1;
+            return __generator(this, function (_d) {
+                switch (_d.label) {
+                    case 0:
+                        _a = this.options, mirror = _a.mirror, platform = _a.platform, arch = _a.arch, version = _a.version, flavor = _a.flavor, showProgress = _a.showProgress;
+                        return [4 /*yield*/, this.handleVersion(version)];
+                    case 1:
+                        partVersion = _d.sent();
+                        partFlavor = flavor == 'normal' ? '' : '-' + flavor;
+                        partPlatform = this.handlePlatform(platform);
+                        partArch = this.handleArch(arch);
+                        partExtension = this.extensionByPlatform(platform);
+                        url = mirror + "/" + partVersion + "/nwjs" + partFlavor + "-" + partVersion + "-" + partPlatform + "-" + partArch + "." + partExtension;
+                        filename = path_1.basename(url);
+                        path = path_1.resolve(this.destination, filename);
+                        debug('in fetch', 'url', url);
+                        debug('in fetch', 'filename', filename);
+                        debug('in fetch', 'path', path);
+                        _b = this.options.forceCaches;
+                        if (!_b) return [3 /*break*/, 3];
+                        return [4 /*yield*/, this.isFileExists(path)];
+                    case 2:
+                        _b = (_d.sent());
+                        _d.label = 3;
+                    case 3:
+                        if (_b) {
+                            return [2 /*return*/, path];
+                        }
+                        _d.label = 4;
+                    case 4:
+                        _d.trys.push([4, 8, , 9]);
+                        return [4 /*yield*/, this.isFileExists(path)];
+                    case 5:
+                        _c = (_d.sent());
+                        if (!_c) return [3 /*break*/, 7];
+                        return [4 /*yield*/, this.isFileSynced(url, path)];
+                    case 6:
+                        _c = (_d.sent());
+                        _d.label = 7;
+                    case 7:
+                        if (_c) {
+                            return [2 /*return*/, path];
+                        }
+                        return [3 /*break*/, 9];
+                    case 8:
+                        err_1 = _d.sent();
+                        debug('in fetch', 'err', err_1);
+                        if (err_1.code === 'ENOTFOUND' && this.options.useCaches) {
+                            console.info('DNS lookup fails, use local caches at this time.');
+                            return [2 /*return*/, path];
+                        }
+                        else if (err_1.code === 'EAI_AGAIN' && this.options.useCaches) {
+                            console.info('DNS lookup timeout, use local caches at this time.');
+                            return [2 /*return*/, path];
+                        }
+                        else {
+                            throw err_1;
+                        }
+                        return [3 /*break*/, 9];
+                    case 9: return [4 /*yield*/, this.download(url, filename, path, showProgress)];
+                    case 10:
+                        _d.sent();
+                        return [2 /*return*/, path];
+                }
+            });
+        });
+    };
+    Downloader.prototype.handleVersion = function (version) {
+        return __awaiter(this, void 0, void 0, function () {
+            var _a, versions;
+            return __generator(this, function (_b) {
+                switch (_b.label) {
+                    case 0:
+                        _a = version;
+                        switch (_a) {
+                            case 'latest': return [3 /*break*/, 1];
+                            case 'stable': return [3 /*break*/, 1];
+                            case 'lts': return [3 /*break*/, 1];
+                        }
+                        return [3 /*break*/, 3];
+                    case 1: return [4 /*yield*/, this.getVersions()];
+                    case 2:
+                        versions = _b.sent();
+                        //debug('in handleVersion', 'versions', versions);
+                        return [2 /*return*/, versions[version]];
+                    case 3: return [2 /*return*/, version[0] == 'v' ? version : 'v' + version];
+                }
+            });
+        });
+    };
+    Downloader.prototype.extensionByPlatform = function (platform) {
+        switch (platform) {
+            case 'win32':
+            case 'win':
+                return 'zip';
+            case 'darwin':
+            case 'osx':
+            case 'mac':
+                return 'zip';
+            case 'linux':
+                return 'tar.gz';
+            default:
+                throw new Error('ERROR_UNKNOWN_PLATFORM');
+        }
+    };
+    Downloader.DEFAULT_OPTIONS = {
+        platform: process.platform,
+        arch: process.arch,
+        version: '0.14.7',
+        flavor: 'normal',
+        mirror: 'https://dl.nwjs.io/',
+        useCaches: true,
+        showProgress: true,
+        forceCaches: false,
+        destination: DownloaderBase_1.DownloaderBase.DEFAULT_DESTINATION,
+    };
+    return Downloader;
+}(DownloaderBase_1.DownloaderBase));
+exports.Downloader = Downloader;
+//# sourceMappingURL=Downloader.js.map

ファイルの差分が大きいため隠しています
+ 1 - 0
dist/lib/Downloader.js.map


+ 30 - 0
dist/lib/FFmpegDownloader.d.ts

@@ -0,0 +1,30 @@
+import { DownloaderBase } from './common';
+export interface IRequestProgress {
+    percent: number;
+    speed: number;
+    size: {
+        total: number;
+        transferred: number;
+    };
+    time: {
+        elapsed: number;
+        remaining: number;
+    };
+}
+export interface IFFmpegDownloaderOptions {
+    platform?: string;
+    arch?: string;
+    version?: string;
+    mirror?: string;
+    useCaches?: boolean;
+    showProgress?: boolean;
+    forceCaches?: boolean;
+    destination?: string;
+}
+export declare class FFmpegDownloader extends DownloaderBase {
+    static DEFAULT_OPTIONS: IFFmpegDownloaderOptions;
+    options: IFFmpegDownloaderOptions;
+    constructor(options: IFFmpegDownloaderOptions);
+    fetch(): Promise<string>;
+    protected handleVersion(version: string): Promise<string>;
+}

+ 159 - 0
dist/lib/FFmpegDownloader.js

@@ -0,0 +1,159 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = Object.setPrototypeOf ||
+        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+    return new (P || (P = Promise))(function (resolve, reject) {
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+        step((generator = generator.apply(thisArg, _arguments || [])).next());
+    });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+    function verb(n) { return function (v) { return step([n, v]); }; }
+    function step(op) {
+        if (f) throw new TypeError("Generator is already executing.");
+        while (_) try {
+            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+            if (y = 0, t) op = [op[0] & 2, t.value];
+            switch (op[0]) {
+                case 0: case 1: t = op; break;
+                case 4: _.label++; return { value: op[1], done: false };
+                case 5: _.label++; y = op[1]; op = [0]; continue;
+                case 7: op = _.ops.pop(); _.trys.pop(); continue;
+                default:
+                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+                    if (t[2]) _.ops.pop();
+                    _.trys.pop(); continue;
+            }
+            op = body.call(thisArg, _);
+        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+    }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var path_1 = require("path");
+var debug = require('debug')('build:ffmpegDownloader');
+var progress = require('request-progress');
+var common_1 = require("./common");
+var util_1 = require("./util");
+var FFmpegDownloader = /** @class */ (function (_super) {
+    __extends(FFmpegDownloader, _super);
+    function FFmpegDownloader(options) {
+        var _this = _super.call(this) || this;
+        _this.options = util_1.mergeOptions(FFmpegDownloader.DEFAULT_OPTIONS, options);
+        if (_this.options.destination !== _this.destination) {
+            _this.setDestination(_this.options.destination);
+        }
+        debug('in constructor', 'options', options);
+        return _this;
+    }
+    FFmpegDownloader.prototype.fetch = function () {
+        return __awaiter(this, void 0, void 0, function () {
+            var _a, mirror, version, platform, arch, showProgress, partVersion, partPlatform, partArch, url, filename, path, _b, _c, err_1;
+            return __generator(this, function (_d) {
+                switch (_d.label) {
+                    case 0:
+                        _a = this.options, mirror = _a.mirror, version = _a.version, platform = _a.platform, arch = _a.arch, showProgress = _a.showProgress;
+                        return [4 /*yield*/, this.handleVersion(version)];
+                    case 1:
+                        partVersion = _d.sent();
+                        partPlatform = this.handlePlatform(platform);
+                        partArch = this.handleArch(arch);
+                        url = mirror + "/" + partVersion + "/" + partVersion + "-" + partPlatform + "-" + partArch + ".zip";
+                        filename = "ffmpeg-" + path_1.basename(url);
+                        path = path_1.resolve(this.destination, filename);
+                        debug('in fetch', 'url', url);
+                        debug('in fetch', 'filename', filename);
+                        debug('in fetch', 'path', path);
+                        _b = this.options.forceCaches;
+                        if (!_b) return [3 /*break*/, 3];
+                        return [4 /*yield*/, this.isFileExists(path)];
+                    case 2:
+                        _b = (_d.sent());
+                        _d.label = 3;
+                    case 3:
+                        if (_b) {
+                            return [2 /*return*/, path];
+                        }
+                        _d.label = 4;
+                    case 4:
+                        _d.trys.push([4, 8, , 9]);
+                        return [4 /*yield*/, this.isFileExists(path)];
+                    case 5:
+                        _c = (_d.sent());
+                        if (!_c) return [3 /*break*/, 7];
+                        return [4 /*yield*/, this.isFileSynced(url, path)];
+                    case 6:
+                        _c = (_d.sent());
+                        _d.label = 7;
+                    case 7:
+                        if (_c) {
+                            return [2 /*return*/, path];
+                        }
+                        return [3 /*break*/, 9];
+                    case 8:
+                        err_1 = _d.sent();
+                        debug('in fetch', 'err', err_1);
+                        if (err_1.code === 'ENOTFOUND' && this.options.useCaches) {
+                            console.info('DNS lookup fails, use local caches at this time.');
+                            return [2 /*return*/, path];
+                        }
+                        else if (err_1.code === 'EAI_AGAIN' && this.options.useCaches) {
+                            console.info('DNS lookup timeout, use local caches at this time.');
+                            return [2 /*return*/, path];
+                        }
+                        else {
+                            throw err_1;
+                        }
+                        return [3 /*break*/, 9];
+                    case 9: return [4 /*yield*/, this.download(url, filename, path, showProgress)];
+                    case 10:
+                        _d.sent();
+                        return [2 /*return*/, path];
+                }
+            });
+        });
+    };
+    FFmpegDownloader.prototype.handleVersion = function (version) {
+        return __awaiter(this, void 0, void 0, function () {
+            return __generator(this, function (_a) {
+                switch (version) {
+                    case 'lts':
+                    case 'stable':
+                    case 'latest':
+                        throw new Error('ERROR_VERSION_UNSUPPORTED');
+                    default:
+                        return [2 /*return*/, version[0] == 'v' ? version.slice(1) : version];
+                }
+                return [2 /*return*/];
+            });
+        });
+    };
+    FFmpegDownloader.DEFAULT_OPTIONS = {
+        platform: process.platform,
+        arch: process.arch,
+        version: '0.14.7',
+        mirror: 'https://github.com/iteufel/nwjs-ffmpeg-prebuilt/releases/download/',
+        useCaches: true,
+        showProgress: true,
+        forceCaches: false,
+        destination: common_1.DownloaderBase.DEFAULT_DESTINATION,
+    };
+    return FFmpegDownloader;
+}(common_1.DownloaderBase));
+exports.FFmpegDownloader = FFmpegDownloader;
+//# sourceMappingURL=FFmpegDownloader.js.map

ファイルの差分が大きいため隠しています
+ 1 - 0
dist/lib/FFmpegDownloader.js.map


+ 19 - 0
dist/lib/Runner.d.ts

@@ -0,0 +1,19 @@
+import { BuildConfig } from './config';
+export interface IRunnerOptions {
+    x86?: boolean;
+    x64?: boolean;
+    chromeApp?: boolean;
+    mirror?: string;
+    detached?: boolean;
+    mute?: boolean;
+    forceCaches?: boolean;
+    destination?: string;
+}
+export declare class Runner {
+    args: string[];
+    static DEFAULT_OPTIONS: IRunnerOptions;
+    options: IRunnerOptions;
+    constructor(options: IRunnerOptions, args: string[]);
+    run(): Promise<number>;
+    protected integrateFFmpeg(platform: string, arch: string, runtimeDir: string, pkg: any, config: BuildConfig): Promise<void>;
+}

+ 179 - 0
dist/lib/Runner.js

@@ -0,0 +1,179 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+    return new (P || (P = Promise))(function (resolve, reject) {
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+        step((generator = generator.apply(thisArg, _arguments || [])).next());
+    });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+    function verb(n) { return function (v) { return step([n, v]); }; }
+    function step(op) {
+        if (f) throw new TypeError("Generator is already executing.");
+        while (_) try {
+            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+            if (y = 0, t) op = [op[0] & 2, t.value];
+            switch (op[0]) {
+                case 0: case 1: t = op; break;
+                case 4: _.label++; return { value: op[1], done: false };
+                case 5: _.label++; y = op[1]; op = [0]; continue;
+                case 7: op = _.ops.pop(); _.trys.pop(); continue;
+                default:
+                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+                    if (t[2]) _.ops.pop();
+                    _.trys.pop(); continue;
+            }
+            op = body.call(thisArg, _);
+        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+    }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var path_1 = require("path");
+var fs_extra_1 = require("fs-extra");
+var debug = require('debug')('build:runner');
+var Downloader_1 = require("./Downloader");
+var FFmpegDownloader_1 = require("./FFmpegDownloader");
+var config_1 = require("./config");
+var util_1 = require("./util");
+var common_1 = require("./common");
+var Runner = /** @class */ (function () {
+    function Runner(options, args) {
+        if (options === void 0) { options = {}; }
+        this.args = args;
+        this.options = util_1.mergeOptions(Runner.DEFAULT_OPTIONS, options);
+        debug('in constructor', 'args', args);
+        debug('in constructor', 'options', this.options);
+    }
+    Runner.prototype.run = function () {
+        return __awaiter(this, void 0, void 0, function () {
+            var platform, arch, pkg, config, downloader, runtimeDir, executable, _a, code, signal;
+            return __generator(this, function (_b) {
+                switch (_b.label) {
+                    case 0:
+                        platform = process.platform;
+                        arch = this.options.x86 || this.options.x64
+                            ? (this.options.x86 ? 'ia32' : 'x64')
+                            : process.arch;
+                        return [4 /*yield*/, fs_extra_1.readJson(path_1.resolve(this.args[0], this.options.chromeApp ? 'manifest.json' : 'package.json'))];
+                    case 1:
+                        pkg = _b.sent();
+                        config = new config_1.BuildConfig(pkg);
+                        debug('in run', 'config', config);
+                        downloader = new Downloader_1.Downloader({
+                            platform: platform, arch: arch,
+                            version: config.nwVersion,
+                            flavor: 'sdk',
+                            mirror: this.options.mirror,
+                            useCaches: true,
+                            showProgress: this.options.mute ? false : true,
+                            forceCaches: this.options.forceCaches,
+                            destination: this.options.destination,
+                        });
+                        if (!this.options.mute) {
+                            console.info('Fetching NW.js binary...', {
+                                platform: downloader.options.platform,
+                                arch: downloader.options.arch,
+                                version: downloader.options.version,
+                                flavor: downloader.options.flavor,
+                            });
+                        }
+                        return [4 /*yield*/, downloader.fetchAndExtract()];
+                    case 2:
+                        runtimeDir = _b.sent();
+                        if (config.ffmpegIntegration) {
+                            // FIXME: Integrate without overwriting extracted files.
+                            //await this.integrateFFmpeg(platform, arch, runtimeDir, pkg, config);
+                            if (!this.options.mute) {
+                                console.warn('Running with FFmpeg integration is not supported.');
+                            }
+                        }
+                        return [4 /*yield*/, util_1.findExecutable(platform, runtimeDir)];
+                    case 3:
+                        executable = _b.sent();
+                        return [4 /*yield*/, fs_extra_1.chmod(executable, 365)];
+                    case 4:
+                        _b.sent();
+                        if (!this.options.mute) {
+                            console.info('Launching NW.js app...');
+                        }
+                        return [4 /*yield*/, util_1.spawnAsync(executable, this.args, {
+                                detached: this.options.detached,
+                            })];
+                    case 5:
+                        _a = _b.sent(), code = _a.code, signal = _a.signal;
+                        if (!!this.options.mute) return [3 /*break*/, 8];
+                        if (!this.options.detached) return [3 /*break*/, 7];
+                        console.info('NW.js app detached.');
+                        return [4 /*yield*/, new Promise(function (resolve, reject) {
+                                setTimeout(resolve, 3000);
+                            })];
+                    case 6:
+                        _b.sent();
+                        return [3 /*break*/, 8];
+                    case 7:
+                        console.info("NW.js app exited with " + code + ".");
+                        _b.label = 8;
+                    case 8: return [2 /*return*/, code];
+                }
+            });
+        });
+    };
+    Runner.prototype.integrateFFmpeg = function (platform, arch, runtimeDir, pkg, config) {
+        return __awaiter(this, void 0, void 0, function () {
+            var downloader, ffmpegDir, src, dest;
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0:
+                        downloader = new FFmpegDownloader_1.FFmpegDownloader({
+                            platform: platform, arch: arch,
+                            version: config.nwVersion,
+                            useCaches: true,
+                            showProgress: this.options.mute ? false : true,
+                            forceCaches: this.options.forceCaches,
+                            destination: this.options.destination,
+                        });
+                        if (!this.options.mute) {
+                            console.info('Fetching FFmpeg prebuilt...', {
+                                platform: downloader.options.platform,
+                                arch: downloader.options.arch,
+                                version: downloader.options.version,
+                            });
+                        }
+                        return [4 /*yield*/, downloader.fetchAndExtract()];
+                    case 1:
+                        ffmpegDir = _a.sent();
+                        return [4 /*yield*/, util_1.findFFmpeg(platform, ffmpegDir)];
+                    case 2:
+                        src = _a.sent();
+                        return [4 /*yield*/, util_1.findFFmpeg(platform, runtimeDir)];
+                    case 3:
+                        dest = _a.sent();
+                        return [4 /*yield*/, fs_extra_1.copy(src, dest)];
+                    case 4:
+                        _a.sent();
+                        return [2 /*return*/];
+                }
+            });
+        });
+    };
+    Runner.DEFAULT_OPTIONS = {
+        x86: false,
+        x64: false,
+        chromeApp: false,
+        mirror: Downloader_1.Downloader.DEFAULT_OPTIONS.mirror,
+        detached: false,
+        mute: true,
+        forceCaches: Downloader_1.Downloader.DEFAULT_OPTIONS.forceCaches,
+        destination: common_1.DownloaderBase.DEFAULT_DESTINATION,
+    };
+    return Runner;
+}());
+exports.Runner = Runner;
+//# sourceMappingURL=Runner.js.map

ファイルの差分が大きいため隠しています
+ 1 - 0
dist/lib/Runner.js.map


+ 30 - 0
dist/lib/common/DownloaderBase.d.ts

@@ -0,0 +1,30 @@
+import { Event } from './Event';
+export interface IRequestProgress {
+    percent: number;
+    speed: number;
+    size: {
+        total: number;
+        transferred: number;
+    };
+    time: {
+        elapsed: number;
+        remaining: number;
+    };
+}
+export declare abstract class DownloaderBase {
+    onProgress: Event<IRequestProgress>;
+    static readonly DEFAULT_DESTINATION: string;
+    protected destination: string;
+    abstract fetch(): Promise<string>;
+    protected abstract handleVersion(version: string): Promise<string>;
+    fetchAndExtract(): Promise<string>;
+    protected getVersions(): Promise<any>;
+    protected setDestination(destination: string): void;
+    protected handlePlatform(platform: string): "linux" | "win" | "osx";
+    protected handleArch(arch: string): "ia32" | "x64";
+    protected getLocalSize(path: string): Promise<number>;
+    protected getRemoteSize(url: string): Promise<number>;
+    protected isFileExists(path: string): Promise<{}>;
+    protected isFileSynced(url: string, path: string): Promise<boolean>;
+    protected download(url: string, filename: string, path: string, showProgress: boolean): Promise<string>;
+}

+ 209 - 0
dist/lib/common/DownloaderBase.js

@@ -0,0 +1,209 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+    return new (P || (P = Promise))(function (resolve, reject) {
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+        step((generator = generator.apply(thisArg, _arguments || [])).next());
+    });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+    function verb(n) { return function (v) { return step([n, v]); }; }
+    function step(op) {
+        if (f) throw new TypeError("Generator is already executing.");
+        while (_) try {
+            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+            if (y = 0, t) op = [op[0] & 2, t.value];
+            switch (op[0]) {
+                case 0: case 1: t = op; break;
+                case 4: _.label++; return { value: op[1], done: false };
+                case 5: _.label++; y = op[1]; op = [0]; continue;
+                case 7: op = _.ops.pop(); _.trys.pop(); continue;
+                default:
+                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+                    if (t[2]) _.ops.pop();
+                    _.trys.pop(); continue;
+            }
+            op = body.call(thisArg, _);
+        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+    }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var path_1 = require("path");
+var request = require("request");
+var ProgressBar = require("progress");
+var fs_extra_1 = require("fs-extra");
+var debug = require('debug')('build:downloader');
+var progress = require('request-progress');
+var Event_1 = require("./Event");
+var util_1 = require("../util");
+var DIR_CACHES = path_1.resolve(path_1.dirname(module.filename), '..', '..', '..', 'caches');
+fs_extra_1.ensureDirSync(DIR_CACHES);
+var DownloaderBase = /** @class */ (function () {
+    function DownloaderBase() {
+        this.onProgress = new Event_1.Event('progress');
+        this.destination = DownloaderBase.DEFAULT_DESTINATION;
+    }
+    DownloaderBase.prototype.fetchAndExtract = function () {
+        return __awaiter(this, void 0, void 0, function () {
+            var archive, dest;
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0: return [4 /*yield*/, this.fetch()];
+                    case 1:
+                        archive = _a.sent();
+                        dest = archive + "-extracted";
+                        return [4 /*yield*/, util_1.extractGeneric(archive, dest)];
+                    case 2:
+                        _a.sent();
+                        return [2 /*return*/, dest];
+                }
+            });
+        });
+    };
+    DownloaderBase.prototype.getVersions = function () {
+        return new Promise(function (resolve, reject) {
+            request('https://nwjs.io/versions.json', function (err, res, body) {
+                if (err) {
+                    return reject(err);
+                }
+                var json = JSON.parse(body);
+                resolve(json);
+            });
+        });
+    };
+    DownloaderBase.prototype.setDestination = function (destination) {
+        this.destination = destination;
+    };
+    DownloaderBase.prototype.handlePlatform = function (platform) {
+        switch (platform) {
+            case 'win32':
+            case 'win':
+                return 'win';
+            case 'darwin':
+            case 'osx':
+            case 'mac':
+                return 'osx';
+            case 'linux':
+                return 'linux';
+            default:
+                throw new Error('ERROR_UNKNOWN_PLATFORM');
+        }
+    };
+    DownloaderBase.prototype.handleArch = function (arch) {
+        switch (arch) {
+            case 'x86':
+            case 'ia32':
+                return 'ia32';
+            case 'x64':
+                return 'x64';
+            default:
+                throw new Error('ERROR_UNKNOWN_PLATFORM');
+        }
+    };
+    DownloaderBase.prototype.getLocalSize = function (path) {
+        return fs_extra_1.lstat(path)
+            .then(function (stat) { return stat.size; });
+    };
+    DownloaderBase.prototype.getRemoteSize = function (url) {
+        return new Promise(function (resolve, reject) {
+            request.head(url, {
+                followAllRedirects: true,
+            })
+                .on('error', reject)
+                .on('response', function (res) { return resolve(parseInt((res.headers['content-length']), 10)); });
+        });
+    };
+    DownloaderBase.prototype.isFileExists = function (path) {
+        return new Promise(function (resolve, reject) {
+            fs_extra_1.exists(path, resolve);
+        });
+    };
+    DownloaderBase.prototype.isFileSynced = function (url, path) {
+        return __awaiter(this, void 0, void 0, function () {
+            var localSize, remoteSize;
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0: return [4 /*yield*/, this.getLocalSize(path)];
+                    case 1:
+                        localSize = _a.sent();
+                        return [4 /*yield*/, this.getRemoteSize(url)];
+                    case 2:
+                        remoteSize = _a.sent();
+                        debug('in isFileSynced', 'localSize', localSize);
+                        debug('in isFileSynced', 'remoteSize', remoteSize);
+                        return [2 /*return*/, localSize == remoteSize];
+                }
+            });
+        });
+    };
+    DownloaderBase.prototype.download = function (url, filename, path, showProgress) {
+        return __awaiter(this, void 0, void 0, function () {
+            var bar, onProgress;
+            var _this = this;
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0:
+                        bar = null;
+                        onProgress = function (state) {
+                            if (!state.size.total) {
+                                return;
+                            }
+                            if (!bar) {
+                                bar = new ProgressBar('[:bar] :speedKB/s :etas', {
+                                    width: 50,
+                                    total: state.size.total,
+                                });
+                                console.info('');
+                            }
+                            bar.update(state.size.transferred / state.size.total, {
+                                speed: (state.speed / 1000).toFixed(2),
+                            });
+                        };
+                        if (showProgress) {
+                            this.onProgress.subscribe(onProgress);
+                        }
+                        debug('in download', 'start downloading', filename);
+                        return [4 /*yield*/, new Promise(function (resolve, reject) {
+                                progress(request(url, {
+                                    encoding: null,
+                                }, function (err, res, data) {
+                                    if (err) {
+                                        return reject(err);
+                                    }
+                                    if (res.statusCode != 200) {
+                                        var e = new Error("ERROR_STATUS_CODE statusCode = " + res.statusCode);
+                                        return reject(e);
+                                    }
+                                    fs_extra_1.writeFile(path, data, function (err) { return err ? reject(err) : resolve(); });
+                                }))
+                                    .on('progress', function (state) {
+                                    _this.onProgress.trigger(state);
+                                });
+                            })];
+                    case 1:
+                        _a.sent();
+                        debug('in fetch', 'end downloading', filename);
+                        if (showProgress) {
+                            this.onProgress.unsubscribe(onProgress);
+                            if (bar) {
+                                console.info('');
+                                bar.terminate();
+                            }
+                        }
+                        return [2 /*return*/, path];
+                }
+            });
+        });
+    };
+    DownloaderBase.DEFAULT_DESTINATION = DIR_CACHES;
+    return DownloaderBase;
+}());
+exports.DownloaderBase = DownloaderBase;
+//# sourceMappingURL=DownloaderBase.js.map

ファイルの差分が大きいため隠しています
+ 1 - 0
dist/lib/common/DownloaderBase.js.map


+ 7 - 0
dist/lib/common/Event.d.ts

@@ -0,0 +1,7 @@
+export declare class Event<TArgs> {
+    listeners: Array<(args: TArgs) => void>;
+    constructor(name: string);
+    subscribe(fn: ((args: TArgs) => void)): void;
+    trigger(args: TArgs): void;
+    unsubscribe(fn: ((args: TArgs) => void)): void;
+}

+ 19 - 0
dist/lib/common/Event.js

@@ -0,0 +1,19 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var Event = /** @class */ (function () {
+    function Event(name) {
+        this.listeners = [];
+    }
+    Event.prototype.subscribe = function (fn) {
+        this.listeners.push(fn);
+    };
+    Event.prototype.trigger = function (args) {
+        this.listeners.map(function (fn) { return fn(args); });
+    };
+    Event.prototype.unsubscribe = function (fn) {
+        this.listeners = this.listeners.filter(function (f) { return f != fn; });
+    };
+    return Event;
+}());
+exports.Event = Event;
+//# sourceMappingURL=Event.js.map

ファイルの差分が大きいため隠しています
+ 1 - 0
dist/lib/common/Event.js.map


+ 39 - 0
dist/lib/common/NsisVersionInfo.d.ts

@@ -0,0 +1,39 @@
+export interface IInstaller {
+    arch: string;
+    path: string;
+    hash: string;
+    created: number;
+}
+export interface IUpdater {
+    arch: string;
+    fromVersion: string;
+    path: string;
+    hash: string;
+    created: number;
+}
+export interface IVersion {
+    version: string;
+    changelog: string;
+    source: string;
+    installers: IInstaller[];
+    updaters: IUpdater[];
+}
+export interface IVersionInfoData {
+    latest: string;
+    versions: IVersion[];
+}
+export declare class NsisVersionInfo {
+    protected path: string;
+    protected outputDir: string;
+    protected data: IVersionInfoData;
+    constructor(path: string);
+    addVersion(version: string, changelog: string, source: string): Promise<void>;
+    getVersions(): Promise<string[]>;
+    getVersion(version: string): Promise<IVersion>;
+    addInstaller(version: string, arch: string, path: string): Promise<void>;
+    addUpdater(version: string, fromVersion: string, arch: string, path: string): Promise<void>;
+    save(): Promise<void>;
+    protected getData(): Promise<IVersionInfoData>;
+    protected updateLatestVersion(): void;
+    protected hashFile(type: string, path: string): Promise<string>;
+}

+ 226 - 0
dist/lib/common/NsisVersionInfo.js

@@ -0,0 +1,226 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+    return new (P || (P = Promise))(function (resolve, reject) {
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+        step((generator = generator.apply(thisArg, _arguments || [])).next());
+    });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+    function verb(n) { return function (v) { return step([n, v]); }; }
+    function step(op) {
+        if (f) throw new TypeError("Generator is already executing.");
+        while (_) try {
+            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+            if (y = 0, t) op = [op[0] & 2, t.value];
+            switch (op[0]) {
+                case 0: case 1: t = op; break;
+                case 4: _.label++; return { value: op[1], done: false };
+                case 5: _.label++; y = op[1]; op = [0]; continue;
+                case 7: op = _.ops.pop(); _.trys.pop(); continue;
+                default:
+                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+                    if (t[2]) _.ops.pop();
+                    _.trys.pop(); continue;
+            }
+            op = body.call(thisArg, _);
+        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+    }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var path_1 = require("path");
+var crypto_1 = require("crypto");
+var fs_extra_1 = require("fs-extra");
+var semver = require("semver");
+var NsisVersionInfo = /** @class */ (function () {
+    function NsisVersionInfo(path) {
+        this.path = path;
+        this.outputDir = path_1.dirname(path);
+    }
+    NsisVersionInfo.prototype.addVersion = function (version, changelog, source) {
+        return __awaiter(this, void 0, void 0, function () {
+            var data;
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0: return [4 /*yield*/, this.getData()];
+                    case 1:
+                        data = _a.sent();
+                        if (!data.versions.find(function (item) { return item.version == version; })) {
+                            data.versions.push({
+                                version: version,
+                                changelog: changelog,
+                                source: path_1.basename(source),
+                                installers: [],
+                                updaters: [],
+                            });
+                        }
+                        this.updateLatestVersion();
+                        return [2 /*return*/];
+                }
+            });
+        });
+    };
+    NsisVersionInfo.prototype.getVersions = function () {
+        return __awaiter(this, void 0, void 0, function () {
+            var data;
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0: return [4 /*yield*/, this.getData()];
+                    case 1:
+                        data = _a.sent();
+                        return [2 /*return*/, data.versions.map(function (item) { return item.version; })];
+                }
+            });
+        });
+    };
+    NsisVersionInfo.prototype.getVersion = function (version) {
+        return __awaiter(this, void 0, void 0, function () {
+            var data, item;
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0: return [4 /*yield*/, this.getData()];
+                    case 1:
+                        data = _a.sent();
+                        item = data.versions.find(function (item) { return item.version == version; });
+                        if (!item) {
+                            throw new Error('ERROR_VERSION_NOT_FOUND');
+                        }
+                        return [2 /*return*/, item];
+                }
+            });
+        });
+    };
+    NsisVersionInfo.prototype.addInstaller = function (version, arch, path) {
+        return __awaiter(this, void 0, void 0, function () {
+            var data, versionItem, _a, _b, _c;
+            return __generator(this, function (_d) {
+                switch (_d.label) {
+                    case 0: return [4 /*yield*/, this.getData()];
+                    case 1:
+                        data = _d.sent();
+                        versionItem = data.versions.find(function (item) { return item.version == version; });
+                        if (!versionItem) {
+                            throw new Error('ERROR_VERSION_NOT_FOUND');
+                        }
+                        if (!!versionItem.installers.find(function (item) { return item.arch == arch; })) return [3 /*break*/, 3];
+                        _b = (_a = versionItem.installers).push;
+                        _c = {
+                            arch: arch,
+                            path: path_1.relative(this.outputDir, path)
+                        };
+                        return [4 /*yield*/, this.hashFile('sha256', path)];
+                    case 2:
+                        _b.apply(_a, [(_c.hash = _d.sent(),
+                                _c.created = Date.now(),
+                                _c)]);
+                        _d.label = 3;
+                    case 3: return [2 /*return*/];
+                }
+            });
+        });
+    };
+    NsisVersionInfo.prototype.addUpdater = function (version, fromVersion, arch, path) {
+        return __awaiter(this, void 0, void 0, function () {
+            var data, versionItem, _a, _b, _c;
+            return __generator(this, function (_d) {
+                switch (_d.label) {
+                    case 0: return [4 /*yield*/, this.getData()];
+                    case 1:
+                        data = _d.sent();
+                        versionItem = data.versions.find(function (item) { return item.version == version; });
+                        if (!versionItem) {
+                            throw new Error('ERROR_VERSION_NOT_FOUND');
+                        }
+                        if (!!versionItem.updaters.find(function (item) { return item.fromVersion == fromVersion && item.arch == arch; })) return [3 /*break*/, 3];
+                        _b = (_a = versionItem.updaters).push;
+                        _c = {
+                            fromVersion: fromVersion,
+                            arch: arch,
+                            path: path_1.relative(this.outputDir, path)
+                        };
+                        return [4 /*yield*/, this.hashFile('sha256', path)];
+                    case 2:
+                        _b.apply(_a, [(_c.hash = _d.sent(),
+                                _c.created = Date.now(),
+                                _c)]);
+                        _d.label = 3;
+                    case 3: return [2 /*return*/];
+                }
+            });
+        });
+    };
+    NsisVersionInfo.prototype.save = function () {
+        return __awaiter(this, void 0, void 0, function () {
+            return __generator(this, function (_a) {
+                switch (_a.label) {
+                    case 0: return [4 /*yield*/, fs_extra_1.writeJson(this.path, this.data)];
+                    case 1:
+                        _a.sent();
+                        return [2 /*return*/];
+                }
+            });
+        });
+    };
+    NsisVersionInfo.prototype.getData = function () {
+        return __awaiter(this, void 0, void 0, function () {
+            var _a, _b;
+            var _this = this;
+            return __generator(this, function (_c) {
+                switch (_c.label) {
+                    case 0:
+                        if (!!this.data) return [3 /*break*/, 5];
+                        _a = this;
+                        return [4 /*yield*/, new Promise(function (resolve, reject) { return fs_extra_1.exists(_this.path, resolve); })];
+                    case 1:
+                        if (!(_c.sent())) return [3 /*break*/, 3];
+                        return [4 /*yield*/, fs_extra_1.readJson(this.path)];
+                    case 2:
+                        _b = _c.sent();
+                        return [3 /*break*/, 4];
+                    case 3:
+                        _b = {
+                            latest: undefined,
+                            versions: [],
+                        };
+                        _c.label = 4;
+                    case 4:
+                        _a.data = _b;
+                        _c.label = 5;
+                    case 5: return [2 /*return*/, this.data];
+                }
+            });
+        });
+    };
+    NsisVersionInfo.prototype.updateLatestVersion = function () {
+        if (this.data.versions.length == 0) {
+            return;
+        }
+        var versions = this.data.versions.slice();
+        versions.sort(function (a, b) { return semver.gt(a.version, b.version) ? -1 : 1; });
+        this.data.latest = versions[0].version;
+    };
+    NsisVersionInfo.prototype.hashFile = function (type, path) {
+        return new Promise(function (resolve, reject) {
+            var hasher = crypto_1.createHash(type);
+            hasher.on('error', reject);
+            hasher.on('readable', function () {
+                var data = hasher.read();
+                if (data) {
+                    hasher.end();
+                    resolve(data.toString('hex'));
+                }
+            });
+            fs_extra_1.createReadStream(path).pipe(hasher);
+        });
+    };
+    return NsisVersionInfo;
+}());
+exports.NsisVersionInfo = NsisVersionInfo;
+//# sourceMappingURL=NsisVersionInfo.js.map

ファイルの差分が大きいため隠しています
+ 1 - 0
dist/lib/common/NsisVersionInfo.js.map


+ 3 - 0
dist/lib/common/index.d.ts

@@ -0,0 +1,3 @@
+export * from './Event';
+export * from './DownloaderBase';
+export * from './NsisVersionInfo';

+ 9 - 0
dist/lib/common/index.js

@@ -0,0 +1,9 @@
+"use strict";
+function __export(m) {
+    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
+}
+Object.defineProperty(exports, "__esModule", { value: true });
+__export(require("./Event"));
+__export(require("./DownloaderBase"));
+__export(require("./NsisVersionInfo"));
+//# sourceMappingURL=index.js.map

+ 1 - 0
dist/lib/common/index.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/common/index.ts"],"names":[],"mappings":";;;;;AACA,6BAAwB;AACxB,sCAAiC;AACjC,uCAAkC"}

+ 23 - 0
dist/lib/config/BuildConfig.d.ts

@@ -0,0 +1,23 @@
+import { WinConfig } from './WinConfig';
+import { MacConfig } from './MacConfig';
+import { LinuxConfig } from './LinuxConfig';
+import { NsisConfig } from './NsisConfig';
+export declare class BuildConfig {
+    nwVersion: string;
+    nwFlavor: string;
+    output: string;
+    outputPattern: string;
+    packed: boolean;
+    targets: string[];
+    files: string[];
+    excludes: string[];
+    win: WinConfig;
+    mac: MacConfig;
+    linux: LinuxConfig;
+    nsis: NsisConfig;
+    appId: string;
+    ffmpegIntegration: boolean;
+    strippedProperties: string[];
+    overriddenProperties: any;
+    constructor(pkg?: any);
+}

+ 81 - 0
dist/lib/config/BuildConfig.js

@@ -0,0 +1,81 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var path_1 = require("path");
+var WinConfig_1 = require("./WinConfig");
+var MacConfig_1 = require("./MacConfig");
+var LinuxConfig_1 = require("./LinuxConfig");
+var NsisConfig_1 = require("./NsisConfig");
+var BuildConfig = /** @class */ (function () {
+    function BuildConfig(pkg) {
+        if (pkg === void 0) { pkg = {}; }
+        var _this = this;
+        this.nwVersion = 'lts';
+        this.nwFlavor = 'normal';
+        this.output = './dist/';
+        this.outputPattern = '${NAME}-${VERSION}-${PLATFORM}-${ARCH}';
+        this.packed = false;
+        this.targets = [];
+        this.files = ['**/*'];
+        this.excludes = [];
+        this.win = new WinConfig_1.WinConfig();
+        this.mac = new MacConfig_1.MacConfig();
+        this.linux = new LinuxConfig_1.LinuxConfig();
+        this.nsis = new NsisConfig_1.NsisConfig();
+        this.appId = undefined;
+        this.ffmpegIntegration = false;
+        this.strippedProperties = ['scripts', 'devDependencies', 'build'];
+        this.overriddenProperties = {};
+        var options = pkg.build ? pkg.build : {};
+        Object.keys(this).map(function (key) {
+            if (options[key] !== undefined) {
+                switch (key) {
+                    case 'win':
+                        _this.win = new WinConfig_1.WinConfig(options.win);
+                        break;
+                    case 'mac':
+                        _this.mac = new MacConfig_1.MacConfig(options.mac);
+                        break;
+                    case 'linux':
+                        _this.linux = new LinuxConfig_1.LinuxConfig(options.linux);
+                        break;
+                    case 'nsis':
+                        _this.nsis = new NsisConfig_1.NsisConfig(options.nsis);
+                        break;
+                    default:
+                        _this[key] = options[key];
+                        break;
+                }
+            }
+        });
+        this.output = path_1.normalize(this.output);
+        this.appId = this.appId ? this.appId : "io.github.nwjs." + pkg.name;
+        if (this.win.versionStrings.ProductName && !this.win.productName) {
+            console.warn('DEPRECATED: build.win.versionStrings.ProductName is deprecated, use build.win.productName instead.');
+            this.win.productName = this.win.versionStrings.ProductName;
+        }
+        if (this.win.versionStrings.CompanyName && !this.win.companyName) {
+            console.warn('DEPRECATED: build.win.versionStrings.CompanyName is deprecated, use build.win.companyName instead.');
+            this.win.companyName = this.win.versionStrings.CompanyName;
+        }
+        if (this.win.versionStrings.FileDescription && !this.win.fileDescription) {
+            console.warn('DEPRECATED: build.win.versionStrings.FileDescription is deprecated, use build.win.fileDescription instead.');
+            this.win.fileDescription = this.win.versionStrings.FileDescription;
+        }
+        if (this.win.versionStrings.LegalCopyright && !this.win.copyright) {
+            console.warn('DEPRECATED: build.win.versionStrings.LegalCopyright is deprecated, use build.win.copyright instead.');
+            this.win.copyright = this.win.versionStrings.LegalCopyright;
+        }
+        this.win.productName = this.win.productName ? this.win.productName : pkg.name;
+        this.win.companyName = this.win.companyName ? this.win.companyName : this.win.productName;
+        this.win.fileDescription = this.win.fileDescription ? this.win.fileDescription : pkg.description;
+        this.win.productVersion = this.win.productVersion ? this.win.productVersion : pkg.version;
+        this.win.fileVersion = this.win.fileVersion ? this.win.fileVersion : this.win.productVersion;
+        this.mac.name = this.mac.name ? this.mac.name : pkg.name;
+        this.mac.displayName = this.mac.displayName ? this.mac.displayName : this.mac.name;
+        this.mac.version = this.mac.version ? this.mac.version : pkg.version;
+        this.mac.description = this.mac.description ? this.mac.description : pkg.description;
+    }
+    return BuildConfig;
+}());
+exports.BuildConfig = BuildConfig;
+//# sourceMappingURL=BuildConfig.js.map

ファイルの差分が大きいため隠しています
+ 1 - 0
dist/lib/config/BuildConfig.js.map


+ 3 - 0
dist/lib/config/LinuxConfig.d.ts

@@ -0,0 +1,3 @@
+export declare class LinuxConfig {
+    constructor(options?: any);
+}

+ 20 - 0
dist/lib/config/LinuxConfig.js

@@ -0,0 +1,20 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var LinuxConfig = /** @class */ (function () {
+    function LinuxConfig(options) {
+        if (options === void 0) { options = {}; }
+        var _this = this;
+        Object.keys(this).map(function (key) {
+            if (options[key] !== undefined) {
+                switch (key) {
+                    default:
+                        _this[key] = options[key];
+                        break;
+                }
+            }
+        });
+    }
+    return LinuxConfig;
+}());
+exports.LinuxConfig = LinuxConfig;
+//# sourceMappingURL=LinuxConfig.js.map

+ 1 - 0
dist/lib/config/LinuxConfig.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"LinuxConfig.js","sourceRoot":"","sources":["../../../src/lib/config/LinuxConfig.ts"],"names":[],"mappings":";;AACA;IAEI,qBAAY,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QAA7B,iBAYC;QAVG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,UAAC,GAAG;YACtB,IAAG,OAAO,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE;gBAC3B,QAAO,GAAG,EAAE;oBACZ;wBACU,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;wBAChC,MAAM;iBACT;aACJ;QACL,CAAC,CAAC,CAAC;IAEP,CAAC;IAEL,kBAAC;AAAD,CAAC,AAhBD,IAgBC;AAhBY,kCAAW"}

+ 11 - 0
dist/lib/config/MacConfig.d.ts

@@ -0,0 +1,11 @@
+export declare class MacConfig {
+    name: string;
+    displayName: string;
+    version: string;
+    description: string;
+    copyright: string;
+    icon: string;
+    documentIcon: string;
+    plistStrings: any;
+    constructor(options?: any);
+}

+ 28 - 0
dist/lib/config/MacConfig.js

@@ -0,0 +1,28 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var MacConfig = /** @class */ (function () {
+    function MacConfig(options) {
+        if (options === void 0) { options = {}; }
+        var _this = this;
+        this.name = '';
+        this.displayName = '';
+        this.version = '';
+        this.description = '';
+        this.copyright = '';
+        this.icon = undefined;
+        this.documentIcon = undefined;
+        this.plistStrings = {};
+        Object.keys(this).map(function (key) {
+            if (options[key] !== undefined) {
+                switch (key) {
+                    default:
+                        _this[key] = options[key];
+                        break;
+                }
+            }
+        });
+    }
+    return MacConfig;
+}());
+exports.MacConfig = MacConfig;
+//# sourceMappingURL=MacConfig.js.map

ファイルの差分が大きいため隠しています
+ 1 - 0
dist/lib/config/MacConfig.js.map


+ 9 - 0
dist/lib/config/NsisConfig.d.ts

@@ -0,0 +1,9 @@
+export declare class NsisConfig {
+    icon: string;
+    unIcon: string;
+    languages: string[];
+    installDirectory: string;
+    diffUpdaters: boolean;
+    hashCalculation: boolean;
+    constructor(options?: any);
+}

+ 26 - 0
dist/lib/config/NsisConfig.js

@@ -0,0 +1,26 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var NsisConfig = /** @class */ (function () {
+    function NsisConfig(options) {
+        if (options === void 0) { options = {}; }
+        var _this = this;
+        this.icon = undefined;
+        this.unIcon = undefined;
+        this.languages = ['English'];
+        this.installDirectory = '$LOCALAPPDATA\\${_APPNAME}';
+        this.diffUpdaters = false;
+        this.hashCalculation = true;
+        Object.keys(this).map(function (key) {
+            if (options[key] !== undefined) {
+                switch (key) {
+                    default:
+                        _this[key] = options[key];
+                        break;
+                }
+            }
+        });
+    }
+    return NsisConfig;
+}());
+exports.NsisConfig = NsisConfig;
+//# sourceMappingURL=NsisConfig.js.map

ファイルの差分が大きいため隠しています
+ 1 - 0
dist/lib/config/NsisConfig.js.map


+ 16 - 0
dist/lib/config/WinConfig.d.ts

@@ -0,0 +1,16 @@
+export declare class WinConfig {
+    productName: string;
+    companyName: string;
+    fileDescription: string;
+    productVersion: string;
+    fileVersion: string;
+    copyright: string;
+    versionStrings: {
+        ProductName?: undefined;
+        CompanyName?: undefined;
+        FileDescription?: undefined;
+        LegalCopyright?: undefined;
+    };
+    icon: string;
+    constructor(options?: any);
+}

+ 28 - 0
dist/lib/config/WinConfig.js

@@ -0,0 +1,28 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var WinConfig = /** @class */ (function () {
+    function WinConfig(options) {
+        if (options === void 0) { options = {}; }
+        var _this = this;
+        this.productName = '';
+        this.companyName = '';
+        this.fileDescription = '';
+        this.productVersion = '';
+        this.fileVersion = '';
+        this.copyright = '';
+        this.versionStrings = {};
+        this.icon = undefined;
+        Object.keys(this).map(function (key) {
+            if (options[key] !== undefined) {
+                switch (key) {
+                    default:
+                        _this[key] = options[key];
+                        break;
+                }
+            }
+        });
+    }
+    return WinConfig;
+}());
+exports.WinConfig = WinConfig;
+//# sourceMappingURL=WinConfig.js.map

ファイルの差分が大きいため隠しています
+ 1 - 0
dist/lib/config/WinConfig.js.map


+ 5 - 0
dist/lib/config/index.d.ts

@@ -0,0 +1,5 @@
+export * from './BuildConfig';
+export * from './WinConfig';
+export * from './MacConfig';
+export * from './LinuxConfig';
+export * from './NsisConfig';

+ 11 - 0
dist/lib/config/index.js

@@ -0,0 +1,11 @@
+"use strict";
+function __export(m) {
+    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
+}
+Object.defineProperty(exports, "__esModule", { value: true });
+__export(require("./BuildConfig"));
+__export(require("./WinConfig"));
+__export(require("./MacConfig"));
+__export(require("./LinuxConfig"));
+__export(require("./NsisConfig"));
+//# sourceMappingURL=index.js.map

+ 1 - 0
dist/lib/config/index.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/config/index.ts"],"names":[],"mappings":";;;;;AACA,mCAA8B;AAC9B,iCAA4B;AAC5B,iCAA4B;AAC5B,mCAA8B;AAC9B,kCAA6B"}

+ 5 - 0
dist/lib/index.d.ts

@@ -0,0 +1,5 @@
+import 'source-map-support/register';
+export * from './Runner';
+export * from './Builder';
+export * from './Downloader';
+export { findExecutable } from './util';

+ 12 - 0
dist/lib/index.js

@@ -0,0 +1,12 @@
+"use strict";
+function __export(m) {
+    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
+}
+Object.defineProperty(exports, "__esModule", { value: true });
+require("source-map-support/register");
+__export(require("./Runner"));
+__export(require("./Builder"));
+__export(require("./Downloader"));
+var util_1 = require("./util");
+exports.findExecutable = util_1.findExecutable;
+//# sourceMappingURL=index.js.map

+ 1 - 0
dist/lib/index.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":";;;;;AACA,uCAAqC;AAErC,8BAAyB;AACzB,+BAA0B;AAC1B,kCAA6B;AAC7B,+BAAwC;AAA/B,gCAAA,cAAc,CAAA"}

+ 6 - 0
dist/lib/nsis-gen/Nsis7Zipper.d.ts

@@ -0,0 +1,6 @@
+import { NsisComposer, INsisComposerOptions } from './NsisComposer';
+export declare class Nsis7Zipper extends NsisComposer {
+    protected path: string;
+    constructor(path: string, options: INsisComposerOptions);
+    protected makeInstallerFiles(): Promise<string>;
+}

+ 67 - 0
dist/lib/nsis-gen/Nsis7Zipper.js

@@ -0,0 +1,67 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = Object.setPrototypeOf ||
+        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+    return new (P || (P = Promise))(function (resolve, reject) {
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+        step((generator = generator.apply(thisArg, _arguments || [])).next());
+    });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+    function verb(n) { return function (v) { return step([n, v]); }; }
+    function step(op) {
+        if (f) throw new TypeError("Generator is already executing.");
+        while (_) try {
+            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+            if (y = 0, t) op = [op[0] & 2, t.value];
+            switch (op[0]) {
+                case 0: case 1: t = op; break;
+                case 4: _.label++; return { value: op[1], done: false };
+                case 5: _.label++; y = op[1]; op = [0]; continue;
+                case 7: op = _.ops.pop(); _.trys.pop(); continue;
+                default:
+                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+                    if (t[2]) _.ops.pop();
+                    _.trys.pop(); continue;
+            }
+            op = body.call(thisArg, _);
+        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+    }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var path_1 = require("path");
+var NsisComposer_1 = require("./NsisComposer");
+var Nsis7Zipper = /** @class */ (function (_super) {
+    __extends(Nsis7Zipper, _super);
+    function Nsis7Zipper(path, options) {
+        var _this = _super.call(this, (options.solid = false, options)) || this;
+        _this.path = path;
+        return _this;
+    }
+    Nsis7Zipper.prototype.makeInstallerFiles = function () {
+        return __awaiter(this, void 0, void 0, function () {
+            return __generator(this, function (_a) {
+                return [2 /*return*/, "SetOutPath \"$INSTDIR\"\nSetCompress off\nFile \"" + path_1.win32.normalize(path_1.resolve(this.path)) + "\"\nNsis7z::ExtractWithDetails \"$OUTDIR\\" + path_1.basename(this.path) + "\" \"$(INSTALLING) %s...\"\nDelete \"$OUTDIR\\" + path_1.basename(this.path) + "\""];
+            });
+        });
+    };
+    return Nsis7Zipper;
+}(NsisComposer_1.NsisComposer));
+exports.Nsis7Zipper = Nsis7Zipper;
+//# sourceMappingURL=Nsis7Zipper.js.map

ファイルの差分が大きいため隠しています
+ 1 - 0
dist/lib/nsis-gen/Nsis7Zipper.js.map


+ 30 - 0
dist/lib/nsis-gen/NsisComposer.d.ts

@@ -0,0 +1,30 @@
+export interface INsisComposerOptions {
+    appName: string;
+    companyName: string;
+    description: string;
+    version: string;
+    copyright: string;
+    icon: string;
+    unIcon: string;
+    compression: 'zlib' | 'bzip2' | 'lzma';
+    solid: boolean;
+    languages: string[];
+    installDirectory: string;
+    output: string;
+}
+export declare class NsisComposer {
+    protected options: INsisComposerOptions;
+    static DIVIDER: string;
+    static STRINGS: any;
+    protected fixedVersion: string;
+    constructor(options: INsisComposerOptions);
+    make(): Promise<string>;
+    protected makeStrings(): Promise<string>;
+    protected makeGeneral(): Promise<string>;
+    protected makeModernUI(): Promise<string>;
+    protected makeVersioning(): Promise<string>;
+    protected makeHooks(): Promise<string>;
+    protected makeInstallSection(): Promise<string>;
+    protected makeUninstallSection(): Promise<string>;
+    protected makeInstallerFiles(): Promise<string>;
+}

ファイルの差分が大きいため隠しています
+ 179 - 0
dist/lib/nsis-gen/NsisComposer.js


ファイルの差分が大きいため隠しています
+ 1 - 0
dist/lib/nsis-gen/NsisComposer.js.map


+ 10 - 0
dist/lib/nsis-gen/NsisDiffer.d.ts

@@ -0,0 +1,10 @@
+import { NsisComposer, INsisComposerOptions } from './NsisComposer';
+export declare class NsisDiffer extends NsisComposer {
+    protected fromDir: string;
+    protected toDir: string;
+    constructor(fromDir: string, toDir: string, options: INsisComposerOptions);
+    protected makeInstallerFiles(): Promise<string>;
+    protected makeRemoveFile(rootDir: string, relativeDir: string, filename: string): Promise<string>;
+    protected makeWriteFile(rootDir: string, relativeDir: string, filename: string): Promise<string>;
+    protected makeRemoveDir(rootDir: string, relativeDir: string, filename: string): Promise<string>;
+}

+ 135 - 0
dist/lib/nsis-gen/NsisDiffer.js

@@ -0,0 +1,135 @@
+"use strict";
+var __extends = (this && this.__extends) || (function () {
+    var extendStatics = Object.setPrototypeOf ||
+        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+    return function (d, b) {
+        extendStatics(d, b);
+        function __() { this.constructor = d; }
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+    };
+})();
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+    return new (P || (P = Promise))(function (resolve, reject) {
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+        step((generator = generator.apply(thisArg, _arguments || [])).next());
+    });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+    function verb(n) { return function (v) { return step([n, v]); }; }
+    function step(op) {
+        if (f) throw new TypeError("Generator is already executing.");
+        while (_) try {
+            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+            if (y = 0, t) op = [op[0] & 2, t.value];
+            switch (op[0]) {
+                case 0: case 1: t = op; break;
+                case 4: _.label++; return { value: op[1], done: false };
+                case 5: _.label++; y = op[1]; op = [0]; continue;
+                case 7: op = _.ops.pop(); _.trys.pop(); continue;
+                default:
+                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+                    if (t[2]) _.ops.pop();
+                    _.trys.pop(); continue;
+            }
+            op = body.call(thisArg, _);
+        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+    }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var path_1 = require("path");
+var dircompare = require('dir-compare');
+var NsisComposer_1 = require("./NsisComposer");
+var NsisDiffer = /** @class */ (function (_super) {
+    __extends(NsisDiffer, _super);
+    function NsisDiffer(fromDir, toDir, options) {
+        var _this = _super.call(this, options) || this;
+        _this.fromDir = fromDir;
+        _this.toDir = toDir;
+        return _this;
+    }
+    // Overrided, https://github.com/Microsoft/TypeScript/issues/2000.
+    NsisDiffer.prototype.makeInstallerFiles = function () {
+        return __awaiter(this, void 0, void 0, function () {
+            var result, lines, _i, _a, diff, _b, _c, _d, _e, _f, _g, _h, _j;
+            return __generator(this, function (_k) {
+                switch (_k.label) {
+                    case 0: return [4 /*yield*/, dircompare.compare(this.fromDir, this.toDir, {
+                            compareContent: true,
+                        })];
+                    case 1:
+                        result = _k.sent();
+                        lines = [];
+                        _i = 0, _a = result.diffSet;
+                        _k.label = 2;
+                    case 2:
+                        if (!(_i < _a.length)) return [3 /*break*/, 11];
+                        diff = _a[_i];
+                        if (!(diff.type1 == 'missing' && diff.type2 == 'file')) return [3 /*break*/, 4];
+                        _c = (_b = lines).push;
+                        return [4 /*yield*/, this.makeWriteFile(diff.path2, '.' + diff.relativePath, diff.name2)];
+                    case 3:
+                        _c.apply(_b, [_k.sent()]);
+                        return [3 /*break*/, 10];
+                    case 4:
+                        if (!(diff.type1 == 'file' && diff.type2 == 'missing')) return [3 /*break*/, 6];
+                        _e = (_d = lines).push;
+                        return [4 /*yield*/, this.makeRemoveFile(diff.path1, '.' + diff.relativePath, diff.name1)];
+                    case 5:
+                        _e.apply(_d, [_k.sent()]);
+                        return [3 /*break*/, 10];
+                    case 6:
+                        if (!(diff.type1 == 'directory' && diff.type2 == 'missing')) return [3 /*break*/, 8];
+                        _g = (_f = lines).push;
+                        return [4 /*yield*/, this.makeRemoveDir(diff.path1, '.' + diff.relativePath, diff.name1)];
+                    case 7:
+                        _g.apply(_f, [_k.sent()]);
+                        return [3 /*break*/, 10];
+                    case 8:
+                        if (!(diff.type1 == 'file' && diff.type2 == 'file' && diff.state == 'distinct')) return [3 /*break*/, 10];
+                        _j = (_h = lines).push;
+                        return [4 /*yield*/, this.makeWriteFile(diff.path2, '.' + diff.relativePath, diff.name2)];
+                    case 9:
+                        _j.apply(_h, [_k.sent()]);
+                        _k.label = 10;
+                    case 10:
+                        _i++;
+                        return [3 /*break*/, 2];
+                    case 11: return [2 /*return*/, lines.join('\n')];
+                }
+            });
+        });
+    };
+    NsisDiffer.prototype.makeRemoveFile = function (rootDir, relativeDir, filename) {
+        return __awaiter(this, void 0, void 0, function () {
+            return __generator(this, function (_a) {
+                return [2 /*return*/, "Delete \"$INSTDIR\\" + path_1.win32.normalize(path_1.join(relativeDir, filename)) + "\""];
+            });
+        });
+    };
+    NsisDiffer.prototype.makeWriteFile = function (rootDir, relativeDir, filename) {
+        return __awaiter(this, void 0, void 0, function () {
+            return __generator(this, function (_a) {
+                return [2 /*return*/, "SetOutPath \"$INSTDIR\\" + path_1.win32.normalize(relativeDir) + "\"\nFile \"" + path_1.win32.normalize(path_1.resolve(rootDir, filename)) + "\""];
+            });
+        });
+    };
+    NsisDiffer.prototype.makeRemoveDir = function (rootDir, relativeDir, filename) {
+        return __awaiter(this, void 0, void 0, function () {
+            return __generator(this, function (_a) {
+                return [2 /*return*/, "RMDir /r \"$INSTDIR\\" + path_1.win32.normalize(path_1.join(relativeDir, filename)) + "\""];
+            });
+        });
+    };
+    return NsisDiffer;
+}(NsisComposer_1.NsisComposer));
+exports.NsisDiffer = NsisDiffer;
+//# sourceMappingURL=NsisDiffer.js.map

ファイルの差分が大きいため隠しています
+ 1 - 0
dist/lib/nsis-gen/NsisDiffer.js.map


+ 7 - 0
dist/lib/nsis-gen/index.d.ts

@@ -0,0 +1,7 @@
+export * from './NsisComposer';
+export * from './NsisDiffer';
+export * from './Nsis7Zipper';
+export interface INsisBuildOptions {
+    mute: boolean;
+}
+export declare function nsisBuild(cwd: string, script: string, options?: INsisBuildOptions): Promise<void>;

+ 85 - 0
dist/lib/nsis-gen/index.js

@@ -0,0 +1,85 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+    return new (P || (P = Promise))(function (resolve, reject) {
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+        step((generator = generator.apply(thisArg, _arguments || [])).next());
+    });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+    function verb(n) { return function (v) { return step([n, v]); }; }
+    function step(op) {
+        if (f) throw new TypeError("Generator is already executing.");
+        while (_) try {
+            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+            if (y = 0, t) op = [op[0] & 2, t.value];
+            switch (op[0]) {
+                case 0: case 1: t = op; break;
+                case 4: _.label++; return { value: op[1], done: false };
+                case 5: _.label++; y = op[1]; op = [0]; continue;
+                case 7: op = _.ops.pop(); _.trys.pop(); continue;
+                default:
+                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+                    if (t[2]) _.ops.pop();
+                    _.trys.pop(); continue;
+            }
+            op = body.call(thisArg, _);
+        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+    }
+};
+function __export(m) {
+    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
+}
+Object.defineProperty(exports, "__esModule", { value: true });
+var path_1 = require("path");
+var child_process_1 = require("child_process");
+__export(require("./NsisComposer"));
+__export(require("./NsisDiffer"));
+__export(require("./Nsis7Zipper"));
+var DIR_ASSETS = path_1.resolve(path_1.dirname(module.filename), '../../../assets/');
+var DIR_NSIS = path_1.resolve(DIR_ASSETS, 'nsis');
+function nsisBuild(cwd, script, options) {
+    if (options === void 0) { options = {
+        mute: false,
+    }; }
+    return __awaiter(this, void 0, void 0, function () {
+        var args, child;
+        return __generator(this, function (_a) {
+            switch (_a.label) {
+                case 0:
+                    args = [path_1.win32.normalize(path_1.resolve(DIR_NSIS, 'makensis.exe')), '/NOCD', '/INPUTCHARSET', 'UTF8', path_1.win32.normalize(path_1.resolve(script))];
+                    if (process.platform != 'win32') {
+                        args.unshift('wine');
+                    }
+                    child = child_process_1.spawn(args.shift(), args, {
+                        cwd: cwd,
+                    });
+                    return [4 /*yield*/, new Promise(function (resolve, reject) {
+                            child.on('error', reject);
+                            child.on('close', function (code, signal) {
+                                if (code != 0) {
+                                    return reject(new Error("ERROR_EXIT_CODE code = " + code));
+                                }
+                                resolve({ code: code, signal: signal });
+                            });
+                            if (!options.mute) {
+                                child.stdout.pipe(process.stdout);
+                                child.stderr.pipe(process.stderr);
+                            }
+                        })];
+                case 1:
+                    _a.sent();
+                    return [2 /*return*/];
+            }
+        });
+    });
+}
+exports.nsisBuild = nsisBuild;
+//# sourceMappingURL=index.js.map

ファイルの差分が大きいため隠しています
+ 1 - 0
dist/lib/nsis-gen/index.js.map


+ 5 - 0
dist/lib/util/archive.d.ts

@@ -0,0 +1,5 @@
+export interface IExtractOptions {
+    overwrite: boolean;
+}
+export declare function extractGeneric(archive: string, dest?: string, options?: IExtractOptions): Promise<string>;
+export declare function compress(dir: string, files: string[], type: string, archive: string): Promise<number>;

+ 150 - 0
dist/lib/util/archive.js

@@ -0,0 +1,150 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+    return new (P || (P = Promise))(function (resolve, reject) {
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+        step((generator = generator.apply(thisArg, _arguments || [])).next());
+    });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+    function verb(n) { return function (v) { return step([n, v]); }; }
+    function step(op) {
+        if (f) throw new TypeError("Generator is already executing.");
+        while (_) try {
+            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+            if (y = 0, t) op = [op[0] & 2, t.value];
+            switch (op[0]) {
+                case 0: case 1: t = op; break;
+                case 4: _.label++; return { value: op[1], done: false };
+                case 5: _.label++; y = op[1]; op = [0]; continue;
+                case 7: op = _.ops.pop(); _.trys.pop(); continue;
+                default:
+                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+                    if (t[2]) _.ops.pop();
+                    _.trys.pop(); continue;
+            }
+            op = body.call(thisArg, _);
+        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+    }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var path_1 = require("path");
+var fs_extra_1 = require("fs-extra");
+var _7zip_bin_1 = require("7zip-bin");
+var debug = require('debug')('build:archive');
+var _1 = require("./");
+function extract(archive, dest, options) {
+    if (dest === void 0) { dest = path_1.dirname(archive); }
+    if (options === void 0) { options = {
+        overwrite: false,
+    }; }
+    return __awaiter(this, void 0, void 0, function () {
+        var _a, code, signal;
+        return __generator(this, function (_b) {
+            switch (_b.label) {
+                case 0:
+                    debug('in extract', 'archive', archive);
+                    debug('in extract', 'dest', dest);
+                    return [4 /*yield*/, _1.spawnAsync(_7zip_bin_1.path7za, ['x', '-y', "-ao" + (options.overwrite ? 'a' : 's'), "-o" + path_1.resolve(dest), path_1.resolve(archive)])];
+                case 1:
+                    _a = _b.sent(), code = _a.code, signal = _a.signal;
+                    if (code != 0) {
+                        throw new Error("ERROR_EXTRACTING path = " + archive);
+                    }
+                    return [2 /*return*/, dest];
+            }
+        });
+    });
+}
+function extractTarGz(archive, dest, options) {
+    if (dest === void 0) { dest = path_1.dirname(archive); }
+    if (options === void 0) { options = {
+        overwrite: false,
+    }; }
+    return __awaiter(this, void 0, void 0, function () {
+        var tar;
+        return __generator(this, function (_a) {
+            switch (_a.label) {
+                case 0:
+                    tar = path_1.join(dest, path_1.basename(archive.slice(0, -3)));
+                    return [4 /*yield*/, extract(archive, dest, {
+                            overwrite: true,
+                        })];
+                case 1:
+                    _a.sent();
+                    return [4 /*yield*/, extract(tar, dest)];
+                case 2:
+                    _a.sent();
+                    return [4 /*yield*/, fs_extra_1.remove(tar)];
+                case 3:
+                    _a.sent();
+                    return [2 /*return*/, dest];
+            }
+        });
+    });
+}
+function extractGeneric(archive, dest, options) {
+    if (dest === void 0) { dest = path_1.dirname(archive); }
+    if (options === void 0) { options = {
+        overwrite: false,
+    }; }
+    return __awaiter(this, void 0, void 0, function () {
+        return __generator(this, function (_a) {
+            switch (_a.label) {
+                case 0:
+                    if (!archive.endsWith('.zip')) return [3 /*break*/, 2];
+                    return [4 /*yield*/, extract(archive, dest, options)];
+                case 1:
+                    _a.sent();
+                    return [3 /*break*/, 5];
+                case 2:
+                    if (!archive.endsWith('tar.gz')) return [3 /*break*/, 4];
+                    return [4 /*yield*/, extractTarGz(archive, dest, options)];
+                case 3:
+                    _a.sent();
+                    return [3 /*break*/, 5];
+                case 4: throw new Error('ERROR_UNKNOWN_EXTENSION');
+                case 5: return [2 /*return*/, dest];
+            }
+        });
+    });
+}
+exports.extractGeneric = extractGeneric;
+function compress(dir, files, type, archive) {
+    return __awaiter(this, void 0, void 0, function () {
+        var listfiles, _a, code, signal;
+        return __generator(this, function (_b) {
+            switch (_b.label) {
+                case 0:
+                    debug('in compress', 'dir', dir);
+                    debug('in compress', 'files', files);
+                    debug('in compress', 'type', type);
+                    debug('in compress', 'archive', archive);
+                    return [4 /*yield*/, _1.tmpFile({
+                            discardDescriptor: true,
+                        })];
+                case 1:
+                    listfiles = (_b.sent()).path;
+                    debug('in compress', 'listfiles', listfiles);
+                    return [4 /*yield*/, fs_extra_1.writeFile(listfiles, files.map(function (file) { return path_1.normalize(file); }).join('\r\n'))];
+                case 2:
+                    _b.sent();
+                    return [4 /*yield*/, _1.spawnAsync(_7zip_bin_1.path7za, ['a', "-t" + type, path_1.resolve(archive), "@" + path_1.resolve(listfiles)], {
+                            cwd: dir,
+                        })];
+                case 3:
+                    _a = _b.sent(), code = _a.code, signal = _a.signal;
+                    return [2 /*return*/, code];
+            }
+        });
+    });
+}
+exports.compress = compress;
+//# sourceMappingURL=archive.js.map

ファイルの差分が大きいため隠しています
+ 1 - 0
dist/lib/util/archive.js.map


+ 26 - 0
dist/lib/util/index.d.ts

@@ -0,0 +1,26 @@
+export * from './archive';
+export declare function mergeOptions(defaults: any, options: any): any;
+export declare function findExecutable(platform: string, runtimeDir: string): Promise<string>;
+export declare function findFFmpeg(platform: string, dir: string): Promise<string>;
+export declare function findRuntimeRoot(platform: string, runtimeDir: string): Promise<string>;
+export declare function findExcludableDependencies(dir: string, pkg: any): Promise<string[]>;
+export declare function tmpName(options?: any): Promise<string>;
+export declare function tmpFile(options?: any): Promise<{
+    path: string;
+    fd: number;
+    cleanup: () => void;
+}>;
+export declare function tmpDir(options?: any): Promise<{
+    path: string;
+    cleanup: () => void;
+}>;
+export declare function fixWindowsVersion(version: string, build?: number): string;
+export declare function copyFileAsync(src: string, dest: string): Promise<void>;
+export declare function spawnAsync(executable: string, args: string[], options?: any): Promise<{
+    code: number;
+    signal: string;
+}>;
+export declare function execAsync(command: string, options?: any): Promise<{
+    stdout: string;
+    stderr: string;
+}>;

+ 318 - 0
dist/lib/util/index.js

@@ -0,0 +1,318 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+    return new (P || (P = Promise))(function (resolve, reject) {
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+        step((generator = generator.apply(thisArg, _arguments || [])).next());
+    });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+    function verb(n) { return function (v) { return step([n, v]); }; }
+    function step(op) {
+        if (f) throw new TypeError("Generator is already executing.");
+        while (_) try {
+            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
+            if (y = 0, t) op = [op[0] & 2, t.value];
+            switch (op[0]) {
+                case 0: case 1: t = op; break;
+                case 4: _.label++; return { value: op[1], done: false };
+                case 5: _.label++; y = op[1]; op = [0]; continue;
+                case 7: op = _.ops.pop(); _.trys.pop(); continue;
+                default:
+                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+                    if (t[2]) _.ops.pop();
+                    _.trys.pop(); continue;
+            }
+            op = body.call(thisArg, _);
+        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+    }
+};
+function __export(m) {
+    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
+}
+Object.defineProperty(exports, "__esModule", { value: true });
+var path_1 = require("path");
+var child_process_1 = require("child_process");
+var tmp = require("tmp");
+tmp.setGracefulCleanup();
+var fs_extra_1 = require("fs-extra");
+var debug = require('debug')('build:util');
+var globby = require('globby');
+__export(require("./archive"));
+function mergeOptions(defaults, options) {
+    var opts = {};
+    Object.keys(defaults).map(function (key) {
+        opts[key] = defaults[key];
+    });
+    Object.keys(defaults).map(function (key) {
+        opts[key] = options[key] === undefined ? opts[key] : options[key];
+    });
+    return opts;
+}
+exports.mergeOptions = mergeOptions;
+function findExecutable(platform, runtimeDir) {
+    return new Promise(function (resolve, reject) {
+        var pattern = (function () {
+            switch (platform) {
+                case 'win32':
+                case 'win':
+                    return '**/nw.exe';
+                case 'darwin':
+                case 'osx':
+                case 'mac':
+                    return '**/nwjs.app/Contents/MacOS/nwjs';
+                case 'linux':
+                    return '**/nw';
+                default:
+                    throw new Error('ERROR_UNKNOWN_PLATFORM');
+            }
+        })();
+        // FIXME: globby.d.ts.
+        globby([pattern], {
+            cwd: runtimeDir,
+        })
+            .then(function (matches) {
+            if (matches.length == 0) {
+                var err = new Error('ERROR_EMPTY_MATCHES');
+                return reject(err);
+            }
+            debug('in findExecutable', 'matches', matches);
+            resolve(path_1.join(runtimeDir, matches[0]));
+        });
+    });
+}
+exports.findExecutable = findExecutable;
+function findFFmpeg(platform, dir) {
+    return new Promise(function (resolve, reject) {
+        var pattern = (function () {
+            switch (platform) {
+                case 'win32':
+                case 'win':
+                    return '**/ffmpeg.dll';
+                case 'darwin':
+                case 'osx':
+                case 'mac':
+                    return '**/libffmpeg.dylib';
+                case 'linux':
+                    return '**/libffmpeg.so';
+                default:
+                    throw new Error('ERROR_UNKNOWN_PLATFORM');
+            }
+        })();
+        // FIXME: globby.d.ts.
+        globby([pattern], {
+            cwd: dir,
+        })
+            .then(function (matches) {
+            if (matches.length == 0) {
+                var err = new Error('ERROR_EMPTY_MATCHES');
+                return reject(err);
+            }
+            debug('in findFFmpeg', 'matches', matches);
+            resolve(path_1.join(dir, matches[0]));
+        });
+    });
+}
+exports.findFFmpeg = findFFmpeg;
+function findRuntimeRoot(platform, runtimeDir) {
+    return new Promise(function (resolve, reject) {
+        var pattern = (function () {
+            switch (platform) {
+                case 'win32':
+                case 'win':
+                    return '**/nw.exe';
+                case 'darwin':
+                case 'osx':
+                case 'mac':
+                    return '**/nwjs.app';
+                case 'linux':
+                    return '**/nw';
+                default:
+                    throw new Error('ERROR_UNKNOWN_PLATFORM');
+            }
+        })();
+        // FIXME: globby.d.ts.
+        globby([pattern], {
+            cwd: runtimeDir,
+        })
+            .then(function (matches) {
+            if (matches.length == 0) {
+                var err = new Error('ERROR_EMPTY_MATCHES');
+                return reject(err);
+            }
+            debug('in findExecutable', 'matches', matches);
+            resolve(path_1.join(runtimeDir, path_1.dirname(matches[0])));
+        });
+    });
+}
+exports.findRuntimeRoot = findRuntimeRoot;
+function findExcludableDependencies(dir, pkg) {
+    return __awaiter(this, void 0, void 0, function () {
+        var prod, dev, excludable, _i, dev_1, d;
+        return __generator(this, function (_a) {
+            switch (_a.label) {
+                case 0: return [4 /*yield*/, execAsync('npm ls --prod --parseable', {
+                        cwd: dir,
+                    })
+                        .then(function (_a) {
+                        var stdout = _a.stdout, stderr = _a.stderr;
+                        return stdout.split(/\r?\n/)
+                            .filter(function (path) { return path; })
+                            .map(function (path) {
+                            return path_1.relative(dir, path);
+                        });
+                    })];
+                case 1:
+                    prod = _a.sent();
+                    debug('in findExcludableDependencies', 'prod', prod);
+                    return [4 /*yield*/, execAsync('npm ls --dev --parseable', {
+                            cwd: dir,
+                        })
+                            .then(function (_a) {
+                            var stdout = _a.stdout, stderr = _a.stderr;
+                            return stdout.split(/\r?\n/)
+                                .filter(function (path) { return path; })
+                                .map(function (path) {
+                                return path_1.relative(dir, path);
+                            });
+                        })];
+                case 2:
+                    dev = _a.sent();
+                    debug('in findExcludableDependencies', 'dev', dev);
+                    excludable = [];
+                    for (_i = 0, dev_1 = dev; _i < dev_1.length; _i++) {
+                        d = dev_1[_i];
+                        if (prod.indexOf(d) == -1) {
+                            excludable.push(d);
+                        }
+                    }
+                    debug('in findExcludableDependencies', 'excludable', excludable);
+                    return [2 /*return*/, excludable];
+            }
+        });
+    });
+}
+exports.findExcludableDependencies = findExcludableDependencies;
+function tmpName(options) {
+    if (options === void 0) { options = {}; }
+    return new Promise(function (resolve, reject) {
+        tmp.tmpName(Object.assign({}, {}, options), function (err, path) { return err ? reject(err) : resolve(path); });
+    });
+}
+exports.tmpName = tmpName;
+function tmpFile(options) {
+    if (options === void 0) { options = {}; }
+    return new Promise(function (resolve, reject) {
+        tmp.file(Object.assign({}, {
+        //discardDescriptor: true,
+        }, options), function (err, path, fd, cleanup) { return err ? reject(err) : resolve({
+            path: path, fd: fd, cleanup: cleanup,
+        }); });
+    });
+}
+exports.tmpFile = tmpFile;
+function tmpDir(options) {
+    if (options === void 0) { options = {}; }
+    return new Promise(function (resolve, reject) {
+        tmp.dir(Object.assign({}, {
+            unsafeCleanup: true,
+        }, options), function (err, path, cleanup) { return err ? reject(err) : resolve({
+            path: path, cleanup: cleanup,
+        }); });
+    });
+}
+exports.tmpDir = tmpDir;
+function fixWindowsVersion(version, build) {
+    if (build === void 0) { build = 0; }
+    return /^\d+\.\d+\.\d+$/.test(version)
+        ? version + "." + build
+        : version;
+}
+exports.fixWindowsVersion = fixWindowsVersion;
+function copyFileAsync(src, dest) {
+    return __awaiter(this, void 0, void 0, function () {
+        var rsrc, stats, _a, _b;
+        return __generator(this, function (_c) {
+            switch (_c.label) {
+                case 0: return [4 /*yield*/, fs_extra_1.realpath(src)];
+                case 1:
+                    rsrc = _c.sent();
+                    return [4 /*yield*/, fs_extra_1.lstat(rsrc)];
+                case 2:
+                    stats = _c.sent();
+                    if (!stats.isDirectory()) return [3 /*break*/, 3];
+                    return [3 /*break*/, 6];
+                case 3:
+                    _a = fs_extra_1.outputFile;
+                    _b = [dest];
+                    return [4 /*yield*/, fs_extra_1.readFile(rsrc)];
+                case 4: return [4 /*yield*/, _a.apply(void 0, _b.concat([_c.sent()]))];
+                case 5:
+                    _c.sent();
+                    _c.label = 6;
+                case 6: return [2 /*return*/];
+            }
+        });
+    });
+}
+exports.copyFileAsync = copyFileAsync;
+function spawnAsync(executable, args, options) {
+    if (options === void 0) { options = {}; }
+    return new Promise(function (resolve, reject) {
+        debug('in spawnAsync', 'executable', executable);
+        debug('in spawnAsync', 'args', args);
+        debug('in spawnAsync', 'options', options);
+        var child = child_process_1.spawn(executable, args, options);
+        if (child.stdout) {
+            child.stdout.on('data', function (chunk) { return debug('in spawnAsync', 'stdout', chunk.toString()); });
+        }
+        if (child.stderr) {
+            child.stderr.on('data', function (chunk) { return debug('in spawnAsync', 'stderr', chunk.toString()); });
+        }
+        child.on('close', function (code, signal) {
+            if (!options.detached) {
+                resolve({
+                    code: code, signal: signal,
+                });
+            }
+        });
+        if (options.detached) {
+            child.unref();
+            resolve({
+                code: 0,
+                signal: '',
+            });
+        }
+    });
+}
+exports.spawnAsync = spawnAsync;
+function execAsync(command, options) {
+    if (options === void 0) { options = {}; }
+    return new Promise(function (resolve, reject) {
+        debug('in execAsync', 'command', command);
+        debug('in execAsync', 'options', options);
+        var child = child_process_1.exec(command, options, function (err, stdout, stderr) {
+            if (!options.detached) {
+                resolve({
+                    stdout: stdout, stderr: stderr,
+                });
+            }
+        });
+        if (options.detached) {
+            child.unref();
+            resolve({
+                stdout: null,
+                stderr: null,
+            });
+        }
+    });
+}
+exports.execAsync = execAsync;
+//# sourceMappingURL=index.js.map

ファイルの差分が大きいため隠しています
+ 1 - 0
dist/lib/util/index.js.map