create-z3 0.0.6 → 0.0.7
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/index.js +26 -49
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2233,57 +2233,34 @@ var program = new Command();
|
|
|
2233
2233
|
async function promptOAuthProviders() {
|
|
2234
2234
|
const popularProviders = getPopularProviders();
|
|
2235
2235
|
const additionalProviders = getAdditionalProviders();
|
|
2236
|
-
const
|
|
2236
|
+
const allOAuthProviders = [...popularProviders, ...additionalProviders].sort(
|
|
2237
|
+
(a, b) => a.name.localeCompare(b.name)
|
|
2238
|
+
);
|
|
2239
|
+
const choices = [
|
|
2237
2240
|
{
|
|
2238
2241
|
name: "Email & Password",
|
|
2239
2242
|
value: "__email_password__",
|
|
2240
2243
|
checked: true
|
|
2241
2244
|
// Default enabled
|
|
2242
2245
|
},
|
|
2243
|
-
new Separator("
|
|
2244
|
-
...
|
|
2246
|
+
new Separator("OAuth Providers (A-Z):"),
|
|
2247
|
+
...allOAuthProviders.map((provider) => ({
|
|
2245
2248
|
name: provider.name,
|
|
2246
|
-
value: provider.id
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
{
|
|
2250
|
-
name: `> Show more providers (${additionalProviders.length} additional)`,
|
|
2251
|
-
value: "__show_more__"
|
|
2252
|
-
}
|
|
2249
|
+
value: provider.id,
|
|
2250
|
+
checked: false
|
|
2251
|
+
}))
|
|
2253
2252
|
];
|
|
2254
|
-
|
|
2255
|
-
message: "Select authentication providers:",
|
|
2256
|
-
choices
|
|
2253
|
+
const selectedProviders = await checkbox({
|
|
2254
|
+
message: "Select authentication providers (space to select, enter to confirm):",
|
|
2255
|
+
choices,
|
|
2256
|
+
pageSize: 15,
|
|
2257
|
+
// Show more items at once
|
|
2258
|
+
loop: false
|
|
2259
|
+
// Don't wrap around
|
|
2257
2260
|
});
|
|
2258
|
-
if (selectedProviders.includes("__show_more__")) {
|
|
2259
|
-
const alreadySelected = selectedProviders.filter((id) => id !== "__show_more__");
|
|
2260
|
-
const expandedChoices = [
|
|
2261
|
-
{
|
|
2262
|
-
name: "Email & Password",
|
|
2263
|
-
value: "__email_password__",
|
|
2264
|
-
checked: alreadySelected.includes("__email_password__")
|
|
2265
|
-
},
|
|
2266
|
-
new Separator("Popular OAuth Providers:"),
|
|
2267
|
-
...popularProviders.map((provider) => ({
|
|
2268
|
-
name: provider.name,
|
|
2269
|
-
value: provider.id,
|
|
2270
|
-
checked: alreadySelected.includes(provider.id)
|
|
2271
|
-
})),
|
|
2272
|
-
new Separator("Additional OAuth Providers:"),
|
|
2273
|
-
...additionalProviders.map((provider) => ({
|
|
2274
|
-
name: provider.name,
|
|
2275
|
-
value: provider.id,
|
|
2276
|
-
checked: alreadySelected.includes(provider.id)
|
|
2277
|
-
}))
|
|
2278
|
-
];
|
|
2279
|
-
selectedProviders = await checkbox({
|
|
2280
|
-
message: "Select authentication providers:",
|
|
2281
|
-
choices: expandedChoices
|
|
2282
|
-
});
|
|
2283
|
-
}
|
|
2284
2261
|
const emailPassword = selectedProviders.includes("__email_password__");
|
|
2285
2262
|
const oauthProviders = selectedProviders.filter(
|
|
2286
|
-
(id) => id !== "__email_password__"
|
|
2263
|
+
(id) => id !== "__email_password__"
|
|
2287
2264
|
);
|
|
2288
2265
|
if (oauthProviders.length > 0) {
|
|
2289
2266
|
const providersNeedingExtraConfig = getProvidersRequiringExtraConfig(oauthProviders);
|
|
@@ -2349,15 +2326,6 @@ program.name("create-z3").version(packageJson.version).description("CLI for scaf
|
|
|
2349
2326
|
displayDirectoryExistsError(projectName);
|
|
2350
2327
|
}
|
|
2351
2328
|
}
|
|
2352
|
-
let createdPath;
|
|
2353
|
-
try {
|
|
2354
|
-
createdPath = await createProjectDirectory(projectName, cwd);
|
|
2355
|
-
} catch (error) {
|
|
2356
|
-
if (error instanceof Error && "code" in error && error.code === "EACCES") {
|
|
2357
|
-
displayPermissionError(targetDir);
|
|
2358
|
-
}
|
|
2359
|
-
throw error;
|
|
2360
|
-
}
|
|
2361
2329
|
const framework = await select({
|
|
2362
2330
|
message: "Which framework would you like to use?",
|
|
2363
2331
|
choices: [
|
|
@@ -2402,6 +2370,15 @@ program.name("create-z3").version(packageJson.version).description("CLI for scaf
|
|
|
2402
2370
|
initGit,
|
|
2403
2371
|
installDependencies
|
|
2404
2372
|
};
|
|
2373
|
+
let createdPath;
|
|
2374
|
+
try {
|
|
2375
|
+
createdPath = await createProjectDirectory(projectName, cwd);
|
|
2376
|
+
} catch (error) {
|
|
2377
|
+
if (error instanceof Error && "code" in error && error.code === "EACCES") {
|
|
2378
|
+
displayPermissionError(targetDir);
|
|
2379
|
+
}
|
|
2380
|
+
throw error;
|
|
2381
|
+
}
|
|
2405
2382
|
let installer;
|
|
2406
2383
|
if (framework === "tanstack") {
|
|
2407
2384
|
installer = new TanStackInstaller(createdPath, projectName);
|