init-xmcp 0.5.4 ā 0.5.5-canary.1
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/.turbo/turbo-build.log +1 -1
- package/dist/helpers/install.js +1 -1
- package/dist/index.js +31 -22
- package/package.json +1 -1
- package/src/helpers/install.ts +1 -1
- package/src/index.ts +34 -24
package/.turbo/turbo-build.log
CHANGED
package/dist/helpers/install.js
CHANGED
|
@@ -30,7 +30,7 @@ export function detectPackageManager(projectPath) {
|
|
|
30
30
|
* @param version - Version of init-xmcp to match xmcp version
|
|
31
31
|
*/
|
|
32
32
|
export async function install(projectPath, packageManager, version) {
|
|
33
|
-
const dependencies = [`xmcp@${version}`, "zod
|
|
33
|
+
const dependencies = [`xmcp@${version}`, "zod"];
|
|
34
34
|
const commands = {
|
|
35
35
|
npm: `npm install ${dependencies.join(" ")}`,
|
|
36
36
|
pnpm: `pnpm add ${dependencies.join(" ")}`,
|
package/dist/index.js
CHANGED
|
@@ -114,28 +114,34 @@ const program = new Command()
|
|
|
114
114
|
console.log(chalk.blue("\nš xmcp Initialization Settings:"));
|
|
115
115
|
console.log(` Framework: ${chalk.cyan(detectedFramework)}`);
|
|
116
116
|
const prompts = [];
|
|
117
|
+
const componentChoices = [];
|
|
117
118
|
if (!options.skipTools) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
default: toolsPath,
|
|
119
|
+
componentChoices.push({
|
|
120
|
+
name: "Tools",
|
|
121
|
+
value: "tools",
|
|
122
|
+
checked: true,
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
if (!options.skipPrompts) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
default: promptsPath,
|
|
126
|
+
componentChoices.push({
|
|
127
|
+
name: "Prompts",
|
|
128
|
+
value: "prompts",
|
|
129
|
+
checked: true,
|
|
131
130
|
});
|
|
132
131
|
}
|
|
133
132
|
if (!options.skipResources) {
|
|
133
|
+
componentChoices.push({
|
|
134
|
+
name: "Resources",
|
|
135
|
+
value: "resources",
|
|
136
|
+
checked: true,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
if (componentChoices.length > 0) {
|
|
134
140
|
prompts.push({
|
|
135
|
-
type: "
|
|
136
|
-
name: "
|
|
137
|
-
message: "
|
|
138
|
-
|
|
141
|
+
type: "checkbox",
|
|
142
|
+
name: "components",
|
|
143
|
+
message: "Select components to initialize:",
|
|
144
|
+
choices: componentChoices,
|
|
139
145
|
});
|
|
140
146
|
}
|
|
141
147
|
if (detectedFramework === "nextjs" && !options.skipRoute) {
|
|
@@ -174,14 +180,17 @@ const program = new Command()
|
|
|
174
180
|
console.log(chalk.yellow("ā Aborting initialization."));
|
|
175
181
|
process.exit(0);
|
|
176
182
|
}
|
|
177
|
-
if (
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
if (answers.components) {
|
|
184
|
+
const selectedComponents = answers.components;
|
|
185
|
+
if (!selectedComponents.includes("tools")) {
|
|
186
|
+
toolsPath = undefined;
|
|
187
|
+
}
|
|
188
|
+
if (!selectedComponents.includes("prompts")) {
|
|
189
|
+
promptsPath = undefined;
|
|
190
|
+
}
|
|
191
|
+
if (!selectedComponents.includes("resources")) {
|
|
192
|
+
resourcesPath = undefined;
|
|
193
|
+
}
|
|
185
194
|
}
|
|
186
195
|
if (detectedFramework === "nextjs" &&
|
|
187
196
|
!options.skipRoute &&
|
package/package.json
CHANGED
package/src/helpers/install.ts
CHANGED
|
@@ -41,7 +41,7 @@ export async function install(
|
|
|
41
41
|
packageManager: "npm" | "pnpm" | "yarn" | "bun",
|
|
42
42
|
version: string
|
|
43
43
|
) {
|
|
44
|
-
const dependencies = [`xmcp@${version}`, "zod
|
|
44
|
+
const dependencies = [`xmcp@${version}`, "zod"];
|
|
45
45
|
|
|
46
46
|
const commands = {
|
|
47
47
|
npm: `npm install ${dependencies.join(" ")}`,
|
package/src/index.ts
CHANGED
|
@@ -151,30 +151,35 @@ const program = new Command()
|
|
|
151
151
|
|
|
152
152
|
const prompts = [];
|
|
153
153
|
|
|
154
|
+
const componentChoices = [];
|
|
154
155
|
if (!options.skipTools) {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
default: toolsPath,
|
|
156
|
+
componentChoices.push({
|
|
157
|
+
name: "Tools",
|
|
158
|
+
value: "tools",
|
|
159
|
+
checked: true,
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
|
-
|
|
163
162
|
if (!options.skipPrompts) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
default: promptsPath,
|
|
163
|
+
componentChoices.push({
|
|
164
|
+
name: "Prompts",
|
|
165
|
+
value: "prompts",
|
|
166
|
+
checked: true,
|
|
169
167
|
});
|
|
170
168
|
}
|
|
171
|
-
|
|
172
169
|
if (!options.skipResources) {
|
|
170
|
+
componentChoices.push({
|
|
171
|
+
name: "Resources",
|
|
172
|
+
value: "resources",
|
|
173
|
+
checked: true,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (componentChoices.length > 0) {
|
|
173
178
|
prompts.push({
|
|
174
|
-
type: "
|
|
175
|
-
name: "
|
|
176
|
-
message: "
|
|
177
|
-
|
|
179
|
+
type: "checkbox",
|
|
180
|
+
name: "components",
|
|
181
|
+
message: "Select components to initialize:",
|
|
182
|
+
choices: componentChoices,
|
|
178
183
|
});
|
|
179
184
|
}
|
|
180
185
|
|
|
@@ -220,15 +225,20 @@ const program = new Command()
|
|
|
220
225
|
process.exit(0);
|
|
221
226
|
}
|
|
222
227
|
|
|
223
|
-
if (
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
228
|
+
if (answers.components) {
|
|
229
|
+
const selectedComponents = answers.components as string[];
|
|
230
|
+
|
|
231
|
+
if (!selectedComponents.includes("tools")) {
|
|
232
|
+
toolsPath = undefined;
|
|
233
|
+
}
|
|
234
|
+
if (!selectedComponents.includes("prompts")) {
|
|
235
|
+
promptsPath = undefined;
|
|
236
|
+
}
|
|
237
|
+
if (!selectedComponents.includes("resources")) {
|
|
238
|
+
resourcesPath = undefined;
|
|
239
|
+
}
|
|
231
240
|
}
|
|
241
|
+
|
|
232
242
|
if (
|
|
233
243
|
detectedFramework === "nextjs" &&
|
|
234
244
|
!options.skipRoute &&
|