create-webiny-project 6.4.5 → 6.6.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_templates/base/example.gitignore +1 -0
- package/_templates/base/template.package.json +1 -3
- package/_templates/server/postgres/.env.example +26 -0
- package/_templates/server/postgres/webiny.config.tsx +46 -0
- package/_templates/server/sqlite/.env.example +22 -0
- package/_templates/server/sqlite/webiny.config.tsx +40 -0
- package/bin.js +6 -0
- package/bin.js.map +1 -1
- package/features/CreateWebinyProject/projects/addProjectDependencies.d.ts +9 -0
- package/features/CreateWebinyProject/projects/addProjectDependencies.js +17 -0
- package/features/CreateWebinyProject/projects/addProjectDependencies.js.map +1 -0
- package/features/CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js +5 -0
- package/features/CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js.map +1 -1
- package/features/CreateWebinyProject/projects/aws/runInteractivePrompt.d.ts +1 -1
- package/features/CreateWebinyProject/projects/base/SetupBaseWebinyProject.js +6 -1
- package/features/CreateWebinyProject/projects/base/SetupBaseWebinyProject.js.map +1 -1
- package/features/CreateWebinyProject/projects/runHostingTypePrompt.d.ts +2 -0
- package/features/CreateWebinyProject/projects/runHostingTypePrompt.js +28 -0
- package/features/CreateWebinyProject/projects/runHostingTypePrompt.js.map +1 -0
- package/features/CreateWebinyProject/projects/server/SetupServerWebinyProject.d.ts +6 -0
- package/features/CreateWebinyProject/projects/server/SetupServerWebinyProject.js +39 -0
- package/features/CreateWebinyProject/projects/server/SetupServerWebinyProject.js.map +1 -0
- package/features/CreateWebinyProject/projects/server/runInteractivePrompt.d.ts +4 -0
- package/features/CreateWebinyProject/projects/server/runInteractivePrompt.js +46 -0
- package/features/CreateWebinyProject/projects/server/runInteractivePrompt.js.map +1 -0
- package/features/CreateWebinyProject/projects/server/types.d.ts +6 -0
- package/features/CreateWebinyProject/projects/server/types.js +0 -0
- package/features/CreateWebinyProject.js +45 -13
- package/features/CreateWebinyProject.js.map +1 -1
- package/package.json +12 -12
- package/services/EnsureNoGlobalWebinyCli.js +1 -1
- package/services/EnsureNoGlobalWebinyCli.js.map +1 -1
- package/services/EnsureSystemWebinyConfig.js +2 -2
- package/services/EnsureSystemWebinyConfig.js.map +1 -1
- package/services/InitGit.js +3 -3
- package/services/InitGit.js.map +1 -1
- package/services/IsGitAvailable.js +2 -2
- package/services/IsGitAvailable.js.map +1 -1
- package/services/SetupYarn/binaries/yarn-4.17.1.cjs +944 -0
- package/services/SetupYarn.js +5 -5
- package/services/SetupYarn.js.map +1 -1
- package/types.d.ts +2 -0
- package/services/SetupYarn/binaries/yarn-4.14.1.cjs +0 -940
- package/services/SetupYarn/binaries/yarn-4.14.1.d.cts +0 -2
|
@@ -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": "
|
|
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"}
|
|
@@ -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":"
|
|
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"}
|
|
@@ -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;
|
|
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,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,39 @@
|
|
|
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
|
+
class SetupServerWebinyProject {
|
|
8
|
+
async execute(cliArgs) {
|
|
9
|
+
const serverArgs = await this.getServerArgs(cliArgs);
|
|
10
|
+
const getTemplatesFolderPath = new GetTemplatesFolderPath();
|
|
11
|
+
const templatesFolderPath = getTemplatesFolderPath.execute();
|
|
12
|
+
const storageTemplatePath = path.join(templatesFolderPath, "server", serverArgs.storageOps);
|
|
13
|
+
const getProjectRoot = new GetProjectRootPath();
|
|
14
|
+
const projectRootFolderPath = getProjectRoot.execute(cliArgs);
|
|
15
|
+
fs_extra.copySync(storageTemplatePath, projectRootFolderPath);
|
|
16
|
+
addProjectDependencies(projectRootFolderPath, {
|
|
17
|
+
"@webiny/cli-server": "latest",
|
|
18
|
+
"@webiny/project-server": "latest",
|
|
19
|
+
"@webiny/project-server-template": "latest",
|
|
20
|
+
"@webiny/self-hosted-auth": "latest"
|
|
21
|
+
});
|
|
22
|
+
return serverArgs;
|
|
23
|
+
}
|
|
24
|
+
async getServerArgs(cliArgs) {
|
|
25
|
+
const serverArgs = {
|
|
26
|
+
storageOps: "sqlite",
|
|
27
|
+
aiAgent: "other"
|
|
28
|
+
};
|
|
29
|
+
const { templateOptions: templateOptionsString } = cliArgs;
|
|
30
|
+
if (templateOptionsString) try {
|
|
31
|
+
Object.assign(serverArgs, JSON.parse(templateOptionsString));
|
|
32
|
+
} catch {}
|
|
33
|
+
if (false !== cliArgs.interactive) Object.assign(serverArgs, await runInteractivePrompt());
|
|
34
|
+
return serverArgs;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export { SetupServerWebinyProject };
|
|
38
|
+
|
|
39
|
+
//# 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\";\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"}
|
|
@@ -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"}
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import execa from "execa";
|
|
1
|
+
import { execa } from "execa";
|
|
2
2
|
import fs_extra from "fs-extra";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
4
|
import path from "path";
|
|
@@ -8,6 +8,8 @@ import yesno from "yesno";
|
|
|
8
8
|
import { configureMcp } from "@webiny/mcp";
|
|
9
9
|
import { SetupBaseWebinyProject } from "./CreateWebinyProject/projects/base/SetupBaseWebinyProject.js";
|
|
10
10
|
import { SetupAwsWebinyProject } from "./CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js";
|
|
11
|
+
import { SetupServerWebinyProject } from "./CreateWebinyProject/projects/server/SetupServerWebinyProject.js";
|
|
12
|
+
import { runHostingTypePrompt } from "./CreateWebinyProject/projects/runHostingTypePrompt.js";
|
|
11
13
|
import { Analytics, EnsureNoGlobalWebinyCli, EnsureNoTargetFolder, EnsureNoYarnLockPackageJson, EnsureValidProjectName, GetProjectRootPath, InitGit, IsGitAvailable, PrintErrorInfo, PrintSystemInfo, SetWebinyPackageVersions, SetupYarn } from "../services/index.js";
|
|
12
14
|
import ora from "ora";
|
|
13
15
|
const { green: green, bold: bold, cyan: cyan, gray: gray, yellow: yellow } = chalk;
|
|
@@ -49,11 +51,8 @@ class CreateWebinyProject {
|
|
|
49
51
|
console.log(`Initializing a new Webiny project in ${green(projectRootPath)}...`);
|
|
50
52
|
const analytics = new Analytics();
|
|
51
53
|
await analytics.track("start");
|
|
52
|
-
let
|
|
53
|
-
|
|
54
|
-
storageOps: "ddb",
|
|
55
|
-
aiAgent: "other"
|
|
56
|
-
};
|
|
54
|
+
let aiAgent = "other";
|
|
55
|
+
let hostingType = "server" === cliArgs.hostingType ? "server" : "aws";
|
|
57
56
|
try {
|
|
58
57
|
const taskItems = [
|
|
59
58
|
{
|
|
@@ -82,10 +81,21 @@ class CreateWebinyProject {
|
|
|
82
81
|
const tasks = new Listr(taskItems);
|
|
83
82
|
await tasks.run();
|
|
84
83
|
console.log();
|
|
84
|
+
if (false !== cliArgs.interactive) {
|
|
85
|
+
hostingType = await runHostingTypePrompt();
|
|
86
|
+
console.log();
|
|
87
|
+
}
|
|
85
88
|
const setupBaseWebinyProject = new SetupBaseWebinyProject();
|
|
86
89
|
setupBaseWebinyProject.execute(cliArgs);
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
if ("server" === hostingType) {
|
|
91
|
+
const setupServerWebinyProject = new SetupServerWebinyProject();
|
|
92
|
+
const serverProjectParams = await setupServerWebinyProject.execute(cliArgs);
|
|
93
|
+
aiAgent = serverProjectParams.aiAgent;
|
|
94
|
+
} else {
|
|
95
|
+
const setupAwsWebinyProject = new SetupAwsWebinyProject();
|
|
96
|
+
const awsProjectParams = await setupAwsWebinyProject.execute(cliArgs);
|
|
97
|
+
aiAgent = awsProjectParams.aiAgent;
|
|
98
|
+
}
|
|
89
99
|
const setWebinyPackageVersions = new SetWebinyPackageVersions();
|
|
90
100
|
await setWebinyPackageVersions.execute(cliArgs);
|
|
91
101
|
console.log();
|
|
@@ -104,12 +114,12 @@ class CreateWebinyProject {
|
|
|
104
114
|
cause: e
|
|
105
115
|
});
|
|
106
116
|
}
|
|
107
|
-
if ("other" !==
|
|
117
|
+
if ("other" !== aiAgent) {
|
|
108
118
|
console.log();
|
|
109
|
-
console.log(bold(`Configuring MCP server for ${cyan(
|
|
119
|
+
console.log(bold(`Configuring MCP server for ${cyan(aiAgent)}...`));
|
|
110
120
|
console.log();
|
|
111
121
|
await configureMcp({
|
|
112
|
-
agent:
|
|
122
|
+
agent: aiAgent,
|
|
113
123
|
ui: new CwpUi(),
|
|
114
124
|
cwd: projectRootPath
|
|
115
125
|
});
|
|
@@ -135,6 +145,28 @@ class CreateWebinyProject {
|
|
|
135
145
|
process.exit(1);
|
|
136
146
|
}
|
|
137
147
|
console.log();
|
|
148
|
+
if ("server" === hostingType) {
|
|
149
|
+
console.log(`🎉 Your new self-hosted Webiny project ${green(projectName)} has been created!`);
|
|
150
|
+
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."));
|
|
152
|
+
console.log();
|
|
153
|
+
if ("other" === aiAgent) await configureMcp({
|
|
154
|
+
instructions: true
|
|
155
|
+
});
|
|
156
|
+
console.log([
|
|
157
|
+
`Start your project in development mode by running: ${green(`cd ${projectName} && yarn webiny watch`)}`,
|
|
158
|
+
"",
|
|
159
|
+
`To see all of the available CLI commands, run ${green("yarn webiny --help")} in your ${green(projectName)} directory.`,
|
|
160
|
+
"",
|
|
161
|
+
"Want to dive deeper into Webiny? Check out https://webiny.com/docs/!",
|
|
162
|
+
"Like the project? Star us on https://github.com/webiny/webiny-js!",
|
|
163
|
+
"",
|
|
164
|
+
"Need help? Join our Slack community! https://www.webiny.com/slack",
|
|
165
|
+
"",
|
|
166
|
+
"🚀 Happy coding!"
|
|
167
|
+
].join("\n"));
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
138
170
|
console.log(`🎉 Your new Webiny project ${green(projectName)} has been created and is ready to be deployed for the first time!`);
|
|
139
171
|
console.log();
|
|
140
172
|
const ok = await yesno({
|
|
@@ -156,12 +188,12 @@ class CreateWebinyProject {
|
|
|
156
188
|
stdio: "inherit"
|
|
157
189
|
});
|
|
158
190
|
} catch {}
|
|
159
|
-
if ("other" ===
|
|
191
|
+
if ("other" === aiAgent) await configureMcp({
|
|
160
192
|
instructions: true
|
|
161
193
|
});
|
|
162
194
|
return;
|
|
163
195
|
}
|
|
164
|
-
if ("other" ===
|
|
196
|
+
if ("other" === aiAgent) await configureMcp({
|
|
165
197
|
instructions: true
|
|
166
198
|
});
|
|
167
199
|
console.log([
|