create-webiny-project 6.6.0-alpha.0 → 6.6.0-alpha.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.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Merges hosting-specific npm scripts into the generated project's `package.json`.
3
+ *
4
+ * The base template ships an empty `scripts` block because the useful shortcuts differ per hosting
5
+ * type — e.g. self-hosted can watch everything with a single command, while AWS watches each app
6
+ * against its own cloud environment.
7
+ */
8
+ export declare const addProjectScripts: (projectRootFolderPath: string, scripts: Record<string, string>) => void;
@@ -0,0 +1,16 @@
1
+ import fs_extra from "fs-extra";
2
+ import path from "path";
3
+ const addProjectScripts = (projectRootFolderPath, scripts)=>{
4
+ const pkgPath = path.join(projectRootFolderPath, "package.json");
5
+ const pkg = fs_extra.readJsonSync(pkgPath);
6
+ pkg.scripts = {
7
+ ...pkg.scripts,
8
+ ...scripts
9
+ };
10
+ fs_extra.writeJsonSync(pkgPath, pkg, {
11
+ spaces: 2
12
+ });
13
+ };
14
+ export { addProjectScripts };
15
+
16
+ //# sourceMappingURL=addProjectScripts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/CreateWebinyProject/projects/addProjectScripts.js","sources":["../../../../src/features/CreateWebinyProject/projects/addProjectScripts.ts"],"sourcesContent":["import fs from \"fs-extra\";\nimport path from \"path\";\n\n/**\n * Merges hosting-specific npm scripts into the generated project's `package.json`.\n *\n * The base template ships an empty `scripts` block because the useful shortcuts differ per hosting\n * type — e.g. self-hosted can watch everything with a single command, while AWS watches each app\n * against its own cloud environment.\n */\nexport const addProjectScripts = (\n projectRootFolderPath: string,\n scripts: Record<string, string>\n) => {\n const pkgPath = path.join(projectRootFolderPath, \"package.json\");\n const pkg = fs.readJsonSync(pkgPath);\n\n pkg.scripts = {\n ...pkg.scripts,\n ...scripts\n };\n\n fs.writeJsonSync(pkgPath, pkg, { spaces: 2 });\n};\n"],"names":["addProjectScripts","projectRootFolderPath","scripts","pkgPath","path","pkg","fs"],"mappings":";;AAUO,MAAMA,oBAAoB,CAC7BC,uBACAC;IAEA,MAAMC,UAAUC,KAAK,IAAI,CAACH,uBAAuB;IACjD,MAAMI,MAAMC,SAAAA,YAAe,CAACH;IAE5BE,IAAI,OAAO,GAAG;QACV,GAAGA,IAAI,OAAO;QACd,GAAGH,OAAO;IACd;IAEAI,SAAAA,aAAgB,CAACH,SAASE,KAAK;QAAE,QAAQ;IAAE;AAC/C"}
@@ -4,6 +4,7 @@ import { runInteractivePrompt } from "./runInteractivePrompt.js";
4
4
  import { GetProjectRootPath } from "../../../../services/index.js";
5
5
  import { GetTemplatesFolderPath } from "../../../../services/GetTemplatesFolderPath.js";
6
6
  import { addProjectDependencies } from "../addProjectDependencies.js";
7
+ import { addProjectScripts } from "../addProjectScripts.js";
7
8
  class SetupServerWebinyProject {
8
9
  async execute(cliArgs) {
9
10
  const serverArgs = await this.getServerArgs(cliArgs);
@@ -19,6 +20,9 @@ class SetupServerWebinyProject {
19
20
  "@webiny/project-server-template": "latest",
20
21
  "@webiny/self-hosted-auth": "latest"
21
22
  });
23
+ addProjectScripts(projectRootFolderPath, {
24
+ dev: "webiny watch"
25
+ });
22
26
  return serverArgs;
23
27
  }
