create-webiny-project 6.4.5-beta.0 → 6.6.0-alpha.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 (44) hide show
  1. package/_templates/base/example.gitignore +1 -0
  2. package/_templates/base/template.package.json +1 -3
  3. package/_templates/server/postgres/.env.example +26 -0
  4. package/_templates/server/postgres/webiny.config.tsx +46 -0
  5. package/_templates/server/sqlite/.env.example +22 -0
  6. package/_templates/server/sqlite/webiny.config.tsx +40 -0
  7. package/bin.js +6 -0
  8. package/bin.js.map +1 -1
  9. package/features/CreateWebinyProject/projects/addProjectDependencies.d.ts +9 -0
  10. package/features/CreateWebinyProject/projects/addProjectDependencies.js +17 -0
  11. package/features/CreateWebinyProject/projects/addProjectDependencies.js.map +1 -0
  12. package/features/CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js +5 -0
  13. package/features/CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js.map +1 -1
  14. package/features/CreateWebinyProject/projects/aws/runInteractivePrompt.d.ts +1 -1
  15. package/features/CreateWebinyProject/projects/base/SetupBaseWebinyProject.js +6 -1
  16. package/features/CreateWebinyProject/projects/base/SetupBaseWebinyProject.js.map +1 -1
  17. package/features/CreateWebinyProject/projects/runHostingTypePrompt.d.ts +2 -0
  18. package/features/CreateWebinyProject/projects/runHostingTypePrompt.js +28 -0
  19. package/features/CreateWebinyProject/projects/runHostingTypePrompt.js.map +1 -0
  20. package/features/CreateWebinyProject/projects/server/SetupServerWebinyProject.d.ts +6 -0
  21. package/features/CreateWebinyProject/projects/server/SetupServerWebinyProject.js +39 -0
  22. package/features/CreateWebinyProject/projects/server/SetupServerWebinyProject.js.map +1 -0
  23. package/features/CreateWebinyProject/projects/server/runInteractivePrompt.d.ts +4 -0
  24. package/features/CreateWebinyProject/projects/server/runInteractivePrompt.js +46 -0
  25. package/features/CreateWebinyProject/projects/server/runInteractivePrompt.js.map +1 -0
  26. package/features/CreateWebinyProject/projects/server/types.d.ts +6 -0
  27. package/features/CreateWebinyProject/projects/server/types.js +0 -0
  28. package/features/CreateWebinyProject.js +45 -13
  29. package/features/CreateWebinyProject.js.map +1 -1
  30. package/package.json +12 -12
  31. package/services/EnsureNoGlobalWebinyCli.js +1 -1
  32. package/services/EnsureNoGlobalWebinyCli.js.map +1 -1
  33. package/services/EnsureSystemWebinyConfig.js +2 -2
  34. package/services/EnsureSystemWebinyConfig.js.map +1 -1
  35. package/services/InitGit.js +3 -3
  36. package/services/InitGit.js.map +1 -1
  37. package/services/IsGitAvailable.js +2 -2
  38. package/services/IsGitAvailable.js.map +1 -1
  39. package/services/SetupYarn/binaries/yarn-4.17.1.cjs +944 -0
  40. package/services/SetupYarn.js +5 -5
  41. package/services/SetupYarn.js.map +1 -1
  42. package/types.d.ts +2 -0
  43. package/services/SetupYarn/binaries/yarn-4.14.1.cjs +0 -940
  44. package/services/SetupYarn/binaries/yarn-4.14.1.d.cts +0 -2
