init-xmcp 0.3.1 → 0.3.2-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.
@@ -1,4 +1,4 @@
1
1
 
2
- > init-xmcp@0.3.1 build /home/runner/work/xmcp/xmcp/packages/init-xmcp
2
+ > init-xmcp@0.3.2-canary.0 build /home/runner/work/xmcp/xmcp/packages/init-xmcp
3
3
  > tsc
4
4
 
@@ -7,6 +7,7 @@ interface InitOptions {
7
7
  resourcesPath: string | undefined;
8
8
  routePath: string | undefined;
9
9
  packageManager: "npm" | "yarn" | "pnpm" | "bun";
10
+ version: string;
10
11
  }
11
12
  export declare function init(options: InitOptions): Promise<void>;
12
13
  export {};
@@ -8,9 +8,9 @@ import { createRoute } from "./create-handler.js";
8
8
  import { createPrompt } from "./create-prompt.js";
9
9
  import { createResources } from "./create-resources.js";
10
10
  export async function init(options) {
11
- const { projectRoot, framework, toolsPath, promptsPath, resourcesPath, routePath, packageManager, } = options;
11
+ const { projectRoot, framework, toolsPath, promptsPath, resourcesPath, routePath, packageManager, version, } = options;
12
12
  generateConfig(projectRoot, framework, toolsPath, promptsPath, resourcesPath);
13
- await install(projectRoot, packageManager);
13
+ await install(projectRoot, packageManager, version);
14
14
  updatePackageJson(projectRoot);
15
15
  updateTsConfig(projectRoot);
16
16
  updateGitignore(projectRoot);
@@ -7,5 +7,6 @@ export declare function detectPackageManager(projectPath: string): "npm" | "yarn
7
7
  /**
8
8
  * Install xmcp dependencies using the specified package manager
9
9
  * @param packageManager - Package manager to use (npm, yarn, pnpm, or bun)
10
+ * @param version - Version of init-xmcp to match xmcp version
10
11
  */
11
- export declare function install(projectPath: string, packageManager: "npm" | "pnpm" | "yarn" | "bun"): Promise<void>;
12
+ export declare function install(projectPath: string, packageManager: "npm" | "pnpm" | "yarn" | "bun", version: string): Promise<void>;
@@ -27,9 +27,10 @@ export function detectPackageManager(projectPath) {
27
27
  /**
28
28
  * Install xmcp dependencies using the specified package manager
29
29
  * @param packageManager - Package manager to use (npm, yarn, pnpm, or bun)
30
+ * @param version - Version of init-xmcp to match xmcp version
30
31
  */
31
- export async function install(projectPath, packageManager) {
32
- const dependencies = ["xmcp", "zod@^3.25.76"]; // pin zod to specific version to avoid compilation errors
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
34
  const devDependencies = ["swc-loader"];
34
35
  const commands = {
35
36
  npm: `npm install ${dependencies.join(" ")} && npm install --save-dev ${devDependencies.join(" ")}`,
package/dist/index.js CHANGED
@@ -251,6 +251,7 @@ const program = new Command()
251
251
  resourcesPath,
252
252
  routePath,
253
253
  packageManager,
254
+ version: packageJson.version,
254
255
  });
255
256
  console.log(chalk.green("\n✔ xmcp initialized successfully!"));
256
257
  console.log(chalk.blue("\n❯ Files created:"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "init-xmcp",
3
- "version": "0.3.1",
3
+ "version": "0.3.2-canary.0",
4
4
  "author": {
5
5
  "name": "Basement Studio",
6
6
  "email": "hello@basement.studio",
@@ -17,6 +17,7 @@ interface InitOptions {
17
17
  resourcesPath: string | undefined;
18
18
  routePath: string | undefined;
19
19
  packageManager: "npm" | "yarn" | "pnpm" | "bun";
20
+ version: string;
20
21
  }
21
22
 
22
23
  export async function init(options: InitOptions) {
@@ -28,11 +29,12 @@ export async function init(options: InitOptions) {
28
29
  resourcesPath,
29
30
  routePath,
30
31
  packageManager,
32
+ version,
31
33
  } = options;
32
34
 
33
35
  generateConfig(projectRoot, framework, toolsPath, promptsPath, resourcesPath);
34
36
 
35
- await install(projectRoot, packageManager);
37
+ await install(projectRoot, packageManager, version);
36
38
 
37
39
  updatePackageJson(projectRoot);
38
40
 
@@ -34,12 +34,14 @@ export function detectPackageManager(
34
34
  /**
35
35
  * Install xmcp dependencies using the specified package manager
36
36
  * @param packageManager - Package manager to use (npm, yarn, pnpm, or bun)
37
+ * @param version - Version of init-xmcp to match xmcp version
37
38
  */
38
39
  export async function install(
39
40
  projectPath: string,
40
- packageManager: "npm" | "pnpm" | "yarn" | "bun"
41
+ packageManager: "npm" | "pnpm" | "yarn" | "bun",
42
+ version: string
41
43
  ) {
42
- const dependencies = ["xmcp", "zod@^3.25.76"]; // pin zod to specific version to avoid compilation errors
44
+ const dependencies = [`xmcp@${version}`, "zod@^3.25.76"]; // pin zod to specific version to avoid compilation errors
43
45
  const devDependencies = ["swc-loader"];
44
46
 
45
47
  const commands = {
package/src/index.ts CHANGED
@@ -317,6 +317,7 @@ const program = new Command()
317
317
  resourcesPath,
318
318
  routePath,
319
319
  packageManager,
320
+ version: packageJson.version,
320
321
  });
321
322
 
322
323
  console.log(chalk.green("\n✔ xmcp initialized successfully!"));