create-windowless-app 9.3.7 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cliParser.js +103 -103
- package/dist/consts.js +65 -65
- package/dist/createWindowlessApp.js +267 -267
- package/dist/createWindowlessAppUtils.js +99 -99
- package/dist/fileUtils.js +37 -37
- package/dist/index.js +5 -5
- package/dist/interactive.js +54 -54
- package/dist/launcherCompiler.js +64 -64
- package/dist/main.js +28 -28
- package/dist/nodeUtils.js +119 -119
- package/dist/validation.js +18 -18
- package/npm-shrinkwrap.json +199 -128
- package/package.json +12 -12
- package/templates/typescript/tsconfig.json +1 -1
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.replaceAppNamePlaceholder = exports.mergeIntoPackageJson = exports.getNexeCommand = exports.checkAppName = exports.isSafeToCreateProjectIn = exports.PACKAGE_JSON_FILENAME = void 0;
|
|
7
|
-
const validate_npm_package_name_1 = __importDefault(require("validate-npm-package-name"));
|
|
8
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const fileUtils_1 = require("./fileUtils");
|
|
11
|
-
const consts_1 = __importDefault(require("./consts"));
|
|
12
|
-
const fs_extra_1 = require("fs-extra");
|
|
13
|
-
// These files should be allowed to remain on a failed install, but then silently removed during the next create.
|
|
14
|
-
const errorLogFilePatterns = consts_1.default.errorLogFilePatterns;
|
|
15
|
-
exports.PACKAGE_JSON_FILENAME = "package.json";
|
|
16
|
-
// If project only contains files generated by GH, it’s safe.
|
|
17
|
-
// Also, if project contains remnant error logs from a previous installation, lets remove them now.
|
|
18
|
-
// We also special case IJ-based products .idea because it integrates with CRA:
|
|
19
|
-
// https://github.com/facebook/create-react-app/pull/368#issuecomment-243446094
|
|
20
|
-
const isSafeToCreateProjectIn = (root, name) => {
|
|
21
|
-
const validFiles = consts_1.default.validFiles;
|
|
22
|
-
console.log();
|
|
23
|
-
const conflicts = (0, fs_extra_1.readdirSync)(root)
|
|
24
|
-
.filter((file) => !validFiles.includes(file))
|
|
25
|
-
// IntelliJ IDEA creates module files before CRA is launched
|
|
26
|
-
.filter((file) => !/\.iml$/.test(file))
|
|
27
|
-
// Don't treat log files from previous installation as conflicts
|
|
28
|
-
.filter((file) => !errorLogFilePatterns.some((pattern) => file.indexOf(pattern) === 0));
|
|
29
|
-
if (conflicts.length > 0) {
|
|
30
|
-
console.log(`The directory ${chalk_1.default.green(name)} contains files that could conflict:`);
|
|
31
|
-
console.log();
|
|
32
|
-
for (const file of conflicts) {
|
|
33
|
-
console.log(` ${file}`);
|
|
34
|
-
}
|
|
35
|
-
console.log();
|
|
36
|
-
console.log("Either try using a new directory name, or remove the files listed above.");
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
// Remove any remnant files from a previous installation
|
|
40
|
-
const currentFiles = (0, fs_extra_1.readdirSync)(path_1.default.join(root));
|
|
41
|
-
currentFiles.forEach((file) => {
|
|
42
|
-
errorLogFilePatterns.forEach((errorLogFilePattern) => {
|
|
43
|
-
// This will catch `npm-debug.log*` files
|
|
44
|
-
if (file.indexOf(errorLogFilePattern) === 0) {
|
|
45
|
-
(0, fs_extra_1.removeSync)(path_1.default.join(root, file));
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
return true;
|
|
50
|
-
};
|
|
51
|
-
exports.isSafeToCreateProjectIn = isSafeToCreateProjectIn;
|
|
52
|
-
const printValidationResults = (results) => {
|
|
53
|
-
if (typeof results !== "undefined") {
|
|
54
|
-
results.forEach((error) => {
|
|
55
|
-
console.error(chalk_1.default.red(` * ${error}`));
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
const checkAppName = (appName) => {
|
|
60
|
-
const validationResult = (0, validate_npm_package_name_1.default)(appName);
|
|
61
|
-
if (!validationResult.validForNewPackages) {
|
|
62
|
-
console.error(`Could not create a project called ${chalk_1.default.red(`"${appName}"`)} because of npm naming restrictions:`);
|
|
63
|
-
printValidationResults(validationResult.errors);
|
|
64
|
-
printValidationResults(validationResult.warnings);
|
|
65
|
-
process.exit(1);
|
|
66
|
-
}
|
|
67
|
-
const dependencies = [...consts_1.default.dependencies, ...consts_1.default.devDependencies].sort();
|
|
68
|
-
if (dependencies.indexOf(appName) >= 0) {
|
|
69
|
-
console.error(chalk_1.default.red(`We cannot create a project called ${chalk_1.default.green(appName)} because a dependency with the same name exists.\n` + "Due to the way npm works, the following names are not allowed:\n\n") +
|
|
70
|
-
chalk_1.default.cyan(dependencies.map((depName) => ` ${depName}`).join("\n")) +
|
|
71
|
-
chalk_1.default.red("\n\nPlease choose a different project name."));
|
|
72
|
-
process.exit(1);
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
exports.checkAppName = checkAppName;
|
|
76
|
-
const getNexeCommand = (appName, nodeVersion) => {
|
|
77
|
-
return `nexe -t ${nodeVersion} -o dist/${appName}.exe`;
|
|
78
|
-
};
|
|
79
|
-
exports.getNexeCommand = getNexeCommand;
|
|
80
|
-
const mergeIntoPackageJson = (root, field, data) => {
|
|
81
|
-
const packageJsonPath = path_1.default.resolve(root, exports.PACKAGE_JSON_FILENAME);
|
|
82
|
-
const packageJson = (0, fileUtils_1.readJsonFile)(packageJsonPath);
|
|
83
|
-
if (Array.isArray(data)) {
|
|
84
|
-
const list = (packageJson[field] || []).concat(data).reduce((acc, cur) => {
|
|
85
|
-
acc[cur] = cur;
|
|
86
|
-
return acc;
|
|
87
|
-
}, {});
|
|
88
|
-
packageJson[field] = Object.keys(list);
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
packageJson[field] = Object.assign(packageJson[field] || {}, data);
|
|
92
|
-
}
|
|
93
|
-
(0, fileUtils_1.writeJson)(packageJsonPath, packageJson);
|
|
94
|
-
};
|
|
95
|
-
exports.mergeIntoPackageJson = mergeIntoPackageJson;
|
|
96
|
-
const replaceAppNamePlaceholder = (str, appName) => {
|
|
97
|
-
return str.replace(/##APPNAME##/g, `${appName}`);
|
|
98
|
-
};
|
|
99
|
-
exports.replaceAppNamePlaceholder = replaceAppNamePlaceholder;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.replaceAppNamePlaceholder = exports.mergeIntoPackageJson = exports.getNexeCommand = exports.checkAppName = exports.isSafeToCreateProjectIn = exports.PACKAGE_JSON_FILENAME = void 0;
|
|
7
|
+
const validate_npm_package_name_1 = __importDefault(require("validate-npm-package-name"));
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const fileUtils_1 = require("./fileUtils");
|
|
11
|
+
const consts_1 = __importDefault(require("./consts"));
|
|
12
|
+
const fs_extra_1 = require("fs-extra");
|
|
13
|
+
// These files should be allowed to remain on a failed install, but then silently removed during the next create.
|
|
14
|
+
const errorLogFilePatterns = consts_1.default.errorLogFilePatterns;
|
|
15
|
+
exports.PACKAGE_JSON_FILENAME = "package.json";
|
|
16
|
+
// If project only contains files generated by GH, it’s safe.
|
|
17
|
+
// Also, if project contains remnant error logs from a previous installation, lets remove them now.
|
|
18
|
+
// We also special case IJ-based products .idea because it integrates with CRA:
|
|
19
|
+
// https://github.com/facebook/create-react-app/pull/368#issuecomment-243446094
|
|
20
|
+
const isSafeToCreateProjectIn = (root, name) => {
|
|
21
|
+
const validFiles = consts_1.default.validFiles;
|
|
22
|
+
console.log();
|
|
23
|
+
const conflicts = (0, fs_extra_1.readdirSync)(root)
|
|
24
|
+
.filter((file) => !validFiles.includes(file))
|
|
25
|
+
// IntelliJ IDEA creates module files before CRA is launched
|
|
26
|
+
.filter((file) => !/\.iml$/.test(file))
|
|
27
|
+
// Don't treat log files from previous installation as conflicts
|
|
28
|
+
.filter((file) => !errorLogFilePatterns.some((pattern) => file.indexOf(pattern) === 0));
|
|
29
|
+
if (conflicts.length > 0) {
|
|
30
|
+
console.log(`The directory ${chalk_1.default.green(name)} contains files that could conflict:`);
|
|
31
|
+
console.log();
|
|
32
|
+
for (const file of conflicts) {
|
|
33
|
+
console.log(` ${file}`);
|
|
34
|
+
}
|
|
35
|
+
console.log();
|
|
36
|
+
console.log("Either try using a new directory name, or remove the files listed above.");
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
// Remove any remnant files from a previous installation
|
|
40
|
+
const currentFiles = (0, fs_extra_1.readdirSync)(path_1.default.join(root));
|
|
41
|
+
currentFiles.forEach((file) => {
|
|
42
|
+
errorLogFilePatterns.forEach((errorLogFilePattern) => {
|
|
43
|
+
// This will catch `npm-debug.log*` files
|
|
44
|
+
if (file.indexOf(errorLogFilePattern) === 0) {
|
|
45
|
+
(0, fs_extra_1.removeSync)(path_1.default.join(root, file));
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
return true;
|
|
50
|
+
};
|
|
51
|
+
exports.isSafeToCreateProjectIn = isSafeToCreateProjectIn;
|
|
52
|
+
const printValidationResults = (results) => {
|
|
53
|
+
if (typeof results !== "undefined") {
|
|
54
|
+
results.forEach((error) => {
|
|
55
|
+
console.error(chalk_1.default.red(` * ${error}`));
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const checkAppName = (appName) => {
|
|
60
|
+
const validationResult = (0, validate_npm_package_name_1.default)(appName);
|
|
61
|
+
if (!validationResult.validForNewPackages) {
|
|
62
|
+
console.error(`Could not create a project called ${chalk_1.default.red(`"${appName}"`)} because of npm naming restrictions:`);
|
|
63
|
+
printValidationResults(validationResult.errors);
|
|
64
|
+
printValidationResults(validationResult.warnings);
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
const dependencies = [...consts_1.default.dependencies, ...consts_1.default.devDependencies].sort();
|
|
68
|
+
if (dependencies.indexOf(appName) >= 0) {
|
|
69
|
+
console.error(chalk_1.default.red(`We cannot create a project called ${chalk_1.default.green(appName)} because a dependency with the same name exists.\n` + "Due to the way npm works, the following names are not allowed:\n\n") +
|
|
70
|
+
chalk_1.default.cyan(dependencies.map((depName) => ` ${depName}`).join("\n")) +
|
|
71
|
+
chalk_1.default.red("\n\nPlease choose a different project name."));
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
exports.checkAppName = checkAppName;
|
|
76
|
+
const getNexeCommand = (appName, nodeVersion) => {
|
|
77
|
+
return `nexe -t ${nodeVersion} -o dist/${appName}.exe`;
|
|
78
|
+
};
|
|
79
|
+
exports.getNexeCommand = getNexeCommand;
|
|
80
|
+
const mergeIntoPackageJson = (root, field, data) => {
|
|
81
|
+
const packageJsonPath = path_1.default.resolve(root, exports.PACKAGE_JSON_FILENAME);
|
|
82
|
+
const packageJson = (0, fileUtils_1.readJsonFile)(packageJsonPath);
|
|
83
|
+
if (Array.isArray(data)) {
|
|
84
|
+
const list = (packageJson[field] || []).concat(data).reduce((acc, cur) => {
|
|
85
|
+
acc[cur] = cur;
|
|
86
|
+
return acc;
|
|
87
|
+
}, {});
|
|
88
|
+
packageJson[field] = Object.keys(list);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
packageJson[field] = Object.assign(packageJson[field] || {}, data);
|
|
92
|
+
}
|
|
93
|
+
(0, fileUtils_1.writeJson)(packageJsonPath, packageJson);
|
|
94
|
+
};
|
|
95
|
+
exports.mergeIntoPackageJson = mergeIntoPackageJson;
|
|
96
|
+
const replaceAppNamePlaceholder = (str, appName) => {
|
|
97
|
+
return str.replace(/##APPNAME##/g, `${appName}`);
|
|
98
|
+
};
|
|
99
|
+
exports.replaceAppNamePlaceholder = replaceAppNamePlaceholder;
|
package/dist/fileUtils.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.copyFile = exports.writeFile = exports.writeJson = exports.readJsonResource = exports.readResource = exports.readJsonFile = exports.readFile = void 0;
|
|
7
|
-
const fs_extra_1 = require("fs-extra");
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const os_1 = __importDefault(require("os"));
|
|
10
|
-
const readFile = (fileName) => {
|
|
11
|
-
return (0, fs_extra_1.readFileSync)(fileName, "utf8");
|
|
12
|
-
};
|
|
13
|
-
exports.readFile = readFile;
|
|
14
|
-
const readJsonFile = (jsonFileName) => {
|
|
15
|
-
return JSON.parse((0, exports.readFile)(jsonFileName));
|
|
16
|
-
};
|
|
17
|
-
exports.readJsonFile = readJsonFile;
|
|
18
|
-
const readResource = (resourceRelativePath) => {
|
|
19
|
-
return (0, exports.readFile)(path_1.default.resolve(__dirname, resourceRelativePath));
|
|
20
|
-
};
|
|
21
|
-
exports.readResource = readResource;
|
|
22
|
-
const readJsonResource = (resourceRelativePath) => {
|
|
23
|
-
return JSON.parse((0, exports.readResource)(resourceRelativePath));
|
|
24
|
-
};
|
|
25
|
-
exports.readJsonResource = readJsonResource;
|
|
26
|
-
const writeJson = (fileName, object) => {
|
|
27
|
-
(0, fs_extra_1.writeFileSync)(fileName, JSON.stringify(object, null, 2).replace(/\n/g, os_1.default.EOL) + os_1.default.EOL);
|
|
28
|
-
};
|
|
29
|
-
exports.writeJson = writeJson;
|
|
30
|
-
const writeFile = (fileName, data) => {
|
|
31
|
-
(0, fs_extra_1.writeFileSync)(fileName, data.replace(/\r/g, "").replace(/\n/g, os_1.default.EOL));
|
|
32
|
-
};
|
|
33
|
-
exports.writeFile = writeFile;
|
|
34
|
-
const copyFile = (source, destination) => {
|
|
35
|
-
(0, fs_extra_1.copyFileSync)(source, destination);
|
|
36
|
-
};
|
|
37
|
-
exports.copyFile = copyFile;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.copyFile = exports.writeFile = exports.writeJson = exports.readJsonResource = exports.readResource = exports.readJsonFile = exports.readFile = void 0;
|
|
7
|
+
const fs_extra_1 = require("fs-extra");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const os_1 = __importDefault(require("os"));
|
|
10
|
+
const readFile = (fileName) => {
|
|
11
|
+
return (0, fs_extra_1.readFileSync)(fileName, "utf8");
|
|
12
|
+
};
|
|
13
|
+
exports.readFile = readFile;
|
|
14
|
+
const readJsonFile = (jsonFileName) => {
|
|
15
|
+
return JSON.parse((0, exports.readFile)(jsonFileName));
|
|
16
|
+
};
|
|
17
|
+
exports.readJsonFile = readJsonFile;
|
|
18
|
+
const readResource = (resourceRelativePath) => {
|
|
19
|
+
return (0, exports.readFile)(path_1.default.resolve(__dirname, resourceRelativePath));
|
|
20
|
+
};
|
|
21
|
+
exports.readResource = readResource;
|
|
22
|
+
const readJsonResource = (resourceRelativePath) => {
|
|
23
|
+
return JSON.parse((0, exports.readResource)(resourceRelativePath));
|
|
24
|
+
};
|
|
25
|
+
exports.readJsonResource = readJsonResource;
|
|
26
|
+
const writeJson = (fileName, object) => {
|
|
27
|
+
(0, fs_extra_1.writeFileSync)(fileName, JSON.stringify(object, null, 2).replace(/\n/g, os_1.default.EOL) + os_1.default.EOL);
|
|
28
|
+
};
|
|
29
|
+
exports.writeJson = writeJson;
|
|
30
|
+
const writeFile = (fileName, data) => {
|
|
31
|
+
(0, fs_extra_1.writeFileSync)(fileName, data.replace(/\r/g, "").replace(/\n/g, os_1.default.EOL));
|
|
32
|
+
};
|
|
33
|
+
exports.writeFile = writeFile;
|
|
34
|
+
const copyFile = (source, destination) => {
|
|
35
|
+
(0, fs_extra_1.copyFileSync)(source, destination);
|
|
36
|
+
};
|
|
37
|
+
exports.copyFile = copyFile;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const main_1 = require("./main");
|
|
5
|
-
// Run main
|
|
6
|
-
(0, main_1.main)().catch(console.error);
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const main_1 = require("./main");
|
|
5
|
+
// Run main
|
|
6
|
+
(0, main_1.main)().catch(console.error);
|
package/dist/interactive.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.interactiveMode = void 0;
|
|
7
|
-
const inquirer_1 = __importDefault(require("inquirer"));
|
|
8
|
-
const validation_1 = require("./validation");
|
|
9
|
-
const interactiveMode = () => {
|
|
10
|
-
return inquirer_1.default.prompt([
|
|
11
|
-
{
|
|
12
|
-
type: "input",
|
|
13
|
-
message: "Project Name:",
|
|
14
|
-
name: "projectName",
|
|
15
|
-
validate: validation_1.validateProjectNameInput
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
type: "input",
|
|
19
|
-
message: "Icon:",
|
|
20
|
-
name: "icon"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
type: "confirm",
|
|
24
|
-
message: "TypeScript:",
|
|
25
|
-
name: "typescript",
|
|
26
|
-
default: true
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
type: "confirm",
|
|
30
|
-
message: "Install Husky:",
|
|
31
|
-
name: "husky",
|
|
32
|
-
default: true
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
type: "confirm",
|
|
36
|
-
message: "Skip NPM Install:",
|
|
37
|
-
name: "skipInstall",
|
|
38
|
-
default: false
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
type: "input",
|
|
42
|
-
message: "Node Version:",
|
|
43
|
-
name: "nodeVersion",
|
|
44
|
-
validate: validation_1.validateNodeVersion
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
type: "confirm",
|
|
48
|
-
message: "Verbose:",
|
|
49
|
-
name: "verbose",
|
|
50
|
-
default: false
|
|
51
|
-
}
|
|
52
|
-
]);
|
|
53
|
-
};
|
|
54
|
-
exports.interactiveMode = interactiveMode;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.interactiveMode = void 0;
|
|
7
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
8
|
+
const validation_1 = require("./validation");
|
|
9
|
+
const interactiveMode = () => {
|
|
10
|
+
return inquirer_1.default.prompt([
|
|
11
|
+
{
|
|
12
|
+
type: "input",
|
|
13
|
+
message: "Project Name:",
|
|
14
|
+
name: "projectName",
|
|
15
|
+
validate: validation_1.validateProjectNameInput
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
type: "input",
|
|
19
|
+
message: "Icon:",
|
|
20
|
+
name: "icon"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
type: "confirm",
|
|
24
|
+
message: "TypeScript:",
|
|
25
|
+
name: "typescript",
|
|
26
|
+
default: true
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
type: "confirm",
|
|
30
|
+
message: "Install Husky:",
|
|
31
|
+
name: "husky",
|
|
32
|
+
default: true
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: "confirm",
|
|
36
|
+
message: "Skip NPM Install:",
|
|
37
|
+
name: "skipInstall",
|
|
38
|
+
default: false
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
type: "input",
|
|
42
|
+
message: "Node Version:",
|
|
43
|
+
name: "nodeVersion",
|
|
44
|
+
validate: validation_1.validateNodeVersion
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: "confirm",
|
|
48
|
+
message: "Verbose:",
|
|
49
|
+
name: "verbose",
|
|
50
|
+
default: false
|
|
51
|
+
}
|
|
52
|
+
]);
|
|
53
|
+
};
|
|
54
|
+
exports.interactiveMode = interactiveMode;
|
package/dist/launcherCompiler.js
CHANGED
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.compileLauncher = exports.checkMsbuildInPath = void 0;
|
|
39
|
-
const fs_extra_1 = require("fs-extra");
|
|
40
|
-
const path = __importStar(require("path"));
|
|
41
|
-
const cross_spawn_1 = __importDefault(require("cross-spawn"));
|
|
42
|
-
const COMPILER = "msbuild.exe";
|
|
43
|
-
const checkMsbuildInPath = (exit) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
-
// Check for compiler in %PATH%
|
|
45
|
-
const promises = process.env.path.split(";").map((p) => (0, fs_extra_1.pathExists)(path.resolve(p, COMPILER)));
|
|
46
|
-
const results = yield Promise.all(promises);
|
|
47
|
-
const compilerFound = results.find((result) => !!result);
|
|
48
|
-
if (exit && !compilerFound) {
|
|
49
|
-
console.error(`You need "${COMPILER}" in your %PATH% in order to compile the launcher executable.`);
|
|
50
|
-
process.exit(1);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
return compilerFound;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
exports.checkMsbuildInPath = checkMsbuildInPath;
|
|
57
|
-
const compileLauncher = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
58
|
-
const args = ["./launcher/launcher.csproj"];
|
|
59
|
-
const spawnResult = cross_spawn_1.default.sync(COMPILER, args, { stdio: "inherit" });
|
|
60
|
-
if (spawnResult.status !== 0) {
|
|
61
|
-
return Promise.reject({ command: `${COMPILER} ${args.join(" ")}` });
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
exports.compileLauncher = compileLauncher;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.compileLauncher = exports.checkMsbuildInPath = void 0;
|
|
39
|
+
const fs_extra_1 = require("fs-extra");
|
|
40
|
+
const path = __importStar(require("path"));
|
|
41
|
+
const cross_spawn_1 = __importDefault(require("cross-spawn"));
|
|
42
|
+
const COMPILER = "msbuild.exe";
|
|
43
|
+
const checkMsbuildInPath = (exit) => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
+
// Check for compiler in %PATH%
|
|
45
|
+
const promises = process.env.path.split(";").map((p) => (0, fs_extra_1.pathExists)(path.resolve(p, COMPILER)));
|
|
46
|
+
const results = yield Promise.all(promises);
|
|
47
|
+
const compilerFound = results.find((result) => !!result);
|
|
48
|
+
if (exit && !compilerFound) {
|
|
49
|
+
console.error(`You need "${COMPILER}" in your %PATH% in order to compile the launcher executable.`);
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
return compilerFound;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
exports.checkMsbuildInPath = checkMsbuildInPath;
|
|
57
|
+
const compileLauncher = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
58
|
+
const args = ["./launcher/launcher.csproj"];
|
|
59
|
+
const spawnResult = cross_spawn_1.default.sync(COMPILER, args, { stdio: "inherit" });
|
|
60
|
+
if (spawnResult.status !== 0) {
|
|
61
|
+
return Promise.reject({ command: `${COMPILER} ${args.join(" ")}` });
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
exports.compileLauncher = compileLauncher;
|
package/dist/main.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.main = void 0;
|
|
13
|
-
const launcherCompiler_1 = require("./launcherCompiler");
|
|
14
|
-
const createWindowlessApp_1 = require("./createWindowlessApp");
|
|
15
|
-
const main = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
const currentNodeVersion = process.versions.node;
|
|
17
|
-
const semver = currentNodeVersion.split(".");
|
|
18
|
-
const major = Number(semver[0]);
|
|
19
|
-
const minor = Number(semver[1]);
|
|
20
|
-
if (isNaN(major) || isNaN(minor) || major < 12 || (major === 12 && minor < 20)) {
|
|
21
|
-
console.error(`You are running NodeJS ${currentNodeVersion}.\nCreate Windowless App requires NodeJS 12.20 or higher.\nPlease update your version of Node.`);
|
|
22
|
-
process.exit(1);
|
|
23
|
-
}
|
|
24
|
-
// Check for msbuild.exe in %PATH%
|
|
25
|
-
yield (0, launcherCompiler_1.checkMsbuildInPath)(true);
|
|
26
|
-
yield (0, createWindowlessApp_1.createWindowlessApp)(process.argv);
|
|
27
|
-
});
|
|
28
|
-
exports.main = main;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.main = void 0;
|
|
13
|
+
const launcherCompiler_1 = require("./launcherCompiler");
|
|
14
|
+
const createWindowlessApp_1 = require("./createWindowlessApp");
|
|
15
|
+
const main = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
const currentNodeVersion = process.versions.node;
|
|
17
|
+
const semver = currentNodeVersion.split(".");
|
|
18
|
+
const major = Number(semver[0]);
|
|
19
|
+
const minor = Number(semver[1]);
|
|
20
|
+
if (isNaN(major) || isNaN(minor) || major < 12 || (major === 12 && minor < 20)) {
|
|
21
|
+
console.error(`You are running NodeJS ${currentNodeVersion}.\nCreate Windowless App requires NodeJS 12.20 or higher.\nPlease update your version of Node.`);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
// Check for msbuild.exe in %PATH%
|
|
25
|
+
yield (0, launcherCompiler_1.checkMsbuildInPath)(true);
|
|
26
|
+
yield (0, createWindowlessApp_1.createWindowlessApp)(process.argv);
|
|
27
|
+
});
|
|
28
|
+
exports.main = main;
|