@@ -1 +1 @@
1
- {"version":3,"file":"features/CreateWebinyProject.js","sources":["../../src/features/CreateWebinyProject.ts"],"sourcesContent":["import execa from \"execa\";\nimport fs from \"fs-extra\";\nimport type { ListrTask } from \"listr2\";\nimport { Listr } from \"listr2\";\nimport path from \"path\";\nimport { rimrafSync } from \"rimraf\";\nimport chalk from \"chalk\";\nimport yesno from \"yesno\";\nimport { configureMcp } from \"@webiny/mcp\";\nimport type { IUi } from \"@webiny/mcp\";\nimport { SetupBaseWebinyProject } from \"./CreateWebinyProject/projects/base/SetupBaseWebinyProject.js\";\nimport { SetupAwsWebinyProject } from \"./CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js\";\nimport {\n Analytics,\n EnsureNoGlobalWebinyCli,\n EnsureNoTargetFolder,\n EnsureNoYarnLockPackageJson,\n EnsureValidProjectName,\n GetProjectRootPath,\n InitGit,\n IsGitAvailable,\n PrintErrorInfo,\n PrintSystemInfo,\n SetupYarn,\n SetWebinyPackageVersions\n} from \"../services/index.js\";\nimport { CliParams } from \"../types.js\";\nimport { AwsProjectParams } from \"./CreateWebinyProject/projects/aws/types.js\";\nimport ora from \"ora\";\n\nconst { green, bold, cyan, gray, yellow } = chalk;\n\n/* Styled UI for MCP setup output — aligns visually with the rest of CWP output. */\nclass CwpUi implements IUi {\n info(text: string, ...args: any[]): void {\n console.log(gray(text), ...args);\n }\n\n success(text: string, ...args: any[]): void {\n console.log(`${green(\"✔\")} ${text}`, ...args);\n }\n\n error(text: string, ...args: any[]): void {\n console.error(`${chalk.red(\"✘\")} ${text}`, ...args);\n }\n\n warning(text: string, ...args: any[]): void {\n console.warn(`${yellow(\"⚠\")} ${text}`, ...args);\n }\n\n text(text: string): void {\n console.log(text);\n }\n\n emptyLine(): void {\n console.log();\n }\n}\n\nexport class CreateWebinyProject {\n async execute(cliArgs: CliParams) {\n const { projectName, debug, cleanup, log } = cliArgs;\n\n if (!projectName) {\n throw Error(\"You must provide a name for the project to use.\");\n }\n\n const getProjectRootPath = new GetProjectRootPath();\n const projectRootPath = getProjectRootPath.execute(cliArgs);\n\n // All of these `ensureXyz` services will terminate the process if something is wrong.\n const ensureValidProjectName = new EnsureValidProjectName();\n ensureValidProjectName.execute(projectName);\n\n const ensureNoTargetFolder = new EnsureNoTargetFolder();\n ensureNoTargetFolder.execute(cliArgs);\n\n const ensureNoYarnLockPackageJson = new EnsureNoYarnLockPackageJson();\n await ensureNoYarnLockPackageJson.execute();\n\n const ensureNoGlobalWebinyCli = new EnsureNoGlobalWebinyCli();\n await ensureNoGlobalWebinyCli.execute();\n\n const isGitAvailable = new IsGitAvailable().execute();\n\n console.log(`Initializing a new Webiny project in ${green(projectRootPath)}...`);\n\n const analytics = new Analytics();\n await analytics.track(\"start\");\n\n let awsProjectParams: AwsProjectParams = {\n region: \"us-east-1\",\n storageOps: \"ddb\",\n aiAgent: \"other\"\n };\n\n try {\n const taskItems: ListrTask[] = [\n {\n // Creates root package.json.\n title: \"Prepare project folder\",\n task: () => fs.ensureDirSync(projectName)\n },\n {\n title: \"Setup Yarn\",\n task: async () => {\n const setupYarn = new SetupYarn();\n await setupYarn.execute(cliArgs);\n }\n }\n ];\n\n if (isGitAvailable) {\n taskItems.push({\n title: `Initialize git`,\n task: (_, task) => {\n const initGit = new InitGit();\n try {\n initGit.execute(cliArgs);\n } catch {\n task.skip(\"Git repo not initialized\");\n }\n }\n });\n }\n\n const tasks = new Listr(taskItems);\n await tasks.run();\n\n console.log();\n\n const setupBaseWebinyProject = new SetupBaseWebinyProject();\n setupBaseWebinyProject.execute(cliArgs);\n\n const setupAwsWebinyProject = new SetupAwsWebinyProject();\n awsProjectParams = await setupAwsWebinyProject.execute(cliArgs);\n\n const setWebinyPackageVersions = new SetWebinyPackageVersions();\n await setWebinyPackageVersions.execute(cliArgs);\n\n // Install dependencies.\n console.log();\n const spinner = ora(\"Installing packages...\").start();\n try {\n const subprocess = execa(\"yarn\", [], {\n cwd: projectRootPath,\n maxBuffer: 500_000_000\n });\n await subprocess;\n spinner.succeed(\"Packages installed successfully.\");\n } catch (e) {\n spinner.fail(\"Failed to install packages.\");\n\n console.log(e.message);\n\n throw new Error(\n \"Failed while installing project dependencies. Please check the above Yarn logs for more information.\",\n { cause: e }\n );\n }\n\n // Configure MCP server for the selected AI agent.\n if (awsProjectParams.aiAgent !== \"other\") {\n console.log();\n console.log(\n bold(`Configuring MCP server for ${cyan(awsProjectParams.aiAgent)}...`)\n );\n console.log();\n await configureMcp({\n agent: awsProjectParams.aiAgent,\n ui: new CwpUi(),\n cwd: projectRootPath\n });\n }\n\n await analytics.track(\"end\");\n } catch (err) {\n const stage = \"error\";\n // Commenting out for now, as we don't have any graceful errors implemented yet.\n // if (err instanceof GracefulError) {\n // stage = \"error-graceful\";\n // }\n\n await analytics.track(stage, {\n errorMessage: err.cause?.message || err.message,\n errorStack: err.cause?.stack || err.stack\n });\n\n const printErrorInfo = new PrintErrorInfo();\n printErrorInfo.execute(err, cliArgs);\n\n const printSystemInfo = new PrintSystemInfo();\n printSystemInfo.execute(cliArgs);\n\n console.log(`Writing logs to ${green(path.resolve(log))}...`);\n fs.writeFileSync(path.resolve(log), err.toString());\n\n console.log();\n if (cleanup) {\n console.log(\"Deleting created files and folders...\");\n rimrafSync(projectRootPath);\n } else {\n console.log(\"Project cleanup skipped.\");\n }\n\n process.exit(1);\n }\n\n console.log();\n console.log(\n `🎉 Your new Webiny project ${green(\n projectName\n )} has been created and is ready to be deployed for the first time!`\n );\n console.log();\n\n const ok = await yesno({\n question: bold(`${green(\"?\")} Would you like to deploy your project now (Y/n)?`),\n defaultValue: true\n });\n\n console.log();\n\n if (ok) {\n console.log(\"🚀 Deploying your new Webiny project...\");\n console.log();\n\n try {\n const command = [\"webiny\", \"deploy\"];\n if (debug) {\n command.push(\"--debug\");\n }\n\n await execa(\"yarn\", command, {\n cwd: projectRootPath,\n stdio: \"inherit\"\n });\n } catch {\n // Don't do anything. This is because the `webiny deploy` command has its own\n // error handling and will print the error message. As far as this setup script\n // is concerned, it succeeded, and it doesn't need to do anything else.\n }\n\n // For \"other\" agents, show manual MCP setup instructions after deploy has finished.\n if (awsProjectParams.aiAgent === \"other\") {\n await configureMcp({ instructions: true });\n }\n\n return;\n }\n\n // For \"other\" agents, show manual MCP setup instructions instead of blocking the deploy step.\n if (awsProjectParams.aiAgent === \"other\") {\n await configureMcp({ instructions: true });\n }\n\n console.log(\n [\n `Finish the setup by running the following command: ${green(\n `cd ${projectName} && yarn webiny deploy`\n )}`,\n \"\",\n `To see all of the available CLI commands, run ${green(\n \"yarn webiny --help\"\n )} in your ${green(projectName)} directory.`,\n \"\",\n \"Want to dive deeper into Webiny? Check out https://webiny.com/docs/!\",\n \"Like the project? Star us on https://github.com/webiny/webiny-js!\",\n \"\",\n \"Need help? Join our Slack community! https://www.webiny.com/slack\",\n \"\",\n \"🚀 Happy coding!\"\n ].join(\"\\n\")\n );\n }\n}\n"],"names":["green","bold","cyan","gray","yellow","chalk","CwpUi","text","args","console","CreateWebinyProject","cliArgs","projectName","debug","cleanup","log","Error","getProjectRootPath","GetProjectRootPath","projectRootPath","ensureValidProjectName","EnsureValidProjectName","ensureNoTargetFolder","EnsureNoTargetFolder","ensureNoYarnLockPackageJson","EnsureNoYarnLockPackageJson","ensureNoGlobalWebinyCli","EnsureNoGlobalWebinyCli","isGitAvailable","IsGitAvailable","analytics","Analytics","awsProjectParams","taskItems","fs","setupYarn","SetupYarn","_","task","initGit","InitGit","tasks","Listr","setupBaseWebinyProject","SetupBaseWebinyProject","setupAwsWebinyProject","SetupAwsWebinyProject","setWebinyPackageVersions","SetWebinyPackageVersions","spinner","ora","subprocess","execa","e","configureMcp","err","stage","printErrorInfo","PrintErrorInfo","printSystemInfo","PrintSystemInfo","path","rimrafSync","process","ok","yesno","command"],"mappings":";;;;;;;;;;;;AA8BA,MAAM,EAAEA,OAAAA,KAAK,EAAEC,MAAAA,IAAI,EAAEC,MAAAA,IAAI,EAAEC,MAAAA,IAAI,EAAEC,QAAAA,MAAM,EAAE,GAAGC;AAG5C,MAAMC;IACF,KAAKC,IAAY,EAAE,GAAGC,IAAW,EAAQ;QACrCC,QAAQ,GAAG,CAACN,KAAKI,UAAUC;IAC/B;IAEA,QAAQD,IAAY,EAAE,GAAGC,IAAW,EAAQ;QACxCC,QAAQ,GAAG,CAAC,GAAGT,MAAM,KAAK,CAAC,EAAEO,MAAM,KAAKC;IAC5C;IAEA,MAAMD,IAAY,EAAE,GAAGC,IAAW,EAAQ;QACtCC,QAAQ,KAAK,CAAC,GAAGJ,MAAM,GAAG,CAAC,KAAK,CAAC,EAAEE,MAAM,KAAKC;IAClD;IAEA,QAAQD,IAAY,EAAE,GAAGC,IAAW,EAAQ;QACxCC,QAAQ,IAAI,CAAC,GAAGL,OAAO,KAAK,CAAC,EAAEG,MAAM,KAAKC;IAC9C;IAEA,KAAKD,IAAY,EAAQ;QACrBE,QAAQ,GAAG,CAACF;IAChB;IAEA,YAAkB;QACdE,QAAQ,GAAG;IACf;AACJ;AAEO,MAAMC;IACT,MAAM,QAAQC,OAAkB,EAAE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esContent":["import { execa } from \"execa\";\nimport fs from \"fs-extra\";\nimport type { ListrTask } from \"listr2\";\nimport { Listr } from \"listr2\";\nimport path from \"path\";\nimport { rimrafSync } from \"rimraf\";\nimport chalk from \"chalk\";\nimport yesno from \"yesno\";\nimport { configureMcp } from \"@webiny/mcp\";\nimport type { IUi } from \"@webiny/mcp\";\nimport { SetupBaseWebinyProject } from \"./CreateWebinyProject/projects/base/SetupBaseWebinyProject.js\";\nimport { SetupAwsWebinyProject } from \"./CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js\";\nimport { SetupServerWebinyProject } from \"./CreateWebinyProject/projects/server/SetupServerWebinyProject.js\";\nimport {\n runHostingTypePrompt,\n type HostingType\n} from \"./CreateWebinyProject/projects/runHostingTypePrompt.js\";\nimport {\n Analytics,\n EnsureNoGlobalWebinyCli,\n EnsureNoTargetFolder,\n EnsureNoYarnLockPackageJson,\n EnsureValidProjectName,\n GetProjectRootPath,\n InitGit,\n IsGitAvailable,\n PrintErrorInfo,\n PrintSystemInfo,\n SetupYarn,\n SetWebinyPackageVersions\n} from \"../services/index.js\";\nimport { CliParams } from \"../types.js\";\nimport ora from \"ora\";\n\nconst { green, bold, cyan, gray, yellow } = chalk;\n\n/* Styled UI for MCP setup output — aligns visually with the rest of CWP output. */\nclass CwpUi implements IUi {\n info(text: string, ...args: any[]): void {\n console.log(gray(text), ...args);\n }\n\n success(text: string, ...args: any[]): void {\n console.log(`${green(\"✔\")} ${text}`, ...args);\n }\n\n error(text: string, ...args: any[]): void {\n console.error(`${chalk.red(\"✘\")} ${text}`, ...args);\n }\n\n warning(text: string, ...args: any[]): void {\n console.warn(`${yellow(\"⚠\")} ${text}`, ...args);\n }\n\n text(text: string): void {\n console.log(text);\n }\n\n emptyLine(): void {\n console.log();\n }\n}\n\nexport class CreateWebinyProject {\n async execute(cliArgs: CliParams) {\n const { projectName, debug, cleanup, log } = cliArgs;\n\n if (!projectName) {\n throw Error(\"You must provide a name for the project to use.\");\n }\n\n const getProjectRootPath = new GetProjectRootPath();\n const projectRootPath = getProjectRootPath.execute(cliArgs);\n\n // All of these `ensureXyz` services will terminate the process if something is wrong.\n const ensureValidProjectName = new EnsureValidProjectName();\n ensureValidProjectName.execute(projectName);\n\n const ensureNoTargetFolder = new EnsureNoTargetFolder();\n ensureNoTargetFolder.execute(cliArgs);\n\n const ensureNoYarnLockPackageJson = new EnsureNoYarnLockPackageJson();\n await ensureNoYarnLockPackageJson.execute();\n\n const ensureNoGlobalWebinyCli = new EnsureNoGlobalWebinyCli();\n await ensureNoGlobalWebinyCli.execute();\n\n const isGitAvailable = new IsGitAvailable().execute();\n\n console.log(`Initializing a new Webiny project in ${green(projectRootPath)}...`);\n\n const analytics = new Analytics();\n await analytics.track(\"start\");\n\n // AI agent selected during the hosting-type prompt (used for MCP setup + final messages).\n let aiAgent: string = \"other\";\n\n // Hosting type. Resolved interactively below, or taken from `--hosting-type` in non-interactive\n // mode (defaults to \"aws\").\n let hostingType: HostingType = cliArgs.hostingType === \"server\" ? \"server\" : \"aws\";\n\n try {\n const taskItems: ListrTask[] = [\n {\n // Creates root package.json.\n title: \"Prepare project folder\",\n task: () => fs.ensureDirSync(projectName)\n },\n {\n title: \"Setup Yarn\",\n task: async () => {\n const setupYarn = new SetupYarn();\n await setupYarn.execute(cliArgs);\n }\n }\n ];\n\n if (isGitAvailable) {\n taskItems.push({\n title: `Initialize git`,\n task: (_, task) => {\n const initGit = new InitGit();\n try {\n initGit.execute(cliArgs);\n } catch {\n task.skip(\"Git repo not initialized\");\n }\n }\n });\n }\n\n const tasks = new Listr(taskItems);\n await tasks.run();\n\n console.log();\n\n // Ask which hosting type to scaffold before anything hosting-specific is copied.\n if (cliArgs.interactive !== false) {\n hostingType = await runHostingTypePrompt();\n console.log();\n }\n\n const setupBaseWebinyProject = new SetupBaseWebinyProject();\n setupBaseWebinyProject.execute(cliArgs);\n\n if (hostingType === \"server\") {\n const setupServerWebinyProject = new SetupServerWebinyProject();\n const serverProjectParams = await setupServerWebinyProject.execute(cliArgs);\n aiAgent = serverProjectParams.aiAgent;\n } else {\n const setupAwsWebinyProject = new SetupAwsWebinyProject();\n const awsProjectParams = await setupAwsWebinyProject.execute(cliArgs);\n aiAgent = awsProjectParams.aiAgent;\n }\n\n const setWebinyPackageVersions = new SetWebinyPackageVersions();\n await setWebinyPackageVersions.execute(cliArgs);\n\n // Install dependencies.\n console.log();\n const spinner = ora(\"Installing packages...\").start();\n try {\n const subprocess = execa(\"yarn\", [], {\n cwd: projectRootPath,\n maxBuffer: 500_000_000\n });\n await subprocess;\n spinner.succeed(\"Packages installed successfully.\");\n } catch (e) {\n spinner.fail(\"Failed to install packages.\");\n\n console.log(e.message);\n\n throw new Error(\n \"Failed while installing project dependencies. Please check the above Yarn logs for more information.\",\n { cause: e }\n );\n }\n\n // Configure MCP server for the selected AI agent.\n if (aiAgent !== \"other\") {\n console.log();\n console.log(bold(`Configuring MCP server for ${cyan(aiAgent)}...`));\n console.log();\n await configureMcp({\n agent: aiAgent,\n ui: new CwpUi(),\n cwd: projectRootPath\n });\n }\n\n await analytics.track(\"end\");\n } catch (err) {\n const stage = \"error\";\n // Commenting out for now, as we don't have any graceful errors implemented yet.\n // if (err instanceof GracefulError) {\n // stage = \"error-graceful\";\n // }\n\n await analytics.track(stage, {\n errorMessage: err.cause?.message || err.message,\n errorStack: err.cause?.stack || err.stack\n });\n\n const printErrorInfo = new PrintErrorInfo();\n printErrorInfo.execute(err, cliArgs);\n\n const printSystemInfo = new PrintSystemInfo();\n printSystemInfo.execute(cliArgs);\n\n console.log(`Writing logs to ${green(path.resolve(log))}...`);\n fs.writeFileSync(path.resolve(log), err.toString());\n\n console.log();\n if (cleanup) {\n console.log(\"Deleting created files and folders...\");\n rimrafSync(projectRootPath);\n } else {\n console.log(\"Project cleanup skipped.\");\n }\n\n process.exit(1);\n }\n\n console.log();\n\n // Self-hosted (server) hosting type: no deploy step (ALPHA — dev-first, run with `webiny watch`).\n if (hostingType === \"server\") {\n console.log(\n `🎉 Your new self-hosted Webiny project ${green(projectName)} has been created!`\n );\n console.log();\n console.log(\n yellow(\n \"⚠ The self-hosted (server) hosting type is in ALPHA. It's for local\\n\" +\n \" development and testing with `webiny watch`. It's still maturing, so\\n\" +\n \" expect some rough edges.\"\n )\n );\n console.log();\n\n // For \"other\" agents, show manual MCP setup instructions.\n if (aiAgent === \"other\") {\n await configureMcp({ instructions: true });\n }\n\n console.log(\n [\n `Start your project in development mode by running: ${green(\n `cd ${projectName} && yarn webiny watch`\n )}`,\n \"\",\n `To see all of the available CLI commands, run ${green(\n \"yarn webiny --help\"\n )} in your ${green(projectName)} directory.`,\n \"\",\n \"Want to dive deeper into Webiny? Check out https://webiny.com/docs/!\",\n \"Like the project? Star us on https://github.com/webiny/webiny-js!\",\n \"\",\n \"Need help? Join our Slack community! https://www.webiny.com/slack\",\n \"\",\n \"🚀 Happy coding!\"\n ].join(\"\\n\")\n );\n\n return;\n }\n\n console.log(\n `🎉 Your new Webiny project ${green(\n projectName\n )} has been created and is ready to be deployed for the first time!`\n );\n console.log();\n\n const ok = await yesno({\n question: bold(`${green(\"?\")} Would you like to deploy your project now (Y/n)?`),\n defaultValue: true\n });\n\n console.log();\n\n if (ok) {\n console.log(\"🚀 Deploying your new Webiny project...\");\n console.log();\n\n try {\n const command = [\"webiny\", \"deploy\"];\n if (debug) {\n command.push(\"--debug\");\n }\n\n await execa(\"yarn\", command, {\n cwd: projectRootPath,\n stdio: \"inherit\"\n });\n } catch {\n // Don't do anything. This is because the `webiny deploy` command has its own\n // error handling and will print the error message. As far as this setup script\n // is concerned, it succeeded, and it doesn't need to do anything else.\n }\n\n // For \"other\" agents, show manual MCP setup instructions after deploy has finished.\n if (aiAgent === \"other\") {\n await configureMcp({ instructions: true });\n }\n\n return;\n }\n\n // For \"other\" agents, show manual MCP setup instructions instead of blocking the deploy step.\n if (aiAgent === \"other\") {\n await configureMcp({ instructions: true });\n }\n\n console.log(\n [\n `Finish the setup by running the following command: ${green(\n `cd ${projectName} && yarn webiny deploy`\n )}`,\n \"\",\n `To see all of the available CLI commands, run ${green(\n \"yarn webiny --help\"\n )} in your ${green(projectName)} directory.`,\n \"\",\n \"Want to dive deeper into Webiny? Check out https://webiny.com/docs/!\",\n \"Like the project? Star us on https://github.com/webiny/webiny-js!\",\n \"\",\n \"Need help? Join our Slack community! https://www.webiny.com/slack\",\n \"\",\n \"🚀 Happy coding!\"\n ].join(\"\\n\")\n );\n }\n}\n"],"names":["green","bold","cyan","gray","yellow","chalk","CwpUi","text","args","console","CreateWebinyProject","cliArgs","projectName","debug","cleanup","log","Error","getProjectRootPath","GetProjectRootPath","projectRootPath","ensureValidProjectName","EnsureValidProjectName","ensureNoTargetFolder","EnsureNoTargetFolder","ensureNoYarnLockPackageJson","EnsureNoYarnLockPackageJson","ensureNoGlobalWebinyCli","EnsureNoGlobalWebinyCli","isGitAvailable","IsGitAvailable","analytics","Analytics","aiAgent","hostingType","taskItems","fs","setupYarn","SetupYarn","_","task","initGit","InitGit","tasks","Listr","runHostingTypePrompt","setupBaseWebinyProject","SetupBaseWebinyProject","setupServerWebinyProject","SetupServerWebinyProject","serverProjectParams","setupAwsWebinyProject","SetupAwsWebinyProject","awsProjectParams","setWebinyPackageVersions","SetWebinyPackageVersions","spinner","ora","subprocess","execa","e","configureMcp","err","stage","printErrorInfo","PrintErrorInfo","printSystemInfo","PrintSystemInfo","path","rimrafSync","process","ok","yesno","command"],"mappings":";;;;;;;;;;;;;;AAkCA,MAAM,EAAEA,OAAAA,KAAK,EAAEC,MAAAA,IAAI,EAAEC,MAAAA,IAAI,EAAEC,MAAAA,IAAI,EAAEC,QAAAA,MAAM,EAAE,GAAGC;AAG5C,MAAMC;IACF,KAAKC,IAAY,EAAE,GAAGC,IAAW,EAAQ;QACrCC,QAAQ,GAAG,CAACN,KAAKI,UAAUC;IAC/B;IAEA,QAAQD,IAAY,EAAE,GAAGC,IAAW,EAAQ;QACxCC,QAAQ,GAAG,CAAC,GAAGT,MAAM,KAAK,CAAC,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version": "6.6.0-alpha.0",
4
4
  "type": "module",
5
5
  "description": "Webiny project bootstrap tool.",
6
6
  "exports": {
@@ -13,26 +13,26 @@
13
13
  "author": "Webiny Ltd.",
14
14
  "license": "MIT",
15
15
  "dependencies": {
16
- "@webiny/build-tools": "6.4.5-beta.0",
17
- "@webiny/mcp": "6.4.5-beta.0",
18
- "@webiny/system-requirements": "6.4.5-beta.0",
19
- "@webiny/telemetry": "6.4.5-beta.0",
20
- "chalk": "5.6.2",
21
- "execa": "5.1.1",
16
+ "@webiny/build-tools": "6.6.0-alpha.0",
17
+ "@webiny/mcp": "6.6.0-alpha.0",
18
+ "@webiny/stdlib": "0.0.14",
19
+ "@webiny/system-requirements": "6.6.0-alpha.0",
20
+ "@webiny/telemetry": "6.6.0-alpha.0",
21
+ "chalk": "6.0.0",
22
+ "execa": "10.0.0",
22
23
  "find-up": "8.0.0",
23
- "fs-extra": "11.3.6",
24
+ "fs-extra": "11.4.0",
24
25
  "inquirer": "14.0.2",
25
- "js-yaml": "5.2.1",
26
- "listr2": "10.2.2",
26
+ "js-yaml": "5.2.2",
27
+ "listr2": "11.0.0",
27
28
  "load-json-file": "7.0.1",
28
29
  "ora": "9.4.1",
29
30
  "os": "0.1.2",
30
31
  "rimraf": "6.1.3",
31
32
  "type-fest": "5.8.0",
32
- "uuid": "14.0.1",
33
33
  "validate-npm-package-name": "8.0.0",
34
34
  "write-json-file": "7.0.0",
35
- "yargs": "18.0.0",
35
+ "yargs": "18.1.0",
36
36
  "yesno": "0.4.0"
37
37
  },
38
38
  "devDependencies": {
@@ -1,4 +1,4 @@
1
- import execa from "execa";
1
+ import { execa } from "execa";
2
2
  import chalk from "chalk";
3
3
  const { green: green } = chalk;
4
4
  class EnsureNoGlobalWebinyCli {
@@ -1 +1 @@
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
+ {"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"}
@@ -2,7 +2,7 @@ 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 } from "uuid";
5
+ import { uuid } from "@webiny/stdlib";
6
6
  const configPath = path.join(os.homedir(), ".webiny", "config");
7
7
  class EnsureSystemWebinyConfig {
8
8
  execute() {
@@ -11,7 +11,7 @@ class EnsureSystemWebinyConfig {
11
11
  if (!config.id) throw Error("Invalid Webiny config.");
12
12
  } catch {
13
13
  writeJsonFileSync(configPath, {
14
- id: v4(),
14
+ id: uuid(),
15
15
  telemetry: true
16
16
  });
17
17
  }
@@ -1 +1 @@
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
+ {"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 { uuid as uuidv4 } from \"@webiny/stdlib\";\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,15 +1,15 @@
1
1
  import path from "path";
2
2
  import fs_extra from "fs-extra";
3
- import execa from "execa";
3
+ import { execaSync } from "execa";
4
4
  import { GetProjectRootPath } from "./GetProjectRootPath.js";
5
5
  class InitGit {
6
6
  execute(cliArgs) {
7
7
  const getProjectRootPath = new GetProjectRootPath();
8
8
  const projectRootPath = getProjectRootPath.execute(cliArgs);
9
- execa.sync("git", [
9
+ execaSync("git", [
10
10
  "--version"
11
11
  ]);
12
- execa.sync("git", [
12
+ execaSync("git", [
13
13
  "init"
14
14
  ], {
15
15
  cwd: projectRootPath
@@ -1 +1 @@
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
+ {"version":3,"file":"services/InitGit.js","sources":["../../src/services/InitGit.ts"],"sourcesContent":["import path from \"path\";\nimport fs from \"fs-extra\";\nimport { execaSync } 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 execaSync(\"git\", [\"--version\"]);\n execaSync(\"git\", [\"init\"], { cwd: projectRootPath });\n fs.writeFileSync(path.join(projectRootPath, \".gitignore\"), \"node_modules/\");\n }\n}\n"],"names":["InitGit","cliArgs","getProjectRootPath","GetProjectRootPath","projectRootPath","execaSync","fs","path"],"mappings":";;;;AAMO,MAAMA;IACT,QAAQC,OAAkB,EAAE;QACxB,MAAMC,qBAAqB,IAAIC;QAC/B,MAAMC,kBAAkBF,mBAAmB,OAAO,CAACD;QAEnDI,UAAU,OAAO;YAAC;SAAY;QAC9BA,UAAU,OAAO;YAAC;SAAO,EAAE;YAAE,KAAKD;QAAgB;QAClDE,SAAAA,aAAgB,CAACC,KAAK,IAAI,CAACH,iBAAiB,eAAe;IAC/D;AACJ"}
@@ -1,8 +1,8 @@
1
- import execa from "execa";
1
+ import { execaSync } from "execa";
2
2
  class IsGitAvailable {
3
3
  execute() {
4
4
  try {
5
- execa.sync("git", [
5
+ execaSync("git", [
6
6
  "--version"
7
7
  ]);
8
8
  return true;
@@ -1 +1 @@
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
+ {"version":3,"file":"services/IsGitAvailable.js","sources":["../../src/services/IsGitAvailable.ts"],"sourcesContent":["import { execaSync } from \"execa\";\n\nexport class IsGitAvailable {\n execute() {\n try {\n execaSync(\"git\", [\"--version\"]);\n return true;\n } catch {\n return false;\n }\n }\n}\n"],"names":["IsGitAvailable","execaSync"],"mappings":";AAEO,MAAMA;IACT,UAAU;QACN,IAAI;YACAC,UAAU,OAAO;gBAAC;aAAY;YAC9B,OAAO;QACX,EAAE,OAAM;YACJ,OAAO;QACX;IACJ;AACJ"}