create-webiny-project 6.4.11 → 6.6.0-alpha.1

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 (47) 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/addProjectScripts.d.ts +8 -0
  13. package/features/CreateWebinyProject/projects/addProjectScripts.js +16 -0
  14. package/features/CreateWebinyProject/projects/addProjectScripts.js.map +1 -0
  15. package/features/CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js +5 -0
  16. package/features/CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js.map +1 -1
  17. package/features/CreateWebinyProject/projects/aws/runInteractivePrompt.d.ts +1 -1
  18. package/features/CreateWebinyProject/projects/base/SetupBaseWebinyProject.js +6 -1
  19. package/features/CreateWebinyProject/projects/base/SetupBaseWebinyProject.js.map +1 -1
  20. package/features/CreateWebinyProject/projects/runHostingTypePrompt.d.ts +2 -0
  21. package/features/CreateWebinyProject/projects/runHostingTypePrompt.js +28 -0
  22. package/features/CreateWebinyProject/projects/runHostingTypePrompt.js.map +1 -0
  23. package/features/CreateWebinyProject/projects/server/SetupServerWebinyProject.d.ts +6 -0
  24. package/features/CreateWebinyProject/projects/server/SetupServerWebinyProject.js +43 -0
  25. package/features/CreateWebinyProject/projects/server/SetupServerWebinyProject.js.map +1 -0
  26. package/features/CreateWebinyProject/projects/server/runInteractivePrompt.d.ts +4 -0
  27. package/features/CreateWebinyProject/projects/server/runInteractivePrompt.js +46 -0
  28. package/features/CreateWebinyProject/projects/server/runInteractivePrompt.js.map +1 -0
  29. package/features/CreateWebinyProject/projects/server/types.d.ts +6 -0
  30. package/features/CreateWebinyProject/projects/server/types.js +0 -0
  31. package/features/CreateWebinyProject.js +54 -14
  32. package/features/CreateWebinyProject.js.map +1 -1
  33. package/package.json +14 -14
  34. package/services/EnsureNoGlobalWebinyCli.js +1 -1
  35. package/services/EnsureNoGlobalWebinyCli.js.map +1 -1
  36. package/services/EnsureSystemWebinyConfig.js +2 -2
  37. package/services/EnsureSystemWebinyConfig.js.map +1 -1
  38. package/services/InitGit.js +3 -3
  39. package/services/InitGit.js.map +1 -1
  40. package/services/IsGitAvailable.js +2 -2
  41. package/services/IsGitAvailable.js.map +1 -1
  42. package/services/SetupYarn/binaries/yarn-4.17.1.cjs +944 -0
  43. package/services/SetupYarn.js +5 -5
  44. package/services/SetupYarn.js.map +1 -1
  45. package/types.d.ts +2 -0
  46. package/services/SetupYarn/binaries/yarn-4.14.1.cjs +0 -940
  47. package/services/SetupYarn/binaries/yarn-4.14.1.d.cts +0 -2
@@ -28,3 +28,4 @@ cypress.json
28
28
  !.yarn/sdks
29
29
  !.yarn/versions
30
30
  .pnp.*
