@keycardai/mcp 0.1.0 → 0.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/LICENSE +21 -0
- package/README.md +169 -0
- package/dist/cjs/server/auth/router.d.ts +8 -3
- package/dist/cjs/server/auth/router.d.ts.map +1 -1
- package/dist/cjs/server/auth/router.js.map +1 -1
- package/dist/esm/server/auth/router.d.ts +8 -3
- package/dist/esm/server/auth/router.d.ts.map +1 -1
- package/dist/esm/server/auth/router.js.map +1 -1
- package/package.json +20 -13
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Keycard
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# @keycardai/mcp
|
|
2
|
+
|
|
3
|
+
MCP-specific OAuth integration for Keycard — Express middleware for bearer token verification, OAuth metadata serving, delegated access via token exchange, and MCP client providers.
|
|
4
|
+
|
|
5
|
+
Builds on [`@keycardai/oauth`](../oauth/) (included as a dependency). Part of the [Keycard TypeScript SDK](../../README.md).
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @keycardai/mcp
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This includes `@keycardai/oauth` automatically.
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
### Protect an MCP Server with Bearer Auth
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import express from "express";
|
|
21
|
+
import { requireBearerAuth } from "@keycardai/mcp/server/auth/middleware/bearerAuth";
|
|
22
|
+
import { mcpAuthMetadataRouter } from "@keycardai/mcp/server/auth/router";
|
|
23
|
+
|
|
24
|
+
const app = express();
|
|
25
|
+
|
|
26
|
+
// Mount OAuth metadata endpoints (.well-known)
|
|
27
|
+
app.use(
|
|
28
|
+
mcpAuthMetadataRouter({
|
|
29
|
+
oauthMetadata: { issuer: "https://your-zone.keycard.cloud" },
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
// Protect routes with bearer token verification
|
|
34
|
+
app.use("/api", requireBearerAuth({ requiredScopes: ["read"] }));
|
|
35
|
+
|
|
36
|
+
app.get("/api/data", (req, res) => {
|
|
37
|
+
res.json({ message: "Authenticated!" });
|
|
38
|
+
});
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Delegated Access (Token Exchange)
|
|
42
|
+
|
|
43
|
+
Exchange a user's bearer token for resource-specific tokens to call external APIs on their behalf:
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
import express from "express";
|
|
47
|
+
import { AuthProvider } from "@keycardai/mcp/server/auth/provider";
|
|
48
|
+
import { ClientSecret } from "@keycardai/mcp/server/auth/credentials";
|
|
49
|
+
import { requireBearerAuth } from "@keycardai/mcp/server/auth/middleware/bearerAuth";
|
|
50
|
+
import type { DelegatedRequest } from "@keycardai/mcp/server/auth/provider";
|
|
51
|
+
|
|
52
|
+
const authProvider = new AuthProvider({
|
|
53
|
+
zoneUrl: "https://your-zone.keycard.cloud",
|
|
54
|
+
applicationCredential: new ClientSecret("your-client-id", "your-client-secret"),
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const app = express();
|
|
58
|
+
app.use(requireBearerAuth());
|
|
59
|
+
|
|
60
|
+
app.get(
|
|
61
|
+
"/api/github-user",
|
|
62
|
+
authProvider.grant("https://api.github.com"),
|
|
63
|
+
async (req, res) => {
|
|
64
|
+
const { accessContext } = req as DelegatedRequest;
|
|
65
|
+
|
|
66
|
+
if (accessContext.hasErrors()) {
|
|
67
|
+
return res.status(502).json(accessContext.getErrors());
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const token = accessContext.access("https://api.github.com").accessToken;
|
|
71
|
+
const response = await fetch("https://api.github.com/user", {
|
|
72
|
+
headers: { Authorization: `Bearer ${token}` },
|
|
73
|
+
});
|
|
74
|
+
res.json(await response.json());
|
|
75
|
+
},
|
|
76
|
+
);
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### MCP Client Provider
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
import { BaseOAuthClientProvider } from "@keycardai/mcp/client/auth/providers/base";
|
|
83
|
+
|
|
84
|
+
class MyOAuthProvider extends BaseOAuthClientProvider {
|
|
85
|
+
constructor() {
|
|
86
|
+
super(
|
|
87
|
+
{
|
|
88
|
+
redirect_uris: [new URL("http://localhost:3000/callback")],
|
|
89
|
+
client_name: "My MCP Client",
|
|
90
|
+
},
|
|
91
|
+
"your-client-id",
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
redirectToAuthorization(authorizationUrl: URL) {
|
|
96
|
+
// Redirect user to authorization URL
|
|
97
|
+
window.location.href = authorizationUrl.toString();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## API Overview
|
|
103
|
+
|
|
104
|
+
### Server Auth Middleware
|
|
105
|
+
|
|
106
|
+
| Export | Import Path | Description |
|
|
107
|
+
|---|---|---|
|
|
108
|
+
| `requireBearerAuth` | `@keycardai/mcp/server/auth/middleware/bearerAuth` | Express middleware — verifies JWT bearer tokens, checks scopes, validates resource claims |
|
|
109
|
+
| `mcpAuthMetadataRouter` | `@keycardai/mcp/server/auth/router` | Express router for `.well-known/oauth-protected-resource` and `.well-known/oauth-authorization-server` |
|
|
110
|
+
| `JWTOAuthTokenVerifier` | `@keycardai/mcp/server/auth/verifiers/jwt` | Token verifier implementing the MCP SDK's `OAuthTokenVerifier` interface |
|
|
111
|
+
|
|
112
|
+
### Delegated Access
|
|
113
|
+
|
|
114
|
+
| Export | Import Path | Description |
|
|
115
|
+
|---|---|---|
|
|
116
|
+
| `AuthProvider` | `@keycardai/mcp/server/auth/provider` | Coordinates token exchange — use `.grant()` as Express middleware or `.exchangeTokens()` standalone |
|
|
117
|
+
| `AccessContext` | `@keycardai/mcp/server/auth/provider` | Result of a grant — contains tokens or errors per resource. Non-throwing by design |
|
|
118
|
+
| `DelegatedRequest` (type) | `@keycardai/mcp/server/auth/provider` | Express `Request` extended with `auth` and `accessContext` |
|
|
119
|
+
|
|
120
|
+
### Application Credentials
|
|
121
|
+
|
|
122
|
+
| Export | Import Path | Description |
|
|
123
|
+
|---|---|---|
|
|
124
|
+
| `ClientSecret` | `@keycardai/mcp/server/auth/credentials` | Client ID + secret authentication |
|
|
125
|
+
| `WebIdentity` | `@keycardai/mcp/server/auth/credentials` | Private key JWT authentication (RFC 7523) with file-based key storage |
|
|
126
|
+
| `EKSWorkloadIdentity` | `@keycardai/mcp/server/auth/credentials` | AWS EKS pod identity token authentication |
|
|
127
|
+
| `ApplicationCredential` (type) | `@keycardai/mcp/server/auth/credentials` | Interface for custom credential implementations |
|
|
128
|
+
|
|
129
|
+
### Client Auth
|
|
130
|
+
|
|
131
|
+
| Export | Import Path | Description |
|
|
132
|
+
|---|---|---|
|
|
133
|
+
| `BaseOAuthClientProvider` | `@keycardai/mcp/client/auth/providers/base` | Abstract base class implementing the MCP SDK's `OAuthClientProvider` interface |
|
|
134
|
+
| `JSONWebTokenSigner` | `@keycardai/mcp/client/auth/signers/jwt` | Signs authentication headers with JWT for client-side auth |
|
|
135
|
+
|
|
136
|
+
### Errors
|
|
137
|
+
|
|
138
|
+
| Export | Import Path | Description |
|
|
139
|
+
|---|---|---|
|
|
140
|
+
| `ResourceAccessError` | `@keycardai/mcp/server/auth/errors` | Token exchange failure for a specific resource |
|
|
141
|
+
| `AuthProviderConfigurationError` | `@keycardai/mcp/server/auth/errors` | Missing zone configuration |
|
|
142
|
+
| `EKSWorkloadIdentityConfigurationError` | `@keycardai/mcp/server/auth/errors` | EKS token file not found |
|
|
143
|
+
|
|
144
|
+
## AccessContext Error Handling
|
|
145
|
+
|
|
146
|
+
`AccessContext` never throws during token exchange. Errors are captured and queryable:
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
const { accessContext } = req as DelegatedRequest;
|
|
150
|
+
|
|
151
|
+
const status = accessContext.getStatus(); // "success" | "partial_error" | "error"
|
|
152
|
+
|
|
153
|
+
if (accessContext.hasError()) {
|
|
154
|
+
console.error(accessContext.getError()); // Global error (e.g., missing auth token)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (accessContext.hasResourceError("https://api.github.com")) {
|
|
158
|
+
console.error(accessContext.getResourceErrors("https://api.github.com"));
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
console.log("OK:", accessContext.getSuccessfulResources());
|
|
162
|
+
console.log("Failed:", accessContext.getFailedResources());
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Related Packages
|
|
166
|
+
|
|
167
|
+
- [`@keycardai/oauth`](../oauth/) — Pure OAuth 2.0 primitives (JWT, JWKS, discovery) without Express or MCP dependencies
|
|
168
|
+
- [`@keycardai/sdk`](../sdk/) — Aggregate package re-exporting from both oauth and mcp
|
|
169
|
+
- [Keycard TypeScript SDK](../../README.md) — Root documentation with full quick start and delegated access guide
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import express from "express";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export type InferredAuthMetadataOptions = {
|
|
3
|
+
oauthMetadata: {
|
|
4
|
+
issuer: string;
|
|
5
|
+
};
|
|
6
|
+
serviceDocumentationUrl?: URL;
|
|
7
|
+
scopesSupported?: string[];
|
|
8
|
+
resourceName?: string;
|
|
9
|
+
};
|
|
5
10
|
export declare function mcpAuthMetadataRouter(options: InferredAuthMetadataOptions): express.Router;
|
|
6
11
|
export declare function getOAuthProtectedResourceMetadataUrl(resourceUrl: URL): string;
|
|
7
12
|
//# sourceMappingURL=router.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,MAAM,MAAM,2BAA2B,GAAG;IACxC,aAAa,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC,uBAAuB,CAAC,EAAE,GAAG,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAGF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAmB1F;AAED,wBAAgB,oCAAoC,CAAC,WAAW,EAAE,GAAG,GAAG,MAAM,CAS7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":";;;;;AAYA,sDAmBC;AAED,oFASC;AA1CD,sDAA8B;AAE9B,wDAA8G;AAU9G,SAAgB,qBAAqB,CAAC,OAAoC;IACxE,MAAM,MAAM,GAAG,iBAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,MAAM,yBAAyB,GAA2C;QACxE,qBAAqB,EAAE;YACrB,OAAO,CAAC,aAAa,CAAC,MAAM;SAC7B;QAED,gBAAgB,EAAE,OAAO,CAAC,eAAe;QACzC,aAAa,EAAE,OAAO,CAAC,YAAY;QACnC,sBAAsB,EAAE,OAAO,CAAC,uBAAuB,EAAE,IAAI;KAC9D,CAAC;IAEF,MAAM,CAAC,GAAG,CAAC,uCAAuC,EAAE,IAAA,8CAAgC,EAAC,yBAAyB,CAAC,CAAC,CAAC;IAEjH,8CAA8C;IAC9C,MAAM,CAAC,GAAG,CAAC,yCAAyC,EAAE,IAAA,gDAAkC,EAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IAExH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,oCAAoC,CAAC,WAAgB;IACnE,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IAC1C,IAAI,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC;IACjC,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;QACnB,IAAI,GAAG,EAAE,CAAC;IACX,CAAC;IAEA,YAAY,CAAC,QAAQ,GAAG,wCAAwC,IAAI,EAAE,CAAA;IACtE,OAAO,YAAY,CAAC,QAAQ,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import express from "express";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export type InferredAuthMetadataOptions = {
|
|
3
|
+
oauthMetadata: {
|
|
4
|
+
issuer: string;
|
|
5
|
+
};
|
|
6
|
+
serviceDocumentationUrl?: URL;
|
|
7
|
+
scopesSupported?: string[];
|
|
8
|
+
resourceName?: string;
|
|
9
|
+
};
|
|
5
10
|
export declare function mcpAuthMetadataRouter(options: InferredAuthMetadataOptions): express.Router;
|
|
6
11
|
export declare function getOAuthProtectedResourceMetadataUrl(resourceUrl: URL): string;
|
|
7
12
|
//# sourceMappingURL=router.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,MAAM,MAAM,2BAA2B,GAAG;IACxC,aAAa,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC,uBAAuB,CAAC,EAAE,GAAG,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAGF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAmB1F;AAED,wBAAgB,oCAAoC,CAAC,WAAW,EAAE,GAAG,GAAG,MAAM,CAS7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"router.js","sourceRoot":"","sources":["../../../../src/server/auth/router.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,OAAO,EAAE,gCAAgC,EAAE,kCAAkC,EAAE,MAAM,wBAAwB,CAAC;AAU9G,MAAM,UAAU,qBAAqB,CAAC,OAAoC;IACxE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAEhC,MAAM,yBAAyB,GAA2C;QACxE,qBAAqB,EAAE;YACrB,OAAO,CAAC,aAAa,CAAC,MAAM;SAC7B;QAED,gBAAgB,EAAE,OAAO,CAAC,eAAe;QACzC,aAAa,EAAE,OAAO,CAAC,YAAY;QACnC,sBAAsB,EAAE,OAAO,CAAC,uBAAuB,EAAE,IAAI;KAC9D,CAAC;IAEF,MAAM,CAAC,GAAG,CAAC,uCAAuC,EAAE,gCAAgC,CAAC,yBAAyB,CAAC,CAAC,CAAC;IAEjH,8CAA8C;IAC9C,MAAM,CAAC,GAAG,CAAC,yCAAyC,EAAE,kCAAkC,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IAExH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,oCAAoC,CAAC,WAAgB;IACnE,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC;IAC1C,IAAI,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC;IACjC,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;QACnB,IAAI,GAAG,EAAE,CAAC;IACX,CAAC;IAEA,YAAY,CAAC,QAAQ,GAAG,wCAAwC,IAAI,EAAE,CAAA;IACtE,OAAO,YAAY,CAAC,QAAQ,EAAE,CAAC;AACjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keycardai/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "High-security OAuth implementation for Model Context Protocol",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/keycardai/typescript-sdk.git",
|
|
9
|
+
"directory": "packages/mcp"
|
|
10
|
+
},
|
|
6
11
|
"type": "module",
|
|
7
12
|
"exports": {
|
|
8
13
|
"./client/auth/providers/base": {
|
|
@@ -61,23 +66,17 @@
|
|
|
61
66
|
],
|
|
62
67
|
"typesVersions": {
|
|
63
68
|
"*": {
|
|
64
|
-
"*": [
|
|
69
|
+
"*": [
|
|
70
|
+
"./dist/esm/*"
|
|
71
|
+
]
|
|
65
72
|
}
|
|
66
73
|
},
|
|
67
|
-
"scripts": {
|
|
68
|
-
"build": "pnpm run build:esm && pnpm run build:cjs",
|
|
69
|
-
"build:esm": "tsc -p tsconfig.prod.json && echo '{\"type\": \"module\"}' > dist/esm/package.json",
|
|
70
|
-
"build:cjs": "tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json",
|
|
71
|
-
"test": "NODE_OPTIONS='--experimental-vm-modules' jest",
|
|
72
|
-
"typecheck": "tsc --noEmit",
|
|
73
|
-
"clean": "rm -rf dist"
|
|
74
|
-
},
|
|
75
74
|
"dependencies": {
|
|
76
|
-
"@keycardai/oauth": "workspace:*",
|
|
77
75
|
"@modelcontextprotocol/sdk": "^1.15.0",
|
|
78
76
|
"cors": "^2.8.5",
|
|
79
77
|
"express": "^5.1.0",
|
|
80
|
-
"zod": "^3.25.74"
|
|
78
|
+
"zod": "^3.25.74",
|
|
79
|
+
"@keycardai/oauth": "0.1.1"
|
|
81
80
|
},
|
|
82
81
|
"devDependencies": {
|
|
83
82
|
"@jest/globals": "^30.0.4",
|
|
@@ -87,5 +86,13 @@
|
|
|
87
86
|
"supertest": "^7.1.1",
|
|
88
87
|
"ts-jest": "^29.4.0",
|
|
89
88
|
"typescript": "^5.8.3"
|
|
89
|
+
},
|
|
90
|
+
"scripts": {
|
|
91
|
+
"build": "pnpm run build:esm && pnpm run build:cjs",
|
|
92
|
+
"build:esm": "tsc -p tsconfig.prod.json && echo '{\"type\": \"module\"}' > dist/esm/package.json",
|
|
93
|
+
"build:cjs": "tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > dist/cjs/package.json",
|
|
94
|
+
"test": "NODE_OPTIONS='--experimental-vm-modules' jest",
|
|
95
|
+
"typecheck": "tsc --noEmit",
|
|
96
|
+
"clean": "rm -rf dist"
|
|
90
97
|
}
|
|
91
|
-
}
|
|
98
|
+
}
|