create-webiny-project 5.40.2-beta.0 → 5.40.2
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/package.json +5 -4
- package/utils/createProject.js +60 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-webiny-project",
|
|
3
|
-
"version": "5.40.2
|
|
3
|
+
"version": "5.40.2",
|
|
4
4
|
"description": "Webiny project bootstrap tool.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"author": "Webiny Ltd.",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@webiny/telemetry": "5.40.2
|
|
16
|
+
"@webiny/telemetry": "5.40.2",
|
|
17
17
|
"chalk": "4.1.2",
|
|
18
18
|
"execa": "5.1.1",
|
|
19
19
|
"find-up": "5.0.0",
|
|
@@ -29,11 +29,12 @@
|
|
|
29
29
|
"uuid": "8.3.2",
|
|
30
30
|
"validate-npm-package-name": "3.0.0",
|
|
31
31
|
"write-json-file": "4.3.0",
|
|
32
|
-
"yargs": "17.6.2"
|
|
32
|
+
"yargs": "17.6.2",
|
|
33
|
+
"yesno": "0.4.0"
|
|
33
34
|
},
|
|
34
35
|
"publishConfig": {
|
|
35
36
|
"access": "public",
|
|
36
37
|
"directory": "."
|
|
37
38
|
},
|
|
38
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "2f0be1d98a87657d119a237d772f66e15736836f"
|
|
39
40
|
}
|
package/utils/createProject.js
CHANGED
|
@@ -12,6 +12,7 @@ const validateProjectName = require("./validateProjectName");
|
|
|
12
12
|
const yaml = require("js-yaml");
|
|
13
13
|
const findUp = require("find-up");
|
|
14
14
|
const { GracefulError } = require("./GracefulError");
|
|
15
|
+
const yesno = require("yesno");
|
|
15
16
|
|
|
16
17
|
const NOT_APPLICABLE = gray("N/A");
|
|
17
18
|
const HL = bold(gray("—")).repeat(30);
|
|
@@ -260,7 +261,8 @@ module.exports = async function createProject({
|
|
|
260
261
|
|
|
261
262
|
console.log();
|
|
262
263
|
|
|
263
|
-
|
|
264
|
+
const setupTemplate = require(templatePath);
|
|
265
|
+
await setupTemplate({
|
|
264
266
|
log,
|
|
265
267
|
isGitAvailable,
|
|
266
268
|
projectName,
|
|
@@ -365,4 +367,61 @@ module.exports = async function createProject({
|
|
|
365
367
|
|
|
366
368
|
process.exit(1);
|
|
367
369
|
}
|
|
370
|
+
|
|
371
|
+
console.log();
|
|
372
|
+
console.log(
|
|
373
|
+
`🎉 Your new Webiny project ${green(
|
|
374
|
+
projectName
|
|
375
|
+
)} has been created and is ready to be deployed for the first time!`
|
|
376
|
+
);
|
|
377
|
+
console.log();
|
|
378
|
+
|
|
379
|
+
const ok = await yesno({
|
|
380
|
+
question: bold(`${green("?")} Would you like to deploy your project now (Y/n)?`),
|
|
381
|
+
defaultValue: true
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
console.log();
|
|
385
|
+
|
|
386
|
+
if (ok) {
|
|
387
|
+
console.log("🚀 Deploying your new Webiny project...");
|
|
388
|
+
console.log();
|
|
389
|
+
|
|
390
|
+
try {
|
|
391
|
+
const command = ["webiny", "deploy"];
|
|
392
|
+
if (debug) {
|
|
393
|
+
command.push("--debug");
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
await execa("yarn", command, {
|
|
397
|
+
cwd: projectRoot,
|
|
398
|
+
stdio: "inherit"
|
|
399
|
+
});
|
|
400
|
+
} catch {
|
|
401
|
+
// Don't do anything. This is because the `webiny deploy` command has its own
|
|
402
|
+
// error handling and will print the error message. As far as this setup script
|
|
403
|
+
// is concerned, it succeeded, and it doesn't need to do anything else.
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
console.log(
|
|
410
|
+
[
|
|
411
|
+
`Finish the setup by running the following command: ${green(
|
|
412
|
+
`cd ${projectName} && yarn webiny deploy`
|
|
413
|
+
)}`,
|
|
414
|
+
"",
|
|
415
|
+
`To see all of the available CLI commands, run ${green(
|
|
416
|
+
"yarn webiny --help"
|
|
417
|
+
)} in your ${green(projectName)} directory.`,
|
|
418
|
+
"",
|
|
419
|
+
"Want to dive deeper into Webiny? Check out https://webiny.com/docs/!",
|
|
420
|
+
"Like the project? Star us on https://github.com/webiny/webiny-js!",
|
|
421
|
+
"",
|
|
422
|
+
"Need help? Join our Slack community! https://www.webiny.com/slack",
|
|
423
|
+
"",
|
|
424
|
+
"🚀 Happy coding!"
|
|
425
|
+
].join("\n")
|
|
426
|
+
);
|
|
368
427
|
};
|