create-mcp-use-app 0.7.4 → 0.7.5-canary.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/dist/index.js +26 -22
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -264,13 +264,24 @@ function listTemplates() {
|
|
|
264
264
|
} catch (error) {
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
|
-
console.log(
|
|
267
|
+
console.log(
|
|
268
|
+
chalk.cyan(` ${template.padEnd(15)}`),
|
|
269
|
+
chalk.gray(description)
|
|
270
|
+
);
|
|
268
271
|
}
|
|
269
272
|
console.log("");
|
|
270
|
-
console.log(
|
|
273
|
+
console.log(
|
|
274
|
+
chalk.gray(
|
|
275
|
+
"\u{1F4A1} Use with: npx create-mcp-use-app my-project --template <template>"
|
|
276
|
+
)
|
|
277
|
+
);
|
|
271
278
|
console.log("");
|
|
272
279
|
}
|
|
273
|
-
program.name("create-mcp-use-app").description("Create a new MCP server project").version(packageJson.version).argument("[project-name]", "Name of the MCP server project").option(
|
|
280
|
+
program.name("create-mcp-use-app").description("Create a new MCP server project").version(packageJson.version).argument("[project-name]", "Name of the MCP server project").option(
|
|
281
|
+
"-t, --template <template>",
|
|
282
|
+
"Template to use (starter, mcp-ui, apps-sdk)",
|
|
283
|
+
"starter"
|
|
284
|
+
).option("--list-templates", "List all available templates").option("--install", "Install dependencies after creating project").option("--no-git", "Skip initializing a git repository").option("--dev", "Use workspace dependencies for development").option("--canary", "Use canary versions of packages").option("--yarn", "Use yarn as package manager").option("--npm", "Use npm as package manager").option("--pnpm", "Use pnpm as package manager").action(
|
|
274
285
|
async (projectName, options) => {
|
|
275
286
|
try {
|
|
276
287
|
if (options.listTemplates) {
|
|
@@ -634,23 +645,20 @@ function ProjectNameInput({ onSubmit }) {
|
|
|
634
645
|
return;
|
|
635
646
|
}
|
|
636
647
|
if (!/^[a-zA-Z0-9-_]+$/.test(trimmed)) {
|
|
637
|
-
setError(
|
|
648
|
+
setError(
|
|
649
|
+
"Project name can only contain letters, numbers, hyphens, and underscores"
|
|
650
|
+
);
|
|
638
651
|
return;
|
|
639
652
|
}
|
|
640
653
|
if (existsSync(join(process.cwd(), trimmed))) {
|
|
641
|
-
setError(
|
|
654
|
+
setError(
|
|
655
|
+
`Directory "${trimmed}" already exists! Please choose a different name.`
|
|
656
|
+
);
|
|
642
657
|
return;
|
|
643
658
|
}
|
|
644
659
|
onSubmit(trimmed);
|
|
645
660
|
};
|
|
646
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true }, "What is your project name?")), /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "cyan" }, "\u276F "), /* @__PURE__ */ React.createElement(
|
|
647
|
-
TextInput,
|
|
648
|
-
{
|
|
649
|
-
value,
|
|
650
|
-
onChange: setValue,
|
|
651
|
-
onSubmit: handleSubmit
|
|
652
|
-
}
|
|
653
|
-
)), error && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "red" }, "\u2716 ", error)));
|
|
661
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true }, "What is your project name?")), /* @__PURE__ */ React.createElement(Box, null, /* @__PURE__ */ React.createElement(Text, { color: "cyan" }, "\u276F "), /* @__PURE__ */ React.createElement(TextInput, { value, onChange: setValue, onSubmit: handleSubmit })), error && /* @__PURE__ */ React.createElement(Box, { marginTop: 1 }, /* @__PURE__ */ React.createElement(Text, { color: "red" }, "\u2716 ", error)));
|
|
654
662
|
}
|
|
655
663
|
async function promptForProjectName() {
|
|
656
664
|
return new Promise((resolve2) => {
|
|
@@ -667,10 +675,12 @@ async function promptForProjectName() {
|
|
|
667
675
|
);
|
|
668
676
|
});
|
|
669
677
|
}
|
|
670
|
-
function TemplateSelector({
|
|
678
|
+
function TemplateSelector({
|
|
679
|
+
onSelect
|
|
680
|
+
}) {
|
|
671
681
|
const templatesDir = join(__dirname, "templates");
|
|
672
682
|
if (!existsSync(templatesDir)) {
|
|
673
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: "red" }, "\u274C Templates directory not found at: ", templatesDir), /* @__PURE__ */ React.createElement(Text, { color: "yellow" }, "
|
|
683
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: "red" }, "\u274C Templates directory not found at: ", templatesDir), /* @__PURE__ */ React.createElement(Text, { color: "yellow" }, " __dirname: ", __dirname));
|
|
674
684
|
}
|
|
675
685
|
const availableTemplates = readdirSync(templatesDir, { withFileTypes: true }).filter((dirent) => dirent.isDirectory()).map((dirent) => dirent.name).sort();
|
|
676
686
|
if (availableTemplates.length === 0) {
|
|
@@ -691,13 +701,7 @@ function TemplateSelector({ onSelect }) {
|
|
|
691
701
|
value: template
|
|
692
702
|
};
|
|
693
703
|
});
|
|
694
|
-
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true }, "Select a template:")), /* @__PURE__ */ React.createElement(
|
|
695
|
-
SelectInput,
|
|
696
|
-
{
|
|
697
|
-
items,
|
|
698
|
-
onSelect: (item) => onSelect(item.value)
|
|
699
|
-
}
|
|
700
|
-
));
|
|
704
|
+
return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Box, { marginBottom: 1 }, /* @__PURE__ */ React.createElement(Text, { bold: true }, "Select a template:")), /* @__PURE__ */ React.createElement(SelectInput, { items, onSelect: (item) => onSelect(item.value) }));
|
|
701
705
|
}
|
|
702
706
|
async function promptForTemplate() {
|
|
703
707
|
return new Promise((resolve2) => {
|