create-webiny-project 6.3.0 → 6.4.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.
Files changed (50) hide show
  1. package/_templates/base/template.package.json +1 -1
  2. package/bin.js +74 -83
  3. package/bin.js.map +1 -1
  4. package/features/CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js +28 -37
  5. package/features/CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js.map +1 -1
  6. package/features/CreateWebinyProject/projects/aws/availableAwsRegions.js +75 -58
  7. package/features/CreateWebinyProject/projects/aws/availableAwsRegions.js.map +1 -1
  8. package/features/CreateWebinyProject/projects/aws/runInteractivePrompt.js +46 -39
  9. package/features/CreateWebinyProject/projects/aws/runInteractivePrompt.js.map +1 -1
  10. package/features/CreateWebinyProject/projects/aws/types.js +0 -3
  11. package/features/CreateWebinyProject/projects/base/SetupBaseWebinyProject.js +27 -24
  12. package/features/CreateWebinyProject/projects/base/SetupBaseWebinyProject.js.map +1 -1
  13. package/features/CreateWebinyProject.js +160 -187
  14. package/features/CreateWebinyProject.js.map +1 -1
  15. package/package.json +9 -9
  16. package/services/Analytics.js +12 -11
  17. package/services/Analytics.js.map +1 -1
  18. package/services/EnsureNoGlobalWebinyCli.js +24 -12
  19. package/services/EnsureNoGlobalWebinyCli.js.map +1 -1
  20. package/services/EnsureNoTargetFolder.js +15 -19
  21. package/services/EnsureNoTargetFolder.js.map +1 -1
  22. package/services/EnsureNoYarnLockPackageJson.js +19 -13
  23. package/services/EnsureNoYarnLockPackageJson.js.map +1 -1
  24. package/services/EnsureSystemWebinyConfig.js +13 -16
  25. package/services/EnsureSystemWebinyConfig.js.map +1 -1
  26. package/services/EnsureValidProjectName.js +17 -16
  27. package/services/EnsureValidProjectName.js.map +1 -1
  28. package/services/GetCwpVersion.js +10 -13
  29. package/services/GetCwpVersion.js.map +1 -1
  30. package/services/GetProjectRootPath.js +5 -4
  31. package/services/GetProjectRootPath.js.map +1 -1
  32. package/services/GetTemplatesFolderPath.js +9 -11
  33. package/services/GetTemplatesFolderPath.js.map +1 -1
  34. package/services/InitGit.js +16 -11
  35. package/services/InitGit.js.map +1 -1
  36. package/services/IsGitAvailable.js +11 -8
  37. package/services/IsGitAvailable.js.map +1 -1
  38. package/services/PrintErrorInfo.js +13 -11
  39. package/services/PrintErrorInfo.js.map +1 -1
  40. package/services/PrintSystemInfo.js +40 -30
  41. package/services/PrintSystemInfo.js.map +1 -1
  42. package/services/SetWebinyPackageVersions.js +14 -21
  43. package/services/SetWebinyPackageVersions.js.map +1 -1
  44. package/services/SetupYarn.js +35 -53
  45. package/services/SetupYarn.js.map +1 -1
  46. package/services/index.js +0 -2
  47. package/types.js +0 -3
  48. package/features/CreateWebinyProject/projects/aws/types.js.map +0 -1
  49. package/services/index.js.map +0 -1
  50. package/types.js.map +0 -1
@@ -1,18 +1,30 @@
1
1
  import execa from "execa";
2
2
  import chalk from "chalk";
