create-webiny-project 6.3.0 → 6.4.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_templates/base/template.package.json +1 -1
- package/bin.js +74 -83
- package/bin.js.map +1 -1
- package/features/CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js +28 -37
- package/features/CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js.map +1 -1
- package/features/CreateWebinyProject/projects/aws/availableAwsRegions.js +75 -58
- package/features/CreateWebinyProject/projects/aws/availableAwsRegions.js.map +1 -1
- package/features/CreateWebinyProject/projects/aws/runInteractivePrompt.js +46 -39
- package/features/CreateWebinyProject/projects/aws/runInteractivePrompt.js.map +1 -1
- package/features/CreateWebinyProject/projects/aws/types.js +0 -3
- package/features/CreateWebinyProject/projects/base/SetupBaseWebinyProject.js +27 -24
- package/features/CreateWebinyProject/projects/base/SetupBaseWebinyProject.js.map +1 -1
- package/features/CreateWebinyProject.js +160 -187
- package/features/CreateWebinyProject.js.map +1 -1
- package/package.json +9 -9
- package/services/Analytics.js +12 -11
- package/services/Analytics.js.map +1 -1
- package/services/EnsureNoGlobalWebinyCli.js +24 -12
- package/services/EnsureNoGlobalWebinyCli.js.map +1 -1
- package/services/EnsureNoTargetFolder.js +15 -19
- package/services/EnsureNoTargetFolder.js.map +1 -1
- package/services/EnsureNoYarnLockPackageJson.js +19 -13
- package/services/EnsureNoYarnLockPackageJson.js.map +1 -1
- package/services/EnsureSystemWebinyConfig.js +13 -16
- package/services/EnsureSystemWebinyConfig.js.map +1 -1
- package/services/EnsureValidProjectName.js +17 -16
- package/services/EnsureValidProjectName.js.map +1 -1
- package/services/GetCwpVersion.js +10 -13
- package/services/GetCwpVersion.js.map +1 -1
- package/services/GetProjectRootPath.js +5 -4
- package/services/GetProjectRootPath.js.map +1 -1
- package/services/GetTemplatesFolderPath.js +9 -11
- package/services/GetTemplatesFolderPath.js.map +1 -1
- package/services/InitGit.js +16 -11
- package/services/InitGit.js.map +1 -1
- package/services/IsGitAvailable.js +11 -8
- package/services/IsGitAvailable.js.map +1 -1
- package/services/PrintErrorInfo.js +13 -11
- package/services/PrintErrorInfo.js.map +1 -1
- package/services/PrintSystemInfo.js +40 -30
- package/services/PrintSystemInfo.js.map +1 -1
- package/services/SetWebinyPackageVersions.js +14 -21
- package/services/SetWebinyPackageVersions.js.map +1 -1
- package/services/SetupYarn.js +35 -53
- package/services/SetupYarn.js.map +1 -1
- package/services/index.js +0 -2
- package/types.js +0 -3
- package/features/CreateWebinyProject/projects/aws/types.js.map +0 -1
- package/services/index.js.map +0 -1
- package/types.js.map +0 -1
package/bin.js
CHANGED
|
@@ -1,95 +1,86 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// Ensure system requirements are met.
|
|
4
2
|
import { ensureSystemRequirements } from "@webiny/system-requirements";
|
|
3
|
+
import { EnsureSystemWebinyConfig, GetCwpVersion } from "./services/index.js";
|
|
4
|
+
import yargs_0 from "yargs";
|
|
5
|
+
import { hideBin } from "yargs/helpers";
|
|
6
|
+
import { CreateWebinyProject } from "./features/CreateWebinyProject.js";
|
|
5
7
|
ensureSystemRequirements();
|
|
6
|
-
|
|
7
|
-
// Verify `.webiny` config file and continue.
|
|
8
|
-
import { EnsureSystemWebinyConfig } from "./services/index.js";
|
|
9
8
|
const ensureSystemWebinyConfig = new EnsureSystemWebinyConfig();
|
|
10
9
|
ensureSystemWebinyConfig.execute();
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import { GetCwpVersion } from "./services/index.js";
|
|
14
|
-
import { CreateWebinyProject } from "./features/CreateWebinyProject.js";
|
|
15
|
-
process.on("unhandledRejection", err => {
|
|
16
|
-
throw err;
|
|
10
|
+
process.on("unhandledRejection", (err)=>{
|
|
11
|
+
throw err;
|
|
17
12
|
});
|
|
18
13
|
const getCwpVersion = new GetCwpVersion();
|
|
19
14
|
const version = getCwpVersion.execute();
|
|
20
|
-
const argv =
|
|
21
|
-
|
|
22
|
-
console.log(
|
|
23
|
-
|
|
24
|
-
if (err) {
|
|
25
|
-
console.log(err);
|
|
26
|
-
}
|
|
27
|
-
process.exit(1);
|
|
15
|
+
const argv = yargs_0(hideBin(process.argv)).usage("Usage: create-webiny-project <project-name> [options]").version(version).demandCommand(1).help().alias("help", "h").scriptName("create-webiny-project").fail(function(msg, err) {
|
|
16
|
+
if (msg) console.log(msg);
|
|
17
|
+
if (err) console.log(err);
|
|
18
|
+
process.exit(1);
|
|
28
19
|
});
|
|
29
|
-
argv.command("$0 <project-name> [options]", "Name of application and template to use", yargs
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}, cliArgs
|
|
91
|
-
|
|
92
|
-
|
|
20
|
+
argv.command("$0 <project-name> [options]", "Name of application and template to use", (yargs)=>{
|
|
21
|
+
yargs.positional("project-name", {
|
|
22
|
+
describe: "Project name"
|
|
23
|
+
});
|
|
24
|
+
yargs.option("force", {
|
|
25
|
+
describe: "All project creation within an existing folder",
|
|
26
|
+
default: false,
|
|
27
|
+
type: "boolean",
|
|
28
|
+
demandOption: false
|
|
29
|
+
});
|
|
30
|
+
yargs.option("template", {
|
|
31
|
+
describe: 'Name of template to use, if no template is provided it will default to "aws" template',
|
|
32
|
+
alias: "t",
|
|
33
|
+
type: "string",
|
|
34
|
+
default: "aws",
|
|
35
|
+
demandOption: false
|
|
36
|
+
});
|
|
37
|
+
yargs.option("template-options", {
|
|
38
|
+
describe: "A JSON containing template-specific options (usually used in non-interactive environments)",
|
|
39
|
+
default: null,
|
|
40
|
+
type: "string",
|
|
41
|
+
demandOption: false
|
|
42
|
+
});
|
|
43
|
+
yargs.option("assign-to-yarnrc", {
|
|
44
|
+
describe: 'A JSON containing additional options that will be assigned into the "yarnrc.yml" configuration file',
|
|
45
|
+
default: null,
|
|
46
|
+
type: "string",
|
|
47
|
+
demandOption: false
|
|
48
|
+
});
|
|
49
|
+
yargs.option("tag", {
|
|
50
|
+
describe: "NPM tag to use for @webiny packages",
|
|
51
|
+
type: "string",
|
|
52
|
+
default: "latest",
|
|
53
|
+
demandOption: false
|
|
54
|
+
});
|
|
55
|
+
yargs.option("interactive", {
|
|
56
|
+
describe: "Enable interactive mode for all commands",
|
|
57
|
+
default: true,
|
|
58
|
+
type: "boolean",
|
|
59
|
+
demandOption: false
|
|
60
|
+
});
|
|
61
|
+
yargs.option("log", {
|
|
62
|
+
describe: "Creates a log file to see output of installation. Defaults to create-webiny-project-logs.txt in current directory",
|
|
63
|
+
alias: "l",
|
|
64
|
+
default: "create-webiny-project-logs.txt",
|
|
65
|
+
type: "string",
|
|
66
|
+
demandOption: false
|
|
67
|
+
});
|
|
68
|
+
yargs.option("debug", {
|
|
69
|
+
describe: "Turn on debug logs",
|
|
70
|
+
default: false,
|
|
71
|
+
type: "boolean",
|
|
72
|
+
demandOption: false
|
|
73
|
+
});
|
|
74
|
+
yargs.option("cleanup", {
|
|
75
|
+
describe: "If an error occurs upon project creation, deletes all generated files",
|
|
76
|
+
alias: "c",
|
|
77
|
+
default: true,
|
|
78
|
+
type: "boolean",
|
|
79
|
+
demandOption: false
|
|
80
|
+
});
|
|
81
|
+
}, (cliArgs)=>{
|
|
82
|
+
const createWebinyProject = new CreateWebinyProject();
|
|
83
|
+
return createWebinyProject.execute(cliArgs);
|
|
93
84
|
}).argv;
|
|
94
85
|
|
|
95
86
|
//# sourceMappingURL=bin.js.map
|
package/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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,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,CAACD;AACvC,GACF,IAAI"}
|
|
@@ -1,46 +1,37 @@
|
|
|
1
|
-
import
|
|
1
|
+
import fs_extra from "fs-extra";
|
|
2
2
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
fs.writeFileSync(webinyConfigTsxEnvFilePath, content);
|
|
21
|
-
return awsArgs;
|
|
22
|
-
}
|
|
23
|
-
async getAwsArgs(cliArgs) {
|
|
24
|
-
const awsArgs = {
|
|
25
|
-
region: "us-east-1",
|
|
26
|
-
storageOps: "ddb",
|
|
27
|
-
aiAgent: "other"
|
|
28
|
-
};
|
|
29
|
-
const {
|
|
30
|
-
templateOptions: templateOptionsString
|
|
31
|
-
} = cliArgs;
|
|
32
|
-
if (templateOptionsString) {
|
|
33
|
-
try {
|
|
34
|
-
Object.assign(awsArgs, JSON.parse(templateOptionsString));
|
|
35
|
-
} catch {
|
|
36
|
-
// Do nothing.
|
|
37
|
-
}
|
|
6
|
+
class SetupAwsWebinyProject {
|
|
7
|
+
async execute(cliArgs) {
|
|
8
|
+
const awsArgs = await this.getAwsArgs(cliArgs);
|
|
9
|
+
const getTemplatesFolderPath = new GetTemplatesFolderPath();
|
|
10
|
+
const templatesFolderPath = getTemplatesFolderPath.execute();
|
|
11
|
+
const storageTemplatePath = path.join(templatesFolderPath, "aws", awsArgs.storageOps);
|
|
12
|
+
const getProjectRoot = new GetProjectRootPath();
|
|
13
|
+
const projectRootFolderPath = getProjectRoot.execute(cliArgs);
|
|
14
|
+
fs_extra.copySync(storageTemplatePath, projectRootFolderPath);
|
|
15
|
+
const webinyConfigTsxEnvFilePath = path.join(projectRootFolderPath, "webiny.config.tsx");
|
|
16
|
+
let content = fs_extra.readFileSync(webinyConfigTsxEnvFilePath).toString();
|
|
17
|
+
content = content.replace("{REGION}", awsArgs.region);
|
|
18
|
+
fs_extra.writeFileSync(webinyConfigTsxEnvFilePath, content);
|
|
19
|
+
return awsArgs;
|
|
38
20
|
}
|
|
39
|
-
|
|
40
|
-
|
|
21
|
+
async getAwsArgs(cliArgs) {
|
|
22
|
+
const awsArgs = {
|
|
23
|
+
region: "us-east-1",
|
|
24
|
+
storageOps: "ddb",
|
|
25
|
+
aiAgent: "other"
|
|
26
|
+
};
|
|
27
|
+
const { templateOptions: templateOptionsString } = cliArgs;
|
|
28
|
+
if (templateOptionsString) try {
|
|
29
|
+
Object.assign(awsArgs, JSON.parse(templateOptionsString));
|
|
30
|
+
} catch {}
|
|
31
|
+
if (false !== cliArgs.interactive) Object.assign(awsArgs, await runInteractivePrompt());
|
|
32
|
+
return awsArgs;
|
|
41
33
|
}
|
|
42
|
-
return awsArgs;
|
|
43
|
-
}
|
|
44
34
|
}
|
|
35
|
+
export { SetupAwsWebinyProject };
|
|
45
36
|
|
|
46
37
|
//# sourceMappingURL=SetupAwsWebinyProject.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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,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
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
1
|
+
const availableAwsRegions = [
|
|
2
|
+
{
|
|
3
|
+
value: "us-east-1",
|
|
4
|
+
name: "us-east-1 (US East, N. Virginia)"
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
value: "us-east-2",
|
|
8
|
+
name: "us-east-2 (US East, Ohio)"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
value: "us-west-1",
|
|
12
|
+
name: "us-west-1 (US West, N. California)"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
value: "us-west-2",
|
|
16
|
+
name: "us-west-2 (US West, Oregon)"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
value: "ca-central-1",
|
|
20
|
+
name: "ca-central-1 (Canada, Central)"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: "eu-central-1",
|
|
24
|
+
name: "eu-central-1 (EU, Frankfurt)"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
value: "eu-west-1",
|
|
28
|
+
name: "eu-west-1 (EU, Ireland)"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: "eu-west-2",
|
|
32
|
+
name: "eu-west-2 (EU, London)"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
value: "eu-west-3",
|
|
36
|
+
name: "eu-west-3 (EU, Paris)"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
value: "eu-north-1",
|
|
40
|
+
name: "eu-north-1 (EU, Stockholm)"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
value: "af-south-1",
|
|
44
|
+
name: "af-south-1 (Africa, Cape Town)"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
value: "ap-east-1",
|
|
48
|
+
name: "ap-east-1 (Asia Pacific, Hong Kong)"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
value: "ap-south-1",
|
|
52
|
+
name: "ap-south-1 (Asia Pacific, Mumbai)"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
value: "ap-northeast-2",
|
|
56
|
+
name: "ap-northeast-2 (Asia Pacific, Seoul)"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
value: "ap-southeast-1",
|
|
60
|
+
name: "ap-southeast-1 (Asia Pacific, Singapore)"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
value: "ap-southeast-2",
|
|
64
|
+
name: "ap-southeast-2 (Asia Pacific, Sydney)"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
value: "ap-northeast-1",
|
|
68
|
+
name: "ap-northeast-1 (Asia Pacific, Tokyo)"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
value: "sa-east-1",
|
|
72
|
+
name: "sa-east-1 (South America, São Paulo)"
|
|
73
|
+
}
|
|
74
|
+
];
|
|
75
|
+
export { availableAwsRegions };
|
|
59
76
|
|
|
60
77
|
//# sourceMappingURL=availableAwsRegions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/CreateWebinyProject/projects/aws/availableAwsRegions.js","sources":["../../../../../src/features/CreateWebinyProject/projects/aws/availableAwsRegions.ts"],"sourcesContent":["export const availableAwsRegions = [\n { value: \"us-east-1\", name: \"us-east-1 (US East, N. Virginia)\" },\n { value: \"us-east-2\", name: \"us-east-2 (US East, Ohio)\" },\n { value: \"us-west-1\", name: \"us-west-1 (US West, N. California)\" },\n { value: \"us-west-2\", name: \"us-west-2 (US West, Oregon)\" },\n { value: \"ca-central-1\", name: \"ca-central-1 (Canada, Central)\" },\n { value: \"eu-central-1\", name: \"eu-central-1 (EU, Frankfurt)\" },\n { value: \"eu-west-1\", name: \"eu-west-1 (EU, Ireland)\" },\n { value: \"eu-west-2\", name: \"eu-west-2 (EU, London)\" },\n /*{ value: \"eu-south-1\", name: \"eu-south-1 (EU, Milan)\" },*/\n { value: \"eu-west-3\", name: \"eu-west-3 (EU, Paris)\" },\n { value: \"eu-north-1\", name: \"eu-north-1 (EU, Stockholm)\" },\n { value: \"af-south-1\", name: \"af-south-1 (Africa, Cape Town)\" },\n { value: \"ap-east-1\", name: \"ap-east-1 (Asia Pacific, Hong Kong)\" },\n { value: \"ap-south-1\", name: \"ap-south-1 (Asia Pacific, Mumbai)\" },\n { value: \"ap-northeast-2\", name: \"ap-northeast-2 (Asia Pacific, Seoul)\" },\n { value: \"ap-southeast-1\", name: \"ap-southeast-1 (Asia Pacific, Singapore)\" },\n { value: \"ap-southeast-2\", name: \"ap-southeast-2 (Asia Pacific, Sydney)\" },\n { value: \"ap-northeast-1\", name: \"ap-northeast-1 (Asia Pacific, Tokyo)\" },\n // { value: \"me-south-1\", name: \"me-south-1 (Middle East, Bahrain)\" },\n { value: \"sa-east-1\", name: \"sa-east-1 (South America, São Paulo)\" }\n];\n"],"names":["availableAwsRegions"],"mappings":"AAAO,MAAMA,sBAAsB;IAC/B;QAAE,OAAO;QAAa,MAAM;IAAmC;IAC/D;QAAE,OAAO;QAAa,MAAM;IAA4B;IACxD;QAAE,OAAO;QAAa,MAAM;IAAqC;IACjE;QAAE,OAAO;QAAa,MAAM;IAA8B;IAC1D;QAAE,OAAO;QAAgB,MAAM;IAAiC;IAChE;QAAE,OAAO;QAAgB,MAAM;IAA+B;IAC9D;QAAE,OAAO;QAAa,MAAM;IAA0B;IACtD;QAAE,OAAO;QAAa,MAAM;IAAyB;IAErD;QAAE,OAAO;QAAa,MAAM;IAAwB;IACpD;QAAE,OAAO;QAAc,MAAM;IAA6B;IAC1D;QAAE,OAAO;QAAc,MAAM;IAAiC;IAC9D;QAAE,OAAO;QAAa,MAAM;IAAsC;IAClE;QAAE,OAAO;QAAc,MAAM;IAAoC;IACjE;QAAE,OAAO;QAAkB,MAAM;IAAuC;IACxE;QAAE,OAAO;QAAkB,MAAM;IAA2C;IAC5E;QAAE,OAAO;QAAkB,MAAM;IAAwC;IACzE;QAAE,OAAO;QAAkB,MAAM;IAAuC;IAExE;QAAE,OAAO;QAAa,MAAM;IAAuC;CACtE"}
|
|
@@ -2,46 +2,53 @@ import inquirer from "inquirer";
|
|
|
2
2
|
import { discoverAgents } from "@webiny/mcp";
|
|
3
3
|
import { availableAwsRegions } from "./availableAwsRegions.js";
|
|
4
4
|
const STORAGE_OPTIONS = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
ddb: {
|
|
6
|
+
value: "ddb",
|
|
7
|
+
name: "DynamoDB (for small and medium sized projects)"
|
|
8
|
+
},
|
|
9
|
+
"ddb-os": {
|
|
10
|
+
value: "ddb-os",
|
|
11
|
+
name: "Amazon DynamoDB + Amazon OpenSearch (for larger projects)"
|
|
12
|
+
}
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
14
|
+
const runInteractivePrompt = async ()=>{
|
|
15
|
+
console.log("In order to create your new Webiny project, please answer the following questions.");
|
|
16
|
+
console.log();
|
|
17
|
+
const agents = await discoverAgents();
|
|
18
|
+
const agentChoices = [
|
|
19
|
+
...Array.from(agents.values()).map((a)=>({
|
|
20
|
+
value: a.preset.slug,
|
|
21
|
+
name: a.preset.displayName
|
|
22
|
+
})),
|
|
23
|
+
{
|
|
24
|
+
value: "other",
|
|
25
|
+
name: "Other / not listed"
|
|
26
|
+
}
|
|
27
|
+
];
|
|
28
|
+
return inquirer.prompt([
|
|
29
|
+
{
|
|
30
|
+
type: "select",
|
|
31
|
+
name: "region",
|
|
32
|
+
default: "us-east-1",
|
|
33
|
+
message: "Please choose the AWS region in which your project will be deployed:",
|
|
34
|
+
choices: availableAwsRegions
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
type: "select",
|
|
38
|
+
name: "storageOps",
|
|
39
|
+
default: "ddb",
|
|
40
|
+
message: "Please choose the database setup you wish to use with your project:",
|
|
41
|
+
choices: Object.values(STORAGE_OPTIONS)
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: "select",
|
|
45
|
+
name: "aiAgent",
|
|
46
|
+
default: "claude",
|
|
47
|
+
message: "Please choose the AI agent you will use with your project:",
|
|
48
|
+
choices: agentChoices
|
|
49
|
+
}
|
|
50
|
+
]);
|
|
45
51
|
};
|
|
52
|
+
export { runInteractivePrompt };
|
|
46
53
|
|
|
47
54
|
//# sourceMappingURL=runInteractivePrompt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/CreateWebinyProject/projects/aws/runInteractivePrompt.js","sources":["../../../../../src/features/CreateWebinyProject/projects/aws/runInteractivePrompt.ts"],"sourcesContent":["import inquirer from \"inquirer\";\nimport { discoverAgents } from \"@webiny/mcp\";\nimport { StorageOps } from \"./types.js\";\nimport { availableAwsRegions } from \"./availableAwsRegions.js\";\n\nconst STORAGE_OPTIONS: Record<StorageOps, { value: StorageOps; name: string }> = {\n ddb: {\n value: \"ddb\",\n name: \"DynamoDB (for small and medium sized projects)\"\n },\n \"ddb-os\": {\n value: \"ddb-os\",\n name: \"Amazon DynamoDB + Amazon OpenSearch (for larger projects)\"\n }\n};\n\nexport const runInteractivePrompt = async () => {\n console.log(\n \"In order to create your new 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: \"region\",\n default: \"us-east-1\",\n message: \"Please choose the AWS region in which your project will be deployed:\",\n // Some of the regions might be commented out (not all service supported).\n choices: availableAwsRegions\n },\n {\n type: \"select\",\n name: \"storageOps\",\n default: \"ddb\",\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","availableAwsRegions","Object"],"mappings":";;;AAKA,MAAMA,kBAA2E;IAC7E,KAAK;QACD,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;YAET,SAASC;QACb;QACA;YACI,MAAM;YACN,MAAM;YACN,SAAS;YACT,SAAS;YACT,SAASC,OAAO,MAAM,CAACV;QAC3B;QACA;YACI,MAAM;YACN,MAAM;YACN,SAAS;YACT,SAAS;YACT,SAASK;QACb;KACH;AACL"}
|