31
+ db/
@@ -1,8 +1,6 @@
1
1
  {
2
2
  "type": "module",
3
3
  "dependencies": {
4
- "@webiny/cli": "latest",
5
- "@webiny/cognito": "latest",
6
4
  "@webiny/mcp": "latest",
7
5
  "react": "18.3.1",
8
6
  "react-dom": "18.3.1",
@@ -12,7 +10,7 @@
12
10
  "@types/node": "^24.13.3",
13
11
  "@types/react": "18.3.31",
14
12
  "@types/react-dom": "18.3.7",
15
- "typescript": "6.0.3"
13
+ "typescript": "7.0.2"
16
14
  },
17
15
  "scripts": {},
18
16
  "engines": {
@@ -0,0 +1,26 @@
1
+ # Self-hosted (server) hosting-type environment variables.
2
+ #
3
+ # Everything here is OPTIONAL — the project runs with sensible defaults out of the box
4
+ # (`yarn webiny watch`). To override a value, copy this file to `.env` and uncomment the line.
5
+
6
+ # --- Dev server ports ---
7
+ # WEBINY_API_PORT=3002
8
+ # WEBINY_ADMIN_PORT=3001
9
+
10
+ # --- Public API origin (used by the Admin app + file-upload URLs) ---
11
+ # WEBINY_API_URL=http://localhost:3002
12
+
13
+ # --- Database: Postgres connection ---
14
+ # WEBINY_PG_HOST=localhost
15
+ # WEBINY_PG_PORT=5432
16
+ # WEBINY_PG_USER=postgres
17
+ # WEBINY_PG_PASSWORD=postgres
18
+ # WEBINY_PG_DATABASE=webiny
19
+
20
+ # --- Local file storage for uploaded files ---
21
+ # WEBINY_LOCAL_STORAGE_PATH=./.webiny/storage
22
+
23
+ # --- Secrets: the defaults are INSECURE dev placeholders.
24
+ # Change these before any non-local use. ---
25
+ # WEBINY_UPLOAD_SECRET=change-me
26
+ # WEBINY_SELF_HOSTED_AUTH_SECRET=change-me
@@ -0,0 +1,46 @@
1
+ import React from "react";
2
+ import { Admin } from "webiny/extensions";
3
+ // Server-only namespaces come from the server hosting-type package. `webiny/extensions` exposes the
4
+ // AWS namespaces, which don't include server-only extensions like `Infra.Postgres`.
5
+ import { Infra } from "@webiny/project-server";
6
+ import { SelfHostedAuth } from "@webiny/self-hosted-auth";
7
+
8
+ /**
9
+ * Self-hosted (server) hosting-type project extensions. No AWS, no Pulumi, no `deploy` — a single
10
+ * long-running Node HTTP server backed by SQL storage. Run it with `yarn webiny watch`.
11
+ */
12
+ export const Extensions = () => {
13
+ return (
14
+ <>
15
+ {/* SQL database — connect to a Postgres server. Connection params come from the WEBINY_PG_*
16
+ env vars (see `.env`); set `ssl` when connecting to a managed Postgres that requires it. */}
17
+ <Infra.Postgres
18
+ host={process.env.WEBINY_PG_HOST || "localhost"}
19
+ port={Number(process.env.WEBINY_PG_PORT) || 5432}
20
+ user={process.env.WEBINY_PG_USER || "postgres"}
21
+ password={process.env.WEBINY_PG_PASSWORD || "postgres"}
22
+ database={process.env.WEBINY_PG_DATABASE || "webiny"}
23
+ />
24
+
25
+ {/* Local file storage (uploaded files) + upload signing secret. Storage path resolves
26
+ against the project root, so uploads persist across rebuilds. */}
27
+ <Infra.FileStorage
28
+ path={process.env.WEBINY_LOCAL_STORAGE_PATH || "./.webiny/storage"}
29
+ uploadSecret={process.env.WEBINY_UPLOAD_SECRET || "dev-only-insecure-upload-secret"}
30
+ />
31
+
32
+ {/* The API's public origin. AWS derives this from stack output; the server has none, so it
33
+ is configured here. `Admin.ApiUrl` points the admin bundle at it; `Infra.ApiUrl` tells
34
+ the API its own origin (used for the file-upload URL + file srcPrefix). */}
35
+ <Admin.ApiUrl url={process.env.WEBINY_API_URL || "http://localhost:3002"} />
36
+ <Infra.ApiUrl url={process.env.WEBINY_API_URL || "http://localhost:3002"} />
37
+
38
+ {/* Auth: built-in self-hosted IdP (login screen + JWT). Back the secret with any env var. */}
39
+ <SelfHostedAuth
40
+ signingSecret={
41
+ process.env.WEBINY_SELF_HOSTED_AUTH_SECRET || "dev-only-insecure-secret"
42
+ }
43
+ />
44
+ </>
45
+ );
46
+ };
@@ -0,0 +1,22 @@
1
+ # Self-hosted (server) hosting-type environment variables.
2
+ #
3
+ # Everything here is OPTIONAL — the project runs with sensible defaults out of the box
4
+ # (`yarn webiny watch`). To override a value, copy this file to `.env` and uncomment the line.
5
+
6
+ # --- Dev server ports ---
7
+ # WEBINY_API_PORT=3002
8
+ # WEBINY_ADMIN_PORT=3001
9
+
10
+ # --- Public API origin (used by the Admin app + file-upload URLs) ---
11
+ # WEBINY_API_URL=http://localhost:3002
12
+
13
+ # --- Database: SQLite file (path resolves against the project root) ---
14
+ # WEBINY_SQL_FILENAME=./.webiny/server.sqlite
15
+
16
+ # --- Local file storage for uploaded files ---
17
+ # WEBINY_LOCAL_STORAGE_PATH=./.webiny/storage
18
+
19
+ # --- Secrets: the defaults are INSECURE dev placeholders.
20
+ # Change these before any non-local use. ---
21
+ # WEBINY_UPLOAD_SECRET=change-me
22
+ # WEBINY_SELF_HOSTED_AUTH_SECRET=change-me
@@ -0,0 +1,40 @@
1
+ import React from "react";
2
+ import { Admin } from "webiny/extensions";
3
+ // Server-only namespaces come from the server hosting-type package. `webiny/extensions` exposes the
4
+ // AWS namespaces, which don't include server-only extensions like `Infra.Sqlite`.
5
+ import { Infra } from "@webiny/project-server";
6
+ import { SelfHostedAuth } from "@webiny/self-hosted-auth";
7
+
8
+ /**
9
+ * Self-hosted (server) hosting-type project extensions. No AWS, no Pulumi, no `deploy` — a single
10
+ * long-running Node HTTP server backed by SQL storage. Run it with `yarn webiny watch`.
11
+ */
12
+ export const Extensions = () => {
13
+ return (
14
+ <>
15
+ {/* SQL database. Relative paths resolve against the project root (not the disposable app
16
+ workspace), so data persists across builds / watch restarts. */}
17
+ <Infra.Sqlite filename={process.env.WEBINY_SQL_FILENAME || "./.webiny/server.sqlite"} />
18
+
19
+ {/* Local file storage (uploaded files) + upload signing secret. Storage path resolves like
20
+ the SQLite file — against the project root — so uploads persist across rebuilds. */}
21
+ <Infra.FileStorage
22
+ path={process.env.WEBINY_LOCAL_STORAGE_PATH || "./.webiny/storage"}
23
+ uploadSecret={process.env.WEBINY_UPLOAD_SECRET || "dev-only-insecure-upload-secret"}
24
+ />
25
+
26
+ {/* The API's public origin. AWS derives this from stack output; the server has none, so it
27
+ is configured here. `Admin.ApiUrl` points the admin bundle at it; `Infra.ApiUrl` tells
28
+ the API its own origin (used for the file-upload URL + file srcPrefix). */}
29
+ <Admin.ApiUrl url={process.env.WEBINY_API_URL || "http://localhost:3002"} />
30
+ <Infra.ApiUrl url={process.env.WEBINY_API_URL || "http://localhost:3002"} />
31
+
32
+ {/* Auth: built-in self-hosted IdP (login screen + JWT). Back the secret with any env var. */}
33
+ <SelfHostedAuth
34
+ signingSecret={
35
+ process.env.WEBINY_SELF_HOSTED_AUTH_SECRET || "dev-only-insecure-secret"
36
+ }
37
+ />
38
+ </>
39
+ );
40
+ };
package/bin.js CHANGED
@@ -34,6 +34,12 @@ argv.command("$0 <project-name> [options]", "Name of application and template to
34
34
  default: "aws",
35
35
  demandOption: false
36
36
  });
37
+ yargs.option("hosting-type", {
38
+ describe: 'Hosting type to use: "aws" (default) or "server" (self-hosted, ALPHA). Used in non-interactive mode',
39
+ type: "string",
40
+ default: "aws",
41
+ demandOption: false
42
+ });
37
43
  yargs.option("template-options", {
38
44
  describe: "A JSON containing template-specific options (usually used in non-interactive environments)",
39
45
  default: null,
package/bin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bin.js","sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\n\n// Ensure system requirements are met.\nimport { ensureSystemRequirements } from \"@webiny/system-requirements\";\nensureSystemRequirements();\n\n// Verify `.webiny` config file and continue.\nimport { EnsureSystemWebinyConfig } from \"./services/index.js\";\n\nconst ensureSystemWebinyConfig = new EnsureSystemWebinyConfig();\nensureSystemWebinyConfig.execute();\n\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\n\nimport { GetCwpVersion } from \"./services/index.js\";\nimport { CreateWebinyProject } from \"./features/CreateWebinyProject.js\";\nimport { type CliParams } from \"./types.js\";\n\nprocess.on(\"unhandledRejection\", err => {\n throw err;\n});\n\nconst getCwpVersion = new GetCwpVersion();\nconst version = getCwpVersion.execute();\n\nconst argv = yargs(hideBin(process.argv))\n .usage(\"Usage: create-webiny-project <project-name> [options]\")\n .version(version)\n .demandCommand(1)\n .help()\n .alias(\"help\", \"h\")\n .scriptName(\"create-webiny-project\")\n .fail(function (msg, err) {\n if (msg) {\n console.log(msg);\n }\n if (err) {\n console.log(err);\n }\n process.exit(1);\n });\n\nargv.command<CliParams>(\n \"$0 <project-name> [options]\",\n \"Name of application and template to use\",\n yargs => {\n yargs.positional(\"project-name\", {\n describe: \"Project name\"\n });\n yargs.option(\"force\", {\n describe: \"All project creation within an existing folder\",\n default: false,\n type: \"boolean\",\n demandOption: false\n });\n yargs.option(\"template\", {\n describe: `Name of template to use, if no template is provided it will default to \"aws\" template`,\n alias: \"t\",\n type: \"string\",\n default: \"aws\",\n demandOption: false\n });\n yargs.option(\"template-options\", {\n describe: `A JSON containing template-specific options (usually used in non-interactive environments)`,\n default: null,\n type: \"string\",\n demandOption: false\n });\n yargs.option(\"assign-to-yarnrc\", {\n describe: `A JSON containing additional options that will be assigned into the \"yarnrc.yml\" configuration file`,\n default: null,\n type: \"string\",\n demandOption: false\n });\n yargs.option(\"tag\", {\n describe: \"NPM tag to use for @webiny packages\",\n type: \"string\",\n default: \"latest\",\n demandOption: false\n });\n yargs.option(\"interactive\", {\n describe: \"Enable interactive mode for all commands\",\n default: true,\n type: \"boolean\",\n demandOption: false\n });\n yargs.option(\"log\", {\n describe:\n \"Creates a log file to see output of installation. Defaults to create-webiny-project-logs.txt in current directory\",\n alias: \"l\",\n default: \"create-webiny-project-logs.txt\",\n type: \"string\",\n demandOption: false\n });\n yargs.option(\"debug\", {\n describe: \"Turn on debug logs\",\n default: false,\n type: \"boolean\",\n demandOption: false\n });\n yargs.option(\"cleanup\", {\n describe: \"If an error occurs upon project creation, deletes all generated files\",\n alias: \"c\",\n default: true,\n type: \"boolean\",\n demandOption: false\n });\n },\n cliArgs => {\n const createWebinyProject = new CreateWebinyProject();\n return createWebinyProject.execute(cliArgs);\n }\n).argv;\n"],"names":["ensureSystemRequirements","ensureSystemWebinyConfig","EnsureSystemWebinyConfig","process","err","getCwpVersion","GetCwpVersion","version","argv","yargs","hideBin","msg","console","cliArgs","createWebinyProject","CreateWebinyProject"],"mappings":";;;;;;AAIAA;AAKA,MAAMC,2BAA2B,IAAIC;AACrCD,yBAAyB,OAAO;AAShCE,QAAQ,EAAE,CAAC,sBAAsBC,CAAAA;IAC7B,MAAMA;AACV;AAEA,MAAMC,gBAAgB,IAAIC;AAC1B,MAAMC,UAAUF,cAAc,OAAO;AAErC,MAAMG,OAAOC,QAAMC,QAAQP,QAAQ,IAAI,GAClC,KAAK,CAAC,yDACN,OAAO,CAACI,SACR,aAAa,CAAC,GACd,IAAI,GACJ,KAAK,CAAC,QAAQ,KACd,UAAU,CAAC,yBACX,IAAI,CAAC,SAAUI,GAAG,EAAEP,GAAG;IACpB,IAAIO,KACAC,QAAQ,GAAG,CAACD;IAEhB,IAAIP,KACAQ,QAAQ,GAAG,CAACR;IAEhBD,QAAQ,IAAI,CAAC;AACjB;AAEJK,KAAK,OAAO,CACR,+BACA,2CACAC,CAAAA;IACIA,MAAM,UAAU,CAAC,gBAAgB;QAC7B,UAAU;IACd;IACAA,MAAM,MAAM,CAAC,SAAS;QAClB,UAAU;QACV,SAAS;QACT,MAAM;QACN,cAAc;IAClB;IACAA,MAAM,MAAM,CAAC,YAAY;QACrB,UAAU;QACV,OAAO;QACP,MAAM;QACN,SAAS;QACT,cAAc;IAClB;IACAA,MAAM,MAAM,CAAC,oBAAoB;QAC7B,UAAU;QACV,SAAS;QACT,MAAM;QACN,cAAc;IAClB;IACAA,MAAM,MAAM,CAAC,oBAAoB;QAC7B,UAAU;QACV,SAAS;QACT,MAAM;QACN,cAAc;IAClB;IACAA,MAAM,MAAM,CAAC,OAAO;QAChB,UAAU;QACV,MAAM;QACN,SAAS;QACT,cAAc;IAClB;IACAA,MAAM,MAAM,CAAC,eAAe;QACxB,UAAU;QACV,SAAS;QACT,MAAM;QACN,cAAc;IAClB;IACAA,MAAM,MAAM,CAAC,OAAO;QAChB,UACI;QACJ,OAAO;QACP,SAAS;QACT,MAAM;QACN,cAAc;IAClB;IACAA,MAAM,MAAM,CAAC,SAAS;QAClB,UAAU;QACV,SAAS;QACT,MAAM;QACN,cAAc;IAClB;IACAA,MAAM,MAAM,CAAC,WAAW;QACpB,UAAU;QACV,OAAO;QACP,SAAS;QACT,MAAM;QACN,cAAc;IAClB;AACJ,GACAI,CAAAA;IACI,MAAMC,sBAAsB,IAAIC;IAChC,OAAOD,oBAAoB,OAAO,CAACD;AACvC,GACF,IAAI"}
1
+ {"version":3,"file":"bin.js","sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\n\n// Ensure system requirements are met.\nimport { ensureSystemRequirements } from \"@webiny/system-requirements\";\nensureSystemRequirements();\n\n// Verify `.webiny` config file and continue.\nimport { EnsureSystemWebinyConfig } from \"./services/index.js\";\n\nconst ensureSystemWebinyConfig = new EnsureSystemWebinyConfig();\nensureSystemWebinyConfig.execute();\n\nimport yargs from \"yargs\";\nimport { hideBin } from \"yargs/helpers\";\n\nimport { GetCwpVersion } from \"./services/index.js\";\nimport { CreateWebinyProject } from \"./features/CreateWebinyProject.js\";\nimport { type CliParams } from \"./types.js\";\n\nprocess.on(\"unhandledRejection\", err => {\n throw err;\n});\n\nconst getCwpVersion = new GetCwpVersion();\nconst version = getCwpVersion.execute();\n\nconst argv = yargs(hideBin(process.argv))\n .usage(\"Usage: create-webiny-project <project-name> [options]\")\n .version(version)\n .demandCommand(1)\n .help()\n .alias(\"help\", \"h\")\n .scriptName(\"create-webiny-project\")\n .fail(function (msg, err) {\n if (msg) {\n console.log(msg);\n }\n if (err) {\n console.log(err);\n }\n process.exit(1);\n });\n\nargv.command<CliParams>(\n \"$0 <project-name> [options]\",\n \"Name of application and template to use\",\n yargs => {\n yargs.positional(\"project-name\", {\n describe: \"Project name\"\n });\n yargs.option(\"force\", {\n describe: \"All project creation within an existing folder\",\n default: false,\n type: \"boolean\",\n demandOption: false\n });\n yargs.option(\"template\", {\n describe: `Name of template to use, if no template is provided it will default to \"aws\" template`,\n alias: \"t\",\n type: \"string\",\n default: \"aws\",\n demandOption: false\n });\n yargs.option(\"hosting-type\", {\n describe: `Hosting type to use: \"aws\" (default) or \"server\" (self-hosted, ALPHA). Used in non-interactive mode`,\n type: \"string\",\n default: \"aws\",\n demandOption: false\n });\n yargs.option(\"template-options\", {\n describe: `A JSON containing template-specific options (usually used in non-interactive environments)`,\n default: null,\n type: \"string\",\n demandOption: false\n });\n yargs.option(\"assign-to-yarnrc\", {\n describe: `A JSON containing additional options that will be assigned into the \"yarnrc.yml\" configuration file`,\n default: null,\n type: \"string\",\n demandOption: false\n });\n yargs.option(\"tag\", {\n describe: \"NPM tag to use for @webiny packages\",\n type: \"string\",\n default: \"latest\",\n demandOption: false\n });\n yargs.option(\"interactive\", {\n describe: \"Enable interactive mode for all commands\",\n default: true,\n type: \"boolean\",\n demandOption: false\n });\n yargs.option(\"log\", {\n describe:\n \"Creates a log file to see output of installation. Defaults to create-webiny-project-logs.txt in current directory\",\n alias: \"l\",\n default: \"create-webiny-project-logs.txt\",\n type: \"string\",\n demandOption: false\n });\n yargs.option(\"debug\", {\n describe: \"Turn on debug logs\",\n default: false,\n type: \"boolean\",\n demandOption: false\n });\n yargs.option(\"cleanup\", {\n describe: \"If an error occurs upon project creation, deletes all generated files\",\n alias: \"c\",\n default: true,\n type: \"boolean\",\n demandOption: false\n });\n },\n cliArgs => {\n const createWebinyProject = new CreateWebinyProject();\n return createWebinyProject.execute(cliArgs);\n }\n).argv;\n"],"names":["ensureSystemRequirements","ensureSystemWebinyConfig","EnsureSystemWebinyConfig","process","err","getCwpVersion","GetCwpVersion","version","argv","yargs","hideBin","msg","console","cliArgs","createWebinyProject","CreateWebinyProject"],"mappings":";;;;;;AAIAA;AAKA,MAAMC,2BAA2B,IAAIC;AACrCD,yBAAyB,OAAO;AAShCE,QAAQ,EAAE,CAAC,sBAAsBC,CAAAA;IAC7B,MAAMA;AACV;AAEA,MAAMC,gBAAgB,IAAIC;AAC1B,MAAMC,UAAUF,cAAc,OAAO;AAErC,MAAMG,OAAOC,QAAMC,QAAQP,QAAQ,IAAI,GAClC,KAAK,CAAC,yDACN,OAAO,CAACI,SACR,aAAa,CAAC,GACd,IAAI,GACJ,KAAK,CAAC,QAAQ,KACd,UAAU,CAAC,yBACX,IAAI,CAAC,SAAUI,GAAG,EAAEP,GAAG;IACpB,IAAIO,KACAC,QAAQ,GAAG,CAACD;IAEhB,IAAIP,KACAQ,QAAQ,GAAG,CAACR;IAEhBD,QAAQ,IAAI,CAAC;AACjB;AAEJK,KAAK,OAAO,CACR,+BACA,2CACAC,CAAAA;IACIA,MAAM,UAAU,CAAC,gBAAgB;QAC7B,UAAU;IACd;IACAA,MAAM,MAAM,CAAC,SAAS;QAClB,UAAU;QACV,SAAS;QACT,MAAM;QACN,cAAc;IAClB;IACAA,MAAM,MAAM,CAAC,YAAY;QACrB,UAAU;QACV,OAAO;QACP,MAAM;QACN,SAAS;QACT,cAAc;IAClB;IACAA,MAAM,MAAM,CAAC,gBAAgB;QACzB,UAAU;QACV,MAAM;QACN,SAAS;QACT,cAAc;IAClB;IACAA,MAAM,MAAM,CAAC,oBAAoB;QAC7B,UAAU;QACV,SAAS;QACT,MAAM;QACN,cAAc;IAClB;IACAA,MAAM,MAAM,CAAC,oBAAoB;QAC7B,UAAU;QACV,SAAS;QACT,MAAM;QACN,cAAc;IAClB;IACAA,MAAM,MAAM,CAAC,OAAO;QAChB,UAAU;QACV,MAAM;QACN,SAAS;QACT,cAAc;IAClB;IACAA,MAAM,MAAM,CAAC,eAAe;QACxB,UAAU;QACV,SAAS;QACT,MAAM;QACN,cAAc;IAClB;IACAA,MAAM,MAAM,CAAC,OAAO;QAChB,UACI;QACJ,OAAO;QACP,SAAS;QACT,MAAM;QACN,cAAc;IAClB;IACAA,MAAM,MAAM,CAAC,SAAS;QAClB,UAAU;QACV,SAAS;QACT,MAAM;QACN,cAAc;IAClB;IACAA,MAAM,MAAM,CAAC,WAAW;QACpB,UAAU;QACV,OAAO;QACP,SAAS;QACT,MAAM;QACN,cAAc;IAClB;AACJ,GACAI,CAAAA;IACI,MAAMC,sBAAsB,IAAIC;IAChC,OAAOD,oBAAoB,OAAO,CAACD;AACvC,GACF,IAAI"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Merges hosting-specific dependencies into the generated project's `package.json`.
3
+ *
4
+ * The base template's `package.json` is hosting-neutral (only shared deps like `webiny`, `react` and
5
+ * `@webiny/mcp`); each hosting-type setup injects its own packages here. Values can be `"latest"` — the
6
+ * later `SetWebinyPackageVersions` step rewrites every `@webiny/*` / `webiny` entry to the actual CWP
7
+ * version, so only the presence of the dependency matters at this point.
8
+ */
9
+ export declare const addProjectDependencies: (projectRootFolderPath: string, dependencies: Record<string, string>) => void;
@@ -0,0 +1,17 @@
1
+ import fs_extra from "fs-extra";
2
+ import path from "path";
3
+ const addProjectDependencies = (projectRootFolderPath, dependencies)=>{
4
+ const pkgPath = path.join(projectRootFolderPath, "package.json");
5
+ const pkg = fs_extra.readJsonSync(pkgPath);
6
+ pkg.dependencies = {
7
+ ...pkg.dependencies,
8
+ ...dependencies
9
+ };
10
+ pkg.dependencies = Object.fromEntries(Object.entries(pkg.dependencies).sort(([a], [b])=>a.localeCompare(b)));
11
+ fs_extra.writeJsonSync(pkgPath, pkg, {
12
+ spaces: 2
13
+ });
14
+ };
15
+ export { addProjectDependencies };
16
+
17
+ //# sourceMappingURL=addProjectDependencies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/CreateWebinyProject/projects/addProjectDependencies.js","sources":["../../../../src/features/CreateWebinyProject/projects/addProjectDependencies.ts"],"sourcesContent":["import fs from \"fs-extra\";\nimport path from \"path\";\n\n/**\n * Merges hosting-specific dependencies into the generated project's `package.json`.\n *\n * The base template's `package.json` is hosting-neutral (only shared deps like `webiny`, `react` and\n * `@webiny/mcp`); each hosting-type setup injects its own packages here. Values can be `\"latest\"` — the\n * later `SetWebinyPackageVersions` step rewrites every `@webiny/*` / `webiny` entry to the actual CWP\n * version, so only the presence of the dependency matters at this point.\n */\nexport const addProjectDependencies = (\n projectRootFolderPath: string,\n dependencies: Record<string, string>\n) => {\n const pkgPath = path.join(projectRootFolderPath, \"package.json\");\n const pkg = fs.readJsonSync(pkgPath);\n\n pkg.dependencies = {\n ...pkg.dependencies,\n ...dependencies\n };\n\n // Keep dependencies sorted, matching the base template's alphabetical ordering.\n pkg.dependencies = Object.fromEntries(\n Object.entries(pkg.dependencies).sort(([a], [b]) => a.localeCompare(b))\n );\n\n fs.writeJsonSync(pkgPath, pkg, { spaces: 2 });\n};\n"],"names":["addProjectDependencies","projectRootFolderPath","dependencies","pkgPath","path","pkg","fs","Object","a","b"],"mappings":";;AAWO,MAAMA,yBAAyB,CAClCC,uBACAC;IAEA,MAAMC,UAAUC,KAAK,IAAI,CAACH,uBAAuB;IACjD,MAAMI,MAAMC,SAAAA,YAAe,CAACH;IAE5BE,IAAI,YAAY,GAAG;QACf,GAAGA,IAAI,YAAY;QACnB,GAAGH,YAAY;IACnB;IAGAG,IAAI,YAAY,GAAGE,OAAO,WAAW,CACjCA,OAAO,OAAO,CAACF,IAAI,YAAY,EAAE,IAAI,CAAC,CAAC,CAACG,EAAE,EAAE,CAACC,EAAE,GAAKD,EAAE,aAAa,CAACC;IAGxEH,SAAAA,aAAgB,CAACH,SAASE,KAAK;QAAE,QAAQ;IAAE;AAC/C"}
@@ -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"}
@@ -3,6 +3,7 @@ import path from "path";
3
3
  import { runInteractivePrompt } from "./runInteractivePrompt.js";
4
4
  import { GetProjectRootPath } from "../../../../services/index.js";
5
5
  import { GetTemplatesFolderPath } from "../../../../services/GetTemplatesFolderPath.js";
6
+ import { addProjectDependencies } from "../addProjectDependencies.js";
6
7
  class SetupAwsWebinyProject {
7
8
  async execute(cliArgs) {
8
9
  const awsArgs = await this.getAwsArgs(cliArgs);
@@ -12,6 +13,10 @@ class SetupAwsWebinyProject {
12
13
  const getProjectRoot = new GetProjectRootPath();
13
14
  const projectRootFolderPath = getProjectRoot.execute(cliArgs);
14
15
  fs_extra.copySync(storageTemplatePath, projectRootFolderPath);
16
+ addProjectDependencies(projectRootFolderPath, {
17
+ "@webiny/cli-aws": "latest",
18
+ "@webiny/cognito": "latest"
19
+ });
15
20
  const webinyConfigTsxEnvFilePath = path.join(projectRootFolderPath, "webiny.config.tsx");
16
21
  let content = fs_extra.readFileSync(webinyConfigTsxEnvFilePath).toString();
17
22
  content = content.replace("{REGION}", awsArgs.region);
@@ -1 +1 @@
1
- {"version":3,"file":"features/CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js","sources":["../../../../../src/features/CreateWebinyProject/projects/aws/SetupAwsWebinyProject.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 { AwsProjectParams } from \"./types.js\";\nimport { GetTemplatesFolderPath } from \"../../../../services/GetTemplatesFolderPath.js\";\n\nexport class SetupAwsWebinyProject {\n async execute(cliArgs: CliParams): Promise<AwsProjectParams> {\n const awsArgs = await this.getAwsArgs(cliArgs);\n\n const getTemplatesFolderPath = new GetTemplatesFolderPath();\n const templatesFolderPath = getTemplatesFolderPath.execute();\n\n const storageTemplatePath = path.join(templatesFolderPath, \"aws\", awsArgs.storageOps);\n\n const getProjectRoot = new GetProjectRootPath();\n const projectRootFolderPath = getProjectRoot.execute(cliArgs);\n\n fs.copySync(storageTemplatePath, projectRootFolderPath);\n\n // Update .env file.\n const webinyConfigTsxEnvFilePath = path.join(projectRootFolderPath, \"webiny.config.tsx\");\n let content = fs.readFileSync(webinyConfigTsxEnvFilePath).toString();\n content = content.replace(\"{REGION}\", awsArgs.region);\n fs.writeFileSync(webinyConfigTsxEnvFilePath, content);\n\n return awsArgs;\n }\n\n private async getAwsArgs(cliArgs: CliParams) {\n const awsArgs: AwsProjectParams = {\n region: \"us-east-1\",\n storageOps: \"ddb\",\n aiAgent: \"other\"\n };\n\n const { templateOptions: templateOptionsString } = cliArgs;\n if (templateOptionsString) {\n try {\n Object.assign(awsArgs, JSON.parse(templateOptionsString));\n } catch {\n // Do nothing.\n }\n }\n\n if (cliArgs.interactive !== false) {\n Object.assign(awsArgs, await runInteractivePrompt());\n }\n\n return awsArgs;\n }\n}\n"],"names":["SetupAwsWebinyProject","cliArgs","awsArgs","getTemplatesFolderPath","GetTemplatesFolderPath","templatesFolderPath","storageTemplatePath","path","getProjectRoot","GetProjectRootPath","projectRootFolderPath","fs","webinyConfigTsxEnvFilePath","content","templateOptionsString","Object","JSON","runInteractivePrompt"],"mappings":";;;;;AAQO,MAAMA;IACT,MAAM,QAAQC,OAAkB,EAA6B;QACzD,MAAMC,UAAU,MAAM,IAAI,CAAC,UAAU,CAACD;QAEtC,MAAME,yBAAyB,IAAIC;QACnC,MAAMC,sBAAsBF,uBAAuB,OAAO;QAE1D,MAAMG,sBAAsBC,KAAK,IAAI,CAACF,qBAAqB,OAAOH,QAAQ,UAAU;QAEpF,MAAMM,iBAAiB,IAAIC;QAC3B,MAAMC,wBAAwBF,eAAe,OAAO,CAACP;QAErDU,SAAAA,QAAW,CAACL,qBAAqBI;QAGjC,MAAME,6BAA6BL,KAAK,IAAI,CAACG,uBAAuB;QACpE,IAAIG,UAAUF,SAAAA,YAAe,CAACC,4BAA4B,QAAQ;QAClEC,UAAUA,QAAQ,OAAO,CAAC,YAAYX,QAAQ,MAAM;QACpDS,SAAAA,aAAgB,CAACC,4BAA4BC;QAE7C,OAAOX;IACX;IAEA,MAAc,WAAWD,OAAkB,EAAE;QACzC,MAAMC,UAA4B;YAC9B,QAAQ;YACR,YAAY;YACZ,SAAS;QACb;QAEA,MAAM,EAAE,iBAAiBY,qBAAqB,EAAE,GAAGb;QACnD,IAAIa,uBACA,IAAI;YACAC,OAAO,MAAM,CAACb,SAASc,KAAK,KAAK,CAACF;QACtC,EAAE,OAAM,CAER;QAGJ,IAAIb,AAAwB,UAAxBA,QAAQ,WAAW,EACnBc,OAAO,MAAM,CAACb,SAAS,MAAMe;QAGjC,OAAOf;IACX;AACJ"}
1
+ {"version":3,"file":"features/CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js","sources":["../../../../../src/features/CreateWebinyProject/projects/aws/SetupAwsWebinyProject.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 { AwsProjectParams } from \"./types.js\";\nimport { GetTemplatesFolderPath } from \"../../../../services/GetTemplatesFolderPath.js\";\nimport { addProjectDependencies } from \"../addProjectDependencies.js\";\n\nexport class SetupAwsWebinyProject {\n async execute(cliArgs: CliParams): Promise<AwsProjectParams> {\n const awsArgs = await this.getAwsArgs(cliArgs);\n\n const getTemplatesFolderPath = new GetTemplatesFolderPath();\n const templatesFolderPath = getTemplatesFolderPath.execute();\n\n const storageTemplatePath = path.join(templatesFolderPath, \"aws\", awsArgs.storageOps);\n\n const getProjectRoot = new GetProjectRootPath();\n const projectRootFolderPath = getProjectRoot.execute(cliArgs);\n\n fs.copySync(storageTemplatePath, projectRootFolderPath);\n\n // AWS hosting-type dependencies: the `webiny` CLI (AWS bin) + Cognito (AWS-managed IdP).\n addProjectDependencies(projectRootFolderPath, {\n \"@webiny/cli-aws\": \"latest\",\n \"@webiny/cognito\": \"latest\"\n });\n\n // Update .env file.\n const webinyConfigTsxEnvFilePath = path.join(projectRootFolderPath, \"webiny.config.tsx\");\n let content = fs.readFileSync(webinyConfigTsxEnvFilePath).toString();\n content = content.replace(\"{REGION}\", awsArgs.region);\n fs.writeFileSync(webinyConfigTsxEnvFilePath, content);\n\n return awsArgs;\n }\n\n private async getAwsArgs(cliArgs: CliParams) {\n const awsArgs: AwsProjectParams = {\n region: \"us-east-1\",\n storageOps: \"ddb\",\n aiAgent: \"other\"\n };\n\n const { templateOptions: templateOptionsString } = cliArgs;\n if (templateOptionsString) {\n try {\n Object.assign(awsArgs, JSON.parse(templateOptionsString));\n } catch {\n // Do nothing.\n }\n }\n\n if (cliArgs.interactive !== false) {\n Object.assign(awsArgs, await runInteractivePrompt());\n }\n\n return awsArgs;\n }\n}\n"],"names":["SetupAwsWebinyProject","cliArgs","awsArgs","getTemplatesFolderPath","GetTemplatesFolderPath","templatesFolderPath","storageTemplatePath","path","getProjectRoot","GetProjectRootPath","projectRootFolderPath","fs","addProjectDependencies","webinyConfigTsxEnvFilePath","content","templateOptionsString","Object","JSON","runInteractivePrompt"],"mappings":";;;;;;AASO,MAAMA;IACT,MAAM,QAAQC,OAAkB,EAA6B;QACzD,MAAMC,UAAU,MAAM,IAAI,CAAC,UAAU,CAACD;QAEtC,MAAME,yBAAyB,IAAIC;QACnC,MAAMC,sBAAsBF,uBAAuB,OAAO;QAE1D,MAAMG,sBAAsBC,KAAK,IAAI,CAACF,qBAAqB,OAAOH,QAAQ,UAAU;QAEpF,MAAMM,iBAAiB,IAAIC;QAC3B,MAAMC,wBAAwBF,eAAe,OAAO,CAACP;QAErDU,SAAAA,QAAW,CAACL,qBAAqBI;QAGjCE,uBAAuBF,uBAAuB;YAC1C,mBAAmB;YACnB,mBAAmB;QACvB;QAGA,MAAMG,6BAA6BN,KAAK,IAAI,CAACG,uBAAuB;QACpE,IAAII,UAAUH,SAAAA,YAAe,CAACE,4BAA4B,QAAQ;QAClEC,UAAUA,QAAQ,OAAO,CAAC,YAAYZ,QAAQ,MAAM;QACpDS,SAAAA,aAAgB,CAACE,4BAA4BC;QAE7C,OAAOZ;IACX;IAEA,MAAc,WAAWD,OAAkB,EAAE;QACzC,MAAMC,UAA4B;YAC9B,QAAQ;YACR,YAAY;YACZ,SAAS;QACb;QAEA,MAAM,EAAE,iBAAiBa,qBAAqB,EAAE,GAAGd;QACnD,IAAIc,uBACA,IAAI;YACAC,OAAO,MAAM,CAACd,SAASe,KAAK,KAAK,CAACF;QACtC,EAAE,OAAM,CAER;QAGJ,IAAId,AAAwB,UAAxBA,QAAQ,WAAW,EACnBe,OAAO,MAAM,CAACd,SAAS,MAAMgB;QAGjC,OAAOhB;IACX;AACJ"}
@@ -1,5 +1,5 @@
1
1
  export declare const runInteractivePrompt: () => Promise<{
2
+ aiAgent: any;
2
3
  region: any;
3
4
  storageOps: any;
4
- aiAgent: any;
5
5
  }>;
@@ -24,7 +24,12 @@ class SetupBaseWebinyProject {
24
24
  const baseTemplatePath = path.join(templatesFolderPath, "base");
25
25
  const getProjectRootPath = new GetProjectRootPath();
26
26
  const projectRootFolderPath = getProjectRootPath.execute(cliArgs);
27
- fs_extra.copySync(baseTemplatePath, projectRootFolderPath);
27
+ fs_extra.copySync(baseTemplatePath, projectRootFolderPath, {
28
+ filter: (src)=>{
29
+ if (src.includes("example.yarnrc.yml")) return false;
30
+ return true;
31
+ }
32
+ });
28
33
  for(let i = 0; i < renames.length; i++)fs_extra.moveSync(path.join(projectRootFolderPath, renames[i].prev), path.join(projectRootFolderPath, renames[i].next), {
29
34
  overwrite: true
30
35
  });
@@ -1 +1 @@
1
- {"version":3,"file":"features/CreateWebinyProject/projects/base/SetupBaseWebinyProject.js","sources":["../../../../../src/features/CreateWebinyProject/projects/base/SetupBaseWebinyProject.ts"],"sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport fs from \"fs-extra\";\nimport path from \"path\";\nimport { GetProjectRootPath } from \"../../../../services/GetProjectRootPath.js\";\nimport { CliParams } from \"../../../../types.js\";\nimport { GetTemplatesFolderPath } from \"../../../../services/GetTemplatesFolderPath.js\";\n\nexport const renames = [\n {\n prev: \"example.gitignore\",\n next: \".gitignore\"\n },\n {\n prev: \"example.gitattributes\",\n next: \".gitattributes\"\n },\n {\n prev: \"template.package.json\",\n next: \"package.json\"\n }\n // {\n // prev: \"example.yarnrc.yml\",\n // next: \".yarnrc.yml\"\n // }\n];\n\nexport class SetupBaseWebinyProject {\n execute(cliArgs: CliParams) {\n const getTemplatesFolderPath = new GetTemplatesFolderPath();\n const templatesFolderPath = getTemplatesFolderPath.execute();\n\n const baseTemplatePath = path.join(templatesFolderPath, \"base\");\n\n const getProjectRootPath = new GetProjectRootPath();\n const projectRootFolderPath = getProjectRootPath.execute(cliArgs);\n\n fs.copySync(baseTemplatePath, projectRootFolderPath);\n\n for (let i = 0; i < renames.length; i++) {\n fs.moveSync(\n path.join(projectRootFolderPath, renames[i].prev),\n path.join(projectRootFolderPath, renames[i].next),\n {\n overwrite: true\n }\n );\n }\n\n // Anonymous per-project identifier used by telemetry to group CLI/admin\n // events at the install level. Tracked in git (not in .webiny/) so it\n // stays stable across machines collaborating on the same project.\n const pkgPath = path.join(projectRootFolderPath, \"package.json\");\n const pkg = fs.readJsonSync(pkgPath);\n pkg.webiny = { ...pkg.webiny, installationId: randomUUID() };\n fs.writeJsonSync(pkgPath, pkg, { spaces: 2 });\n }\n}\n"],"names":["renames","SetupBaseWebinyProject","cliArgs","getTemplatesFolderPath","GetTemplatesFolderPath","templatesFolderPath","baseTemplatePath","path","getProjectRootPath","GetProjectRootPath","projectRootFolderPath","fs","i","pkgPath","pkg","randomUUID"],"mappings":";;;;;AAOO,MAAMA,UAAU;IACnB;QACI,MAAM;QACN,MAAM;IACV;IACA;QACI,MAAM;QACN,MAAM;IACV;IACA;QACI,MAAM;QACN,MAAM;IACV;CAKH;AAEM,MAAMC;IACT,QAAQC,OAAkB,EAAE;QACxB,MAAMC,yBAAyB,IAAIC;QACnC,MAAMC,sBAAsBF,uBAAuB,OAAO;QAE1D,MAAMG,mBAAmBC,KAAK,IAAI,CAACF,qBAAqB;QAExD,MAAMG,qBAAqB,IAAIC;QAC/B,MAAMC,wBAAwBF,mBAAmB,OAAO,CAACN;QAEzDS,SAAAA,QAAW,CAACL,kBAAkBI;QAE9B,IAAK,IAAIE,IAAI,GAAGA,IAAIZ,QAAQ,MAAM,EAAEY,IAChCD,SAAAA,QAAW,CACPJ,KAAK,IAAI,CAACG,uBAAuBV,OAAO,CAACY,EAAE,CAAC,IAAI,GAChDL,KAAK,IAAI,CAACG,uBAAuBV,OAAO,CAACY,EAAE,CAAC,IAAI,GAChD;YACI,WAAW;QACf;QAOR,MAAMC,UAAUN,KAAK,IAAI,CAACG,uBAAuB;QACjD,MAAMI,MAAMH,SAAAA,YAAe,CAACE;QAC5BC,IAAI,MAAM,GAAG;YAAE,GAAGA,IAAI,MAAM;YAAE,gBAAgBC;QAAa;QAC3DJ,SAAAA,aAAgB,CAACE,SAASC,KAAK;YAAE,QAAQ;QAAE;IAC/C;AACJ"}
1
+ {"version":3,"file":"features/CreateWebinyProject/projects/base/SetupBaseWebinyProject.js","sources":["../../../../../src/features/CreateWebinyProject/projects/base/SetupBaseWebinyProject.ts"],"sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport fs from \"fs-extra\";\nimport path from \"path\";\nimport { GetProjectRootPath } from \"../../../../services/GetProjectRootPath.js\";\nimport { CliParams } from \"../../../../types.js\";\nimport { GetTemplatesFolderPath } from \"../../../../services/GetTemplatesFolderPath.js\";\n\nexport const renames = [\n {\n prev: \"example.gitignore\",\n next: \".gitignore\"\n },\n {\n prev: \"example.gitattributes\",\n next: \".gitattributes\"\n },\n {\n prev: \"template.package.json\",\n next: \"package.json\"\n }\n // {\n // prev: \"example.yarnrc.yml\",\n // next: \".yarnrc.yml\"\n // }\n];\n\nexport class SetupBaseWebinyProject {\n execute(cliArgs: CliParams) {\n const getTemplatesFolderPath = new GetTemplatesFolderPath();\n const templatesFolderPath = getTemplatesFolderPath.execute();\n\n const baseTemplatePath = path.join(templatesFolderPath, \"base\");\n\n const getProjectRootPath = new GetProjectRootPath();\n const projectRootFolderPath = getProjectRootPath.execute(cliArgs);\n\n fs.copySync(baseTemplatePath, projectRootFolderPath, {\n filter: src => {\n // We want to skip copying yarnrc.yml file as it is not required anymore.\n // The installation script now creates file with required settings.\n if (src.includes(\"example.yarnrc.yml\")) {\n return false;\n }\n return true;\n }\n });\n\n for (let i = 0; i < renames.length; i++) {\n fs.moveSync(\n path.join(projectRootFolderPath, renames[i].prev),\n path.join(projectRootFolderPath, renames[i].next),\n {\n overwrite: true\n }\n );\n }\n\n // Anonymous per-project identifier used by telemetry to group CLI/admin\n // events at the install level. Tracked in git (not in .webiny/) so it\n // stays stable across machines collaborating on the same project.\n const pkgPath = path.join(projectRootFolderPath, \"package.json\");\n const pkg = fs.readJsonSync(pkgPath);\n pkg.webiny = { ...pkg.webiny, installationId: randomUUID() };\n fs.writeJsonSync(pkgPath, pkg, { spaces: 2 });\n }\n}\n"],"names":["renames","SetupBaseWebinyProject","cliArgs","getTemplatesFolderPath","GetTemplatesFolderPath","templatesFolderPath","baseTemplatePath","path","getProjectRootPath","GetProjectRootPath","projectRootFolderPath","fs","src","i","pkgPath","pkg","randomUUID"],"mappings":";;;;;AAOO,MAAMA,UAAU;IACnB;QACI,MAAM;QACN,MAAM;IACV;IACA;QACI,MAAM;QACN,MAAM;IACV;IACA;QACI,MAAM;QACN,MAAM;IACV;CAKH;AAEM,MAAMC;IACT,QAAQC,OAAkB,EAAE;QACxB,MAAMC,yBAAyB,IAAIC;QACnC,MAAMC,sBAAsBF,uBAAuB,OAAO;QAE1D,MAAMG,mBAAmBC,KAAK,IAAI,CAACF,qBAAqB;QAExD,MAAMG,qBAAqB,IAAIC;QAC/B,MAAMC,wBAAwBF,mBAAmB,OAAO,CAACN;QAEzDS,SAAAA,QAAW,CAACL,kBAAkBI,uBAAuB;YACjD,QAAQE,CAAAA;gBAGJ,IAAIA,IAAI,QAAQ,CAAC,uBACb,OAAO;gBAEX,OAAO;YACX;QACJ;QAEA,IAAK,IAAIC,IAAI,GAAGA,IAAIb,QAAQ,MAAM,EAAEa,IAChCF,SAAAA,QAAW,CACPJ,KAAK,IAAI,CAACG,uBAAuBV,OAAO,CAACa,EAAE,CAAC,IAAI,GAChDN,KAAK,IAAI,CAACG,uBAAuBV,OAAO,CAACa,EAAE,CAAC,IAAI,GAChD;YACI,WAAW;QACf;QAOR,MAAMC,UAAUP,KAAK,IAAI,CAACG,uBAAuB;QACjD,MAAMK,MAAMJ,SAAAA,YAAe,CAACG;QAC5BC,IAAI,MAAM,GAAG;YAAE,GAAGA,IAAI,MAAM;YAAE,gBAAgBC;QAAa;QAC3DL,SAAAA,aAAgB,CAACG,SAASC,KAAK;YAAE,QAAQ;QAAE;IAC/C;AACJ"}
@@ -0,0 +1,2 @@
1
+ export type HostingType = "aws" | "server";
2
+ export declare const runHostingTypePrompt: () => Promise<HostingType>;
@@ -0,0 +1,28 @@
1
+ import inquirer from "inquirer";
2
+ const HOSTING_TYPE_OPTIONS = [
3
+ {
4
+ value: "aws",
5
+ name: "AWS (Lambda, DynamoDB, API Gateway — deployed with Pulumi)"
6
+ },
7
+ {
8
+ value: "server",
9
+ name: "Self-hosted / server (Node HTTP server + SQL storage) — ALPHA"
10
+ }
11
+ ];
12
+ const runHostingTypePrompt = async ()=>{
13
+ console.log("How would you like to host your new Webiny project?");
14
+ console.log();
15
+ const { hostingType } = await inquirer.prompt([
16
+ {
17
+ type: "select",
18
+ name: "hostingType",
19
+ default: "aws",
20
+ message: "Please choose how you would like to host your project:",
21
+ choices: HOSTING_TYPE_OPTIONS
22
+ }
23
+ ]);
24
+ return hostingType;
25
+ };
26
+ export { runHostingTypePrompt };
27
+
28
+ //# sourceMappingURL=runHostingTypePrompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/CreateWebinyProject/projects/runHostingTypePrompt.js","sources":["../../../../src/features/CreateWebinyProject/projects/runHostingTypePrompt.ts"],"sourcesContent":["import inquirer from \"inquirer\";\n\nexport type HostingType = \"aws\" | \"server\";\n\nconst HOSTING_TYPE_OPTIONS: { value: HostingType; name: string }[] = [\n {\n value: \"aws\",\n name: \"AWS (Lambda, DynamoDB, API Gateway — deployed with Pulumi)\"\n },\n {\n value: \"server\",\n name: \"Self-hosted / server (Node HTTP server + SQL storage) — ALPHA\"\n }\n];\n\nexport const runHostingTypePrompt = async (): Promise<HostingType> => {\n console.log(\"How would you like to host your new Webiny project?\");\n console.log();\n\n const { hostingType } = await inquirer.prompt<{ hostingType: HostingType }>([\n {\n type: \"select\",\n name: \"hostingType\",\n default: \"aws\",\n message: \"Please choose how you would like to host your project:\",\n choices: HOSTING_TYPE_OPTIONS\n }\n ]);\n\n return hostingType;\n};\n"],"names":["HOSTING_TYPE_OPTIONS","runHostingTypePrompt","console","hostingType","inquirer"],"mappings":";AAIA,MAAMA,uBAA+D;IACjE;QACI,OAAO;QACP,MAAM;IACV;IACA;QACI,OAAO;QACP,MAAM;IACV;CACH;AAEM,MAAMC,uBAAuB;IAChCC,QAAQ,GAAG,CAAC;IACZA,QAAQ,GAAG;IAEX,MAAM,EAAEC,WAAW,EAAE,GAAG,MAAMC,SAAS,MAAM,CAA+B;QACxE;YACI,MAAM;YACN,MAAM;YACN,SAAS;YACT,SAAS;YACT,SAASJ;QACb;KACH;IAED,OAAOG;AACX"}
@@ -0,0 +1,6 @@
1
+ import { CliParams } from "../../../../types.js";
2
+ import { ServerProjectParams } from "./types.js";
3
+ export declare class SetupServerWebinyProject {
4
+ execute(cliArgs: CliParams): Promise<ServerProjectParams>;
5
+ private getServerArgs;
6
+ }
@@ -0,0 +1,43 @@
1
+ import fs_extra from "fs-extra";
2
+ import path from "path";
3
+ import { runInteractivePrompt } from "./runInteractivePrompt.js";
4
+ import { GetProjectRootPath } from "../../../../services/index.js";
5
+ import { GetTemplatesFolderPath } from "../../../../services/GetTemplatesFolderPath.js";
6
+ import { addProjectDependencies } from "../addProjectDependencies.js";
7
+ import { addProjectScripts } from "../addProjectScripts.js";
8
+ class SetupServerWebinyProject {
9
+ async execute(cliArgs) {
10
+ const serverArgs = await this.getServerArgs(cliArgs);
11
+ const getTemplatesFolderPath = new GetTemplatesFolderPath();
12
+ const templatesFolderPath = getTemplatesFolderPath.execute();
13
+ const storageTemplatePath = path.join(templatesFolderPath, "server", serverArgs.storageOps);
14
+ const getProjectRoot = new GetProjectRootPath();
15
+ const projectRootFolderPath = getProjectRoot.execute(cliArgs);
16
+ fs_extra.copySync(storageTemplatePath, projectRootFolderPath);
17
+ addProjectDependencies(projectRootFolderPath, {
18
+ "@webiny/cli-server": "latest",
19
+ "@webiny/project-server": "latest",
20
+ "@webiny/project-server-template": "latest",
21
+ "@webiny/self-hosted-auth": "latest"
22
+ });
23
+ addProjectScripts(projectRootFolderPath, {
24
+ dev: "webiny watch"
25
+ });
26
+ return serverArgs;
27
+ }
28
+ async getServerArgs(cliArgs) {
29
+ const serverArgs = {
30
+ storageOps: "sqlite",
31
+ aiAgent: "other"
32
+ };
33
+ const { templateOptions: templateOptionsString } = cliArgs;
34
+ if (templateOptionsString) try {
35
+ Object.assign(serverArgs, JSON.parse(templateOptionsString));
36
+ } catch {}
37
+ if (false !== cliArgs.interactive) Object.assign(serverArgs, await runInteractivePrompt());
38
+ return serverArgs;
39
+ }
40
+ }
41
+ export { SetupServerWebinyProject };
42
+
43
+ //# sourceMappingURL=SetupServerWebinyProject.js.map
@@ -0,0 +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\";\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"}
@@ -0,0 +1,4 @@
1
+ export declare const runInteractivePrompt: () => Promise<{
2
+ aiAgent: any;
3
+ storageOps: any;
4
+ }>;
@@ -0,0 +1,46 @@
1
+ import inquirer from "inquirer";
2
+ import { discoverAgents } from "@webiny/mcp";
3
+ const STORAGE_OPTIONS = {
4
+ sqlite: {
5
+ value: "sqlite",
6
+ name: "SQLite (single-file local database)"
7
+ },
8
+ postgres: {
9
+ value: "postgres",
10
+ name: "PostgreSQL (connect to a Postgres server)"
11
+ }
12
+ };
13
+ const runInteractivePrompt = async ()=>{
14
+ console.log("In order to create your new self-hosted Webiny project, please answer the following questions.");
15
+ console.log();
16
+ const agents = await discoverAgents();
17
+ const agentChoices = [
18
+ ...Array.from(agents.values()).map((a)=>({
19
+ value: a.preset.slug,
20
+ name: a.preset.displayName
21
+ })),
22
+ {
23
+ value: "other",
24
+ name: "Other / not listed"
25
+ }
26
+ ];
27
+ return inquirer.prompt([
28
+ {
29
+ type: "select",
30
+ name: "storageOps",
31
+ default: "sqlite",
32
+ message: "Please choose the database setup you wish to use with your project:",
33
+ choices: Object.values(STORAGE_OPTIONS)
34
+ },
35
+ {
36
+ type: "select",
37
+ name: "aiAgent",
38
+ default: "claude",
39
+ message: "Please choose the AI agent you will use with your project:",
40
+ choices: agentChoices
41
+ }
42
+ ]);
43
+ };
44
+ export { runInteractivePrompt };
45
+
46
+ //# sourceMappingURL=runInteractivePrompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/CreateWebinyProject/projects/server/runInteractivePrompt.js","sources":["../../../../../src/features/CreateWebinyProject/projects/server/runInteractivePrompt.ts"],"sourcesContent":["import inquirer from \"inquirer\";\nimport { discoverAgents } from \"@webiny/mcp\";\nimport { StorageOps } from \"./types.js\";\n\nconst STORAGE_OPTIONS: Record<StorageOps, { value: StorageOps; name: string }> = {\n sqlite: {\n value: \"sqlite\",\n name: \"SQLite (single-file local database)\"\n },\n postgres: {\n value: \"postgres\",\n name: \"PostgreSQL (connect to a Postgres server)\"\n }\n};\n\nexport const runInteractivePrompt = async () => {\n console.log(\n \"In order to create your new self-hosted Webiny project, please answer the following questions.\"\n );\n console.log();\n\n const agents = await discoverAgents();\n const agentChoices = [\n ...Array.from(agents.values()).map(a => ({\n value: a.preset.slug,\n name: a.preset.displayName\n })),\n { value: \"other\", name: \"Other / not listed\" }\n ];\n\n return inquirer.prompt([\n {\n type: \"select\",\n name: \"storageOps\",\n default: \"sqlite\",\n message: `Please choose the database setup you wish to use with your project:`,\n choices: Object.values(STORAGE_OPTIONS)\n },\n {\n type: \"select\",\n name: \"aiAgent\",\n default: \"claude\",\n message: \"Please choose the AI agent you will use with your project:\",\n choices: agentChoices\n }\n ]);\n};\n"],"names":["STORAGE_OPTIONS","runInteractivePrompt","console","agents","discoverAgents","agentChoices","Array","a","inquirer","Object"],"mappings":";;AAIA,MAAMA,kBAA2E;IAC7E,QAAQ;QACJ,OAAO;QACP,MAAM;IACV;IACA,UAAU;QACN,OAAO;QACP,MAAM;IACV;AACJ;AAEO,MAAMC,uBAAuB;IAChCC,QAAQ,GAAG,CACP;IAEJA,QAAQ,GAAG;IAEX,MAAMC,SAAS,MAAMC;IACrB,MAAMC,eAAe;WACdC,MAAM,IAAI,CAACH,OAAO,MAAM,IAAI,GAAG,CAACI,CAAAA,IAAM;gBACrC,OAAOA,EAAE,MAAM,CAAC,IAAI;gBACpB,MAAMA,EAAE,MAAM,CAAC,WAAW;YAC9B;QACA;YAAE,OAAO;YAAS,MAAM;QAAqB;KAChD;IAED,OAAOC,SAAS,MAAM,CAAC;QACnB;YACI,MAAM;YACN,MAAM;YACN,SAAS;YACT,SAAS;YACT,SAASC,OAAO,MAAM,CAACT;QAC3B;QACA;YACI,MAAM;YACN,MAAM;YACN,SAAS;YACT,SAAS;YACT,SAASK;QACb;KACH;AACL"}
@@ -0,0 +1,6 @@
1
+ export type StorageOps = "sqlite" | "postgres";
2
+ export type AiAgent = string | "other";
3
+ export interface ServerProjectParams {
4
+ storageOps: StorageOps;
5
+ aiAgent: AiAgent;
6
+ }