create-webiny-project 5.41.4 → 5.42.0-beta.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/bin.js +98 -78
- package/package.json +8 -7
- package/utils/binaries/yarn-4.6.0.cjs +934 -0
- package/utils/createProject.js +1 -1
- package/utils/{verifyConfig.js → ensureConfig.js} +5 -3
- package/utils/binaries/yarn-3.6.4.cjs +0 -874
- package/utils/getNpmVersion.js +0 -10
- package/utils/getYarnVersion.js +0 -10
package/bin.js
CHANGED
|
@@ -1,87 +1,107 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const getYarnVersion = require("./utils/getYarnVersion");
|
|
7
|
-
const getNpmVersion = require("./utils/getNpmVersion");
|
|
8
|
-
const verifyConfig = require("./utils/verifyConfig");
|
|
3
|
+
// Ensure system requirements are met.
|
|
4
|
+
require("@webiny/system-requirements").ensureSystemRequirements();
|
|
9
5
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const minYarnVersion = "1.22.21";
|
|
13
|
-
/**
|
|
14
|
-
* Node
|
|
15
|
-
*/
|
|
16
|
-
const nodeVersion = process.versions.node;
|
|
17
|
-
if (!semver.satisfies(nodeVersion, `^18 || ^20`)) {
|
|
18
|
-
console.error(
|
|
19
|
-
chalk.red(
|
|
20
|
-
[
|
|
21
|
-
`You are running Node.js ${nodeVersion}, but Webiny requires version 18 or 20.`,
|
|
22
|
-
`Please switch to one of the required versions and try again.`,
|
|
23
|
-
"For more information, please visit https://www.webiny.com/docs/get-started/install-webiny#prerequisites."
|
|
24
|
-
].join(" ")
|
|
25
|
-
)
|
|
26
|
-
);
|
|
27
|
-
process.exit(1);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* npm
|
|
31
|
-
*/
|
|
32
|
-
try {
|
|
33
|
-
const npmVersion = await getNpmVersion();
|
|
34
|
-
if (!semver.satisfies(npmVersion, `>=${minNpmVersion}`)) {
|
|
35
|
-
console.error(
|
|
36
|
-
chalk.red(
|
|
37
|
-
[
|
|
38
|
-
`Webiny requires npm@^${minNpmVersion} or higher.`,
|
|
39
|
-
`Please run ${chalk.green(
|
|
40
|
-
"npm install npm@latest -g"
|
|
41
|
-
)}, to get the latest version.`
|
|
42
|
-
].join("\n")
|
|
43
|
-
)
|
|
44
|
-
);
|
|
45
|
-
process.exit(1);
|
|
46
|
-
}
|
|
47
|
-
} catch (err) {
|
|
48
|
-
console.error(chalk.red(`Webiny depends on "npm".`));
|
|
6
|
+
// Verify `.webiny` config file and continue.
|
|
7
|
+
require("./utils/ensureConfig").ensureConfig();
|
|
49
8
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
)}.`
|
|
54
|
-
);
|
|
9
|
+
const yargs = require("yargs");
|
|
10
|
+
const packageJson = require("./package.json");
|
|
11
|
+
const createProject = require("./utils/createProject");
|
|
55
12
|
|
|
56
|
-
|
|
57
|
-
|
|
13
|
+
process.on("unhandledRejection", err => {
|
|
14
|
+
throw err;
|
|
15
|
+
});
|
|
58
16
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
);
|
|
73
|
-
process.exit(1);
|
|
17
|
+
yargs
|
|
18
|
+
.usage("Usage: create-webiny-project <project-name> [options]")
|
|
19
|
+
.version(packageJson.version)
|
|
20
|
+
.demandCommand(1)
|
|
21
|
+
.help()
|
|
22
|
+
.alias("help", "h")
|
|
23
|
+
.scriptName("create-webiny-project")
|
|
24
|
+
.fail(function (msg, err) {
|
|
25
|
+
if (msg) {
|
|
26
|
+
console.log(msg);
|
|
27
|
+
}
|
|
28
|
+
if (err) {
|
|
29
|
+
console.log(err);
|
|
74
30
|
}
|
|
75
|
-
} catch (err) {
|
|
76
|
-
console.error(
|
|
77
|
-
chalk.red(`Webiny depends on "yarn" and its built-in support for workspaces.`)
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
console.log(`Please visit https://yarnpkg.com/ to install ${chalk.green("yarn")}.`);
|
|
81
|
-
|
|
82
31
|
process.exit(1);
|
|
83
|
-
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// noinspection BadExpressionStatementJS
|
|
35
|
+
yargs.command(
|
|
36
|
+
"$0 <project-name> [options]",
|
|
37
|
+
"Name of application and template to use",
|
|
38
|
+
yargs => {
|
|
39
|
+
yargs.positional("project-name", {
|
|
40
|
+
describe: "Project name"
|
|
41
|
+
});
|
|
42
|
+
yargs.option("force", {
|
|
43
|
+
describe: "All project creation within an existing folder",
|
|
44
|
+
default: false,
|
|
45
|
+
type: "boolean",
|
|
46
|
+
demandOption: false
|
|
47
|
+
});
|
|
48
|
+
yargs.option("template", {
|
|
49
|
+
describe: `Name of template to use, if no template is provided it will default to "aws" template`,
|
|
50
|
+
alias: "t",
|
|
51
|
+
type: "string",
|
|
52
|
+
default: "aws",
|
|
53
|
+
demandOption: false
|
|
54
|
+
});
|
|
55
|
+
yargs.option("template-options", {
|
|
56
|
+
describe: `A JSON containing template-specific options (usually used in non-interactive environments)`,
|
|
57
|
+
default: null,
|
|
58
|
+
type: "string",
|
|
59
|
+
demandOption: false
|
|
60
|
+
});
|
|
61
|
+
yargs.option("assign-to-yarnrc", {
|
|
62
|
+
describe: `A JSON containing additional options that will be assigned into the "yarnrc.yml" configuration file`,
|
|
63
|
+
default: null,
|
|
64
|
+
type: "string",
|
|
65
|
+
demandOption: false
|
|
66
|
+
});
|
|
67
|
+
yargs.option("tag", {
|
|
68
|
+
describe: "NPM tag to use for @webiny packages",
|
|
69
|
+
type: "string",
|
|
70
|
+
default: "latest",
|
|
71
|
+
demandOption: false
|
|
72
|
+
});
|
|
73
|
+
yargs.option("interactive", {
|
|
74
|
+
describe: "Enable interactive mode for all commands",
|
|
75
|
+
default: true,
|
|
76
|
+
type: "boolean",
|
|
77
|
+
demandOption: false
|
|
78
|
+
});
|
|
79
|
+
yargs.option("log", {
|
|
80
|
+
describe:
|
|
81
|
+
"Creates a log file to see output of installation. Defaults to create-webiny-project-logs.txt in current directory",
|
|
82
|
+
alias: "l",
|
|
83
|
+
default: "create-webiny-project-logs.txt",
|
|
84
|
+
type: "string",
|
|
85
|
+
demandOption: false
|
|
86
|
+
});
|
|
87
|
+
yargs.option("debug", {
|
|
88
|
+
describe: "Turn on debug logs",
|
|
89
|
+
default: false,
|
|
90
|
+
type: "boolean",
|
|
91
|
+
demandOption: false
|
|
92
|
+
});
|
|
93
|
+
yargs.option("cleanup", {
|
|
94
|
+
describe: "If an error occurs upon project creation, deletes all generated files",
|
|
95
|
+
alias: "c",
|
|
96
|
+
default: true,
|
|
97
|
+
type: "boolean",
|
|
98
|
+
demandOption: false
|
|
99
|
+
});
|
|
84
100
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
101
|
+
yargs.example("$0 <project-name>");
|
|
102
|
+
yargs.example("$0 <project-name> --template=aws");
|
|
103
|
+
yargs.example("$0 <project-name> --template=../path/to/template");
|
|
104
|
+
yargs.example("$0 <project-name> --log=./my-logs.txt");
|
|
105
|
+
},
|
|
106
|
+
argv => createProject(argv)
|
|
107
|
+
).argv;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-webiny-project",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.42.0-beta.0",
|
|
4
4
|
"description": "Webiny project bootstrap tool.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"author": "Webiny Ltd.",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@webiny/
|
|
16
|
+
"@webiny/system-requirements": "5.42.0-beta.0",
|
|
17
|
+
"@webiny/telemetry": "5.42.0-beta.0",
|
|
17
18
|
"chalk": "4.1.2",
|
|
18
19
|
"execa": "5.1.1",
|
|
19
20
|
"find-up": "5.0.0",
|
|
@@ -21,20 +22,20 @@
|
|
|
21
22
|
"js-yaml": "3.14.1",
|
|
22
23
|
"listr": "0.14.3",
|
|
23
24
|
"load-json-file": "6.2.0",
|
|
24
|
-
"node-fetch": "2.7
|
|
25
|
+
"node-fetch": "2.6.7",
|
|
25
26
|
"os": "0.1.1",
|
|
26
27
|
"p-retry": "4.6.2",
|
|
27
|
-
"rimraf": "
|
|
28
|
-
"semver": "7.
|
|
28
|
+
"rimraf": "6.0.1",
|
|
29
|
+
"semver": "7.6.3",
|
|
29
30
|
"uuid": "8.3.2",
|
|
30
31
|
"validate-npm-package-name": "3.0.0",
|
|
31
32
|
"write-json-file": "4.3.0",
|
|
32
|
-
"yargs": "17.
|
|
33
|
+
"yargs": "17.7.2",
|
|
33
34
|
"yesno": "0.4.0"
|
|
34
35
|
},
|
|
35
36
|
"publishConfig": {
|
|
36
37
|
"access": "public",
|
|
37
38
|
"directory": "."
|
|
38
39
|
},
|
|
39
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "ebf90f62ed3f28114ffdb012b7e5f80988af53d3"
|
|
40
41
|
}
|