create-webiny-project 6.3.0-beta.4 → 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
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
import
|
|
1
|
+
import fs_extra from "fs-extra";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { GetProjectRootPath } from "../../../../services/GetProjectRootPath.js";
|
|
4
4
|
import { GetTemplatesFolderPath } from "../../../../services/GetTemplatesFolderPath.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
5
|
+
const renames = [
|
|
6
|
+
{
|
|
7
|
+
prev: "example.gitignore",
|
|
8
|
+
next: ".gitignore"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
prev: "example.gitattributes",
|
|
12
|
+
next: ".gitattributes"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
prev: "template.package.json",
|
|
16
|
+
next: "package.json"
|
|
17
|
+
}
|
|
18
|
+
];
|
|
19
|
+
class SetupBaseWebinyProject {
|
|
20
|
+
execute(cliArgs) {
|
|
21
|
+
const getTemplatesFolderPath = new GetTemplatesFolderPath();
|
|
22
|
+
const templatesFolderPath = getTemplatesFolderPath.execute();
|
|
23
|
+
const baseTemplatePath = path.join(templatesFolderPath, "base");
|
|
24
|
+
const getProjectRootPath = new GetProjectRootPath();
|
|
25
|
+
const projectRootFolderPath = getProjectRootPath.execute(cliArgs);
|
|
26
|
+
fs_extra.copySync(baseTemplatePath, projectRootFolderPath);
|
|
27
|
+
for(let i = 0; i < renames.length; i++)fs_extra.moveSync(path.join(projectRootFolderPath, renames[i].prev), path.join(projectRootFolderPath, renames[i].next), {
|
|
28
|
+
overwrite: true
|
|
29
|
+
});
|
|
27
30
|
}
|
|
28
|
-
}
|
|
29
31
|
}
|
|
32
|
+
export { SetupBaseWebinyProject, renames };
|
|
30
33
|
|
|
31
34
|
//# sourceMappingURL=SetupBaseWebinyProject.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/CreateWebinyProject/projects/base/SetupBaseWebinyProject.js","sources":["../../../../../src/features/CreateWebinyProject/projects/base/SetupBaseWebinyProject.ts"],"sourcesContent":["import 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\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}\n"],"names":["renames","SetupBaseWebinyProject","cliArgs","getTemplatesFolderPath","GetTemplatesFolderPath","templatesFolderPath","baseTemplatePath","path","getProjectRootPath","GetProjectRootPath","projectRootFolderPath","fs","i"],"mappings":";;;;AAMO,MAAMA,UAAU;IACnB;QACI,MAAM;QACN,MAAM;IACV;IACA;QACI,MAAM;QACN,MAAM;IACV;IACA;QACI,MAAM;QACN,MAAM;IACV;CACH;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;IAGZ;AACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import execa from "execa";
|
|
2
|
-
import
|
|
2
|
+
import fs_extra from "fs-extra";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
4
|
import path from "path";
|
|
5
5
|
import { rimrafSync } from "rimraf";
|
|
@@ -8,203 +8,176 @@ 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 { Analytics, EnsureNoGlobalWebinyCli, EnsureNoTargetFolder, EnsureNoYarnLockPackageJson, EnsureValidProjectName, GetProjectRootPath, InitGit, IsGitAvailable, PrintErrorInfo, PrintSystemInfo,
|
|
11
|
+
import { Analytics, EnsureNoGlobalWebinyCli, EnsureNoTargetFolder, EnsureNoYarnLockPackageJson, EnsureValidProjectName, GetProjectRootPath, InitGit, IsGitAvailable, PrintErrorInfo, PrintSystemInfo, SetWebinyPackageVersions, SetupYarn } from "../services/index.js";
|
|
12
12
|
import ora from "ora";
|
|
13
|
-
const {
|
|
14
|
-
green,
|
|
15
|
-
bold,
|
|
16
|
-
cyan,
|
|
17
|
-
gray,
|
|
18
|
-
yellow
|
|
19
|
-
} = chalk;
|
|
20
|
-
|
|
21
|
-
/* Styled UI for MCP setup output — aligns visually with the rest of CWP output. */
|
|
13
|
+
const { green: green, bold: bold, cyan: cyan, gray: gray, yellow: yellow } = chalk;
|
|
22
14
|
class CwpUi {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
success(text, ...args) {
|
|
27
|
-
console.log(`${green("✔")} ${text}`, ...args);
|
|
28
|
-
}
|
|
29
|
-
error(text, ...args) {
|
|
30
|
-
console.error(`${chalk.red("✘")} ${text}`, ...args);
|
|
31
|
-
}
|
|
32
|
-
warning(text, ...args) {
|
|
33
|
-
console.warn(`${yellow("⚠")} ${text}`, ...args);
|
|
34
|
-
}
|
|
35
|
-
text(text) {
|
|
36
|
-
console.log(text);
|
|
37
|
-
}
|
|
38
|
-
emptyLine() {
|
|
39
|
-
console.log();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
export class CreateWebinyProject {
|
|
43
|
-
async execute(cliArgs) {
|
|
44
|
-
const {
|
|
45
|
-
projectName,
|
|
46
|
-
debug,
|
|
47
|
-
cleanup,
|
|
48
|
-
log
|
|
49
|
-
} = cliArgs;
|
|
50
|
-
if (!projectName) {
|
|
51
|
-
throw Error("You must provide a name for the project to use.");
|
|
15
|
+
info(text, ...args) {
|
|
16
|
+
console.log(gray(text), ...args);
|
|
52
17
|
}
|
|
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
|
-
|
|
18
|
+
success(text, ...args) {
|
|
19
|
+
console.log(`${green("✔")} ${text}`, ...args);
|
|
20
|
+
}
|
|
21
|
+
error(text, ...args) {
|
|
22
|
+
console.error(`${chalk.red("✘")} ${text}`, ...args);
|
|
23
|
+
}
|
|
24
|
+
warning(text, ...args) {
|
|
25
|
+
console.warn(`${yellow("⚠")} ${text}`, ...args);
|
|
26
|
+
}
|
|
27
|
+
text(text) {
|
|
28
|
+
console.log(text);
|
|
29
|
+
}
|
|
30
|
+
emptyLine() {
|
|
31
|
+
console.log();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
class CreateWebinyProject {
|
|
35
|
+
async execute(cliArgs) {
|
|
36
|
+
const { projectName, debug, cleanup, log } = cliArgs;
|
|
37
|
+
if (!projectName) throw Error("You must provide a name for the project to use.");
|
|
38
|
+
const getProjectRootPath = new GetProjectRootPath();
|
|
39
|
+
const projectRootPath = getProjectRootPath.execute(cliArgs);
|
|
40
|
+
const ensureValidProjectName = new EnsureValidProjectName();
|
|
41
|
+
ensureValidProjectName.execute(projectName);
|
|
42
|
+
const ensureNoTargetFolder = new EnsureNoTargetFolder();
|
|
43
|
+
ensureNoTargetFolder.execute(cliArgs);
|
|
44
|
+
const ensureNoYarnLockPackageJson = new EnsureNoYarnLockPackageJson();
|
|
45
|
+
await ensureNoYarnLockPackageJson.execute();
|
|
46
|
+
const ensureNoGlobalWebinyCli = new EnsureNoGlobalWebinyCli();
|
|
47
|
+
await ensureNoGlobalWebinyCli.execute();
|
|
48
|
+
const isGitAvailable = new IsGitAvailable().execute();
|
|
49
|
+
console.log(`Initializing a new Webiny project in ${green(projectRootPath)}...`);
|
|
50
|
+
const analytics = new Analytics();
|
|
51
|
+
await analytics.track("start");
|
|
52
|
+
let awsProjectParams = {
|
|
53
|
+
region: "us-east-1",
|
|
54
|
+
storageOps: "ddb",
|
|
55
|
+
aiAgent: "other"
|
|
56
|
+
};
|
|
57
|
+
try {
|
|
58
|
+
const taskItems = [
|
|
59
|
+
{
|
|
60
|
+
title: "Prepare project folder",
|
|
61
|
+
task: ()=>fs_extra.ensureDirSync(projectName)
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
title: "Setup Yarn",
|
|
65
|
+
task: async ()=>{
|
|
66
|
+
const setupYarn = new SetupYarn();
|
|
67
|
+
await setupYarn.execute(cliArgs);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
];
|
|
71
|
+
if (isGitAvailable) taskItems.push({
|
|
72
|
+
title: "Initialize git",
|
|
73
|
+
task: (_, task)=>{
|
|
74
|
+
const initGit = new InitGit();
|
|
75
|
+
try {
|
|
76
|
+
initGit.execute(cliArgs);
|
|
77
|
+
} catch {
|
|
78
|
+
task.skip("Git repo not initialized");
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
const tasks = new Listr(taskItems);
|
|
83
|
+
await tasks.run();
|
|
84
|
+
console.log();
|
|
85
|
+
const setupBaseWebinyProject = new SetupBaseWebinyProject();
|
|
86
|
+
setupBaseWebinyProject.execute(cliArgs);
|
|
87
|
+
const setupAwsWebinyProject = new SetupAwsWebinyProject();
|
|
88
|
+
awsProjectParams = await setupAwsWebinyProject.execute(cliArgs);
|
|
89
|
+
const setWebinyPackageVersions = new SetWebinyPackageVersions();
|
|
90
|
+
await setWebinyPackageVersions.execute(cliArgs);
|
|
91
|
+
console.log();
|
|
92
|
+
const spinner = ora("Installing packages...").start();
|
|
91
93
|
try {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
const subprocess = execa("yarn", [], {
|
|
95
|
+
cwd: projectRootPath,
|
|
96
|
+
maxBuffer: 500000000
|
|
97
|
+
});
|
|
98
|
+
await subprocess;
|
|
99
|
+
spinner.succeed("Packages installed successfully.");
|
|
100
|
+
} catch (e) {
|
|
101
|
+
spinner.fail("Failed to install packages.");
|
|
102
|
+
console.log(e.message);
|
|
103
|
+
throw new Error("Failed while installing project dependencies. Please check the above Yarn logs for more information.", {
|
|
104
|
+
cause: e
|
|
105
|
+
});
|
|
95
106
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
// Configure MCP server for the selected AI agent.
|
|
128
|
-
if (awsProjectParams.aiAgent !== "other") {
|
|
107
|
+
if ("other" !== awsProjectParams.aiAgent) {
|
|
108
|
+
console.log();
|
|
109
|
+
console.log(bold(`Configuring MCP server for ${cyan(awsProjectParams.aiAgent)}...`));
|
|
110
|
+
console.log();
|
|
111
|
+
await configureMcp({
|
|
112
|
+
agent: awsProjectParams.aiAgent,
|
|
113
|
+
ui: new CwpUi(),
|
|
114
|
+
cwd: projectRootPath
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
await analytics.track("end");
|
|
118
|
+
} catch (err) {
|
|
119
|
+
const stage = "error";
|
|
120
|
+
await analytics.track(stage, {
|
|
121
|
+
errorMessage: err.cause?.message || err.message,
|
|
122
|
+
errorStack: err.cause?.stack || err.stack
|
|
123
|
+
});
|
|
124
|
+
const printErrorInfo = new PrintErrorInfo();
|
|
125
|
+
printErrorInfo.execute(err, cliArgs);
|
|
126
|
+
const printSystemInfo = new PrintSystemInfo();
|
|
127
|
+
printSystemInfo.execute(cliArgs);
|
|
128
|
+
console.log(`Writing logs to ${green(path.resolve(log))}...`);
|
|
129
|
+
fs_extra.writeFileSync(path.resolve(log), err.toString());
|
|
130
|
+
console.log();
|
|
131
|
+
if (cleanup) {
|
|
132
|
+
console.log("Deleting created files and folders...");
|
|
133
|
+
rimrafSync(projectRootPath);
|
|
134
|
+
} else console.log("Project cleanup skipped.");
|
|
135
|
+
process.exit(1);
|
|
136
|
+
}
|
|
129
137
|
console.log();
|
|
130
|
-
console.log(
|
|
138
|
+
console.log(`🎉 Your new Webiny project ${green(projectName)} has been created and is ready to be deployed for the first time!`);
|
|
131
139
|
console.log();
|
|
132
|
-
await
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
cwd: projectRootPath
|
|
140
|
+
const ok = await yesno({
|
|
141
|
+
question: bold(`${green("?")} Would you like to deploy your project now (Y/n)?`),
|
|
142
|
+
defaultValue: true
|
|
136
143
|
});
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
console.log();
|
|
157
|
-
if (cleanup) {
|
|
158
|
-
console.log("Deleting created files and folders...");
|
|
159
|
-
rimrafSync(projectRootPath);
|
|
160
|
-
} else {
|
|
161
|
-
console.log("Project cleanup skipped.");
|
|
162
|
-
}
|
|
163
|
-
process.exit(1);
|
|
164
|
-
}
|
|
165
|
-
console.log();
|
|
166
|
-
console.log(`🎉 Your new Webiny project ${green(projectName)} has been created and is ready to be deployed for the first time!`);
|
|
167
|
-
console.log();
|
|
168
|
-
const ok = await yesno({
|
|
169
|
-
question: bold(`${green("?")} Would you like to deploy your project now (Y/n)?`),
|
|
170
|
-
defaultValue: true
|
|
171
|
-
});
|
|
172
|
-
console.log();
|
|
173
|
-
if (ok) {
|
|
174
|
-
console.log("🚀 Deploying your new Webiny project...");
|
|
175
|
-
console.log();
|
|
176
|
-
try {
|
|
177
|
-
const command = ["webiny", "deploy"];
|
|
178
|
-
if (debug) {
|
|
179
|
-
command.push("--debug");
|
|
144
|
+
console.log();
|
|
145
|
+
if (ok) {
|
|
146
|
+
console.log("🚀 Deploying your new Webiny project...");
|
|
147
|
+
console.log();
|
|
148
|
+
try {
|
|
149
|
+
const command = [
|
|
150
|
+
"webiny",
|
|
151
|
+
"deploy"
|
|
152
|
+
];
|
|
153
|
+
if (debug) command.push("--debug");
|
|
154
|
+
await execa("yarn", command, {
|
|
155
|
+
cwd: projectRootPath,
|
|
156
|
+
stdio: "inherit"
|
|
157
|
+
});
|
|
158
|
+
} catch {}
|
|
159
|
+
if ("other" === awsProjectParams.aiAgent) await configureMcp({
|
|
160
|
+
instructions: true
|
|
161
|
+
});
|
|
162
|
+
return;
|
|
180
163
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
stdio: "inherit"
|
|
184
|
-
});
|
|
185
|
-
} catch {
|
|
186
|
-
// Don't do anything. This is because the `webiny deploy` command has its own
|
|
187
|
-
// error handling and will print the error message. As far as this setup script
|
|
188
|
-
// is concerned, it succeeded, and it doesn't need to do anything else.
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
// For "other" agents, show manual MCP setup instructions after deploy has finished.
|
|
192
|
-
if (awsProjectParams.aiAgent === "other") {
|
|
193
|
-
await configureMcp({
|
|
194
|
-
instructions: true
|
|
164
|
+
if ("other" === awsProjectParams.aiAgent) await configureMcp({
|
|
165
|
+
instructions: true
|
|
195
166
|
});
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
167
|
+
console.log([
|
|
168
|
+
`Finish the setup by running the following command: ${green(`cd ${projectName} && yarn webiny deploy`)}`,
|
|
169
|
+
"",
|
|
170
|
+
`To see all of the available CLI commands, run ${green("yarn webiny --help")} in your ${green(projectName)} directory.`,
|
|
171
|
+
"",
|
|
172
|
+
"Want to dive deeper into Webiny? Check out https://webiny.com/docs/!",
|
|
173
|
+
"Like the project? Star us on https://github.com/webiny/webiny-js!",
|
|
174
|
+
"",
|
|
175
|
+
"Need help? Join our Slack community! https://www.webiny.com/slack",
|
|
176
|
+
"",
|
|
177
|
+
"🚀 Happy coding!"
|
|
178
|
+
].join("\n"));
|
|
205
179
|
}
|
|
206
|
-
console.log([`Finish the setup by running the following command: ${green(`cd ${projectName} && yarn webiny deploy`)}`, "", `To see all of the available CLI commands, run ${green("yarn webiny --help")} in your ${green(projectName)} directory.`, "", "Want to dive deeper into Webiny? Check out https://webiny.com/docs/!", "Like the project? Star us on https://github.com/webiny/webiny-js!", "", "Need help? Join our Slack community! https://www.webiny.com/slack", "", "🚀 Happy coding!"].join("\n"));
|
|
207
|
-
}
|
|
208
180
|
}
|
|
181
|
+
export { CreateWebinyProject };
|
|
209
182
|
|
|
210
183
|
//# sourceMappingURL=CreateWebinyProject.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["execa","fs","Listr","path","rimrafSync","chalk","yesno","configureMcp","SetupBaseWebinyProject","SetupAwsWebinyProject","Analytics","EnsureNoGlobalWebinyCli","EnsureNoTargetFolder","EnsureNoYarnLockPackageJson","EnsureValidProjectName","GetProjectRootPath","InitGit","IsGitAvailable","PrintErrorInfo","PrintSystemInfo","SetupYarn","SetWebinyPackageVersions","ora","green","bold","cyan","gray","yellow","CwpUi","info","text","args","console","log","success","error","red","warning","warn","emptyLine","CreateWebinyProject","execute","cliArgs","projectName","debug","cleanup","Error","getProjectRootPath","projectRootPath","ensureValidProjectName","ensureNoTargetFolder","ensureNoYarnLockPackageJson","ensureNoGlobalWebinyCli","isGitAvailable","analytics","track","awsProjectParams","region","storageOps","aiAgent","taskItems","title","task","ensureDirSync","setupYarn","push","_","initGit","skip","tasks","run","setupBaseWebinyProject","setupAwsWebinyProject","setWebinyPackageVersions","spinner","start","subprocess","cwd","maxBuffer","succeed","e","fail","message","cause","agent","ui","err","stage","errorMessage","errorStack","stack","printErrorInfo","printSystemInfo","resolve","writeFileSync","toString","process","exit","ok","question","defaultValue","command","stdio","instructions","join"],"sources":["CreateWebinyProject.ts"],"sourcesContent":["import execa from \"execa\";\nimport fs from \"fs-extra\";\nimport type { ListrTask } from \"listr2\";\nimport { Listr } from \"listr2\";\nimport path from \"path\";\nimport { rimrafSync } from \"rimraf\";\nimport chalk from \"chalk\";\nimport yesno from \"yesno\";\nimport { configureMcp } from \"@webiny/mcp\";\nimport type { IUi } from \"@webiny/mcp\";\nimport { SetupBaseWebinyProject } from \"./CreateWebinyProject/projects/base/SetupBaseWebinyProject.js\";\nimport { SetupAwsWebinyProject } from \"./CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js\";\nimport {\n Analytics,\n EnsureNoGlobalWebinyCli,\n EnsureNoTargetFolder,\n EnsureNoYarnLockPackageJson,\n EnsureValidProjectName,\n GetProjectRootPath,\n InitGit,\n IsGitAvailable,\n PrintErrorInfo,\n PrintSystemInfo,\n SetupYarn,\n SetWebinyPackageVersions\n} from \"../services/index.js\";\nimport { CliParams } from \"../types.js\";\nimport { AwsProjectParams } from \"./CreateWebinyProject/projects/aws/types.js\";\nimport ora from \"ora\";\n\nconst { green, bold, cyan, gray, yellow } = chalk;\n\n/* Styled UI for MCP setup output — aligns visually with the rest of CWP output. */\nclass CwpUi implements IUi {\n info(text: string, ...args: any[]): void {\n console.log(gray(text), ...args);\n }\n\n success(text: string, ...args: any[]): void {\n console.log(`${green(\"✔\")} ${text}`, ...args);\n }\n\n error(text: string, ...args: any[]): void {\n console.error(`${chalk.red(\"✘\")} ${text}`, ...args);\n }\n\n warning(text: string, ...args: any[]): void {\n console.warn(`${yellow(\"⚠\")} ${text}`, ...args);\n }\n\n text(text: string): void {\n console.log(text);\n }\n\n emptyLine(): void {\n console.log();\n }\n}\n\nexport class CreateWebinyProject {\n async execute(cliArgs: CliParams) {\n const { projectName, debug, cleanup, log } = cliArgs;\n\n if (!projectName) {\n throw Error(\"You must provide a name for the project to use.\");\n }\n\n const getProjectRootPath = new GetProjectRootPath();\n const projectRootPath = getProjectRootPath.execute(cliArgs);\n\n // All of these `ensureXyz` services will terminate the process if something is wrong.\n const ensureValidProjectName = new EnsureValidProjectName();\n ensureValidProjectName.execute(projectName);\n\n const ensureNoTargetFolder = new EnsureNoTargetFolder();\n ensureNoTargetFolder.execute(cliArgs);\n\n const ensureNoYarnLockPackageJson = new EnsureNoYarnLockPackageJson();\n await ensureNoYarnLockPackageJson.execute();\n\n const ensureNoGlobalWebinyCli = new EnsureNoGlobalWebinyCli();\n await ensureNoGlobalWebinyCli.execute();\n\n const isGitAvailable = new IsGitAvailable().execute();\n\n console.log(`Initializing a new Webiny project in ${green(projectRootPath)}...`);\n\n const analytics = new Analytics();\n await analytics.track(\"start\");\n\n let awsProjectParams: AwsProjectParams = {\n region: \"us-east-1\",\n storageOps: \"ddb\",\n aiAgent: \"other\"\n };\n\n try {\n const taskItems: ListrTask[] = [\n {\n // Creates root package.json.\n title: \"Prepare project folder\",\n task: () => fs.ensureDirSync(projectName)\n },\n {\n title: \"Setup Yarn\",\n task: async () => {\n const setupYarn = new SetupYarn();\n await setupYarn.execute(cliArgs);\n }\n }\n ];\n\n if (isGitAvailable) {\n taskItems.push({\n title: `Initialize git`,\n task: (_, task) => {\n const initGit = new InitGit();\n try {\n initGit.execute(cliArgs);\n } catch {\n task.skip(\"Git repo not initialized\");\n }\n }\n });\n }\n\n const tasks = new Listr(taskItems);\n await tasks.run();\n\n console.log();\n\n const setupBaseWebinyProject = new SetupBaseWebinyProject();\n setupBaseWebinyProject.execute(cliArgs);\n\n const setupAwsWebinyProject = new SetupAwsWebinyProject();\n awsProjectParams = await setupAwsWebinyProject.execute(cliArgs);\n\n const setWebinyPackageVersions = new SetWebinyPackageVersions();\n await setWebinyPackageVersions.execute(cliArgs);\n\n // Install dependencies.\n console.log();\n const spinner = ora(\"Installing packages...\").start();\n try {\n const subprocess = execa(\"yarn\", [], {\n cwd: projectRootPath,\n maxBuffer: 500_000_000\n });\n await subprocess;\n spinner.succeed(\"Packages installed successfully.\");\n } catch (e) {\n spinner.fail(\"Failed to install packages.\");\n\n console.log(e.message);\n\n throw new Error(\n \"Failed while installing project dependencies. Please check the above Yarn logs for more information.\",\n { cause: e }\n );\n }\n\n // Configure MCP server for the selected AI agent.\n if (awsProjectParams.aiAgent !== \"other\") {\n console.log();\n console.log(\n bold(`Configuring MCP server for ${cyan(awsProjectParams.aiAgent)}...`)\n );\n console.log();\n await configureMcp({\n agent: awsProjectParams.aiAgent,\n ui: new CwpUi(),\n cwd: projectRootPath\n });\n }\n\n await analytics.track(\"end\");\n } catch (err) {\n const stage = \"error\";\n // Commenting out for now, as we don't have any graceful errors implemented yet.\n // if (err instanceof GracefulError) {\n // stage = \"error-graceful\";\n // }\n\n await analytics.track(stage, {\n errorMessage: err.cause?.message || err.message,\n errorStack: err.cause?.stack || err.stack\n });\n\n const printErrorInfo = new PrintErrorInfo();\n printErrorInfo.execute(err, cliArgs);\n\n const printSystemInfo = new PrintSystemInfo();\n printSystemInfo.execute(cliArgs);\n\n console.log(`Writing logs to ${green(path.resolve(log))}...`);\n fs.writeFileSync(path.resolve(log), err.toString());\n\n console.log();\n if (cleanup) {\n console.log(\"Deleting created files and folders...\");\n rimrafSync(projectRootPath);\n } else {\n console.log(\"Project cleanup skipped.\");\n }\n\n process.exit(1);\n }\n\n console.log();\n console.log(\n `🎉 Your new Webiny project ${green(\n projectName\n )} has been created and is ready to be deployed for the first time!`\n );\n console.log();\n\n const ok = await yesno({\n question: bold(`${green(\"?\")} Would you like to deploy your project now (Y/n)?`),\n defaultValue: true\n });\n\n console.log();\n\n if (ok) {\n console.log(\"🚀 Deploying your new Webiny project...\");\n console.log();\n\n try {\n const command = [\"webiny\", \"deploy\"];\n if (debug) {\n command.push(\"--debug\");\n }\n\n await execa(\"yarn\", command, {\n cwd: projectRootPath,\n stdio: \"inherit\"\n });\n } catch {\n // Don't do anything. This is because the `webiny deploy` command has its own\n // error handling and will print the error message. As far as this setup script\n // is concerned, it succeeded, and it doesn't need to do anything else.\n }\n\n // For \"other\" agents, show manual MCP setup instructions after deploy has finished.\n if (awsProjectParams.aiAgent === \"other\") {\n await configureMcp({ instructions: true });\n }\n\n return;\n }\n\n // For \"other\" agents, show manual MCP setup instructions instead of blocking the deploy step.\n if (awsProjectParams.aiAgent === \"other\") {\n await configureMcp({ instructions: true });\n }\n\n console.log(\n [\n `Finish the setup by running the following command: ${green(\n `cd ${projectName} && yarn webiny deploy`\n )}`,\n \"\",\n `To see all of the available CLI commands, run ${green(\n \"yarn webiny --help\"\n )} in your ${green(projectName)} directory.`,\n \"\",\n \"Want to dive deeper into Webiny? Check out https://webiny.com/docs/!\",\n \"Like the project? Star us on https://github.com/webiny/webiny-js!\",\n \"\",\n \"Need help? Join our Slack community! https://www.webiny.com/slack\",\n \"\",\n \"🚀 Happy coding!\"\n ].join(\"\\n\")\n );\n }\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,EAAE,MAAM,UAAU;AAEzB,SAASC,KAAK,QAAQ,QAAQ;AAC9B,O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yC,CAAC;MACtDD,OAAO,CAACC,GAAG,CAAC,CAAC;MAEb,IAAI;QACA,MAAMoE,OAAO,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC;QACpC,IAAIzD,KAAK,EAAE;UACPyD,OAAO,CAACpC,IAAI,CAAC,SAAS,CAAC;QAC3B;QAEA,MAAMjE,KAAK,CAAC,MAAM,EAAEqG,OAAO,EAAE;UACzBxB,GAAG,EAAE7B,eAAe;UACpBsD,KAAK,EAAE;QACX,CAAC,CAAC;MACN,CAAC,CAAC,MAAM;QACJ;QACA;QACA;MAAA;;MAGJ;MACA,IAAI9C,gBAAgB,CAACG,OAAO,KAAK,OAAO,EAAE;QACtC,MAAMpD,YAAY,CAAC;UAAEgG,YAAY,EAAE;QAAK,CAAC,CAAC;MAC9C;MAEA;IACJ;;IAEA;IACA,IAAI/C,gBAAgB,CAACG,OAAO,KAAK,OAAO,EAAE;MACtC,MAAMpD,YAAY,CAAC;QAAEgG,YAAY,EAAE;MAAK,CAAC,CAAC;IAC9C;IAEAvE,OAAO,CAACC,GAAG,CACP,CACI,sDAAsDV,KAAK,CACvD,MAAMoB,WAAW,wBACrB,CAAC,EAAE,EACH,EAAE,EACF,iDAAiDpB,KAAK,CAClD,oBACJ,CAAC,YAAYA,KAAK,CAACoB,WAAW,CAAC,aAAa,EAC5C,EAAE,EACF,sEAAsE,EACtE,mEAAmE,EACnE,EAAE,EACF,mEAAmE,EACnE,EAAE,EACF,kBAAkB,CACrB,CAAC6D,IAAI,CAAC,IAAI,CACf,CAAC;EACL;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"features/CreateWebinyProject.js","sources":["../../src/features/CreateWebinyProject.ts"],"sourcesContent":["import execa from \"execa\";\nimport fs from \"fs-extra\";\nimport type { ListrTask } from \"listr2\";\nimport { Listr } from \"listr2\";\nimport path from \"path\";\nimport { rimrafSync } from \"rimraf\";\nimport chalk from \"chalk\";\nimport yesno from \"yesno\";\nimport { configureMcp } from \"@webiny/mcp\";\nimport type { IUi } from \"@webiny/mcp\";\nimport { SetupBaseWebinyProject } from \"./CreateWebinyProject/projects/base/SetupBaseWebinyProject.js\";\nimport { SetupAwsWebinyProject } from \"./CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js\";\nimport {\n Analytics,\n EnsureNoGlobalWebinyCli,\n EnsureNoTargetFolder,\n EnsureNoYarnLockPackageJson,\n EnsureValidProjectName,\n GetProjectRootPath,\n InitGit,\n IsGitAvailable,\n PrintErrorInfo,\n PrintSystemInfo,\n SetupYarn,\n SetWebinyPackageVersions\n} from \"../services/index.js\";\nimport { CliParams } from \"../types.js\";\nimport { AwsProjectParams } from \"./CreateWebinyProject/projects/aws/types.js\";\nimport ora from \"ora\";\n\nconst { green, bold, cyan, gray, yellow } = chalk;\n\n/* Styled UI for MCP setup output — aligns visually with the rest of CWP output. */\nclass CwpUi implements IUi {\n info(text: string, ...args: any[]): void {\n console.log(gray(text), ...args);\n }\n\n success(text: string, ...args: any[]): void {\n console.log(`${green(\"✔\")} ${text}`, ...args);\n }\n\n error(text: string, ...args: any[]): void {\n console.error(`${chalk.red(\"✘\")} ${text}`, ...args);\n }\n\n warning(text: string, ...args: any[]): void {\n console.warn(`${yellow(\"⚠\")} ${text}`, ...args);\n }\n\n text(text: string): void {\n console.log(text);\n }\n\n emptyLine(): void {\n console.log();\n }\n}\n\nexport class CreateWebinyProject {\n async execute(cliArgs: CliParams) {\n const { projectName, debug, cleanup, log } = cliArgs;\n\n if (!projectName) {\n throw Error(\"You must provide a name for the project to use.\");\n }\n\n const getProjectRootPath = new GetProjectRootPath();\n const projectRootPath = getProjectRootPath.execute(cliArgs);\n\n // All of these `ensureXyz` services will terminate the process if something is wrong.\n const ensureValidProjectName = new EnsureValidProjectName();\n ensureValidProjectName.execute(projectName);\n\n const ensureNoTargetFolder = new EnsureNoTargetFolder();\n ensureNoTargetFolder.execute(cliArgs);\n\n const ensureNoYarnLockPackageJson = new EnsureNoYarnLockPackageJson();\n await ensureNoYarnLockPackageJson.execute();\n\n const ensureNoGlobalWebinyCli = new EnsureNoGlobalWebinyCli();\n await ensureNoGlobalWebinyCli.execute();\n\n const isGitAvailable = new IsGitAvailable().execute();\n\n console.log(`Initializing a new Webiny project in ${green(projectRootPath)}...`);\n\n const analytics = new Analytics();\n await analytics.track(\"start\");\n\n let awsProjectParams: AwsProjectParams = {\n region: \"us-east-1\",\n storageOps: \"ddb\",\n aiAgent: \"other\"\n };\n\n try {\n const taskItems: ListrTask[] = [\n {\n // Creates root package.json.\n title: \"Prepare project folder\",\n task: () => fs.ensureDirSync(projectName)\n },\n {\n title: \"Setup Yarn\",\n task: async () => {\n const setupYarn = new SetupYarn();\n await setupYarn.execute(cliArgs);\n }\n }\n ];\n\n if (isGitAvailable) {\n taskItems.push({\n title: `Initialize git`,\n task: (_, task) => {\n const initGit = new InitGit();\n try {\n initGit.execute(cliArgs);\n } catch {\n task.skip(\"Git repo not initialized\");\n }\n }\n });\n }\n\n const tasks = new Listr(taskItems);\n await tasks.run();\n\n console.log();\n\n const setupBaseWebinyProject = new SetupBaseWebinyProject();\n setupBaseWebinyProject.execute(cliArgs);\n\n const setupAwsWebinyProject = new SetupAwsWebinyProject();\n awsProjectParams = await setupAwsWebinyProject.execute(cliArgs);\n\n const setWebinyPackageVersions = new SetWebinyPackageVersions();\n await setWebinyPackageVersions.execute(cliArgs);\n\n // Install dependencies.\n console.log();\n const spinner = ora(\"Installing packages...\").start();\n try {\n const subprocess = execa(\"yarn\", [], {\n cwd: projectRootPath,\n maxBuffer: 500_000_000\n });\n await subprocess;\n spinner.succeed(\"Packages installed successfully.\");\n } catch (e) {\n spinner.fail(\"Failed to install packages.\");\n\n console.log(e.message);\n\n throw new Error(\n \"Failed while installing project dependencies. Please check the above Yarn logs for more information.\",\n { cause: e }\n );\n }\n\n // Configure MCP server for the selected AI agent.\n if (awsProjectParams.aiAgent !== \"other\") {\n console.log();\n console.log(\n bold(`Configuring MCP server for ${cyan(awsProjectParams.aiAgent)}...`)\n );\n console.log();\n await configureMcp({\n agent: awsProjectParams.aiAgent,\n ui: new CwpUi(),\n cwd: projectRootPath\n });\n }\n\n await analytics.track(\"end\");\n } catch (err) {\n const stage = \"error\";\n // Commenting out for now, as we don't have any graceful errors implemented yet.\n // if (err instanceof GracefulError) {\n // stage = \"error-graceful\";\n // }\n\n await analytics.track(stage, {\n errorMessage: err.cause?.message || err.message,\n errorStack: err.cause?.stack || err.stack\n });\n\n const printErrorInfo = new PrintErrorInfo();\n printErrorInfo.execute(err, cliArgs);\n\n const printSystemInfo = new PrintSystemInfo();\n printSystemInfo.execute(cliArgs);\n\n console.log(`Writing logs to ${green(path.resolve(log))}...`);\n fs.writeFileSync(path.resolve(log), err.toString());\n\n console.log();\n if (cleanup) {\n console.log(\"Deleting created files and folders...\");\n rimrafSync(projectRootPath);\n } else {\n console.log(\"Project cleanup skipped.\");\n }\n\n process.exit(1);\n }\n\n console.log();\n console.log(\n `🎉 Your new Webiny project ${green(\n projectName\n )} has been created and is ready to be deployed for the first time!`\n );\n console.log();\n\n const ok = await yesno({\n question: bold(`${green(\"?\")} Would you like to deploy your project now (Y/n)?`),\n defaultValue: true\n });\n\n console.log();\n\n if (ok) {\n console.log(\"🚀 Deploying your new Webiny project...\");\n console.log();\n\n try {\n const command = [\"webiny\", \"deploy\"];\n if (debug) {\n command.push(\"--debug\");\n }\n\n await execa(\"yarn\", command, {\n cwd: projectRootPath,\n stdio: \"inherit\"\n });\n } catch {\n // Don't do anything. This is because the `webiny deploy` command has its own\n // error handling and will print the error message. As far as this setup script\n // is concerned, it succeeded, and it doesn't need to do anything else.\n }\n\n // For \"other\" agents, show manual MCP setup instructions after deploy has finished.\n if (awsProjectParams.aiAgent === \"other\") {\n await configureMcp({ instructions: true });\n }\n\n return;\n }\n\n // For \"other\" agents, show manual MCP setup instructions instead of blocking the deploy step.\n if (awsProjectParams.aiAgent === \"other\") {\n await configureMcp({ instructions: true });\n }\n\n console.log(\n [\n `Finish the setup by running the following command: ${green(\n `cd ${projectName} && yarn webiny deploy`\n )}`,\n \"\",\n `To see all of the available CLI commands, run ${green(\n \"yarn webiny --help\"\n )} in your ${green(projectName)} directory.`,\n \"\",\n \"Want to dive deeper into Webiny? Check out https://webiny.com/docs/!\",\n \"Like the project? Star us on https://github.com/webiny/webiny-js!\",\n \"\",\n \"Need help? Join our Slack community! https://www.webiny.com/slack\",\n \"\",\n \"🚀 Happy coding!\"\n ].join(\"\\n\")\n );\n }\n}\n"],"names":["green","bold","cyan","gray","yellow","chalk","CwpUi","text","args","console","CreateWebinyProject","cliArgs","projectName","debug","cleanup","log","Error","getProjectRootPath","GetProjectRootPath","projectRootPath","ensureValidProjectName","EnsureValidProjectName","ensureNoTargetFolder","EnsureNoTargetFolder","ensureNoYarnLockPackageJson","EnsureNoYarnLockPackageJson","ensureNoGlobalWebinyCli","EnsureNoGlobalWebinyCli","isGitAvailable","IsGitAvailable","analytics","Analytics","awsProjectParams","taskItems","fs","setupYarn","SetupYarn","_","task","initGit","InitGit","tasks","Listr","setupBaseWebinyProject","SetupBaseWebinyProject","setupAwsWebinyProject","SetupAwsWebinyProject","setWebinyPackageVersions","SetWebinyPackageVersions","spinner","ora","subprocess","execa","e","configureMcp","err","stage","printErrorInfo","PrintErrorInfo","printSystemInfo","PrintSystemInfo","path","rimrafSync","process","ok","yesno","command"],"mappings":";;;;;;;;;;;;AA8BA,MAAM,EAAEA,OAAAA,KAAK,EAAEC,MAAAA,IAAI,EAAEC,MAAAA,IAAI,EAAEC,MAAAA,IAAI,EAAEC,QAAAA,MAAM,EAAE,GAAGC;AAG5C,MAAMC;IACF,KAAKC,IAAY,EAAE,GAAGC,IAAW,EAAQ;QACrCC,QAAQ,GAAG,CAACN,KAAKI,UAAUC;IAC/B;IAEA,QAAQD,IAAY,EAAE,GAAGC,IAAW,EAAQ;QACxCC,QAAQ,GAAG,CAAC,GAAGT,MAAM,KAAK,CAAC,EAAEO,MAAM,KAAKC;IAC5C;IAEA,MAAMD,IAAY,EAAE,GAAGC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,OAAO,EACxB,MAAMsB,aAAa;YAAE,cAAc;QAAK;QAG5C7C,QAAQ,GAAG,CACP;YACI,CAAC,mDAAmD,EAAET,MAClD,CAAC,GAAG,EAAEY,YAAY,sBAAsB,CAAC,GAC1C;YACH;YACA,CAAC,8CAA8C,EAAEZ,MAC7C,sBACF,SAAS,EAAEA,MAAMY,aAAa,WAAW,CAAC;YAC5C;YACA;YACA;YACA;YACA;YACA;YACA;SACH,CAAC,IAAI,CAAC;IAEf;AACJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-webiny-project",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0-beta.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Webiny project bootstrap tool.",
|
|
6
6
|
"exports": {
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
"author": "Webiny Ltd.",
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@webiny/build-tools": "6.
|
|
17
|
-
"@webiny/mcp": "6.
|
|
18
|
-
"@webiny/system-requirements": "6.
|
|
19
|
-
"@webiny/telemetry": "6.
|
|
16
|
+
"@webiny/build-tools": "6.4.0-beta.0",
|
|
17
|
+
"@webiny/mcp": "6.4.0-beta.0",
|
|
18
|
+
"@webiny/system-requirements": "6.4.0-beta.0",
|
|
19
|
+
"@webiny/telemetry": "6.4.0-beta.0",
|
|
20
20
|
"chalk": "5.6.2",
|
|
21
21
|
"execa": "5.1.1",
|
|
22
22
|
"find-up": "8.0.0",
|
|
23
|
-
"fs-extra": "11.3.
|
|
24
|
-
"inquirer": "13.4.
|
|
23
|
+
"fs-extra": "11.3.5",
|
|
24
|
+
"inquirer": "13.4.3",
|
|
25
25
|
"js-yaml": "4.1.1",
|
|
26
26
|
"listr2": "10.2.1",
|
|
27
27
|
"load-json-file": "7.0.1",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"rimraf": "6.1.3",
|
|
31
31
|
"type-fest": "5.6.0",
|
|
32
32
|
"uuid": "14.0.0",
|
|
33
|
-
"validate-npm-package-name": "
|
|
33
|
+
"validate-npm-package-name": "8.0.0",
|
|
34
34
|
"write-json-file": "7.0.0",
|
|
35
35
|
"yargs": "18.0.0",
|
|
36
36
|
"yesno": "0.4.0"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"access": "public",
|
|
44
44
|
"directory": "dist"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "a545d7529828af07d08d49c3da1bcb967483b9ce",
|
|
47
47
|
"adio": {
|
|
48
48
|
"ignoreDirs": [
|
|
49
49
|
"_templates"
|
package/services/Analytics.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { sendEvent } from "@webiny/telemetry/cli.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
class Analytics {
|
|
3
|
+
track(stage, properties = {}) {
|
|
4
|
+
const event = this.getEventName(stage);
|
|
5
|
+
return sendEvent({
|
|
6
|
+
event,
|
|
7
|
+
properties
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
getEventName(stage) {
|
|
11
|
+
return `cli-create-webiny-project-${stage}`;
|
|
12
|
+
}
|
|
13
13
|
}
|
|
14
|
+
export { Analytics };
|
|
14
15
|
|
|
15
16
|
//# sourceMappingURL=Analytics.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"services/Analytics.js","sources":["../../src/services/Analytics.ts"],"sourcesContent":["import { sendEvent } from \"@webiny/telemetry/cli.js\";\n\nexport class Analytics {\n track(stage: string, properties: Record<string, any> = {}) {\n const event = this.getEventName(stage);\n return sendEvent({ event, properties });\n }\n\n getEventName(stage: string) {\n return `cli-create-webiny-project-${stage}`;\n }\n}\n"],"names":["Analytics","stage","properties","event","sendEvent"],"mappings":";AAEO,MAAMA;IACT,MAAMC,KAAa,EAAEC,aAAkC,CAAC,CAAC,EAAE;QACvD,MAAMC,QAAQ,IAAI,CAAC,YAAY,CAACF;QAChC,OAAOG,UAAU;YAAED;YAAOD;QAAW;IACzC;IAEA,aAAaD,KAAa,EAAE;QACxB,OAAO,CAAC,0BAA0B,EAAEA,OAAO;IAC/C;AACJ"}
|