create-skateboard-app 1.2.1 → 1.3.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/CHANGELOG.md +5 -0
- package/bin/cli.js +17 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/bin/cli.js
CHANGED
|
@@ -168,16 +168,21 @@ async function downloadTemplate(projectName) {
|
|
|
168
168
|
|
|
169
169
|
// Interactive prompt functions
|
|
170
170
|
function ask(question, defaultValue = '') {
|
|
171
|
+
// When stdin is not a TTY (piped input, CI, agents), use default value
|
|
172
|
+
if (!process.stdin.isTTY) {
|
|
173
|
+
return Promise.resolve(defaultValue);
|
|
174
|
+
}
|
|
175
|
+
|
|
171
176
|
const rl = createInterface({
|
|
172
177
|
input: process.stdin,
|
|
173
178
|
output: process.stdout
|
|
174
179
|
});
|
|
175
180
|
|
|
176
181
|
return new Promise((resolve) => {
|
|
177
|
-
const prompt = defaultValue
|
|
182
|
+
const prompt = defaultValue
|
|
178
183
|
? `${colors.cyan}${question}${colors.reset} ${colors.yellow}(${defaultValue})${colors.reset}: `
|
|
179
184
|
: `${colors.cyan}${question}${colors.reset}: `;
|
|
180
|
-
|
|
185
|
+
|
|
181
186
|
rl.question(prompt, (answer) => {
|
|
182
187
|
rl.close();
|
|
183
188
|
resolve(answer.trim() || defaultValue);
|
|
@@ -186,9 +191,14 @@ function ask(question, defaultValue = '') {
|
|
|
186
191
|
}
|
|
187
192
|
|
|
188
193
|
function askChoice(question, choices, defaultChoice = 0) {
|
|
194
|
+
// When stdin is not a TTY (piped input, CI, agents), use default choice
|
|
195
|
+
if (!process.stdin.isTTY) {
|
|
196
|
+
return choices[defaultChoice];
|
|
197
|
+
}
|
|
198
|
+
|
|
189
199
|
return new Promise((resolve) => {
|
|
190
200
|
let currentChoice = defaultChoice;
|
|
191
|
-
|
|
201
|
+
|
|
192
202
|
const displayMenu = () => {
|
|
193
203
|
// Clear screen and show menu
|
|
194
204
|
console.clear();
|
|
@@ -245,6 +255,10 @@ async function askYesNo(question, defaultYes = true) {
|
|
|
245
255
|
async function collectProjectConfig(projectName, flags = {}) {
|
|
246
256
|
const nonInteractive = flags.yes;
|
|
247
257
|
|
|
258
|
+
if (!nonInteractive && !process.stdin.isTTY) {
|
|
259
|
+
info('Non-interactive mode detected, using defaults. Use --flags to customize.');
|
|
260
|
+
}
|
|
261
|
+
|
|
248
262
|
if (!nonInteractive) {
|
|
249
263
|
log(`\n${colors.bold}Let's configure your Skateboard app!${colors.reset}\n`);
|
|
250
264
|
}
|
package/package.json
CHANGED