@beaket/ui 1.7.0 → 1.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beaket/ui",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "CLI tool for adding Beaket UI components to your project",
5
5
  "type": "module",
6
6
  "bin": {
@@ -106,33 +106,42 @@ const CSS_VARIABLES = `
106
106
  }
107
107
  `;
108
108
 
109
- export async function init() {
109
+ interface InitOptions {
110
+ yes?: boolean;
111
+ }
112
+
113
+ export async function init(options: InitOptions) {
110
114
  console.log();
111
115
  console.log(pc.bold("Initializing Beaket UI..."));
112
116
  console.log();
113
117
 
114
- // Auto-detect defaults based on project structure
115
118
  const detectedComponentsPath = await detectAliasPath();
116
119
  const detectedCssPath = await detectCssPath();
117
120
 
118
- const response = await prompts([
119
- {
120
- type: "text",
121
- name: "components",
122
- message: "Where should components be installed?",
123
- initial: detectedComponentsPath,
124
- },
125
- {
126
- type: "text",
127
- name: "css",
128
- message: "Where is your Tailwind CSS file?",
129
- initial: detectedCssPath,
130
- },
131
- ]);
132
-
133
- if (!response.components) {
134
- console.log(pc.red("Cancelled."));
135
- process.exit(1);
121
+ let response: { components: string; css: string };
122
+
123
+ if (options.yes) {
124
+ response = { components: detectedComponentsPath, css: detectedCssPath };
125
+ } else {
126
+ response = await prompts([
127
+ {
128
+ type: "text",
129
+ name: "components",
130
+ message: "Where should components be installed?",
131
+ initial: detectedComponentsPath,
132
+ },
133
+ {
134
+ type: "text",
135
+ name: "css",
136
+ message: "Where is your Tailwind CSS file?",
137
+ initial: detectedCssPath,
138
+ },
139
+ ]);
140
+
141
+ if (!response.components) {
142
+ console.log(pc.red("Cancelled."));
143
+ process.exit(1);
144
+ }
136
145
  }
137
146
 
138
147
  // Write beaket.ui.json (only components path)
package/src/index.ts CHANGED
@@ -15,7 +15,11 @@ program
15
15
  .description("CLI for adding Beaket UI components to your project")
16
16
  .version(version);
17
17
 
18
- program.command("init").description("Initialize Beaket UI in your project").action(init);
18
+ program
19
+ .command("init")
20
+ .description("Initialize Beaket UI in your project")
21
+ .option("-y, --yes", "Use defaults without prompting")
22
+ .action(init);
19
23
 
20
24
  program
21
25
  .command("add")
@@ -74,7 +74,7 @@ async function detectPackageManager(): Promise<"npm" | "pnpm" | "yarn" | "bun">
74
74
  if (await fs.pathExists(path.join(cwd, "yarn.lock"))) {
75
75
  return "yarn";
76
76
  }
77
- if (await fs.pathExists(path.join(cwd, "bun.lockb"))) {
77
+ if (await fs.pathExists(path.join(cwd, "bun.lock"))) {
78
78
  return "bun";
79
79
  }
80
80