auth 1.1.0 → 1.1.1
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/README.md +1 -1
- package/lib/detect.js +10 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -132,7 +132,7 @@ We have an [OpenCollective](https://opencollective.com/nextauth) for companies a
|
|
|
132
132
|
<sub>💵</sub>
|
|
133
133
|
</td>
|
|
134
134
|
<td align="center" valign="top">
|
|
135
|
-
<a href="https://arcjet.com
|
|
135
|
+
<a href="https://arcjet.com/?ref=auth.js" target="_blank">
|
|
136
136
|
<img width="108" src="https://avatars.githubusercontent.com/u/24397786?s=200&v=4" alt="Arcjet Logo" />
|
|
137
137
|
</a><br />
|
|
138
138
|
<div>Arcjet</div>
|
package/lib/detect.js
CHANGED
|
@@ -19,9 +19,9 @@ export async function detectFramework(path = "") {
|
|
|
19
19
|
/** @type {import("./meta").SupportedFramework[]} */
|
|
20
20
|
const foundFrameworks = []
|
|
21
21
|
|
|
22
|
-
if (packageJson
|
|
23
|
-
if (packageJson
|
|
24
|
-
if (packageJson
|
|
22
|
+
if (packageJson?.dependencies?.["next"]) foundFrameworks.push("next")
|
|
23
|
+
if (packageJson?.dependencies?.["express"]) foundFrameworks.push("express")
|
|
24
|
+
if (packageJson?.devDependencies?.["@sveltejs/kit"])
|
|
25
25
|
foundFrameworks.push("sveltekit")
|
|
26
26
|
|
|
27
27
|
if (foundFrameworks.length === 1) return foundFrameworks[0]
|
|
@@ -33,7 +33,8 @@ export async function detectFramework(path = "") {
|
|
|
33
33
|
return "unknown"
|
|
34
34
|
}
|
|
35
35
|
return "unknown"
|
|
36
|
-
} catch {
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.error(error)
|
|
37
38
|
return "unknown"
|
|
38
39
|
}
|
|
39
40
|
}
|
|
@@ -43,9 +44,11 @@ export async function requireFramework(path = "") {
|
|
|
43
44
|
|
|
44
45
|
if (framework === "unknown") {
|
|
45
46
|
console.error(
|
|
46
|
-
y.red(
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
y.red(
|
|
48
|
+
`No framework detected. Currently supported frameworks are: ${y.bold(
|
|
49
|
+
Object.keys(frameworks).join(", ")
|
|
50
|
+
)}`
|
|
51
|
+
)
|
|
49
52
|
)
|
|
50
53
|
|
|
51
54
|
process.exit(0)
|
|
@@ -53,4 +56,3 @@ export async function requireFramework(path = "") {
|
|
|
53
56
|
|
|
54
57
|
return framework
|
|
55
58
|
}
|
|
56
|
-
|