init-xmcp 0.1.7 → 0.1.8

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.0.1 build /home/runner/work/xmcp/xmcp/packages/init-xmcp
2
+ > init-xmcp@0.1.8 build /home/runner/work/xmcp/xmcp/packages/init-xmcp
3
3
  > tsc
4
4
 
package/README.md CHANGED
@@ -27,7 +27,7 @@ npx init-xmcp@latest
27
27
 
28
28
  - `-v, --version`: Output the current version of init-xmcp.
29
29
  - `-y, --yes`: Skip confirmation prompts (default: false)
30
- - `--package-manager <manager>`: Specify package manager (npm, yarn, pnpm) (default: "")
30
+ - `--package-manager <manager>`: Specify package manager (npm, yarn, pnpm, bun) (default: "")
31
31
  - `--tools-path <path>`: Specify custom tools path (default: "")
32
32
  - `--route-path <path>`: Specify custom route path (default: "")
33
33
  - `--skip-tools`: Skip tool creation (default: false)
@@ -4,7 +4,7 @@ interface InitOptions {
4
4
  framework: Framework;
5
5
  toolsPath: string | undefined;
6
6
  routePath: string | undefined;
7
- packageManager: "npm" | "yarn" | "pnpm";
7
+ packageManager: "npm" | "yarn" | "pnpm" | "bun";
8
8
  }
9
9
  export declare function init(options: InitOptions): Promise<void>;
10
10
  export {};
@@ -3,9 +3,9 @@
3
3
  * @param projectPath - Project directory path
4
4
  * @returns Package manager name (npm, yarn, or pnpm)
5
5
  */
6
- export declare function detectPackageManager(projectPath: string): "npm" | "yarn" | "pnpm" | null;
6
+ export declare function detectPackageManager(projectPath: string): "npm" | "yarn" | "pnpm" | "bun" | null;
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
10
  */
11
- export declare function install(projectPath: string, packageManager: "npm" | "pnpm" | "yarn"): Promise<void>;
11
+ export declare function install(projectPath: string, packageManager: "npm" | "pnpm" | "yarn" | "bun"): Promise<void>;
@@ -9,6 +9,9 @@ import { execSync } from "child_process";
9
9
  * @returns Package manager name (npm, yarn, or pnpm)
10
10
  */
11
11
  export function detectPackageManager(projectPath) {
12
+ if (fs.existsSync(path.join(projectPath, "bun.lockb"))) {
13
+ return "bun";
14
+ }
12
15
  if (fs.existsSync(path.join(projectPath, "yarn.lock"))) {
13
16
  return "yarn";
14
17
  }
@@ -31,6 +34,7 @@ export async function install(projectPath, packageManager) {
31
34
  npm: `npm install ${dependencies.join(" ")} && npm install --save-dev ${devDependencies.join(" ")}`,
32
35
  pnpm: `pnpm add ${dependencies.join(" ")} && pnpm add --save-dev ${devDependencies.join(" ")}`,
33
36
  yarn: `yarn add ${dependencies.join(" ")} && yarn add --dev ${devDependencies.join(" ")}`,
37
+ bun: `bun add ${dependencies.join(" ")} && bun add --dev ${devDependencies.join(" ")}`,
34
38
  };
35
39
  try {
36
40
  console.log(chalk.blue(`\nInstalling dependencies using ${packageManager}...`));
package/dist/index.js CHANGED
@@ -19,7 +19,7 @@ const program = new Command()
19
19
  .version(packageJson.version, "-v, --version", "Output the current version of init-xmcp.")
20
20
  .helpOption("-h, --help", "Display help message.")
21
21
  .option("-y, --yes", "Skip confirmation prompts", false)
22
- .option("--package-manager <manager>", "Specify package manager (npm, yarn, pnpm)", "")
22
+ .option("--package-manager <manager>", "Specify package manager (npm, yarn, pnpm, bun)", "")
23
23
  .option("--tools-path <path>", "Specify custom tools path", "")
24
24
  .option("--route-path <path>", "Specify custom route path", "")
25
25
  .option("--skip-tools", "Skip tool creation", false)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "init-xmcp",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "author": {
5
5
  "name": "Basement Studio",
6
6
  "email": "hello@basement.studio",
@@ -13,7 +13,7 @@ interface InitOptions {
13
13
  framework: Framework;
14
14
  toolsPath: string | undefined;
15
15
  routePath: string | undefined;
16
- packageManager: "npm" | "yarn" | "pnpm";
16
+ packageManager: "npm" | "yarn" | "pnpm" | "bun";
17
17
  }
18
18
 
19
19
  export async function init(options: InitOptions) {
@@ -12,7 +12,10 @@ import { execSync } from "child_process";
12
12
  */
13
13
  export function detectPackageManager(
14
14
  projectPath: string
15
- ): "npm" | "yarn" | "pnpm" | null {
15
+ ): "npm" | "yarn" | "pnpm" | "bun" | null {
16
+ if (fs.existsSync(path.join(projectPath, "bun.lockb"))) {
17
+ return "bun";
18
+ }
16
19
  if (fs.existsSync(path.join(projectPath, "yarn.lock"))) {
17
20
  return "yarn";
18
21
  }
@@ -31,7 +34,7 @@ export function detectPackageManager(
31
34
  */
32
35
  export async function install(
33
36
  projectPath: string,
34
- packageManager: "npm" | "pnpm" | "yarn"
37
+ packageManager: "npm" | "pnpm" | "yarn" | "bun"
35
38
  ) {
36
39
  const dependencies = ["xmcp", "zod"];
37
40
  const devDependencies = ["swc-loader"];
@@ -40,6 +43,7 @@ export async function install(
40
43
  npm: `npm install ${dependencies.join(" ")} && npm install --save-dev ${devDependencies.join(" ")}`,
41
44
  pnpm: `pnpm add ${dependencies.join(" ")} && pnpm add --save-dev ${devDependencies.join(" ")}`,
42
45
  yarn: `yarn add ${dependencies.join(" ")} && yarn add --dev ${devDependencies.join(" ")}`,
46
+ bun: `bun add ${dependencies.join(" ")} && bun add --dev ${devDependencies.join(" ")}`,
43
47
  };
44
48
 
45
49
  try {
package/src/index.ts CHANGED
@@ -35,7 +35,7 @@ const program = new Command()
35
35
  .option("-y, --yes", "Skip confirmation prompts", false)
36
36
  .option(
37
37
  "--package-manager <manager>",
38
- "Specify package manager (npm, yarn, pnpm)",
38
+ "Specify package manager (npm, yarn, pnpm, bun)",
39
39
  ""
40
40
  )
41
41
  .option("--tools-path <path>", "Specify custom tools path", "")
@@ -102,11 +102,15 @@ const program = new Command()
102
102
  }
103
103
 
104
104
  // determine package manager
105
- let packageManager: "npm" | "yarn" | "pnpm";
105
+ let packageManager: "npm" | "yarn" | "pnpm" | "bun";
106
106
  if (detectedPackageManager) {
107
107
  packageManager = detectedPackageManager;
108
108
  } else if (options.packageManager) {
109
- packageManager = options.packageManager as "npm" | "yarn" | "pnpm";
109
+ packageManager = options.packageManager as
110
+ | "npm"
111
+ | "yarn"
112
+ | "pnpm"
113
+ | "bun";
110
114
  } else {
111
115
  // no package manager detected, will prompt user
112
116
  packageManager = "npm"; // default fallback