authverse 1.1.2 → 1.1.3
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.cjs +26 -49
- package/dist/index.js +4 -27
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -935,7 +935,7 @@ var initAnswer = async () => {
|
|
|
935
935
|
};
|
|
936
936
|
|
|
937
937
|
// index.ts
|
|
938
|
-
var
|
|
938
|
+
var import_fs26 = require("fs");
|
|
939
939
|
|
|
940
940
|
// cli/provider.ts
|
|
941
941
|
var import_chalk11 = __toESM(require("chalk"), 1);
|
|
@@ -2163,33 +2163,14 @@ var forget = () => {
|
|
|
2163
2163
|
}
|
|
2164
2164
|
};
|
|
2165
2165
|
|
|
2166
|
-
// script/detect-nextjs.ts
|
|
2167
|
-
var import_fs23 = require("fs");
|
|
2168
|
-
function isNextJsProject() {
|
|
2169
|
-
if (!(0, import_fs23.existsSync)("./package.json")) return false;
|
|
2170
|
-
try {
|
|
2171
|
-
const pkg = JSON.parse((0, import_fs23.readFileSync)("./package.json", "utf8"));
|
|
2172
|
-
const deps = {
|
|
2173
|
-
...pkg.dependencies,
|
|
2174
|
-
...pkg.devDependencies
|
|
2175
|
-
};
|
|
2176
|
-
return deps["next"] !== void 0;
|
|
2177
|
-
} catch (err) {
|
|
2178
|
-
return false;
|
|
2179
|
-
}
|
|
2180
|
-
}
|
|
2181
|
-
|
|
2182
|
-
// index.ts
|
|
2183
|
-
var import_chalk23 = __toESM(require("chalk"), 1);
|
|
2184
|
-
|
|
2185
2166
|
// cli/verification.ts
|
|
2186
2167
|
var import_chalk22 = __toESM(require("chalk"), 1);
|
|
2187
|
-
var
|
|
2168
|
+
var import_fs25 = __toESM(require("fs"), 1);
|
|
2188
2169
|
var import_path25 = __toESM(require("path"), 1);
|
|
2189
2170
|
|
|
2190
2171
|
// script/verifyNext.ts
|
|
2191
2172
|
var import_chalk20 = __toESM(require("chalk"), 1);
|
|
2192
|
-
var
|
|
2173
|
+
var import_fs23 = __toESM(require("fs"), 1);
|
|
2193
2174
|
var import_path23 = __toESM(require("path"), 1);
|
|
2194
2175
|
var import_url19 = require("url");
|
|
2195
2176
|
var import_meta19 = {};
|
|
@@ -2199,17 +2180,17 @@ var verifyNext = async () => {
|
|
|
2199
2180
|
const __filename = (0, import_url19.fileURLToPath)(import_meta19.url);
|
|
2200
2181
|
const __dirname = import_path23.default.dirname(__filename);
|
|
2201
2182
|
const srcPath = import_path23.default.join(projectDir, "src");
|
|
2202
|
-
const folder =
|
|
2183
|
+
const folder = import_fs23.default.existsSync(srcPath) ? "src" : "";
|
|
2203
2184
|
const emailFilePath = import_path23.default.join(projectDir, folder, "lib", "email.ts");
|
|
2204
|
-
if (!
|
|
2185
|
+
if (!import_fs23.default.existsSync(emailFilePath)) {
|
|
2205
2186
|
await email();
|
|
2206
2187
|
}
|
|
2207
2188
|
const authFilePath = import_path23.default.join(projectDir, folder, "lib", "auth.ts");
|
|
2208
|
-
if (!
|
|
2189
|
+
if (!import_fs23.default.existsSync(authFilePath)) {
|
|
2209
2190
|
console.log(import_chalk20.default.red("auth.ts file not found."));
|
|
2210
2191
|
return;
|
|
2211
2192
|
}
|
|
2212
|
-
let content =
|
|
2193
|
+
let content = import_fs23.default.readFileSync(authFilePath, "utf8");
|
|
2213
2194
|
if (content.includes("emailAndPassword: {")) {
|
|
2214
2195
|
const start = content.indexOf("emailAndPassword: {");
|
|
2215
2196
|
let end = start;
|
|
@@ -2263,18 +2244,18 @@ import { sendEmail } from "./email";
|
|
|
2263
2244
|
`;
|
|
2264
2245
|
content = content.slice(0, nextLine) + imports + content.slice(nextLine);
|
|
2265
2246
|
}
|
|
2266
|
-
|
|
2247
|
+
import_fs23.default.writeFileSync(authFilePath, content, "utf8");
|
|
2267
2248
|
const templatePath = import_path23.default.resolve(
|
|
2268
2249
|
__dirname,
|
|
2269
2250
|
"./template/email/EmailVerification.tsx"
|
|
2270
2251
|
);
|
|
2271
2252
|
const componentsDir = import_path23.default.join(projectDir, folder, "components", "email");
|
|
2272
|
-
if (!
|
|
2273
|
-
|
|
2253
|
+
if (!import_fs23.default.existsSync(componentsDir)) {
|
|
2254
|
+
import_fs23.default.mkdirSync(componentsDir, { recursive: true });
|
|
2274
2255
|
}
|
|
2275
2256
|
const destFile = import_path23.default.join(componentsDir, "EmailVerification.tsx");
|
|
2276
|
-
if (
|
|
2277
|
-
|
|
2257
|
+
if (import_fs23.default.existsSync(templatePath) && !import_fs23.default.existsSync(destFile)) {
|
|
2258
|
+
import_fs23.default.copyFileSync(templatePath, destFile);
|
|
2278
2259
|
}
|
|
2279
2260
|
console.log(import_chalk20.default.green("Email verification successfully configured"));
|
|
2280
2261
|
} catch (error) {
|
|
@@ -2284,7 +2265,7 @@ import { sendEmail } from "./email";
|
|
|
2284
2265
|
|
|
2285
2266
|
// script/verifyTanstack.ts
|
|
2286
2267
|
var import_chalk21 = __toESM(require("chalk"), 1);
|
|
2287
|
-
var
|
|
2268
|
+
var import_fs24 = __toESM(require("fs"), 1);
|
|
2288
2269
|
var import_path24 = __toESM(require("path"), 1);
|
|
2289
2270
|
var import_url20 = require("url");
|
|
2290
2271
|
var import_meta20 = {};
|
|
@@ -2295,15 +2276,15 @@ var verifyTanstack = async () => {
|
|
|
2295
2276
|
const __dirname = import_path24.default.dirname(__filename);
|
|
2296
2277
|
const srcPath = import_path24.default.join(projectDir, "src");
|
|
2297
2278
|
const emailFilePath = import_path24.default.join(srcPath, "lib", "email.ts");
|
|
2298
|
-
if (!
|
|
2279
|
+
if (!import_fs24.default.existsSync(emailFilePath)) {
|
|
2299
2280
|
await email();
|
|
2300
2281
|
}
|
|
2301
2282
|
const authFilePath = import_path24.default.join(srcPath, "lib", "auth.ts");
|
|
2302
|
-
if (!
|
|
2283
|
+
if (!import_fs24.default.existsSync(authFilePath)) {
|
|
2303
2284
|
console.log(import_chalk21.default.red("auth.ts file not found."));
|
|
2304
2285
|
return;
|
|
2305
2286
|
}
|
|
2306
|
-
let content =
|
|
2287
|
+
let content = import_fs24.default.readFileSync(authFilePath, "utf8");
|
|
2307
2288
|
if (content.includes("emailAndPassword: {")) {
|
|
2308
2289
|
const start = content.indexOf("emailAndPassword: {");
|
|
2309
2290
|
let end = start;
|
|
@@ -2357,18 +2338,18 @@ import { sendEmail } from "./email";
|
|
|
2357
2338
|
`;
|
|
2358
2339
|
content = content.slice(0, nextLine) + imports + content.slice(nextLine);
|
|
2359
2340
|
}
|
|
2360
|
-
|
|
2341
|
+
import_fs24.default.writeFileSync(authFilePath, content, "utf8");
|
|
2361
2342
|
const templatePath = import_path24.default.resolve(
|
|
2362
2343
|
__dirname,
|
|
2363
2344
|
"./template/email/EmailVerification.tsx"
|
|
2364
2345
|
);
|
|
2365
2346
|
const componentsDir = import_path24.default.join(srcPath, "components", "email");
|
|
2366
|
-
if (!
|
|
2367
|
-
|
|
2347
|
+
if (!import_fs24.default.existsSync(componentsDir)) {
|
|
2348
|
+
import_fs24.default.mkdirSync(componentsDir, { recursive: true });
|
|
2368
2349
|
}
|
|
2369
2350
|
const destFile = import_path24.default.join(componentsDir, "EmailVerification.tsx");
|
|
2370
|
-
if (
|
|
2371
|
-
|
|
2351
|
+
if (import_fs24.default.existsSync(templatePath) && !import_fs24.default.existsSync(destFile)) {
|
|
2352
|
+
import_fs24.default.copyFileSync(templatePath, destFile);
|
|
2372
2353
|
}
|
|
2373
2354
|
console.log(import_chalk21.default.green("Email verification successfully configured"));
|
|
2374
2355
|
} catch (error) {
|
|
@@ -2382,8 +2363,8 @@ var verification = async () => {
|
|
|
2382
2363
|
const projectDir = process.cwd();
|
|
2383
2364
|
const packageJsonPath = import_path25.default.join(projectDir, "package.json");
|
|
2384
2365
|
let framework = "tanstack state";
|
|
2385
|
-
if (
|
|
2386
|
-
const packageJson2 = JSON.parse(
|
|
2366
|
+
if (import_fs25.default.existsSync(packageJsonPath)) {
|
|
2367
|
+
const packageJson2 = JSON.parse(import_fs25.default.readFileSync(packageJsonPath, "utf-8"));
|
|
2387
2368
|
const hasNext = packageJson2?.dependencies?.["next"] || packageJson2?.devDependencies?.["next"];
|
|
2388
2369
|
framework = hasNext ? "Next js" : "tanstack state";
|
|
2389
2370
|
}
|
|
@@ -2399,19 +2380,15 @@ var verification = async () => {
|
|
|
2399
2380
|
};
|
|
2400
2381
|
|
|
2401
2382
|
// index.ts
|
|
2402
|
-
var packageJson = JSON.parse((0,
|
|
2383
|
+
var packageJson = JSON.parse((0, import_fs26.readFileSync)("./package.json", "utf8"));
|
|
2403
2384
|
var program = new import_commander.Command();
|
|
2404
2385
|
program.name("authverse").description("CLI tool for creating authverse projects").version(
|
|
2405
2386
|
packageJson.version || "1.0.0",
|
|
2406
2387
|
"-v, --version",
|
|
2407
2388
|
"display the version number"
|
|
2408
2389
|
);
|
|
2409
|
-
program.command("init").description("Select project template and configuration").action(() => {
|
|
2410
|
-
|
|
2411
|
-
console.log(import_chalk23.default.red("Only Next.js projects are supported."));
|
|
2412
|
-
process.exit(1);
|
|
2413
|
-
}
|
|
2414
|
-
initAnswer();
|
|
2390
|
+
program.command("init").description("Select project template and configuration").action(async () => {
|
|
2391
|
+
await initAnswer();
|
|
2415
2392
|
});
|
|
2416
2393
|
program.command("add <provider>").description("Add a new authentication provider").action((provider) => providers({ provider }));
|
|
2417
2394
|
program.command("forget").description("Forget stored configurations").action(forget);
|
package/dist/index.js
CHANGED
|
@@ -907,7 +907,7 @@ var initAnswer = async () => {
|
|
|
907
907
|
};
|
|
908
908
|
|
|
909
909
|
// index.ts
|
|
910
|
-
import { readFileSync
|
|
910
|
+
import { readFileSync } from "fs";
|
|
911
911
|
|
|
912
912
|
// cli/provider.ts
|
|
913
913
|
import chalk11 from "chalk";
|
|
@@ -2123,25 +2123,6 @@ var forget = () => {
|
|
|
2123
2123
|
}
|
|
2124
2124
|
};
|
|
2125
2125
|
|
|
2126
|
-
// script/detect-nextjs.ts
|
|
2127
|
-
import { existsSync, readFileSync } from "fs";
|
|
2128
|
-
function isNextJsProject() {
|
|
2129
|
-
if (!existsSync("./package.json")) return false;
|
|
2130
|
-
try {
|
|
2131
|
-
const pkg = JSON.parse(readFileSync("./package.json", "utf8"));
|
|
2132
|
-
const deps = {
|
|
2133
|
-
...pkg.dependencies,
|
|
2134
|
-
...pkg.devDependencies
|
|
2135
|
-
};
|
|
2136
|
-
return deps["next"] !== void 0;
|
|
2137
|
-
} catch (err) {
|
|
2138
|
-
return false;
|
|
2139
|
-
}
|
|
2140
|
-
}
|
|
2141
|
-
|
|
2142
|
-
// index.ts
|
|
2143
|
-
import chalk23 from "chalk";
|
|
2144
|
-
|
|
2145
2126
|
// cli/verification.ts
|
|
2146
2127
|
import chalk22 from "chalk";
|
|
2147
2128
|
import fs25 from "fs";
|
|
@@ -2357,19 +2338,15 @@ var verification = async () => {
|
|
|
2357
2338
|
};
|
|
2358
2339
|
|
|
2359
2340
|
// index.ts
|
|
2360
|
-
var packageJson = JSON.parse(
|
|
2341
|
+
var packageJson = JSON.parse(readFileSync("./package.json", "utf8"));
|
|
2361
2342
|
var program = new Command();
|
|
2362
2343
|
program.name("authverse").description("CLI tool for creating authverse projects").version(
|
|
2363
2344
|
packageJson.version || "1.0.0",
|
|
2364
2345
|
"-v, --version",
|
|
2365
2346
|
"display the version number"
|
|
2366
2347
|
);
|
|
2367
|
-
program.command("init").description("Select project template and configuration").action(() => {
|
|
2368
|
-
|
|
2369
|
-
console.log(chalk23.red("Only Next.js projects are supported."));
|
|
2370
|
-
process.exit(1);
|
|
2371
|
-
}
|
|
2372
|
-
initAnswer();
|
|
2348
|
+
program.command("init").description("Select project template and configuration").action(async () => {
|
|
2349
|
+
await initAnswer();
|
|
2373
2350
|
});
|
|
2374
2351
|
program.command("add <provider>").description("Add a new authentication provider").action((provider) => providers({ provider }));
|
|
2375
2352
|
program.command("forget").description("Forget stored configurations").action(forget);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "authverse",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "Authverse Fast modern CLI to generate full auth systems with OAuth Prisma Drizzle better auth and ready-to-use ShadCN UI screens",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "git+https://github.com/abdirahmanmahamoud/authverse.git",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"chalk": "^5.6.2",
|
|
49
49
|
"commander": "^14.0.2",
|
|
50
|
-
"inquirer": "^
|
|
50
|
+
"inquirer": "^12.10.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@semantic-release/changelog": "^6.0.3",
|