24
28
  async getServerArgs(cliArgs) {
@@ -1 +1 @@
1
- {"version":3,"file":"features/CreateWebinyProject/projects/server/SetupServerWebinyProject.js","sources":["../../../../../src/features/CreateWebinyProject/projects/server/SetupServerWebinyProject.ts"],"sourcesContent":["import fs from \"fs-extra\";\nimport path from \"path\";\nimport { runInteractivePrompt } from \"./runInteractivePrompt.js\";\nimport { CliParams } from \"../../../../types.js\";\nimport { GetProjectRootPath } from \"../../../../services/index.js\";\nimport { ServerProjectParams } from \"./types.js\";\nimport { GetTemplatesFolderPath } from \"../../../../services/GetTemplatesFolderPath.js\";\nimport { addProjectDependencies } from \"../addProjectDependencies.js\";\n\nexport class SetupServerWebinyProject {\n async execute(cliArgs: CliParams): Promise<ServerProjectParams> {\n const serverArgs = await this.getServerArgs(cliArgs);\n\n const getTemplatesFolderPath = new GetTemplatesFolderPath();\n const templatesFolderPath = getTemplatesFolderPath.execute();\n\n const storageTemplatePath = path.join(templatesFolderPath, \"server\", serverArgs.storageOps);\n\n const getProjectRoot = new GetProjectRootPath();\n const projectRootFolderPath = getProjectRoot.execute(cliArgs);\n\n // Copies the storage-specific template files into the project — `webiny.config.tsx` and a\n // `.env.example` (all vars commented; the project runs on config defaults with no `.env`).\n fs.copySync(storageTemplatePath, projectRootFolderPath);\n\n // Server (self-hosted) hosting-type dependencies. The `webiny` CLI (server bin) sets\n // WEBINY_HOSTING_TYPE=server; `@webiny/project-server` provides the server `Infra.*` extensions\n // and resolves `@webiny/project-server-template` (the workspace base config) at build time;\n // `@webiny/self-hosted-auth` is the built-in JWT identity provider (replaces Cognito).\n addProjectDependencies(projectRootFolderPath, {\n \"@webiny/cli-server\": \"latest\",\n \"@webiny/project-server\": \"latest\",\n \"@webiny/project-server-template\": \"latest\",\n \"@webiny/self-hosted-auth\": \"latest\"\n });\n\n return serverArgs;\n }\n\n private async getServerArgs(cliArgs: CliParams) {\n const serverArgs: ServerProjectParams = {\n storageOps: \"sqlite\",\n aiAgent: \"other\"\n };\n\n const { templateOptions: templateOptionsString } = cliArgs;\n if (templateOptionsString) {\n try {\n Object.assign(serverArgs, JSON.parse(templateOptionsString));\n } catch {\n // Do nothing.\n }\n }\n\n if (cliArgs.interactive !== false) {\n Object.assign(serverArgs, await runInteractivePrompt());\n }\n\n return serverArgs;\n }\n}\n"],"names":["SetupServerWebinyProject","cliArgs","serverArgs","getTemplatesFolderPath","GetTemplatesFolderPath","templatesFolderPath","storageTemplatePath","path","getProjectRoot","GetProjectRootPath","projectRootFolderPath","fs","addProjectDependencies","templateOptionsString","Object","JSON","runInteractivePrompt"],"mappings":";;;;;;AASO,MAAMA;IACT,MAAM,QAAQC,OAAkB,EAAgC;QAC5D,MAAMC,aAAa,MAAM,IAAI,CAAC,aAAa,CAACD;QAE5C,MAAME,yBAAyB,IAAIC;QACnC,MAAMC,sBAAsBF,uBAAuB,OAAO;QAE1D,MAAMG,sBAAsBC,KAAK,IAAI,CAACF,qBAAqB,UAAUH,WAAW,UAAU;QAE1F,MAAMM,iBAAiB,IAAIC;QAC3B,MAAMC,wBAAwBF,eAAe,OAAO,CAACP;QAIrDU,SAAAA,QAAW,CAACL,qBAAqBI;QAMjCE,uBAAuBF,uBAAuB;YAC1C,sBAAsB;YACtB,0BAA0B;YAC1B,mCAAmC;YACnC,4BAA4B;QAChC;QAEA,OAAOR;IACX;IAEA,MAAc,cAAcD,OAAkB,EAAE;QAC5C,MAAMC,aAAkC;YACpC,YAAY;YACZ,SAAS;QACb;QAEA,MAAM,EAAE,iBAAiBW,qBAAqB,EAAE,GAAGZ;QACnD,IAAIY,uBACA,IAAI;YACAC,OAAO,MAAM,CAACZ,YAAYa,KAAK,KAAK,CAACF;QACzC,EAAE,OAAM,CAER;QAGJ,IAAIZ,AAAwB,UAAxBA,QAAQ,WAAW,EACnBa,OAAO,MAAM,CAACZ,YAAY,MAAMc;QAGpC,OAAOd;IACX;AACJ"}
1
+ {"version":3,"file":"features/CreateWebinyProject/projects/server/SetupServerWebinyProject.js","sources":["../../../../../src/features/CreateWebinyProject/projects/server/SetupServerWebinyProject.ts"],"sourcesContent":["import fs from \"fs-extra\";\nimport path from \"path\";\nimport { runInteractivePrompt } from \"./runInteractivePrompt.js\";\nimport { CliParams } from \"../../../../types.js\";\nimport { GetProjectRootPath } from \"../../../../services/index.js\";\nimport { ServerProjectParams } from \"./types.js\";\nimport { GetTemplatesFolderPath } from \"../../../../services/GetTemplatesFolderPath.js\";\nimport { addProjectDependencies } from \"../addProjectDependencies.js\";\nimport { addProjectScripts } from \"../addProjectScripts.js\";\n\nexport class SetupServerWebinyProject {\n async execute(cliArgs: CliParams): Promise<ServerProjectParams> {\n const serverArgs = await this.getServerArgs(cliArgs);\n\n const getTemplatesFolderPath = new GetTemplatesFolderPath();\n const templatesFolderPath = getTemplatesFolderPath.execute();\n\n const storageTemplatePath = path.join(templatesFolderPath, \"server\", serverArgs.storageOps);\n\n const getProjectRoot = new GetProjectRootPath();\n const projectRootFolderPath = getProjectRoot.execute(cliArgs);\n\n // Copies the storage-specific template files into the project — `webiny.config.tsx` and a\n // `.env.example` (all vars commented; the project runs on config defaults with no `.env`).\n fs.copySync(storageTemplatePath, projectRootFolderPath);\n\n // Server (self-hosted) hosting-type dependencies. The `webiny` CLI (server bin) sets\n // WEBINY_HOSTING_TYPE=server; `@webiny/project-server` provides the server `Infra.*` extensions\n // and resolves `@webiny/project-server-template` (the workspace base config) at build time;\n // `@webiny/self-hosted-auth` is the built-in JWT identity provider (replaces Cognito).\n addProjectDependencies(projectRootFolderPath, {\n \"@webiny/cli-server\": \"latest\",\n \"@webiny/project-server\": \"latest\",\n \"@webiny/project-server-template\": \"latest\",\n \"@webiny/self-hosted-auth\": \"latest\"\n });\n\n // Self-hosted watches every default app in a single process, so `yarn dev` is all a developer\n // needs to get the whole project running locally. Server-only — on AWS the apps are watched\n // separately, so there's no single command to alias.\n addProjectScripts(projectRootFolderPath, {\n dev: \"webiny watch\"\n });\n\n return serverArgs;\n }\n\n private async getServerArgs(cliArgs: CliParams) {\n const serverArgs: ServerProjectParams = {\n storageOps: \"sqlite\",\n aiAgent: \"other\"\n };\n\n const { templateOptions: templateOptionsString } = cliArgs;\n if (templateOptionsString) {\n try {\n Object.assign(serverArgs, JSON.parse(templateOptionsString));\n } catch {\n // Do nothing.\n }\n }\n\n if (cliArgs.interactive !== false) {\n Object.assign(serverArgs, await runInteractivePrompt());\n }\n\n return serverArgs;\n }\n}\n"],"names":["SetupServerWebinyProject","cliArgs","serverArgs","getTemplatesFolderPath","GetTemplatesFolderPath","templatesFolderPath","storageTemplatePath","path","getProjectRoot","GetProjectRootPath","projectRootFolderPath","fs","addProjectDependencies","addProjectScripts","templateOptionsString","Object","JSON","runInteractivePrompt"],"mappings":";;;;;;;AAUO,MAAMA;IACT,MAAM,QAAQC,OAAkB,EAAgC;QAC5D,MAAMC,aAAa,MAAM,IAAI,CAAC,aAAa,CAACD;QAE5C,MAAME,yBAAyB,IAAIC;QACnC,MAAMC,sBAAsBF,uBAAuB,OAAO;QAE1D,MAAMG,sBAAsBC,KAAK,IAAI,CAACF,qBAAqB,UAAUH,WAAW,UAAU;QAE1F,MAAMM,iBAAiB,IAAIC;QAC3B,MAAMC,wBAAwBF,eAAe,OAAO,CAACP;QAIrDU,SAAAA,QAAW,CAACL,qBAAqBI;QAMjCE,uBAAuBF,uBAAuB;YAC1C,sBAAsB;YACtB,0BAA0B;YAC1B,mCAAmC;YACnC,4BAA4B;QAChC;QAKAG,kBAAkBH,uBAAuB;YACrC,KAAK;QACT;QAEA,OAAOR;IACX;IAEA,MAAc,cAAcD,OAAkB,EAAE;QAC5C,MAAMC,aAAkC;YACpC,YAAY;YACZ,SAAS;QACb;QAEA,MAAM,EAAE,iBAAiBY,qBAAqB,EAAE,GAAGb;QACnD,IAAIa,uBACA,IAAI;YACAC,OAAO,MAAM,CAACb,YAAYc,KAAK,KAAK,CAACF;QACzC,EAAE,OAAM,CAER;QAGJ,IAAIb,AAAwB,UAAxBA,QAAQ,WAAW,EACnBc,OAAO,MAAM,CAACb,YAAY,MAAMe;QAGpC,OAAOf;IACX;AACJ"}
@@ -53,6 +53,7 @@ class CreateWebinyProject {
53
53
  await analytics.track("start");
54
54
  let aiAgent = "other";
55
55
  let hostingType = "server" === cliArgs.hostingType ? "server" : "aws";
56
+ let hostingTypeResolved = false === cliArgs.interactive;
56
57
  try {
57
58
  const taskItems = [
58
59
  {
@@ -83,6 +84,7 @@ class CreateWebinyProject {
83
84
  console.log();
84
85
  if (false !== cliArgs.interactive) {
85
86
  hostingType = await runHostingTypePrompt();
87
+ hostingTypeResolved = true;
86
88
  console.log();
87
89
  }
88
90
  const setupBaseWebinyProject = new SetupBaseWebinyProject();
@@ -124,10 +126,13 @@ class CreateWebinyProject {
124
126
  cwd: projectRootPath
125
127
  });
126
128
  }
127
- await analytics.track("end");
129
+ await analytics.track("end", {
130
+ hostingType
131
+ });
128
132
  } catch (err) {
129
133
  const stage = "error";
130
134
  await analytics.track(stage, {
135
+ hostingType: hostingTypeResolved ? hostingType : "unknown",
131
136
  errorMessage: err.cause?.message || err.message,
132
137
  errorStack: err.cause?.stack || err.stack
133
138
  });
@@ -148,13 +153,16 @@ class CreateWebinyProject {
148
153
  if ("server" === hostingType) {
149
154
  console.log(`🎉 Your new self-hosted Webiny project ${green(projectName)} has been created!`);
150
155
  console.log();
151
- console.log(yellow("⚠ The self-hosted (server) hosting type is in ALPHA. It's for local\n development and testing with `webiny watch`. It's still maturing, so\n expect some rough edges."));
156
+ console.log(yellow("⚠ The self-hosted (server) hosting type is in ALPHA. It's for local\n development and testing with `webiny watch api` / `webiny watch admin`.\n It's still maturing, so expect some rough edges."));
152
157
  console.log();
153
158
  if ("other" === aiAgent) await configureMcp({
154
159
  instructions: true
155
160
  });
156
161
  console.log([
157
- `Start your project in development mode by running: ${green(`cd ${projectName} && yarn webiny watch`)}`,
162
+ `First, enter the project directory: ${green(`cd ${projectName}`)}`,
163
+ "",
164
+ "Then start development mode. Watching all apps at once isn't supported yet,",
165
+ `so run the API and Admin apps separately, each in its own terminal: ${green("yarn webiny watch api")} and ${green("yarn webiny watch admin")}.`,
158
166
  "",
159
167
  `To see all of the available CLI commands, run ${green("yarn webiny --help")} in your ${green(projectName)} directory.`,
160
168
  "",
@@ -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 { 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,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,CAA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AH,QAAQ,GAAG,CACP,CAAC,2BAA2B,EAAET,MAC1BY,aACF,iEAAiE,CAAC;QAExEH,QAAQ,GAAG;QAEX,MAAM6D,KAAK,MAAMC,MAAM;YACnB,UAAUtE,KAAK,GAAGD,MAAM,KAAK,iDAAiD,CAAC;YAC/E,cAAc;QAClB;QAEAS,QAAQ,GAAG;QAEX,IAAI6D,IAAI;YACJ7D,QAAQ,GAAG,CAAC;YACZA,QAAQ,GAAG;YAEX,IAAI;gBACA,MAAM+D,UAAU;oBAAC;oBAAU;iBAAS;gBACpC,IAAI3D,OACA2D,QAAQ,IAAI,CAAC;gBAGjB,MAAMd,MAAM,QAAQc,SAAS;oBACzB,KAAKrD;oBACL,OAAO;gBACX;YACJ,EAAE,OAAM,CAIR;YAGA,IAAIa,AAAY,YAAZA,SACA,MAAM4B,aAAa;gBAAE,cAAc;YAAK;YAG5C;QACJ;QAGA,IAAI5B,AAAY,YAAZA,SACA,MAAM4B,aAAa;YAAE,cAAc;QAAK;QAG5CnD,QAAQ,GAAG,CACP;YACI,CAAC,mDAAmD,EAAET,MAClD,CAAC,GAAG,EAAEY,YAAY,sBAAsB,CAAC,GAC1C;YACH;YACA,CAAC,8CAA8C,EAAEZ,MAC7C,sBACF,SAAS,EAAEA,MAAMY,aAAa,WAAW,CAAC;YAC5C;YACA;YACA;YACA;YACA;YACA;YACA;SACH,CAAC,IAAI,CAAC;IAEf;AACJ"}
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 { 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 // No `hostingType` here: in interactive mode the choice hasn't been made yet, and reporting\n // the placeholder default would inflate \"aws\". Use `-end` / `-error` to segment by hosting\n // type, and this event as the funnel denominator.\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 // In interactive mode the value above is only a placeholder until the prompt below runs.\n // Telemetry reports \"unknown\" while that's the case, so a failure before the prompt isn't\n // counted as an AWS project.\n let hostingTypeResolved = cliArgs.interactive === false;\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 hostingTypeResolved = true;\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\", { hostingType });\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 hostingType: hostingTypeResolved ? hostingType : \"unknown\",\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 api` / `webiny watch admin`.\\n\" +\n \" It's still maturing, so 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 `First, enter the project directory: ${green(`cd ${projectName}`)}`,\n \"\",\n \"Then start development mode. Watching all apps at once isn't supported yet,\",\n `so run the API and Admin apps separately, each in its own terminal: ${green(\n \"yarn webiny watch api\"\n )} and ${green(\"yarn webiny watch admin\")}.`,\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","hostingTypeResolved","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,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AAQ,GAAG,CACP;YACI,CAAC,mDAAmD,EAAET,MAClD,CAAC,GAAG,EAAEY,YAAY,sBAAsB,CAAC,GAC1C;YACH;YACA,CAAC,8CAA8C,EAAEZ,MAC7C,sBACF,SAAS,EAAEA,MAAMY,aAAa,WAAW,CAAC;YAC5C;YACA;YACA;YACA;YACA;YACA;YACA;SACH,CAAC,IAAI,CAAC;IAEf;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-webiny-project",
3
- "version": "6.6.0-alpha.0",
3
+ "version": "6.6.0-alpha.2",
4
4
  "type": "module",
5
5
  "description": "Webiny project bootstrap tool.",
6
6
  "exports": {
@@ -13,17 +13,17 @@
13
13
  "author": "Webiny Ltd.",
14
14
  "license": "MIT",
15
15
  "dependencies": {
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",
16
+ "@webiny/build-tools": "6.6.0-alpha.2",
17
+ "@webiny/mcp": "6.6.0-alpha.2",
18
+ "@webiny/stdlib": "0.0.17",
19
+ "@webiny/system-requirements": "6.6.0-alpha.2",
20
+ "@webiny/telemetry": "6.6.0-alpha.2",
21
21
  "chalk": "6.0.0",
22
- "execa": "10.0.0",
22
+ "execa": "10.0.1",
23
23
  "find-up": "8.0.0",
24
24
  "fs-extra": "11.4.0",
25
- "inquirer": "14.0.2",
26
- "js-yaml": "5.2.2",
25
+ "inquirer": "14.1.0",
26
+ "js-yaml": "5.3.0",
27
27
  "listr2": "11.0.0",
28
28
  "load-json-file": "7.0.1",
29
29
  "ora": "9.4.1",
@@ -38,7 +38,7 @@
38
38
  "devDependencies": {
39
39
  "@types/js-yaml": "4.0.9",
40
40
  "@types/validate-npm-package-name": "4.0.2",
41
- "vitest": "4.1.10"
41
+ "vitest": "4.1.11"
42
42
  },
43
43
  "publishConfig": {
44
44
  "access": "public"