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.
@@ -1,4 +1,4 @@
1
1
 
2
- > init-xmcp@0.5.4 build /home/runner/work/xmcp/xmcp/packages/init-xmcp
2
+ > init-xmcp@0.5.5-canary.1 build /home/runner/work/xmcp/xmcp/packages/init-xmcp
3
3
  > tsc
4
4
 
@@ -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@^3.25.76"]; // pin zod to specific version to avoid compilation errors
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
- prompts.push({
119
- type: "input",
120
- name: "toolsPath",
121
- message: "Tools directory path:",
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
- prompts.push({
127
- type: "input",
128
- name: "promptsPath",
129
- message: "Prompts directory path:",
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: "input",
136
- name: "resourcesPath",
137
- message: "Resources directory path:",
138
- default: resourcesPath,
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 (!options.skipTools) {
178
- toolsPath = answers.toolsPath;
179
- }
180
- if (!options.skipPrompts) {
181
- promptsPath = answers.promptsPath;
182
- }
183
- if (!options.skipResources) {
184
- resourcesPath = answers.resourcesPath;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "init-xmcp",
3
- "version": "0.5.4",
3
+ "version": "0.5.5-canary.1",
4
4
  "author": {
5
5
  "name": "xmcp",
6
6
  "email": "support@xmcp.dev",
@@ -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@^3.25.76"]; // pin zod to specific version to avoid compilation errors
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
- prompts.push({
156
- type: "input",
157
- name: "toolsPath",
158
- message: "Tools directory path:",
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
- prompts.push({
165
- type: "input",
166
- name: "promptsPath",
167
- message: "Prompts directory path:",
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: "input",
175
- name: "resourcesPath",
176
- message: "Resources directory path:",
177
- default: resourcesPath,
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 (!options.skipTools) {
224
- toolsPath = answers.toolsPath;
225
- }
226
- if (!options.skipPrompts) {
227
- promptsPath = answers.promptsPath;
228
- }
229
- if (!options.skipResources) {
230
- resourcesPath = answers.resourcesPath;
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 &&