mulguard 1.2.2 → 1.2.4
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 +51 -0
- package/cli.d.ts +8 -0
- package/cli.d.ts.map +1 -0
- package/cli.js +26 -0
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -18,4 +18,55 @@
|
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
### From npm (Recommended)
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install mulguard
|
|
27
|
+
# or
|
|
28
|
+
pnpm add mulguard
|
|
29
|
+
# or
|
|
30
|
+
yarn add mulguard
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### From Source (Development)
|
|
34
|
+
|
|
35
|
+
If you're installing from the source code (monorepo), you need to use **pnpm** because the package uses `workspace:*` protocol:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Install pnpm if you don't have it
|
|
39
|
+
npm install -g pnpm
|
|
40
|
+
|
|
41
|
+
# From the monorepo root
|
|
42
|
+
pnpm install
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If you encounter the error `Unsupported URL Type "workspace:"` when using npm:
|
|
46
|
+
|
|
47
|
+
1. **Use pnpm instead** (recommended):
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pnpm install
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
2. **Or fix the workspace protocol manually**:
|
|
54
|
+
```bash
|
|
55
|
+
# From packages/mulguard directory
|
|
56
|
+
node scripts/fix-workspace.js
|
|
57
|
+
npm install
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Troubleshooting
|
|
61
|
+
|
|
62
|
+
**Error: `Unsupported URL Type "workspace:"`**
|
|
63
|
+
|
|
64
|
+
This error occurs when trying to install from source code using npm instead of pnpm. Solutions:
|
|
65
|
+
|
|
66
|
+
- **Option 1**: Use pnpm (recommended for monorepo development)
|
|
67
|
+
- **Option 2**: Install from npm registry (if the package is published)
|
|
68
|
+
- **Option 3**: Run the fix script: `node packages/mulguard/scripts/fix-workspace.js`
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
21
72
|
Check out the documentation at [mulverse.com](https://mulverse.com) or visit the [Mulverse Network](https://mulverse.com) for more information.
|
package/cli.d.ts
ADDED
package/cli.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["src/cli.ts"],"names":[],"mappings":";AACA;;;;GAIG"}
|
package/cli.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* MulGuard CLI
|
|
4
|
+
*
|
|
5
|
+
* Generates a cryptographically secure random secret for use with MulGuard
|
|
6
|
+
*/
|
|
7
|
+
import { randomBytes } from "node:crypto";
|
|
8
|
+
const command = process.argv[2];
|
|
9
|
+
if (command === "secret") {
|
|
10
|
+
// Generate a 32-byte random secret and encode it as base64
|
|
11
|
+
const secret = randomBytes(32).toString("base64");
|
|
12
|
+
console.log(secret);
|
|
13
|
+
process.exit(0);
|
|
14
|
+
}
|
|
15
|
+
else if (!command) {
|
|
16
|
+
console.error("Usage: mulguard <command>");
|
|
17
|
+
console.error("\nCommands:");
|
|
18
|
+
console.error(" secret Generate a cryptographically secure random secret");
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
console.error(`Unknown command: ${command}`);
|
|
23
|
+
console.error("\nAvailable commands:");
|
|
24
|
+
console.error(" secret Generate a cryptographically secure random secret");
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export type { NextAuthConfig, NextAuthRequest, NextAuthMiddleware };
|
|
|
81
81
|
export { AuthError, CredentialsSignin } from "@mulverse/mulguard-core/errors";
|
|
82
82
|
export { customFetch };
|
|
83
83
|
export type { Session, Account, Profile, DefaultSession, User, } from "@mulverse/mulguard-core/types";
|
|
84
|
-
export type { ServerActionsAdapter } from "@mulverse/mulguard-core/adapters";
|
|
84
|
+
export type { ServerActionsAdapter, AdapterAccount, AdapterUser, AdapterSession, VerificationToken, AdapterAuthenticator, } from "@mulverse/mulguard-core/adapters";
|
|
85
85
|
type AppRouteHandlers = Record<"GET" | "POST", (req: NextRequest) => Promise<Response>>;
|
|
86
86
|
/**
|
|
87
87
|
* The result of invoking {@link MulGuard|MulGuard}, initialized with the {@link MulGuardConfig}.
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmEG;AAEH,OAAO,EAAQ,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAK3D,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EACV,yBAAyB,EACzB,cAAc,EACd,eAAe,EAChB,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EACV,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC9D,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,kBAAkB,EACnB,MAAM,gBAAgB,CAAA;AAEvB,KAAK,cAAc,GAAG,cAAc,CAAA;AACpC,KAAK,eAAe,GAAG,eAAe,CAAA;AACtC,KAAK,kBAAkB,GAAG,kBAAkB,CAAA;AAE5C,YAAY,EAAE,cAAc,EAAE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.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mulguard",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "Authentication for Next.js with Backend-First Architecture",
|
|
5
5
|
"homepage": "https://mulverse.com/packages/mulguard",
|
|
6
6
|
"repository": "https://github.com/mulverse/mulverse.git",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"access": "public"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@mulverse/mulguard-core": "^1.0.
|
|
80
|
+
"@mulverse/mulguard-core": "^1.0.5"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
83
|
"@simplewebauthn/browser": "^9.0.1",
|
|
@@ -112,6 +112,7 @@
|
|
|
112
112
|
"test": "vitest run -c ../utils/vitest.config.ts",
|
|
113
113
|
"test:watch": "vitest -c ../utils/vitest.config.ts",
|
|
114
114
|
"test:e2e": "playwright test",
|
|
115
|
-
"providers": "node ../utils/scripts/providers"
|
|
115
|
+
"providers": "node ../utils/scripts/providers",
|
|
116
|
+
"preinstall": "node scripts/preinstall.js"
|
|
116
117
|
}
|
|
117
118
|
}
|