create-windowless-app 9.1.2 → 9.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/dist/cliParser.js +10 -61
- package/dist/interactive.js +54 -0
- package/dist/validation.js +18 -0
- package/npm-shrinkwrap.json +5523 -316
- package/package.json +17 -16
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|

|
|
2
2
|
# Create Windowless App
|
|
3
|
-
[](https://lgtm.com/projects/g/yoavain/create-windowless-app/context:javascript)
|
|
3
|
+
[](https://github.com/yoavain/create-windowless-app/actions?query=workflow%3ACodeQL)
|
|
5
4
|
[](https://github.com/yoavain/create-windowless-app/actions)
|
|
6
5
|

|
|
7
6
|

|
package/dist/cliParser.js
CHANGED
|
@@ -12,71 +12,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.parseCommand =
|
|
15
|
+
exports.parseCommand = void 0;
|
|
16
16
|
const chalk_1 = __importDefault(require("chalk"));
|
|
17
17
|
const createWindowlessAppUtils_1 = require("./createWindowlessAppUtils");
|
|
18
18
|
const fs_extra_1 = require("fs-extra");
|
|
19
|
-
const inquirer_1 = __importDefault(require("inquirer"));
|
|
20
|
-
const validate_npm_package_name_1 = __importDefault(require("validate-npm-package-name"));
|
|
21
|
-
const semver_1 = __importDefault(require("semver"));
|
|
22
19
|
const yargs_1 = __importDefault(require("yargs"));
|
|
23
20
|
const helpers_1 = require("yargs/helpers");
|
|
21
|
+
const interactive_1 = require("./interactive");
|
|
24
22
|
const packageJson = require(`../${createWindowlessAppUtils_1.PACKAGE_JSON_FILENAME}`);
|
|
25
|
-
const validateProjectNameInput = (value) => {
|
|
26
|
-
var _a, _b;
|
|
27
|
-
const result = (0, validate_npm_package_name_1.default)(value);
|
|
28
|
-
return result.validForNewPackages || ((_a = result === null || result === void 0 ? void 0 : result.errors) === null || _a === void 0 ? void 0 : _a[0]) || ((_b = result === null || result === void 0 ? void 0 : result.warnings) === null || _b === void 0 ? void 0 : _b[0]) || "Invalid project name";
|
|
29
|
-
};
|
|
30
|
-
exports.validateProjectNameInput = validateProjectNameInput;
|
|
31
|
-
const validateNodeVersion = (value) => {
|
|
32
|
-
return !value || !!semver_1.default.valid(value) || "Invalid node version";
|
|
33
|
-
};
|
|
34
|
-
exports.validateNodeVersion = validateNodeVersion;
|
|
35
|
-
const interactiveMode = () => {
|
|
36
|
-
return inquirer_1.default.prompt([
|
|
37
|
-
{
|
|
38
|
-
type: "input",
|
|
39
|
-
message: "Project Name:",
|
|
40
|
-
name: "projectName",
|
|
41
|
-
validate: exports.validateProjectNameInput
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
type: "input",
|
|
45
|
-
message: "Icon:",
|
|
46
|
-
name: "icon"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
type: "confirm",
|
|
50
|
-
message: "TypeScript:",
|
|
51
|
-
name: "typescript",
|
|
52
|
-
default: true
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
type: "confirm",
|
|
56
|
-
message: "Install Husky:",
|
|
57
|
-
name: "husky",
|
|
58
|
-
default: true
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
type: "confirm",
|
|
62
|
-
message: "Skip NPM Install:",
|
|
63
|
-
name: "skipInstall",
|
|
64
|
-
default: false
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
type: "input",
|
|
68
|
-
message: "Node Version:",
|
|
69
|
-
name: "nodeVersion",
|
|
70
|
-
validate: exports.validateNodeVersion
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
type: "confirm",
|
|
74
|
-
message: "Verbose:",
|
|
75
|
-
name: "verbose",
|
|
76
|
-
default: false
|
|
77
|
-
}
|
|
78
|
-
]);
|
|
79
|
-
};
|
|
80
23
|
const validateInput = (argv) => {
|
|
81
24
|
if (argv.icon && !(0, fs_extra_1.pathExistsSync)(argv.icon)) {
|
|
82
25
|
console.log(`Cannot find icon in ${chalk_1.default.red(argv.icon)}. Switching to ${chalk_1.default.green("default")} icon.`);
|
|
@@ -86,7 +29,7 @@ const validateInput = (argv) => {
|
|
|
86
29
|
};
|
|
87
30
|
const parseCommand = (argv) => __awaiter(void 0, void 0, void 0, function* () {
|
|
88
31
|
const command = (0, yargs_1.default)((0, helpers_1.hideBin)(argv))
|
|
89
|
-
.command("*
|
|
32
|
+
.command("* [projectName]", "project name", (yargs) => {
|
|
90
33
|
return yargs.positional("projectName", {
|
|
91
34
|
describe: "project name",
|
|
92
35
|
type: "string"
|
|
@@ -128,6 +71,12 @@ const parseCommand = (argv) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
128
71
|
alias: "n",
|
|
129
72
|
type: "string",
|
|
130
73
|
description: "override node version to bundle"
|
|
74
|
+
})
|
|
75
|
+
.check((argv) => {
|
|
76
|
+
if (!argv.projectName && !argv.interactive && !argv.help) {
|
|
77
|
+
throw new Error("Missing project name");
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
131
80
|
})
|
|
132
81
|
.version("version", packageJson.version)
|
|
133
82
|
.help()
|
|
@@ -136,7 +85,7 @@ const parseCommand = (argv) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
136
85
|
.argv;
|
|
137
86
|
let programConfig;
|
|
138
87
|
if (command.interactive) {
|
|
139
|
-
programConfig = yield interactiveMode();
|
|
88
|
+
programConfig = yield (0, interactive_1.interactiveMode)();
|
|
140
89
|
}
|
|
141
90
|
else {
|
|
142
91
|
programConfig = {
|
|
@@ -0,0 +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;
|
|
@@ -0,0 +1,18 @@
|
|
|
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.validateNodeVersion = exports.validateProjectNameInput = void 0;
|
|
7
|
+
const validate_npm_package_name_1 = __importDefault(require("validate-npm-package-name"));
|
|
8
|
+
const semver_1 = __importDefault(require("semver"));
|
|
9
|
+
const validateProjectNameInput = (value) => {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
const result = (0, validate_npm_package_name_1.default)(value);
|
|
12
|
+
return result.validForNewPackages || ((_a = result === null || result === void 0 ? void 0 : result.errors) === null || _a === void 0 ? void 0 : _a[0]) || ((_b = result === null || result === void 0 ? void 0 : result.warnings) === null || _b === void 0 ? void 0 : _b[0]) || "Invalid project name";
|
|
13
|
+
};
|
|
14
|
+
exports.validateProjectNameInput = validateProjectNameInput;
|
|
15
|
+
const validateNodeVersion = (value) => {
|
|
16
|
+
return !value || !!semver_1.default.valid(value) || "Invalid node version";
|
|
17
|
+
};
|
|
18
|
+
exports.validateNodeVersion = validateNodeVersion;
|