3
- const {
4
- green
5
- } = chalk;
6
- export class EnsureNoGlobalWebinyCli {
7
- async execute() {
8
- try {
9
- await execa("npm", ["list", "-g", "@webiny/cli"]);
10
- console.log(["", "🚨 IMPORTANT NOTICE:", "----------------------------------------", `We've detected a global installation of ${green("@webiny/cli")}. This might not play well with your new project.`, `We recommend you do one of the following things:\n`, ` - uninstall the global @webiny/cli package by running ${green("npm rm -g @webiny/cli")} or`, ` - run webiny commands using ${green("yarn webiny")} so that the package is always resolved to your project dependencies\n`, `The second option is also recommended if you have an older version of Webiny project you want to keep using.`, "----------------------------------------", ""].join("\n"));
11
- process.exit(1);
12
- } catch {
13
- // @webiny/cli is not installed globally
3
+ const { green: green } = chalk;
4
+ class EnsureNoGlobalWebinyCli {
5
+ async execute() {
6
+ try {
7
+ await execa("npm", [
8
+ "list",
9
+ "-g",
10
+ "@webiny/cli"
11
+ ]);
12
+ console.log([
13
+ "",
14
+ "🚨 IMPORTANT NOTICE:",
15
+ "----------------------------------------",
16
+ `We've detected a global installation of ${green("@webiny/cli")}. This might not play well with your new project.`,
17
+ `We recommend you do one of the following things:\n`,
18
+ ` - uninstall the global @webiny/cli package by running ${green("npm rm -g @webiny/cli")} or`,
19
+ ` - run webiny commands using ${green("yarn webiny")} so that the package is always resolved to your project dependencies\n`,
20
+ "The second option is also recommended if you have an older version of Webiny project you want to keep using.",
21
+ "----------------------------------------",
22
+ ""
23
+ ].join("\n"));
24
+ process.exit(1);
25
+ } catch {}
14
26
  }
15
- }
16
27
  }
28
+ export { EnsureNoGlobalWebinyCli };
17
29
 
18
30
  //# sourceMappingURL=EnsureNoGlobalWebinyCli.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["execa","chalk","green","EnsureNoGlobalWebinyCli","execute","console","log","join","process","exit"],"sources":["EnsureNoGlobalWebinyCli.ts"],"sourcesContent":["import execa from \"execa\";\nimport chalk from \"chalk\";\nconst { green } = chalk;\n\nexport class EnsureNoGlobalWebinyCli {\n async execute() {\n try {\n await execa(\"npm\", [\"list\", \"-g\", \"@webiny/cli\"]);\n console.log(\n [\n \"\",\n \"🚨 IMPORTANT NOTICE:\",\n \"----------------------------------------\",\n `We've detected a global installation of ${green(\n \"@webiny/cli\"\n )}. This might not play well with your new project.`,\n `We recommend you do one of the following things:\\n`,\n ` - uninstall the global @webiny/cli package by running ${green(\n \"npm rm -g @webiny/cli\"\n )} or`,\n ` - run webiny commands using ${green(\n \"yarn webiny\"\n )} so that the package is always resolved to your project dependencies\\n`,\n `The second option is also recommended if you have an older version of Webiny project you want to keep using.`,\n \"----------------------------------------\",\n \"\"\n ].join(\"\\n\")\n );\n\n process.exit(1);\n } catch {\n // @webiny/cli is not installed globally\n }\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,KAAK,MAAM,OAAO;AACzB,MAAM;EAAEC;AAAM,CAAC,GAAGD,KAAK;AAEvB,OAAO,MAAME,uBAAuB,CAAC;EACjC,MAAMC,OAAOA,CAAA,EAAG;IACZ,IAAI;MACA,MAAMJ,KAAK,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;MACjDK,OAAO,CAACC,GAAG,CACP,CACI,EAAE,EACF,sBAAsB,EACtB,0CAA0C,EAC1C,2CAA2CJ,KAAK,CAC5C,aACJ,CAAC,mDAAmD,EACpD,oDAAoD,EACpD,0DAA0DA,KAAK,CAC3D,uBACJ,CAAC,KAAK,EACN,gCAAgCA,KAAK,CACjC,aACJ,CAAC,wEAAwE,EACzE,8GAA8G,EAC9G,0CAA0C,EAC1C,EAAE,CACL,CAACK,IAAI,CAAC,IAAI,CACf,CAAC;MAEDC,OAAO,CAACC,IAAI,CAAC,CAAC,CAAC;IACnB,CAAC,CAAC,MAAM;MACJ;IAAA;EAER;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"services/EnsureNoGlobalWebinyCli.js","sources":["../../src/services/EnsureNoGlobalWebinyCli.ts"],"sourcesContent":["import execa from \"execa\";\nimport chalk from \"chalk\";\nconst { green } = chalk;\n\nexport class EnsureNoGlobalWebinyCli {\n async execute() {\n try {\n await execa(\"npm\", [\"list\", \"-g\", \"@webiny/cli\"]);\n console.log(\n [\n \"\",\n \"🚨 IMPORTANT NOTICE:\",\n \"----------------------------------------\",\n `We've detected a global installation of ${green(\n \"@webiny/cli\"\n )}. This might not play well with your new project.`,\n `We recommend you do one of the following things:\\n`,\n ` - uninstall the global @webiny/cli package by running ${green(\n \"npm rm -g @webiny/cli\"\n )} or`,\n ` - run webiny commands using ${green(\n \"yarn webiny\"\n )} so that the package is always resolved to your project dependencies\\n`,\n `The second option is also recommended if you have an older version of Webiny project you want to keep using.`,\n \"----------------------------------------\",\n \"\"\n ].join(\"\\n\")\n );\n\n process.exit(1);\n } catch {\n // @webiny/cli is not installed globally\n }\n }\n}\n"],"names":["green","chalk","EnsureNoGlobalWebinyCli","execa","console","process"],"mappings":";;AAEA,MAAM,EAAEA,OAAAA,KAAK,EAAE,GAAGC;AAEX,MAAMC;IACT,MAAM,UAAU;QACZ,IAAI;YACA,MAAMC,MAAM,OAAO;gBAAC;gBAAQ;gBAAM;aAAc;YAChDC,QAAQ,GAAG,CACP;gBACI;gBACA;gBACA;gBACA,CAAC,wCAAwC,EAAEJ,MACvC,eACF,iDAAiD,CAAC;gBACpD,CAAC,kDAAkD,CAAC;gBACpD,CAAC,uDAAuD,EAAEA,MACtD,yBACF,GAAG,CAAC;gBACN,CAAC,6BAA6B,EAAEA,MAC5B,eACF,sEAAsE,CAAC;gBACzE;gBACA;gBACA;aACH,CAAC,IAAI,CAAC;YAGXK,QAAQ,IAAI,CAAC;QACjB,EAAE,OAAM,CAER;IACJ;AACJ"}
@@ -1,25 +1,21 @@
1
- import fs from "fs-extra";
1
+ import fs_extra from "fs-extra";
2
2
  import chalk from "chalk";
3
3
  import { GetProjectRootPath } from "./GetProjectRootPath.js";
4
- const {
5
- red
6
- } = chalk;
7
- export class EnsureNoTargetFolder {
8
- execute(cliArgs) {
9
- const getProjectRootPath = new GetProjectRootPath();
10
- const projectRootPath = getProjectRootPath.execute(cliArgs);
11
- const {
12
- force,
13
- projectName
14
- } = cliArgs;
15
- if (fs.existsSync(projectRootPath)) {
16
- if (!force) {
17
- console.log(`Cannot continue because the target folder ${red(projectName)} already exists.`);
18
- console.log(`If you still wish to proceed, run the same command with the ${red("--force")} flag.`);
19
- process.exit(1);
20
- }
4
+ const { red: red } = chalk;
5
+ class EnsureNoTargetFolder {
6
+ execute(cliArgs) {
7
+ const getProjectRootPath = new GetProjectRootPath();
8
+ const projectRootPath = getProjectRootPath.execute(cliArgs);
9
+ const { force, projectName } = cliArgs;
10
+ if (fs_extra.existsSync(projectRootPath)) {
11
+ if (!force) {
12
+ console.log(`Cannot continue because the target folder ${red(projectName)} already exists.`);
13
+ console.log(`If you still wish to proceed, run the same command with the ${red("--force")} flag.`);
14
+ process.exit(1);
15
+ }
16
+ }
21
17
  }
22
- }
23
18
  }
19
+ export { EnsureNoTargetFolder };
24
20
 
25
21
  //# sourceMappingURL=EnsureNoTargetFolder.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["fs","chalk","GetProjectRootPath","red","EnsureNoTargetFolder","execute","cliArgs","getProjectRootPath","projectRootPath","force","projectName","existsSync","console","log","process","exit"],"sources":["EnsureNoTargetFolder.ts"],"sourcesContent":["import fs from \"fs-extra\";\nimport chalk from \"chalk\";\nimport { CliParams } from \"../types.js\";\nimport { GetProjectRootPath } from \"./GetProjectRootPath.js\";\n\nconst { red } = chalk;\n\nexport class EnsureNoTargetFolder {\n execute(cliArgs: CliParams) {\n const getProjectRootPath = new GetProjectRootPath();\n const projectRootPath = getProjectRootPath.execute(cliArgs);\n\n const { force, projectName } = cliArgs;\n if (fs.existsSync(projectRootPath)) {\n if (!force) {\n console.log(\n `Cannot continue because the target folder ${red(projectName)} already exists.`\n );\n console.log(\n `If you still wish to proceed, run the same command with the ${red(\n \"--force\"\n )} flag.`\n );\n process.exit(1);\n }\n }\n }\n}\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,UAAU;AACzB,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,kBAAkB;AAE3B,MAAM;EAAEC;AAAI,CAAC,GAAGF,KAAK;AAErB,OAAO,MAAMG,oBAAoB,CAAC;EAC9BC,OAAOA,CAACC,OAAkB,EAAE;IACxB,MAAMC,kBAAkB,GAAG,IAAIL,kBAAkB,CAAC,CAAC;IACnD,MAAMM,eAAe,GAAGD,kBAAkB,CAACF,OAAO,CAACC,OAAO,CAAC;IAE3D,MAAM;MAAEG,KAAK;MAAEC;IAAY,CAAC,GAAGJ,OAAO;IACtC,IAAIN,EAAE,CAACW,UAAU,CAACH,eAAe,CAAC,EAAE;MAChC,IAAI,CAACC,KAAK,EAAE;QACRG,OAAO,CAACC,GAAG,CACP,6CAA6CV,GAAG,CAACO,WAAW,CAAC,kBACjE,CAAC;QACDE,OAAO,CAACC,GAAG,CACP,+DAA+DV,GAAG,CAC9D,SACJ,CAAC,QACL,CAAC;QACDW,OAAO,CAACC,IAAI,CAAC,CAAC,CAAC;MACnB;IACJ;EACJ;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"services/EnsureNoTargetFolder.js","sources":["../../src/services/EnsureNoTargetFolder.ts"],"sourcesContent":["import fs from \"fs-extra\";\nimport chalk from \"chalk\";\nimport { CliParams } from \"../types.js\";\nimport { GetProjectRootPath } from \"./GetProjectRootPath.js\";\n\nconst { red } = chalk;\n\nexport class EnsureNoTargetFolder {\n execute(cliArgs: CliParams) {\n const getProjectRootPath = new GetProjectRootPath();\n const projectRootPath = getProjectRootPath.execute(cliArgs);\n\n const { force, projectName } = cliArgs;\n if (fs.existsSync(projectRootPath)) {\n if (!force) {\n console.log(\n `Cannot continue because the target folder ${red(projectName)} already exists.`\n );\n console.log(\n `If you still wish to proceed, run the same command with the ${red(\n \"--force\"\n )} flag.`\n );\n process.exit(1);\n }\n }\n }\n}\n"],"names":["red","chalk","EnsureNoTargetFolder","cliArgs","getProjectRootPath","GetProjectRootPath","projectRootPath","force","projectName","fs","console","process"],"mappings":";;;AAKA,MAAM,EAAEA,KAAAA,GAAG,EAAE,GAAGC;AAET,MAAMC;IACT,QAAQC,OAAkB,EAAE;QACxB,MAAMC,qBAAqB,IAAIC;QAC/B,MAAMC,kBAAkBF,mBAAmB,OAAO,CAACD;QAEnD,MAAM,EAAEI,KAAK,EAAEC,WAAW,EAAE,GAAGL;QAC/B,IAAIM,SAAAA,UAAa,CAACH,kBACd;YAAA,IAAI,CAACC,OAAO;gBACRG,QAAQ,GAAG,CACP,CAAC,0CAA0C,EAAEV,IAAIQ,aAAa,gBAAgB,CAAC;gBAEnFE,QAAQ,GAAG,CACP,CAAC,4DAA4D,EAAEV,IAC3D,WACF,MAAM,CAAC;gBAEbW,QAAQ,IAAI,CAAC;YACjB;QAAA;IAER;AACJ"}
@@ -1,18 +1,24 @@
1
1
  import { findUp } from "find-up";
2
2
  import chalk from "chalk";
3
- const {
4
- red
5
- } = chalk;
6
- export class EnsureNoYarnLockPackageJson {
7
- async execute() {
8
- return Promise.all([findUp("yarn.lock"), findUp("package.json")]).then(files => files.filter(Boolean)).then(files => {
9
- if (files.length) {
10
- const messages = ["\nThe following file(s) will cause problems with project root detection:\n", ...files.map(file => red(file) + "\n"), `\nMake sure you delete all ${red("yarn.lock")} and ${red("package.json")} files higher in the hierarchy.`];
11
- console.log(messages.join(""));
12
- process.exit(1);
13
- }
14
- });
15
- }
3
+ const { red: red } = chalk;
4
+ class EnsureNoYarnLockPackageJson {
5
+ async execute() {
6
+ return Promise.all([
7
+ findUp("yarn.lock"),
8
+ findUp("package.json")
9
+ ]).then((files)=>files.filter(Boolean)).then((files)=>{
10
+ if (files.length) {
11
+ const messages = [
12
+ "\nThe following file(s) will cause problems with project root detection:\n",
13
+ ...files.map((file)=>red(file) + "\n"),
14
+ `\nMake sure you delete all ${red("yarn.lock")} and ${red("package.json")} files higher in the hierarchy.`
15
+ ];
16
+ console.log(messages.join(""));
17
+ process.exit(1);
18
+ }
19
+ });
20
+ }
16
21
  }
22
+ export { EnsureNoYarnLockPackageJson };
17
23
 
18
24
  //# sourceMappingURL=EnsureNoYarnLockPackageJson.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["findUp","chalk","red","EnsureNoYarnLockPackageJson","execute","Promise","all","then","files","filter","Boolean","length","messages","map","file","console","log","join","process","exit"],"sources":["EnsureNoYarnLockPackageJson.ts"],"sourcesContent":["import { findUp } from \"find-up\";\nimport chalk from \"chalk\";\n\nconst { red } = chalk;\n\nexport class EnsureNoYarnLockPackageJson {\n async execute() {\n return Promise.all([findUp(\"yarn.lock\"), findUp(\"package.json\")])\n .then(files => files.filter(Boolean))\n .then(files => {\n if (files.length) {\n const messages = [\n \"\\nThe following file(s) will cause problems with project root detection:\\n\",\n ...files.map(file => red(file) + \"\\n\"),\n `\\nMake sure you delete all ${red(\"yarn.lock\")} and ${red(\n \"package.json\"\n )} files higher in the hierarchy.`\n ];\n\n console.log(messages.join(\"\"));\n process.exit(1);\n }\n });\n }\n}\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,SAAS;AAChC,OAAOC,KAAK,MAAM,OAAO;AAEzB,MAAM;EAAEC;AAAI,CAAC,GAAGD,KAAK;AAErB,OAAO,MAAME,2BAA2B,CAAC;EACrC,MAAMC,OAAOA,CAAA,EAAG;IACZ,OAAOC,OAAO,CAACC,GAAG,CAAC,CAACN,MAAM,CAAC,WAAW,CAAC,EAAEA,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAC5DO,IAAI,CAACC,KAAK,IAAIA,KAAK,CAACC,MAAM,CAACC,OAAO,CAAC,CAAC,CACpCH,IAAI,CAACC,KAAK,IAAI;MACX,IAAIA,KAAK,CAACG,MAAM,EAAE;QACd,MAAMC,QAAQ,GAAG,CACb,4EAA4E,EAC5E,GAAGJ,KAAK,CAACK,GAAG,CAACC,IAAI,IAAIZ,GAAG,CAACY,IAAI,CAAC,GAAG,IAAI,CAAC,EACtC,8BAA8BZ,GAAG,CAAC,WAAW,CAAC,QAAQA,GAAG,CACrD,cACJ,CAAC,iCAAiC,CACrC;QAEDa,OAAO,CAACC,GAAG,CAACJ,QAAQ,CAACK,IAAI,CAAC,EAAE,CAAC,CAAC;QAC9BC,OAAO,CAACC,IAAI,CAAC,CAAC,CAAC;MACnB;IACJ,CAAC,CAAC;EACV;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"services/EnsureNoYarnLockPackageJson.js","sources":["../../src/services/EnsureNoYarnLockPackageJson.ts"],"sourcesContent":["import { findUp } from \"find-up\";\nimport chalk from \"chalk\";\n\nconst { red } = chalk;\n\nexport class EnsureNoYarnLockPackageJson {\n async execute() {\n return Promise.all([findUp(\"yarn.lock\"), findUp(\"package.json\")])\n .then(files => files.filter(Boolean))\n .then(files => {\n if (files.length) {\n const messages = [\n \"\\nThe following file(s) will cause problems with project root detection:\\n\",\n ...files.map(file => red(file) + \"\\n\"),\n `\\nMake sure you delete all ${red(\"yarn.lock\")} and ${red(\n \"package.json\"\n )} files higher in the hierarchy.`\n ];\n\n console.log(messages.join(\"\"));\n process.exit(1);\n }\n });\n }\n}\n"],"names":["red","chalk","EnsureNoYarnLockPackageJson","Promise","findUp","files","Boolean","messages","file","console","process"],"mappings":";;AAGA,MAAM,EAAEA,KAAAA,GAAG,EAAE,GAAGC;AAET,MAAMC;IACT,MAAM,UAAU;QACZ,OAAOC,QAAQ,GAAG,CAAC;YAACC,OAAO;YAAcA,OAAO;SAAgB,EAC3D,IAAI,CAACC,CAAAA,QAASA,MAAM,MAAM,CAACC,UAC3B,IAAI,CAACD,CAAAA;YACF,IAAIA,MAAM,MAAM,EAAE;gBACd,MAAME,WAAW;oBACb;uBACGF,MAAM,GAAG,CAACG,CAAAA,OAAQR,IAAIQ,QAAQ;oBACjC,CAAC,2BAA2B,EAAER,IAAI,aAAa,KAAK,EAAEA,IAClD,gBACF,+BAA+B,CAAC;iBACrC;gBAEDS,QAAQ,GAAG,CAACF,SAAS,IAAI,CAAC;gBAC1BG,QAAQ,IAAI,CAAC;YACjB;QACJ;IACR;AACJ"}
@@ -2,24 +2,21 @@ import os from "os";
2
2
  import path from "path";
3
3
  import { loadJsonFileSync } from "load-json-file";
4
4
  import { writeJsonFileSync } from "write-json-file";
5
- import { v4 as uuidv4 } from "uuid";
5
+ import { v4 } from "uuid";
6
6
  const configPath = path.join(os.homedir(), ".webiny", "config");
7
- export class EnsureSystemWebinyConfig {
8
- execute() {
9
- // Check user ID
10
- try {
11
- const config = loadJsonFileSync(configPath);
12
- if (!config.id) {
13
- throw Error("Invalid Webiny config.");
14
- }
15
- } catch {
16
- // A new config file is written if it doesn't exist or is invalid.
17
- writeJsonFileSync(configPath, {
18
- id: uuidv4(),
19
- telemetry: true
20
- });
7
+ class EnsureSystemWebinyConfig {
8
+ execute() {
9
+ try {
10
+ const config = loadJsonFileSync(configPath);
11
+ if (!config.id) throw Error("Invalid Webiny config.");
12
+ } catch {
13
+ writeJsonFileSync(configPath, {
14
+ id: v4(),
15
+ telemetry: true
16
+ });
17
+ }
21
18
  }
22
- }
23
19
  }
20
+ export { EnsureSystemWebinyConfig };
24
21
 
25
22
  //# sourceMappingURL=EnsureSystemWebinyConfig.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["os","path","loadJsonFileSync","writeJsonFileSync","v4","uuidv4","configPath","join","homedir","EnsureSystemWebinyConfig","execute","config","id","Error","telemetry"],"sources":["EnsureSystemWebinyConfig.ts"],"sourcesContent":["import os from \"os\";\nimport path from \"path\";\nimport { loadJsonFileSync } from \"load-json-file\";\nimport { writeJsonFileSync } from \"write-json-file\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nconst configPath = path.join(os.homedir(), \".webiny\", \"config\");\n\nexport class EnsureSystemWebinyConfig {\n execute() {\n // Check user ID\n try {\n const config = loadJsonFileSync<Record<string, any>>(configPath);\n if (!config.id) {\n throw Error(\"Invalid Webiny config.\");\n }\n } catch {\n // A new config file is written if it doesn't exist or is invalid.\n writeJsonFileSync(configPath, { id: uuidv4(), telemetry: true });\n }\n }\n}\n"],"mappings":"AAAA,OAAOA,EAAE,MAAM,IAAI;AACnB,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,gBAAgB,QAAQ,gBAAgB;AACjD,SAASC,iBAAiB,QAAQ,iBAAiB;AACnD,SAASC,EAAE,IAAIC,MAAM,QAAQ,MAAM;AAEnC,MAAMC,UAAU,GAAGL,IAAI,CAACM,IAAI,CAACP,EAAE,CAACQ,OAAO,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC;AAE/D,OAAO,MAAMC,wBAAwB,CAAC;EAClCC,OAAOA,CAAA,EAAG;IACN;IACA,IAAI;MACA,MAAMC,MAAM,GAAGT,gBAAgB,CAAsBI,UAAU,CAAC;MAChE,IAAI,CAACK,MAAM,CAACC,EAAE,EAAE;QACZ,MAAMC,KAAK,CAAC,wBAAwB,CAAC;MACzC;IACJ,CAAC,CAAC,MAAM;MACJ;MACAV,iBAAiB,CAACG,UAAU,EAAE;QAAEM,EAAE,EAAEP,MAAM,CAAC,CAAC;QAAES,SAAS,EAAE;MAAK,CAAC,CAAC;IACpE;EACJ;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"services/EnsureSystemWebinyConfig.js","sources":["../../src/services/EnsureSystemWebinyConfig.ts"],"sourcesContent":["import os from \"os\";\nimport path from \"path\";\nimport { loadJsonFileSync } from \"load-json-file\";\nimport { writeJsonFileSync } from \"write-json-file\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nconst configPath = path.join(os.homedir(), \".webiny\", \"config\");\n\nexport class EnsureSystemWebinyConfig {\n execute() {\n // Check user ID\n try {\n const config = loadJsonFileSync<Record<string, any>>(configPath);\n if (!config.id) {\n throw Error(\"Invalid Webiny config.\");\n }\n } catch {\n // A new config file is written if it doesn't exist or is invalid.\n writeJsonFileSync(configPath, { id: uuidv4(), telemetry: true });\n }\n }\n}\n"],"names":["configPath","path","os","EnsureSystemWebinyConfig","config","loadJsonFileSync","Error","writeJsonFileSync","uuidv4"],"mappings":";;;;;AAMA,MAAMA,aAAaC,KAAK,IAAI,CAACC,GAAG,OAAO,IAAI,WAAW;AAE/C,MAAMC;IACT,UAAU;QAEN,IAAI;YACA,MAAMC,SAASC,iBAAsCL;YACrD,IAAI,CAACI,OAAO,EAAE,EACV,MAAME,MAAM;QAEpB,EAAE,OAAM;YAEJC,kBAAkBP,YAAY;gBAAE,IAAIQ;gBAAU,WAAW;YAAK;QAClE;IACJ;AACJ"}
@@ -1,21 +1,22 @@
1
- import validateNpmPkgName from "validate-npm-package-name";
1
+ import validate_npm_package_name from "validate-npm-package-name";
2
2
  import chalk from "chalk";
3
- const {
4
- red,
5
- green
6
- } = chalk;
7
- export class EnsureValidProjectName {
8
- execute(projectName) {
9
- const validationResult = validateNpmPkgName(projectName);
10
- if (!validationResult.validForNewPackages) {
11
- console.error(red(`Cannot create a project named ${green(`"${projectName}"`)} because of npm naming restrictions:\n`));
12
- [...(validationResult.errors || []), ...(validationResult.warnings || [])].forEach(error => {
13
- console.error(red(` * ${error}`));
14
- });
15
- console.error(red("\nPlease choose a different project name."));
16
- process.exit(1);
3
+ const { red: red, green: green } = chalk;
4
+ class EnsureValidProjectName {
5
+ execute(projectName) {
6
+ const validationResult = validate_npm_package_name(projectName);
7
+ if (!validationResult.validForNewPackages) {
8
+ console.error(red(`Cannot create a project named ${green(`"${projectName}"`)} because of npm naming restrictions:\n`));
9
+ [
10
+ ...validationResult.errors || [],
11
+ ...validationResult.warnings || []
12
+ ].forEach((error)=>{
13
+ console.error(red(` * ${error}`));
14
+ });
15
+ console.error(red("\nPlease choose a different project name."));
16
+ process.exit(1);
17
+ }
17
18
  }
18
- }
19
19
  }
20
+ export { EnsureValidProjectName };
20
21
 
21
22
  //# sourceMappingURL=EnsureValidProjectName.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["validateNpmPkgName","chalk","red","green","EnsureValidProjectName","execute","projectName","validationResult","validForNewPackages","console","error","errors","warnings","forEach","process","exit"],"sources":["EnsureValidProjectName.ts"],"sourcesContent":["import validateNpmPkgName from \"validate-npm-package-name\";\nimport chalk from \"chalk\";\n\nconst { red, green } = chalk;\n\nexport class EnsureValidProjectName {\n execute(projectName: string) {\n const validationResult = validateNpmPkgName(projectName);\n if (!validationResult.validForNewPackages) {\n console.error(\n red(\n `Cannot create a project named ${green(\n `\"${projectName}\"`\n )} because of npm naming restrictions:\\n`\n )\n );\n [...(validationResult.errors || []), ...(validationResult.warnings || [])].forEach(\n error => {\n console.error(red(` * ${error}`));\n }\n );\n console.error(red(\"\\nPlease choose a different project name.\"));\n process.exit(1);\n }\n }\n}\n"],"mappings":"AAAA,OAAOA,kBAAkB,MAAM,2BAA2B;AAC1D,OAAOC,KAAK,MAAM,OAAO;AAEzB,MAAM;EAAEC,GAAG;EAAEC;AAAM,CAAC,GAAGF,KAAK;AAE5B,OAAO,MAAMG,sBAAsB,CAAC;EAChCC,OAAOA,CAACC,WAAmB,EAAE;IACzB,MAAMC,gBAAgB,GAAGP,kBAAkB,CAACM,WAAW,CAAC;IACxD,IAAI,CAACC,gBAAgB,CAACC,mBAAmB,EAAE;MACvCC,OAAO,CAACC,KAAK,CACTR,GAAG,CACC,iCAAiCC,KAAK,CAClC,IAAIG,WAAW,GACnB,CAAC,wCACL,CACJ,CAAC;MACD,CAAC,IAAIC,gBAAgB,CAACI,MAAM,IAAI,EAAE,CAAC,EAAE,IAAIJ,gBAAgB,CAACK,QAAQ,IAAI,EAAE,CAAC,CAAC,CAACC,OAAO,CAC9EH,KAAK,IAAI;QACLD,OAAO,CAACC,KAAK,CAACR,GAAG,CAAC,OAAOQ,KAAK,EAAE,CAAC,CAAC;MACtC,CACJ,CAAC;MACDD,OAAO,CAACC,KAAK,CAACR,GAAG,CAAC,2CAA2C,CAAC,CAAC;MAC/DY,OAAO,CAACC,IAAI,CAAC,CAAC,CAAC;IACnB;EACJ;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"services/EnsureValidProjectName.js","sources":["../../src/services/EnsureValidProjectName.ts"],"sourcesContent":["import validateNpmPkgName from \"validate-npm-package-name\";\nimport chalk from \"chalk\";\n\nconst { red, green } = chalk;\n\nexport class EnsureValidProjectName {\n execute(projectName: string) {\n const validationResult = validateNpmPkgName(projectName);\n if (!validationResult.validForNewPackages) {\n console.error(\n red(\n `Cannot create a project named ${green(\n `\"${projectName}\"`\n )} because of npm naming restrictions:\\n`\n )\n );\n [...(validationResult.errors || []), ...(validationResult.warnings || [])].forEach(\n error => {\n console.error(red(` * ${error}`));\n }\n );\n console.error(red(\"\\nPlease choose a different project name.\"));\n process.exit(1);\n }\n }\n}\n"],"names":["red","green","chalk","EnsureValidProjectName","projectName","validationResult","validateNpmPkgName","console","error","process"],"mappings":";;AAGA,MAAM,EAAEA,KAAAA,GAAG,EAAEC,OAAAA,KAAK,EAAE,GAAGC;AAEhB,MAAMC;IACT,QAAQC,WAAmB,EAAE;QACzB,MAAMC,mBAAmBC,0BAAmBF;QAC5C,IAAI,CAACC,iBAAiB,mBAAmB,EAAE;YACvCE,QAAQ,KAAK,CACTP,IACI,CAAC,8BAA8B,EAAEC,MAC7B,CAAC,CAAC,EAAEG,YAAY,CAAC,CAAC,EACpB,sCAAsC,CAAC;YAGjD;mBAAKC,iBAAiB,MAAM,IAAI,EAAE;mBAAOA,iBAAiB,QAAQ,IAAI,EAAE;aAAE,CAAC,OAAO,CAC9EG,CAAAA;gBACID,QAAQ,KAAK,CAACP,IAAI,CAAC,IAAI,EAAEQ,OAAO;YACpC;YAEJD,QAAQ,KAAK,CAACP,IAAI;YAClBS,QAAQ,IAAI,CAAC;QACjB;IACJ;AACJ"}
@@ -1,19 +1,16 @@
1
1
  import { findUpSync } from "find-up";
2
2
  import { loadJsonFileSync } from "load-json-file";
3
- export class GetCwpVersion {
4
- execute() {
5
- const cwpPackageJsonPath = findUpSync("package.json", {
6
- cwd: import.meta.dirname
7
- });
8
- if (!cwpPackageJsonPath) {
9
- throw new Error("Could not find package.json for create-webiny-project.");
3
+ class GetCwpVersion {
4
+ execute() {
5
+ const cwpPackageJsonPath = findUpSync("package.json", {
6
+ cwd: import.meta.dirname
7
+ });
8
+ if (!cwpPackageJsonPath) throw new Error("Could not find package.json for create-webiny-project.");
9
+ const cwpPackageJson = loadJsonFileSync(cwpPackageJsonPath);
10
+ if (!cwpPackageJson?.version) throw new Error("Could not find version in create-webiny-project's package.json.");
11
+ return cwpPackageJson.version;
10
12
  }
11
- const cwpPackageJson = loadJsonFileSync(cwpPackageJsonPath);
12
- if (!cwpPackageJson?.version) {
13
- throw new Error("Could not find version in create-webiny-project's package.json.");
14
- }
15
- return cwpPackageJson.version;
16
- }
17
13
  }
14
+ export { GetCwpVersion };
18
15
 
19
16
  //# sourceMappingURL=GetCwpVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["findUpSync","loadJsonFileSync","GetCwpVersion","execute","cwpPackageJsonPath","cwd","import","meta","dirname","Error","cwpPackageJson","version"],"sources":["GetCwpVersion.ts"],"sourcesContent":["import { findUpSync } from \"find-up\";\nimport { loadJsonFileSync } from \"load-json-file\";\nimport type { PackageJson } from \"type-fest\";\n\nexport class GetCwpVersion {\n execute(): string {\n const cwpPackageJsonPath = findUpSync(\"package.json\", {\n cwd: import.meta.dirname\n });\n if (!cwpPackageJsonPath) {\n throw new Error(\"Could not find package.json for create-webiny-project.\");\n }\n const cwpPackageJson = loadJsonFileSync<PackageJson>(cwpPackageJsonPath);\n if (!cwpPackageJson?.version) {\n throw new Error(\"Could not find version in create-webiny-project's package.json.\");\n }\n return cwpPackageJson.version;\n }\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,SAAS;AACpC,SAASC,gBAAgB,QAAQ,gBAAgB;AAGjD,OAAO,MAAMC,aAAa,CAAC;EACvBC,OAAOA,CAAA,EAAW;IACd,MAAMC,kBAAkB,GAAGJ,UAAU,CAAC,cAAc,EAAE;MAClDK,GAAG,EAAEC,MAAM,CAACC,IAAI,CAACC;IACrB,CAAC,CAAC;IACF,IAAI,CAACJ,kBAAkB,EAAE;MACrB,MAAM,IAAIK,KAAK,CAAC,wDAAwD,CAAC;IAC7E;IACA,MAAMC,cAAc,GAAGT,gBAAgB,CAAcG,kBAAkB,CAAC;IACxE,IAAI,CAACM,cAAc,EAAEC,OAAO,EAAE;MAC1B,MAAM,IAAIF,KAAK,CAAC,iEAAiE,CAAC;IACtF;IACA,OAAOC,cAAc,CAACC,OAAO;EACjC;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"services/GetCwpVersion.js","sources":["../../src/services/GetCwpVersion.ts"],"sourcesContent":["import { findUpSync } from \"find-up\";\nimport { loadJsonFileSync } from \"load-json-file\";\nimport type { PackageJson } from \"type-fest\";\n\nexport class GetCwpVersion {\n execute(): string {\n const cwpPackageJsonPath = findUpSync(\"package.json\", {\n cwd: import.meta.dirname\n });\n if (!cwpPackageJsonPath) {\n throw new Error(\"Could not find package.json for create-webiny-project.\");\n }\n const cwpPackageJson = loadJsonFileSync<PackageJson>(cwpPackageJsonPath);\n if (!cwpPackageJson?.version) {\n throw new Error(\"Could not find version in create-webiny-project's package.json.\");\n }\n return cwpPackageJson.version;\n }\n}\n"],"names":["GetCwpVersion","cwpPackageJsonPath","findUpSync","Error","cwpPackageJson","loadJsonFileSync"],"mappings":";;AAIO,MAAMA;IACT,UAAkB;QACd,MAAMC,qBAAqBC,WAAW,gBAAgB;YAClD,KAAK,YAAY,OAAO;QAC5B;QACA,IAAI,CAACD,oBACD,MAAM,IAAIE,MAAM;QAEpB,MAAMC,iBAAiBC,iBAA8BJ;QACrD,IAAI,CAACG,gBAAgB,SACjB,MAAM,IAAID,MAAM;QAEpB,OAAOC,eAAe,OAAO;IACjC;AACJ"}
@@ -1,8 +1,9 @@
1
1
  import path from "path";
2
- export class GetProjectRootPath {
3
- execute(cliArgs) {
4
- return path.resolve(cliArgs.projectName).replace(/\\/g, "/");
5
- }
2
+ class GetProjectRootPath {
3
+ execute(cliArgs) {
4
+ return path.resolve(cliArgs.projectName).replace(/\\/g, "/");
5
+ }
6
6
  }
7
+ export { GetProjectRootPath };
7
8
 
8
9
  //# sourceMappingURL=GetProjectRootPath.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["path","GetProjectRootPath","execute","cliArgs","resolve","projectName","replace"],"sources":["GetProjectRootPath.ts"],"sourcesContent":["import path from \"path\";\nimport { CliParams } from \"../types.js\";\n\nexport class GetProjectRootPath {\n execute(cliArgs: CliParams) {\n return path.resolve(cliArgs.projectName).replace(/\\\\/g, \"/\");\n }\n}\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,MAAM;AAGvB,OAAO,MAAMC,kBAAkB,CAAC;EAC5BC,OAAOA,CAACC,OAAkB,EAAE;IACxB,OAAOH,IAAI,CAACI,OAAO,CAACD,OAAO,CAACE,WAAW,CAAC,CAACC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;EAChE;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"services/GetProjectRootPath.js","sources":["../../src/services/GetProjectRootPath.ts"],"sourcesContent":["import path from \"path\";\nimport { CliParams } from \"../types.js\";\n\nexport class GetProjectRootPath {\n execute(cliArgs: CliParams) {\n return path.resolve(cliArgs.projectName).replace(/\\\\/g, \"/\");\n }\n}\n"],"names":["GetProjectRootPath","cliArgs","path"],"mappings":";AAGO,MAAMA;IACT,QAAQC,OAAkB,EAAE;QACxB,OAAOC,KAAK,OAAO,CAACD,QAAQ,WAAW,EAAE,OAAO,CAAC,OAAO;IAC5D;AACJ"}
@@ -1,18 +1,16 @@
1
1
  import { findUpSync } from "find-up";
2
2
  import path from "path";
3
3
  const TEMPLATES_FOLDER_NAME = "_templates";
4
- export class GetTemplatesFolderPath {
5
- execute() {
6
- const templatesFolderPath = findUpSync(TEMPLATES_FOLDER_NAME, {
7
- type: "directory",
8
- cwd: path.join(import.meta.dirname)
9
- });
10
- if (!templatesFolderPath) {
11
- // This should never happen because we're controlling the templates.
12
- throw new Error("Could not find the `appTemplates` folder. Something went terribly wrong.");
4
+ class GetTemplatesFolderPath {
5
+ execute() {
6
+ const templatesFolderPath = findUpSync(TEMPLATES_FOLDER_NAME, {
7
+ type: "directory",
8
+ cwd: path.join(import.meta.dirname)
9
+ });
10
+ if (!templatesFolderPath) throw new Error("Could not find the `appTemplates` folder. Something went terribly wrong.");
11
+ return templatesFolderPath;
13
12
  }
14
- return templatesFolderPath;
15
- }
16
13
  }
14
+ export { GetTemplatesFolderPath };
17
15
 
18
16
  //# sourceMappingURL=GetTemplatesFolderPath.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["findUpSync","path","TEMPLATES_FOLDER_NAME","GetTemplatesFolderPath","execute","templatesFolderPath","type","cwd","join","import","meta","dirname","Error"],"sources":["GetTemplatesFolderPath.ts"],"sourcesContent":["import { findUpSync } from \"find-up\";\nimport path from \"path\";\n\nconst TEMPLATES_FOLDER_NAME = \"_templates\";\n\nexport class GetTemplatesFolderPath {\n execute() {\n const templatesFolderPath = findUpSync(TEMPLATES_FOLDER_NAME, {\n type: \"directory\",\n cwd: path.join(import.meta.dirname)\n });\n\n if (!templatesFolderPath) {\n // This should never happen because we're controlling the templates.\n throw new Error(\n \"Could not find the `appTemplates` folder. Something went terribly wrong.\"\n );\n }\n\n return templatesFolderPath;\n }\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,SAAS;AACpC,OAAOC,IAAI,MAAM,MAAM;AAEvB,MAAMC,qBAAqB,GAAG,YAAY;AAE1C,OAAO,MAAMC,sBAAsB,CAAC;EAChCC,OAAOA,CAAA,EAAG;IACN,MAAMC,mBAAmB,GAAGL,UAAU,CAACE,qBAAqB,EAAE;MAC1DI,IAAI,EAAE,WAAW;MACjBC,GAAG,EAAEN,IAAI,CAACO,IAAI,CAACC,MAAM,CAACC,IAAI,CAACC,OAAO;IACtC,CAAC,CAAC;IAEF,IAAI,CAACN,mBAAmB,EAAE;MACtB;MACA,MAAM,IAAIO,KAAK,CACX,0EACJ,CAAC;IACL;IAEA,OAAOP,mBAAmB;EAC9B;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"services/GetTemplatesFolderPath.js","sources":["../../src/services/GetTemplatesFolderPath.ts"],"sourcesContent":["import { findUpSync } from \"find-up\";\nimport path from \"path\";\n\nconst TEMPLATES_FOLDER_NAME = \"_templates\";\n\nexport class GetTemplatesFolderPath {\n execute() {\n const templatesFolderPath = findUpSync(TEMPLATES_FOLDER_NAME, {\n type: \"directory\",\n cwd: path.join(import.meta.dirname)\n });\n\n if (!templatesFolderPath) {\n // This should never happen because we're controlling the templates.\n throw new Error(\n \"Could not find the `appTemplates` folder. Something went terribly wrong.\"\n );\n }\n\n return templatesFolderPath;\n }\n}\n"],"names":["TEMPLATES_FOLDER_NAME","GetTemplatesFolderPath","templatesFolderPath","findUpSync","path","Error"],"mappings":";;AAGA,MAAMA,wBAAwB;AAEvB,MAAMC;IACT,UAAU;QACN,MAAMC,sBAAsBC,WAAWH,uBAAuB;YAC1D,MAAM;YACN,KAAKI,KAAK,IAAI,CAAC,YAAY,OAAO;QACtC;QAEA,IAAI,CAACF,qBAED,MAAM,IAAIG,MACN;QAIR,OAAOH;IACX;AACJ"}
@@ -1,17 +1,22 @@
1
1
  import path from "path";
2
- import fs from "fs-extra";
2
+ import fs_extra from "fs-extra";
3
3
  import execa from "execa";
4
4
  import { GetProjectRootPath } from "./GetProjectRootPath.js";
5
- export class InitGit {
6
- execute(cliArgs) {
7
- const getProjectRootPath = new GetProjectRootPath();
8
- const projectRootPath = getProjectRootPath.execute(cliArgs);
9
- execa.sync("git", ["--version"]);
10
- execa.sync("git", ["init"], {
11
- cwd: projectRootPath
12
- });
13
- fs.writeFileSync(path.join(projectRootPath, ".gitignore"), "node_modules/");
14
- }
5
+ class InitGit {
6
+ execute(cliArgs) {
7
+ const getProjectRootPath = new GetProjectRootPath();
8
+ const projectRootPath = getProjectRootPath.execute(cliArgs);
9
+ execa.sync("git", [
10
+ "--version"
11
+ ]);
12
+ execa.sync("git", [
13
+ "init"
14
+ ], {
15
+ cwd: projectRootPath
16
+ });
17
+ fs_extra.writeFileSync(path.join(projectRootPath, ".gitignore"), "node_modules/");
18
+ }
15
19
  }
20
+ export { InitGit };
16
21
 
17
22
  //# sourceMappingURL=InitGit.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["path","fs","execa","GetProjectRootPath","InitGit","execute","cliArgs","getProjectRootPath","projectRootPath","sync","cwd","writeFileSync","join"],"sources":["InitGit.ts"],"sourcesContent":["import path from \"path\";\nimport fs from \"fs-extra\";\nimport execa from \"execa\";\nimport { CliParams } from \"../types.js\";\nimport { GetProjectRootPath } from \"./GetProjectRootPath.js\";\n\nexport class InitGit {\n execute(cliArgs: CliParams) {\n const getProjectRootPath = new GetProjectRootPath();\n const projectRootPath = getProjectRootPath.execute(cliArgs);\n\n execa.sync(\"git\", [\"--version\"]);\n execa.sync(\"git\", [\"init\"], { cwd: projectRootPath });\n fs.writeFileSync(path.join(projectRootPath, \".gitignore\"), \"node_modules/\");\n }\n}\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,MAAM;AACvB,OAAOC,EAAE,MAAM,UAAU;AACzB,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,kBAAkB;AAE3B,OAAO,MAAMC,OAAO,CAAC;EACjBC,OAAOA,CAACC,OAAkB,EAAE;IACxB,MAAMC,kBAAkB,GAAG,IAAIJ,kBAAkB,CAAC,CAAC;IACnD,MAAMK,eAAe,GAAGD,kBAAkB,CAACF,OAAO,CAACC,OAAO,CAAC;IAE3DJ,KAAK,CAACO,IAAI,CAAC,KAAK,EAAE,CAAC,WAAW,CAAC,CAAC;IAChCP,KAAK,CAACO,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE;MAAEC,GAAG,EAAEF;IAAgB,CAAC,CAAC;IACrDP,EAAE,CAACU,aAAa,CAACX,IAAI,CAACY,IAAI,CAACJ,eAAe,EAAE,YAAY,CAAC,EAAE,eAAe,CAAC;EAC/E;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"services/InitGit.js","sources":["../../src/services/InitGit.ts"],"sourcesContent":["import path from \"path\";\nimport fs from \"fs-extra\";\nimport execa from \"execa\";\nimport { CliParams } from \"../types.js\";\nimport { GetProjectRootPath } from \"./GetProjectRootPath.js\";\n\nexport class InitGit {\n execute(cliArgs: CliParams) {\n const getProjectRootPath = new GetProjectRootPath();\n const projectRootPath = getProjectRootPath.execute(cliArgs);\n\n execa.sync(\"git\", [\"--version\"]);\n execa.sync(\"git\", [\"init\"], { cwd: projectRootPath });\n fs.writeFileSync(path.join(projectRootPath, \".gitignore\"), \"node_modules/\");\n }\n}\n"],"names":["InitGit","cliArgs","getProjectRootPath","GetProjectRootPath","projectRootPath","execa","fs","path"],"mappings":";;;;AAMO,MAAMA;IACT,QAAQC,OAAkB,EAAE;QACxB,MAAMC,qBAAqB,IAAIC;QAC/B,MAAMC,kBAAkBF,mBAAmB,OAAO,CAACD;QAEnDI,MAAM,IAAI,CAAC,OAAO;YAAC;SAAY;QAC/BA,MAAM,IAAI,CAAC,OAAO;YAAC;SAAO,EAAE;YAAE,KAAKD;QAAgB;QACnDE,SAAAA,aAAgB,CAACC,KAAK,IAAI,CAACH,iBAAiB,eAAe;IAC/D;AACJ"}
@@ -1,13 +1,16 @@
1
1
  import execa from "execa";
2
- export class IsGitAvailable {
3
- execute() {
4
- try {
5
- execa.sync("git", ["--version"]);
6
- return true;
7
- } catch {
8
- return false;
2
+ class IsGitAvailable {
3
+ execute() {
4
+ try {
5
+ execa.sync("git", [
6
+ "--version"
7
+ ]);
8
+ return true;
9
+ } catch {
10
+ return false;
11
+ }
9
12
  }
10
- }
11
13
  }
14
+ export { IsGitAvailable };
12
15
 
13
16
  //# sourceMappingURL=IsGitAvailable.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["execa","IsGitAvailable","execute","sync"],"sources":["IsGitAvailable.ts"],"sourcesContent":["import execa from \"execa\";\n\nexport class IsGitAvailable {\n execute() {\n try {\n execa.sync(\"git\", [\"--version\"]);\n return true;\n } catch {\n return false;\n }\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAO,MAAMC,cAAc,CAAC;EACxBC,OAAOA,CAAA,EAAG;IACN,IAAI;MACAF,KAAK,CAACG,IAAI,CAAC,KAAK,EAAE,CAAC,WAAW,CAAC,CAAC;MAChC,OAAO,IAAI;IACf,CAAC,CAAC,MAAM;MACJ,OAAO,KAAK;IAChB;EACJ;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"services/IsGitAvailable.js","sources":["../../src/services/IsGitAvailable.ts"],"sourcesContent":["import execa from \"execa\";\n\nexport class IsGitAvailable {\n execute() {\n try {\n execa.sync(\"git\", [\"--version\"]);\n return true;\n } catch {\n return false;\n }\n }\n}\n"],"names":["IsGitAvailable","execa"],"mappings":";AAEO,MAAMA;IACT,UAAU;QACN,IAAI;YACAC,MAAM,IAAI,CAAC,OAAO;gBAAC;aAAY;YAC/B,OAAO;QACX,EAAE,OAAM;YACJ,OAAO;QACX;IACJ;AACJ"}
@@ -1,16 +1,18 @@
1
1
  import chalk from "chalk";
2
- const {
3
- bold,
4
- gray
5
- } = chalk;
2
+ const { bold: bold, gray: gray } = chalk;
6
3
  const HL = bold(gray("—")).repeat(30);
7
- export class PrintErrorInfo {
8
- execute(err, cliArgs) {
9
- const {
10
- debug
11
- } = cliArgs;
12
- console.log(["", `${bold("Error Logs")}`, HL, err.message, debug && err.stack].join("\n"));
13
- }
4
+ class PrintErrorInfo {
5
+ execute(err, cliArgs) {
6
+ const { debug } = cliArgs;
7
+ console.log([
8
+ "",
9
+ `${bold("Error Logs")}`,
10
+ HL,
11
+ err.message,
12
+ debug && err.stack
13
+ ].join("\n"));
14
+ }
14
15
  }
16
+ export { PrintErrorInfo };
15
17
 
16
18
  //# sourceMappingURL=PrintErrorInfo.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["chalk","bold","gray","HL","repeat","PrintErrorInfo","execute","err","cliArgs","debug","console","log","message","stack","join"],"sources":["PrintErrorInfo.ts"],"sourcesContent":["import chalk from \"chalk\";\nimport { CliParams } from \"../types.js\";\n\nconst { bold, gray } = chalk;\n\nconst HL = bold(gray(\"—\")).repeat(30);\n\nexport class PrintErrorInfo {\n execute(err: Error, cliArgs: CliParams) {\n const { debug } = cliArgs;\n console.log([\"\", `${bold(\"Error Logs\")}`, HL, err.message, debug && err.stack].join(\"\\n\"));\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,GAAGF,KAAK;AAE5B,MAAMG,EAAE,GAAGF,IAAI,CAACC,IAAI,CAAC,GAAG,CAAC,CAAC,CAACE,MAAM,CAAC,EAAE,CAAC;AAErC,OAAO,MAAMC,cAAc,CAAC;EACxBC,OAAOA,CAACC,GAAU,EAAEC,OAAkB,EAAE;IACpC,MAAM;MAAEC;IAAM,CAAC,GAAGD,OAAO;IACzBE,OAAO,CAACC,GAAG,CAAC,CAAC,EAAE,EAAE,GAAGV,IAAI,CAAC,YAAY,CAAC,EAAE,EAAEE,EAAE,EAAEI,GAAG,CAACK,OAAO,EAAEH,KAAK,IAAIF,GAAG,CAACM,KAAK,CAAC,CAACC,IAAI,CAAC,IAAI,CAAC,CAAC;EAC9F;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"services/PrintErrorInfo.js","sources":["../../src/services/PrintErrorInfo.ts"],"sourcesContent":["import chalk from \"chalk\";\nimport { CliParams } from \"../types.js\";\n\nconst { bold, gray } = chalk;\n\nconst HL = bold(gray(\"—\")).repeat(30);\n\nexport class PrintErrorInfo {\n execute(err: Error, cliArgs: CliParams) {\n const { debug } = cliArgs;\n console.log([\"\", `${bold(\"Error Logs\")}`, HL, err.message, debug && err.stack].join(\"\\n\"));\n }\n}\n"],"names":["bold","gray","chalk","HL","PrintErrorInfo","err","cliArgs","debug","console"],"mappings":";AAGA,MAAM,EAAEA,MAAAA,IAAI,EAAEC,MAAAA,IAAI,EAAE,GAAGC;AAEvB,MAAMC,KAAKH,KAAKC,KAAK,MAAM,MAAM,CAAC;AAE3B,MAAMG;IACT,QAAQC,GAAU,EAAEC,OAAkB,EAAE;QACpC,MAAM,EAAEC,KAAK,EAAE,GAAGD;QAClBE,QAAQ,GAAG,CAAC;YAAC;YAAI,GAAGR,KAAK,eAAe;YAAEG;YAAIE,IAAI,OAAO;YAAEE,SAASF,IAAI,KAAK;SAAC,CAAC,IAAI,CAAC;IACxF;AACJ"}
@@ -1,38 +1,48 @@
1
1
  import { SystemRequirements } from "@webiny/system-requirements";
2
2
  import chalk from "chalk";
3
3
  import { GetCwpVersion } from "./GetCwpVersion.js";
4
- const {
5
- bold,
6
- gray
7
- } = chalk;
4
+ const { bold: bold, gray: gray } = chalk;
8
5
  const NOT_APPLICABLE = gray("N/A");
9
6
  const HL = bold(gray("—")).repeat(30);
10
- export class PrintSystemInfo {
11
- execute(cliArgs) {
12
- const node = SystemRequirements.getNodeVersion();
13
- const os = SystemRequirements.getOsVersion();
14
- let npm = NOT_APPLICABLE;
15
- try {
16
- npm = SystemRequirements.getNpmVersion();
17
- } catch {}
18
- let npx = NOT_APPLICABLE;
19
- try {
20
- npx = SystemRequirements.getNpxVersion();
21
- } catch {}
22
- let yarn = NOT_APPLICABLE;
23
- try {
24
- yarn = SystemRequirements.getYarnVersion();
25
- } catch {}
26
- let cwpVersion = NOT_APPLICABLE;
27
- try {
28
- const getCwpVersion = new GetCwpVersion();
29
- cwpVersion = getCwpVersion.execute();
30
- } catch {}
31
- const {
32
- templateOptions
33
- } = cliArgs;
34
- console.log([`${bold("System Information")}`, HL, `create-webiny-project: ${cwpVersion}`, `Operating System: ${os}`, `Node: ${node}`, `Yarn: ${yarn}`, `Npm: ${npm}`, `Npx: ${npx}`, `Template Options: ${templateOptions}`, "", "Please open an issue including the error output at https://github.com/webiny/webiny-js/issues/new.", "You can also get in touch with us on our Slack Community: https://www.webiny.com/slack", ""].join("\n"));
35
- }
7
+ class PrintSystemInfo {
8
+ execute(cliArgs) {
9
+ const node = SystemRequirements.getNodeVersion();
10
+ const os = SystemRequirements.getOsVersion();
11
+ let npm = NOT_APPLICABLE;
12
+ try {
13
+ npm = SystemRequirements.getNpmVersion();
14
+ } catch {}
15
+ let npx = NOT_APPLICABLE;
16
+ try {
17
+ npx = SystemRequirements.getNpxVersion();
18
+ } catch {}
19
+ let yarn = NOT_APPLICABLE;
20
+ try {
21
+ yarn = SystemRequirements.getYarnVersion();
22
+ } catch {}
23
+ let cwpVersion = NOT_APPLICABLE;
24
+ try {
25
+ const getCwpVersion = new GetCwpVersion();
26
+ cwpVersion = getCwpVersion.execute();
27
+ } catch {}
28
+ const { templateOptions } = cliArgs;
29
+ console.log([
30
+ `${bold("System Information")}`,
31
+ HL,
32
+ `create-webiny-project: ${cwpVersion}`,
33
+ `Operating System: ${os}`,
34
+ `Node: ${node}`,
35
+ `Yarn: ${yarn}`,
36
+ `Npm: ${npm}`,
37
+ `Npx: ${npx}`,
38
+ `Template Options: ${templateOptions}`,
39
+ "",
40
+ "Please open an issue including the error output at https://github.com/webiny/webiny-js/issues/new.",
41
+ "You can also get in touch with us on our Slack Community: https://www.webiny.com/slack",
42
+ ""
43
+ ].join("\n"));
44
+ }
36
45
  }
46
+ export { PrintSystemInfo };
37
47
 
38
48
  //# sourceMappingURL=PrintSystemInfo.js.map