create-webiny-project 6.1.0-beta.3 → 6.2.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 +5 -5
- package/features/CreateWebinyProject/projects/aws/SetupAwsWebinyProject.d.ts +2 -1
- package/features/CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js +3 -1
- package/features/CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js.map +1 -1
- package/features/CreateWebinyProject/projects/aws/runInteractivePrompt.d.ts +1 -0
- package/features/CreateWebinyProject/projects/aws/runInteractivePrompt.js +15 -0
- package/features/CreateWebinyProject/projects/aws/runInteractivePrompt.js.map +1 -1
- package/features/CreateWebinyProject/projects/aws/types.d.ts +2 -0
- package/features/CreateWebinyProject/projects/aws/types.js.map +1 -1
- package/features/CreateWebinyProject.js +64 -7
- package/features/CreateWebinyProject.js.map +1 -1
- package/package.json +8 -7
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
"@webiny/cli": "latest",
|
|
5
5
|
"@webiny/cognito": "latest",
|
|
6
6
|
"@webiny/mcp": "latest",
|
|
7
|
-
"react": "18.
|
|
8
|
-
"react-dom": "18.
|
|
7
|
+
"react": "18.3.1",
|
|
8
|
+
"react-dom": "18.3.1",
|
|
9
9
|
"webiny": "latest"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@types/node": "^24.12.
|
|
13
|
-
"@types/react": "18.
|
|
14
|
-
"@types/react-dom": "18.
|
|
12
|
+
"@types/node": "^24.12.2",
|
|
13
|
+
"@types/react": "18.3.28",
|
|
14
|
+
"@types/react-dom": "18.3.7",
|
|
15
15
|
"typescript": "5.9.3"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CliParams } from "../../../../types.js";
|
|
2
|
+
import { AwsProjectParams } from "./types.js";
|
|
2
3
|
export declare class SetupAwsWebinyProject {
|
|
3
|
-
execute(cliArgs: CliParams): Promise<
|
|
4
|
+
execute(cliArgs: CliParams): Promise<AwsProjectParams>;
|
|
4
5
|
private getAwsArgs;
|
|
5
6
|
}
|
|
@@ -18,11 +18,13 @@ export class SetupAwsWebinyProject {
|
|
|
18
18
|
let content = fs.readFileSync(webinyConfigTsxEnvFilePath).toString();
|
|
19
19
|
content = content.replace("{REGION}", awsArgs.region);
|
|
20
20
|
fs.writeFileSync(webinyConfigTsxEnvFilePath, content);
|
|
21
|
+
return awsArgs;
|
|
21
22
|
}
|
|
22
23
|
async getAwsArgs(cliArgs) {
|
|
23
24
|
const awsArgs = {
|
|
24
25
|
region: "us-east-1",
|
|
25
|
-
storageOps: "ddb"
|
|
26
|
+
storageOps: "ddb",
|
|
27
|
+
aiAgent: "other"
|
|
26
28
|
};
|
|
27
29
|
const {
|
|
28
30
|
templateOptions: templateOptionsString
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["fs","path","runInteractivePrompt","GetProjectRootPath","GetTemplatesFolderPath","SetupAwsWebinyProject","execute","cliArgs","awsArgs","getAwsArgs","getTemplatesFolderPath","templatesFolderPath","storageTemplatePath","join","storageOps","getProjectRoot","projectRootFolderPath","copySync","webinyConfigTsxEnvFilePath","content","readFileSync","toString","replace","region","writeFileSync","templateOptions","templateOptionsString","Object","assign","JSON","parse","interactive"],"sources":["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) {\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\n private async getAwsArgs(cliArgs: CliParams) {\n const awsArgs: AwsProjectParams = {
|
|
1
|
+
{"version":3,"names":["fs","path","runInteractivePrompt","GetProjectRootPath","GetTemplatesFolderPath","SetupAwsWebinyProject","execute","cliArgs","awsArgs","getAwsArgs","getTemplatesFolderPath","templatesFolderPath","storageTemplatePath","join","storageOps","getProjectRoot","projectRootFolderPath","copySync","webinyConfigTsxEnvFilePath","content","readFileSync","toString","replace","region","writeFileSync","aiAgent","templateOptions","templateOptionsString","Object","assign","JSON","parse","interactive"],"sources":["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"],"mappings":"AAAA,OAAOA,EAAE,MAAM,UAAU;AACzB,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,oBAAoB;AAE7B,SAASC,kBAAkB;AAE3B,SAASC,sBAAsB;AAE/B,OAAO,MAAMC,qBAAqB,CAAC;EAC/B,MAAMC,OAAOA,CAACC,OAAkB,EAA6B;IACzD,MAAMC,OAAO,GAAG,MAAM,IAAI,CAACC,UAAU,CAACF,OAAO,CAAC;IAE9C,MAAMG,sBAAsB,GAAG,IAAIN,sBAAsB,CAAC,CAAC;IAC3D,MAAMO,mBAAmB,GAAGD,sBAAsB,CAACJ,OAAO,CAAC,CAAC;IAE5D,MAAMM,mBAAmB,GAAGX,IAAI,CAACY,IAAI,CAACF,mBAAmB,EAAE,KAAK,EAAEH,OAAO,CAACM,UAAU,CAAC;IAErF,MAAMC,cAAc,GAAG,IAAIZ,kBAAkB,CAAC,CAAC;IAC/C,MAAMa,qBAAqB,GAAGD,cAAc,CAACT,OAAO,CAACC,OAAO,CAAC;IAE7DP,EAAE,CAACiB,QAAQ,CAACL,mBAAmB,EAAEI,qBAAqB,CAAC;;IAEvD;IACA,MAAME,0BAA0B,GAAGjB,IAAI,CAACY,IAAI,CAACG,qBAAqB,EAAE,mBAAmB,CAAC;IACxF,IAAIG,OAAO,GAAGnB,EAAE,CAACoB,YAAY,CAACF,0BAA0B,CAAC,CAACG,QAAQ,CAAC,CAAC;IACpEF,OAAO,GAAGA,OAAO,CAACG,OAAO,CAAC,UAAU,EAAEd,OAAO,CAACe,MAAM,CAAC;IACrDvB,EAAE,CAACwB,aAAa,CAACN,0BAA0B,EAAEC,OAAO,CAAC;IAErD,OAAOX,OAAO;EAClB;EAEA,MAAcC,UAAUA,CAACF,OAAkB,EAAE;IACzC,MAAMC,OAAyB,GAAG;MAC9Be,MAAM,EAAE,WAAW;MACnBT,UAAU,EAAE,KAAK;MACjBW,OAAO,EAAE;IACb,CAAC;IAED,MAAM;MAAEC,eAAe,EAAEC;IAAsB,CAAC,GAAGpB,OAAO;IAC1D,IAAIoB,qBAAqB,EAAE;MACvB,IAAI;QACAC,MAAM,CAACC,MAAM,CAACrB,OAAO,EAAEsB,IAAI,CAACC,KAAK,CAACJ,qBAAqB,CAAC,CAAC;MAC7D,CAAC,CAAC,MAAM;QACJ;MAAA;IAER;IAEA,IAAIpB,OAAO,CAACyB,WAAW,KAAK,KAAK,EAAE;MAC/BJ,MAAM,CAACC,MAAM,CAACrB,OAAO,EAAE,MAAMN,oBAAoB,CAAC,CAAC,CAAC;IACxD;IAEA,OAAOM,OAAO;EAClB;AACJ","ignoreList":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import inquirer from "inquirer";
|
|
2
|
+
import { discoverAgents } from "@webiny/mcp";
|
|
2
3
|
import { availableAwsRegions } from "./availableAwsRegions.js";
|
|
3
4
|
const STORAGE_OPTIONS = {
|
|
4
5
|
ddb: {
|
|
@@ -13,6 +14,14 @@ const STORAGE_OPTIONS = {
|
|
|
13
14
|
export const runInteractivePrompt = async () => {
|
|
14
15
|
console.log("In order to create your new Webiny project, please answer the following questions.");
|
|
15
16
|
console.log();
|
|
17
|
+
const agents = await discoverAgents();
|
|
18
|
+
const agentChoices = [...Array.from(agents.values()).map(a => ({
|
|
19
|
+
value: a.preset.slug,
|
|
20
|
+
name: a.preset.displayName
|
|
21
|
+
})), {
|
|
22
|
+
value: "other",
|
|
23
|
+
name: "Other / not listed"
|
|
24
|
+
}];
|
|
16
25
|
return inquirer.prompt([{
|
|
17
26
|
type: "select",
|
|
18
27
|
name: "region",
|
|
@@ -26,6 +35,12 @@ export const runInteractivePrompt = async () => {
|
|
|
26
35
|
default: "ddb",
|
|
27
36
|
message: `Please choose the database setup you wish to use with your project:`,
|
|
28
37
|
choices: Object.values(STORAGE_OPTIONS)
|
|
38
|
+
}, {
|
|
39
|
+
type: "select",
|
|
40
|
+
name: "aiAgent",
|
|
41
|
+
default: "claude",
|
|
42
|
+
message: "Please choose the AI agent you will use with your project:",
|
|
43
|
+
choices: agentChoices
|
|
29
44
|
}]);
|
|
30
45
|
};
|
|
31
46
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["inquirer","availableAwsRegions","STORAGE_OPTIONS","ddb","value","name","runInteractivePrompt","console","log","prompt","type","default","message","choices","Object"
|
|
1
|
+
{"version":3,"names":["inquirer","discoverAgents","availableAwsRegions","STORAGE_OPTIONS","ddb","value","name","runInteractivePrompt","console","log","agents","agentChoices","Array","from","values","map","a","preset","slug","displayName","prompt","type","default","message","choices","Object"],"sources":["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"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,UAAU;AAC/B,SAASC,cAAc,QAAQ,aAAa;AAE5C,SAASC,mBAAmB;AAE5B,MAAMC,eAAwE,GAAG;EAC7EC,GAAG,EAAE;IACDC,KAAK,EAAE,KAAK;IACZC,IAAI,EAAE;EACV,CAAC;EACD,QAAQ,EAAE;IACND,KAAK,EAAE,QAAQ;IACfC,IAAI,EAAE;EACV;AACJ,CAAC;AAED,OAAO,MAAMC,oBAAoB,GAAG,MAAAA,CAAA,KAAY;EAC5CC,OAAO,CAACC,GAAG,CACP,oFACJ,CAAC;EACDD,OAAO,CAACC,GAAG,CAAC,CAAC;EAEb,MAAMC,MAAM,GAAG,MAAMT,cAAc,CAAC,CAAC;EACrC,MAAMU,YAAY,GAAG,CACjB,GAAGC,KAAK,CAACC,IAAI,CAACH,MAAM,CAACI,MAAM,CAAC,CAAC,CAAC,CAACC,GAAG,CAACC,CAAC,KAAK;IACrCX,KAAK,EAAEW,CAAC,CAACC,MAAM,CAACC,IAAI;IACpBZ,IAAI,EAAEU,CAAC,CAACC,MAAM,CAACE;EACnB,CAAC,CAAC,CAAC,EACH;IAAEd,KAAK,EAAE,OAAO;IAAEC,IAAI,EAAE;EAAqB,CAAC,CACjD;EAED,OAAON,QAAQ,CAACoB,MAAM,CAAC,CACnB;IACIC,IAAI,EAAE,QAAQ;IACdf,IAAI,EAAE,QAAQ;IACdgB,OAAO,EAAE,WAAW;IACpBC,OAAO,EAAE,sEAAsE;IAC/E;IACAC,OAAO,EAAEtB;EACb,CAAC,EACD;IACImB,IAAI,EAAE,QAAQ;IACdf,IAAI,EAAE,YAAY;IAClBgB,OAAO,EAAE,KAAK;IACdC,OAAO,EAAE,qEAAqE;IAC9EC,OAAO,EAAEC,MAAM,CAACX,MAAM,CAACX,eAAe;EAC1C,CAAC,EACD;IACIkB,IAAI,EAAE,QAAQ;IACdf,IAAI,EAAE,SAAS;IACfgB,OAAO,EAAE,QAAQ;IACjBC,OAAO,EAAE,4DAA4D;IACrEC,OAAO,EAAEb;EACb,CAAC,CACJ,CAAC;AACN,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export type StorageOps = \"ddb\" | \"ddb-os\";\n\nexport interface AwsProjectParams {\n region: string;\n storageOps: StorageOps;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export type StorageOps = \"ddb\" | \"ddb-os\";\nexport type AiAgent = string | \"other\";\n\nexport interface AwsProjectParams {\n region: string;\n storageOps: StorageOps;\n aiAgent: AiAgent;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,18 +1,44 @@
|
|
|
1
1
|
import execa from "execa";
|
|
2
2
|
import fs from "fs-extra";
|
|
3
|
-
import Listr from "
|
|
3
|
+
import { Listr } from "listr2";
|
|
4
4
|
import path from "path";
|
|
5
5
|
import { rimrafSync } from "rimraf";
|
|
6
6
|
import chalk from "chalk";
|
|
7
7
|
import yesno from "yesno";
|
|
8
|
+
import { configureMcp } from "@webiny/mcp";
|
|
8
9
|
import { SetupBaseWebinyProject } from "./CreateWebinyProject/projects/base/SetupBaseWebinyProject.js";
|
|
9
10
|
import { SetupAwsWebinyProject } from "./CreateWebinyProject/projects/aws/SetupAwsWebinyProject.js";
|
|
10
11
|
import { Analytics, EnsureNoGlobalWebinyCli, EnsureNoTargetFolder, EnsureNoYarnLockPackageJson, EnsureValidProjectName, GetProjectRootPath, InitGit, IsGitAvailable, PrintErrorInfo, PrintSystemInfo, SetupYarn, SetWebinyPackageVersions } from "../services/index.js";
|
|
11
12
|
import ora from "ora";
|
|
12
13
|
const {
|
|
13
14
|
green,
|
|
14
|
-
bold
|
|
15
|
+
bold,
|
|
16
|
+
cyan,
|
|
17
|
+
gray,
|
|
18
|
+
yellow
|
|
15
19
|
} = chalk;
|
|
20
|
+
|
|
21
|
+
/* Styled UI for MCP setup output — aligns visually with the rest of CWP output. */
|
|
22
|
+
class CwpUi {
|
|
23
|
+
info(text, ...args) {
|
|
24
|
+
console.log(gray(text), ...args);
|
|
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
|
+
}
|
|
16
42
|
export class CreateWebinyProject {
|
|
17
43
|
async execute(cliArgs) {
|
|
18
44
|
const {
|
|
@@ -40,9 +66,13 @@ export class CreateWebinyProject {
|
|
|
40
66
|
console.log(`Initializing a new Webiny project in ${green(projectRootPath)}...`);
|
|
41
67
|
const analytics = new Analytics();
|
|
42
68
|
await analytics.track("start");
|
|
69
|
+
let awsProjectParams = {
|
|
70
|
+
region: "us-east-1",
|
|
71
|
+
storageOps: "ddb",
|
|
72
|
+
aiAgent: "other"
|
|
73
|
+
};
|
|
43
74
|
try {
|
|
44
|
-
const
|
|
45
|
-
tasks.add([{
|
|
75
|
+
const taskItems = [{
|
|
46
76
|
// Creates root package.json.
|
|
47
77
|
title: "Prepare project folder",
|
|
48
78
|
task: () => fs.ensureDirSync(projectName)
|
|
@@ -52,9 +82,9 @@ export class CreateWebinyProject {
|
|
|
52
82
|
const setupYarn = new SetupYarn();
|
|
53
83
|
await setupYarn.execute(cliArgs);
|
|
54
84
|
}
|
|
55
|
-
}]
|
|
85
|
+
}];
|
|
56
86
|
if (isGitAvailable) {
|
|
57
|
-
|
|
87
|
+
taskItems.push({
|
|
58
88
|
title: `Initialize git`,
|
|
59
89
|
task: (_, task) => {
|
|
60
90
|
const initGit = new InitGit();
|
|
@@ -66,12 +96,13 @@ export class CreateWebinyProject {
|
|
|
66
96
|
}
|
|
67
97
|
});
|
|
68
98
|
}
|
|
99
|
+
const tasks = new Listr(taskItems);
|
|
69
100
|
await tasks.run();
|
|
70
101
|
console.log();
|
|
71
102
|
const setupBaseWebinyProject = new SetupBaseWebinyProject();
|
|
72
103
|
setupBaseWebinyProject.execute(cliArgs);
|
|
73
104
|
const setupAwsWebinyProject = new SetupAwsWebinyProject();
|
|
74
|
-
await setupAwsWebinyProject.execute(cliArgs);
|
|
105
|
+
awsProjectParams = await setupAwsWebinyProject.execute(cliArgs);
|
|
75
106
|
const setWebinyPackageVersions = new SetWebinyPackageVersions();
|
|
76
107
|
await setWebinyPackageVersions.execute(cliArgs);
|
|
77
108
|
|
|
@@ -92,6 +123,18 @@ export class CreateWebinyProject {
|
|
|
92
123
|
cause: e
|
|
93
124
|
});
|
|
94
125
|
}
|
|
126
|
+
|
|
127
|
+
// Configure MCP server for the selected AI agent.
|
|
128
|
+
if (awsProjectParams.aiAgent !== "other") {
|
|
129
|
+
console.log();
|
|
130
|
+
console.log(bold(`Configuring MCP server for ${cyan(awsProjectParams.aiAgent)}...`));
|
|
131
|
+
console.log();
|
|
132
|
+
await configureMcp({
|
|
133
|
+
agent: awsProjectParams.aiAgent,
|
|
134
|
+
ui: new CwpUi(),
|
|
135
|
+
cwd: projectRootPath
|
|
136
|
+
});
|
|
137
|
+
}
|
|
95
138
|
await analytics.track("end");
|
|
96
139
|
} catch (err) {
|
|
97
140
|
const stage = "error";
|
|
@@ -144,8 +187,22 @@ export class CreateWebinyProject {
|
|
|
144
187
|
// error handling and will print the error message. As far as this setup script
|
|
145
188
|
// is concerned, it succeeded, and it doesn't need to do anything else.
|
|
146
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
|
|
195
|
+
});
|
|
196
|
+
}
|
|
147
197
|
return;
|
|
148
198
|
}
|
|
199
|
+
|
|
200
|
+
// For "other" agents, show manual MCP setup instructions instead of blocking the deploy step.
|
|
201
|
+
if (awsProjectParams.aiAgent === "other") {
|
|
202
|
+
await configureMcp({
|
|
203
|
+
instructions: true
|
|
204
|
+
});
|
|
205
|
+
}
|
|
149
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"));
|
|
150
207
|
}
|
|
151
208
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["execa","fs","Listr","path","rimrafSync","chalk","yesno","SetupBaseWebinyProject","SetupAwsWebinyProject","Analytics","EnsureNoGlobalWebinyCli","EnsureNoTargetFolder","EnsureNoYarnLockPackageJson","EnsureValidProjectName","GetProjectRootPath","InitGit","IsGitAvailable","PrintErrorInfo","PrintSystemInfo","SetupYarn","SetWebinyPackageVersions","ora","green","bold","CreateWebinyProject","execute","cliArgs","projectName","debug","cleanup","log","Error","getProjectRootPath","projectRootPath","ensureValidProjectName","ensureNoTargetFolder","ensureNoYarnLockPackageJson","ensureNoGlobalWebinyCli","isGitAvailable","console","analytics","track","tasks","add","title","task","ensureDirSync","setupYarn","_","initGit","skip","run","setupBaseWebinyProject","setupAwsWebinyProject","setWebinyPackageVersions","spinner","start","subprocess","cwd","maxBuffer","succeed","e","fail","message","cause","err","stage","errorMessage","errorStack","stack","printErrorInfo","printSystemInfo","resolve","writeFileSync","toString","process","exit","ok","question","defaultValue","command","push","stdio","join"],"sources":["CreateWebinyProject.ts"],"sourcesContent":["import execa from \"execa\";\nimport fs from \"fs-extra\";\nimport Listr from \"listr\";\nimport path from \"path\";\nimport { rimrafSync } from \"rimraf\";\nimport chalk from \"chalk\";\nimport yesno from \"yesno\";\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 ora from \"ora\";\n\nconst { green, bold } = chalk;\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 try {\n const tasks = new Listr();\n tasks.add([\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 tasks.add({\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 await tasks.run();\n\n console.log();\n\n const setupBaseWebinyProject = new SetupBaseWebinyProject();\n setupBaseWebinyProject.execute(cliArgs);\n\n const setupAwsWebinyProject = new SetupAwsWebinyProject();\n 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 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 return;\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;AACzB,OAAOC,KAAK,MAAM,OAAO;AACzB,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,CAAC,MAAM,EAAEgF,OAAO,EAAE;UACzBtB,GAAG,EAAEzB,eAAe;UACpBiD,KAAK,EAAE;QACX,CAAC,CAAC;MACN,CAAC,CAAC,MAAM;QACJ;QACA;QACA;MAAA;MAGJ;IACJ;IAEA3C,OAAO,CAACT,GAAG,CACP,CACI,sDAAsDR,KAAK,CACvD,MAAMK,WAAW,wBACrB,CAAC,EAAE,EACH,EAAE,EACF,iDAAiDL,KAAK,CAClD,oBACJ,CAAC,YAAYA,KAAK,CAACK,WAAW,CAAC,aAAa,EAC5C,EAAE,EACF,sEAAsE,EACtE,mEAAmE,EACnE,EAAE,EACF,mEAAmE,EACnE,EAAE,EACF,kBAAkB,CACrB,CAACwD,IAAI,CAAC,IAAI,CACf,CAAC;EACL;AACJ","ignoreList":[]}
|
|
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,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,UAAU,QAAQ,QAAQ;AACnC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,QAAQ,aAAa;AAE1C,SAASC,sBAAsB;AAC/B,SAASC,qBAAqB;AAC9B,SACIC,SAAS,EACTC,uBAAuB,EACvBC,oBAAoB,EACpBC,2BAA2B,EAC3BC,sBAAsB,EACtBC,kBAAkB,EAClBC,OAAO,EACPC,cAAc,EACdC,cAAc,EACdC,eAAe,EACfC,SAAS,EACTC,wBAAwB;AAI5B,OAAOC,GAAG,MAAM,KAAK;AAErB,MAAM;EAAEC,KAAK;EAAEC,IAAI;EAAEC,IAAI;EAAEC,IAAI;EAAEC;AAAO,CAAC,GAAGtB,KAAK;;AAEjD;AACA,MAAMuB,KAAK,CAAgB;EACvBC,IAAIA,CAACC,IAAY,EAAE,GAAGC,IAAW,EAAQ;IACrCC,OAAO,CAACC,GAAG,CAACP,IAAI,CAACI,IAAI,CAAC,EAAE,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,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":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-webiny-project",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0-beta.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Webiny project bootstrap tool.",
|
|
6
6
|
"main": "index.js",
|
|
@@ -11,16 +11,17 @@
|
|
|
11
11
|
"author": "Webiny Ltd.",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@webiny/build-tools": "6.
|
|
15
|
-
"@webiny/
|
|
16
|
-
"@webiny/
|
|
14
|
+
"@webiny/build-tools": "6.2.0-beta.0",
|
|
15
|
+
"@webiny/mcp": "6.2.0-beta.0",
|
|
16
|
+
"@webiny/system-requirements": "6.2.0-beta.0",
|
|
17
|
+
"@webiny/telemetry": "6.2.0-beta.0",
|
|
17
18
|
"chalk": "5.6.2",
|
|
18
19
|
"execa": "5.1.1",
|
|
19
20
|
"find-up": "8.0.0",
|
|
20
21
|
"fs-extra": "11.3.4",
|
|
21
|
-
"inquirer": "13.
|
|
22
|
+
"inquirer": "13.4.1",
|
|
22
23
|
"js-yaml": "4.1.1",
|
|
23
|
-
"
|
|
24
|
+
"listr2": "10.2.1",
|
|
24
25
|
"load-json-file": "7.0.1",
|
|
25
26
|
"ora": "9.3.0",
|
|
26
27
|
"os": "0.1.2",
|
|
@@ -40,7 +41,7 @@
|
|
|
40
41
|
"access": "public",
|
|
41
42
|
"directory": "dist"
|
|
42
43
|
},
|
|
43
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "3d3148358b6febbc857371930871743bec3b3939",
|
|
44
45
|
"adio": {
|
|
45
46
|
"ignoreDirs": [
|
|
46
47
|
"_templates"
|