@clerk/upgrade 2.0.0-canary.v20251210164116 → 2.0.0-canary.v20251210171743
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/dist/cli.js +1 -1
- package/dist/render.js +9 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -121,7 +121,7 @@ async function main() {
|
|
|
121
121
|
dir: options.dir,
|
|
122
122
|
packageManager: getPackageManagerDisplayName(packageManager)
|
|
123
123
|
});
|
|
124
|
-
if (isInteractive && !(await promptConfirm('Ready to upgrade?'))) {
|
|
124
|
+
if (isInteractive && !(await promptConfirm('Ready to upgrade?', true))) {
|
|
125
125
|
renderError('Upgrade cancelled. Exiting...');
|
|
126
126
|
process.exit(0);
|
|
127
127
|
}
|
package/dist/render.js
CHANGED
|
@@ -43,15 +43,21 @@ export function renderConfig({
|
|
|
43
43
|
}
|
|
44
44
|
console.log('');
|
|
45
45
|
}
|
|
46
|
-
export async function promptConfirm(message) {
|
|
46
|
+
export async function promptConfirm(message, defaultYes = false) {
|
|
47
47
|
const rl = readline.createInterface({
|
|
48
48
|
input: process.stdin,
|
|
49
49
|
output: process.stdout
|
|
50
50
|
});
|
|
51
51
|
return new Promise(resolve => {
|
|
52
|
-
|
|
52
|
+
const prompt = defaultYes ? `${message} (Y/n): ` : `${message} (y/N): `;
|
|
53
|
+
rl.question(prompt, answer => {
|
|
53
54
|
rl.close();
|
|
54
|
-
|
|
55
|
+
const normalized = answer.trim().toLowerCase();
|
|
56
|
+
if (!normalized) {
|
|
57
|
+
resolve(defaultYes);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
resolve(normalized === 'y' || normalized === 'yes');
|
|
55
61
|
});
|
|
56
62
|
});
|
|
57
63
|
}
|