@jaypie/mcp 0.1.10 → 0.2.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.
Files changed (41) hide show
  1. package/dist/datadog.d.ts +212 -0
  2. package/dist/index.js +1461 -6
  3. package/dist/index.js.map +1 -1
  4. package/package.json +9 -5
  5. package/prompts/Development_Process.md +57 -35
  6. package/prompts/Jaypie_CDK_Constructs_and_Patterns.md +143 -19
  7. package/prompts/Jaypie_Express_Package.md +35 -15
  8. package/prompts/Jaypie_Init_Express_on_Lambda.md +66 -38
  9. package/prompts/Jaypie_Init_Lambda_Package.md +202 -83
  10. package/prompts/Jaypie_Init_Project_Subpackage.md +21 -26
  11. package/prompts/Jaypie_Legacy_Patterns.md +4 -0
  12. package/prompts/Jaypie_Repokit.md +103 -0
  13. package/prompts/Templates_CDK_Subpackage.md +113 -0
  14. package/prompts/Templates_Express_Subpackage.md +183 -0
  15. package/prompts/Templates_Project_Monorepo.md +326 -0
  16. package/prompts/Templates_Project_Subpackage.md +93 -0
  17. package/prompts/Jaypie_Mongoose_Models_Package.md +0 -231
  18. package/prompts/Jaypie_Mongoose_with_Express_CRUD.md +0 -1000
  19. package/prompts/templates/cdk-subpackage/bin/cdk.ts +0 -11
  20. package/prompts/templates/cdk-subpackage/cdk.json +0 -19
  21. package/prompts/templates/cdk-subpackage/lib/cdk-app.ts +0 -41
  22. package/prompts/templates/cdk-subpackage/lib/cdk-infrastructure.ts +0 -15
  23. package/prompts/templates/express-subpackage/index.ts +0 -8
  24. package/prompts/templates/express-subpackage/src/app.ts +0 -18
  25. package/prompts/templates/express-subpackage/src/handler.config.ts +0 -44
  26. package/prompts/templates/express-subpackage/src/routes/resource/__tests__/resourceGet.route.spec.ts +0 -29
  27. package/prompts/templates/express-subpackage/src/routes/resource/resourceGet.route.ts +0 -22
  28. package/prompts/templates/express-subpackage/src/routes/resource.router.ts +0 -11
  29. package/prompts/templates/express-subpackage/src/types/express.ts +0 -9
  30. package/prompts/templates/project-monorepo/.vscode/settings.json +0 -72
  31. package/prompts/templates/project-monorepo/eslint.config.mjs +0 -1
  32. package/prompts/templates/project-monorepo/gitignore +0 -11
  33. package/prompts/templates/project-monorepo/package.json +0 -20
  34. package/prompts/templates/project-monorepo/tsconfig.base.json +0 -18
  35. package/prompts/templates/project-monorepo/tsconfig.json +0 -6
  36. package/prompts/templates/project-monorepo/vitest.workspace.js +0 -3
  37. package/prompts/templates/project-subpackage/package.json +0 -16
  38. package/prompts/templates/project-subpackage/tsconfig.json +0 -11
  39. package/prompts/templates/project-subpackage/vite.config.ts +0 -21
  40. package/prompts/templates/project-subpackage/vitest.config.ts +0 -7
  41. package/prompts/templates/project-subpackage/vitest.setup.ts +0 -6
@@ -0,0 +1,113 @@
1
+ ---
2
+ description: Template files for creating a CDK subpackage in a Jaypie monorepo
3
+ ---
4
+
5
+ # CDK Subpackage Templates
6
+
7
+ Templates for creating a CDK (AWS Cloud Development Kit) subpackage in a Jaypie monorepo.
8
+
9
+ ## bin/cdk.ts
10
+
11
+ ```typescript
12
+ #!/usr/bin/env node
13
+
14
+ import cdk from "aws-cdk-lib";
15
+ import { AppStack } from "../lib/cdk-app.ts";
16
+ import { InfrastructureStack } from "../lib/cdk-infrastructure.ts";
17
+
18
+ const app = new cdk.App();
19
+
20
+ new InfrastructureStack(app, "InfrastructureStack");
21
+
22
+ new AppStack(app, "AppStack");
23
+ ```
24
+
25
+ ## lib/cdk-app.ts
26
+
27
+ ```typescript
28
+ import {
29
+ JaypieAppStack,
30
+ JaypieApiGateway,
31
+ JaypieExpressLambda,
32
+ JaypieMongoDbSecret,
33
+ JaypieLambda,
34
+ } from "@jaypie/constructs";
35
+
36
+ import * as cdk from "aws-cdk-lib";
37
+ import { Construct } from "constructs";
38
+ import * as lambda from "aws-cdk-lib/aws-lambda";
39
+
40
+ export class AppStack extends JaypieAppStack {
41
+ constructor(scope: Construct, id: string, props?: cdk.StackProps) {
42
+ super(scope, id, props);
43
+
44
+ const mongoConnectionString = new JaypieMongoDbSecret(this);
45
+
46
+ const expressLambda = new JaypieExpressLambda(this, "expressLambda", {
47
+ code: lambda.Code.fromAsset("../express"),
48
+ handler: "dist/index.expressLambda",
49
+ secrets: [mongoConnectionString],
50
+ });
51
+
52
+ new JaypieApiGateway(this, "apiGateway", {
53
+ handler: expressLambda,
54
+ host: "api.example.com",
55
+ zone: "example.com",
56
+ });
57
+
58
+ new JaypieLambda(
59
+ this,
60
+ "lambdaWorker",
61
+ {
62
+ code: lambda.Code.fromAsset("../lambda"),
63
+ handler: "dist/index.lambdaWorker",
64
+ secrets: [mongoConnectionString],
65
+ },
66
+ );
67
+ }
68
+ }
69
+ ```
70
+
71
+ ## lib/cdk-infrastructure.ts
72
+
73
+ ```typescript
74
+ import {
75
+ JaypieInfrastructureStack,
76
+ JaypieWebDeploymentBucket,
77
+ } from "@jaypie/constructs";
78
+
79
+ export class InfrastructureStack extends JaypieInfrastructureStack {
80
+ constructor(scope, id, props = {}) {
81
+ super(scope, id, props);
82
+
83
+ new JaypieWebDeploymentBucket(this, "DeploymentBucket", {
84
+ // * host is not needed if CDK_ENV_WEB_SUBDOMAIN and CDK_ENV_WEB_HOSTED_ZONE or CDK_ENV_HOSTED_ZONE
85
+ // * zone is not needed if CDK_ENV_WEB_HOSTED_ZONE or CDK_ENV_HOSTED_ZONE
86
+ });
87
+ }
88
+ }
89
+ ```
90
+
91
+ ## cdk.json
92
+
93
+ ```json
94
+ {
95
+ "app": "npx ts-node --prefer-ts-exts bin/cdk.ts",
96
+ "watch": {
97
+ "include": [
98
+ "**"
99
+ ],
100
+ "exclude": [
101
+ "README.md",
102
+ "cdk*.json",
103
+ "**/*.d.ts",
104
+ "**/*.js",
105
+ "tsconfig.json",
106
+ "package*.json",
107
+ "yarn.lock",
108
+ "node_modules",
109
+ "test"
110
+ ]
111
+ }
112
+ }
113
+ ```
@@ -0,0 +1,183 @@
1
+ ---
2
+ description: Template files for creating an Express on Lambda subpackage in a Jaypie monorepo
3
+ ---
4
+
5
+ # Express Subpackage Templates
6
+
7
+ Templates for creating an Express subpackage that runs on AWS Lambda in a Jaypie monorepo.
8
+
9
+ ## index.ts
10
+
11
+ ```typescript
12
+ import serverlessExpress from "@codegenie/serverless-express";
13
+ import app from "./src/app.js";
14
+
15
+ export default serverlessExpress({ app });
16
+
17
+ if (process.env.NODE_ENV === "development") {
18
+ app.listen(8080);
19
+ }
20
+ ```
21
+
22
+ ## src/app.ts
23
+
24
+ ```typescript
25
+ import { cors, echoRoute, EXPRESS, noContentRoute, notFoundRoute } from "jaypie";
26
+ import express from "express";
27
+ import resourceRouter from "./routes/resource.router.js";
28
+
29
+ const app = express();
30
+
31
+ // Built-in Jaypie routes
32
+ app.get(EXPRESS.PATH.ROOT, noContentRoute);
33
+ app.use("/_sy/echo", cors(), echoRoute);
34
+
35
+ // Application routes
36
+ app.use(/^\/resource$/, cors(), resourceRouter);
37
+ app.use("/resource/", cors(), resourceRouter);
38
+
39
+ // Catch-all
40
+ app.all(EXPRESS.PATH.ANY, notFoundRoute);
41
+
42
+ export default app;
43
+ ```
44
+
45
+ ## src/handler.config.ts
46
+
47
+ ```typescript
48
+ import { force } from "jaypie";
49
+
50
+ interface HandlerConfigOptions {
51
+ locals?: Record<string, any>;
52
+ setup?: Array<() => void | Promise<void>>;
53
+ teardown?: Array<() => void | Promise<void>>;
54
+ validate?: Array<() => boolean | Promise<boolean>>;
55
+ }
56
+
57
+ interface HandlerConfig {
58
+ name: string;
59
+ locals: Record<string, any>;
60
+ setup: Array<() => void | Promise<void>>;
61
+ teardown: Array<() => void | Promise<void>>;
62
+ validate: Array<() => boolean | Promise<boolean>>;
63
+ }
64
+
65
+ const handlerConfig = (
66
+ nameOrConfig: string | (HandlerConfig & { name: string }),
67
+ options: HandlerConfigOptions = {}
68
+ ): HandlerConfig => {
69
+ let name: string;
70
+ let locals: Record<string, any>;
71
+ let setup: Array<() => void | Promise<void>>;
72
+ let teardown: Array<() => void | Promise<void>>;
73
+ let validate: Array<() => boolean | Promise<boolean>>;
74
+
75
+ if (typeof nameOrConfig === "object") {
76
+ ({ name, locals = {}, setup = [], teardown = [], validate = [] } = nameOrConfig);
77
+ } else {
78
+ name = nameOrConfig;
79
+ ({ locals = {}, setup = [], teardown = [], validate = [] } = options);
80
+ }
81
+
82
+ return {
83
+ name,
84
+ locals: { ...force.object(locals) },
85
+ setup: [...force.array(setup)],
86
+ teardown: [...force.array(teardown)],
87
+ validate: [...force.array(validate)],
88
+ };
89
+ };
90
+
91
+ export default handlerConfig;
92
+ ```
93
+
94
+ ## src/routes/resource.router.ts
95
+
96
+ ```typescript
97
+ import express from "express";
98
+ import { EXPRESS } from "jaypie";
99
+ import resourceGetRoute from "./resource/resourceGet.route.js";
100
+
101
+ const router = express.Router();
102
+ router.use(express.json({ strict: false }));
103
+
104
+ // Single example route
105
+ router.get(EXPRESS.PATH.ROOT, resourceGetRoute);
106
+
107
+ export default router;
108
+ ```
109
+
110
+ ## src/routes/resource/resourceGet.route.ts
111
+
112
+ ```typescript
113
+ import { expressHandler } from "jaypie";
114
+ import type { Request } from "express";
115
+ import handlerConfig from "../../handler.config.js";
116
+
117
+ interface ResourceGetResponse {
118
+ message: string;
119
+ query: Record<string, any>;
120
+ timestamp: string;
121
+ }
122
+
123
+ export default expressHandler(
124
+ handlerConfig("resourceGet"),
125
+ async (req: Request): Promise<ResourceGetResponse> => {
126
+ const { query } = req;
127
+
128
+ return {
129
+ message: "Resource endpoint",
130
+ query,
131
+ timestamp: new Date().toISOString(),
132
+ };
133
+ }
134
+ );
135
+ ```
136
+
137
+ ## src/routes/resource/__tests__/resourceGet.route.spec.ts
138
+
139
+ ```typescript
140
+ import { describe, expect, it } from "vitest";
141
+ import resourceGet from "../resourceGet.route.js";
142
+
143
+ describe("Resource Get Route", () => {
144
+ it("returns resource data", async () => {
145
+ const mockRequest = {
146
+ query: { search: "test" },
147
+ locals: {},
148
+ } as any;
149
+
150
+ const response = await resourceGet(mockRequest);
151
+
152
+ expect(response.message).toBe("Resource endpoint");
153
+ expect(response.query).toEqual({ search: "test" });
154
+ expect(response.timestamp).toBeDefined();
155
+ });
156
+
157
+ it("handles empty query", async () => {
158
+ const mockRequest = {
159
+ query: {},
160
+ locals: {},
161
+ } as any;
162
+
163
+ const response = await resourceGet(mockRequest);
164
+
165
+ expect(response.message).toBe("Resource endpoint");
166
+ expect(response.query).toEqual({});
167
+ });
168
+ });
169
+ ```
170
+
171
+ ## src/types/express.ts
172
+
173
+ ```typescript
174
+ declare global {
175
+ namespace Express {
176
+ interface Request {
177
+ locals?: Record<string, any>;
178
+ }
179
+ }
180
+ }
181
+
182
+ export {};
183
+ ```
@@ -0,0 +1,326 @@
1
+ ---
2
+ description: Configuration examples for creating a monorepo using Jaypie conventions
3
+ ---
4
+
5
+ # Project Monorepo Configuration Examples
6
+
7
+ Configuration examples for creating a monorepo project following Jaypie conventions. These examples show the configuration files used in the Jaypie monorepo itself.
8
+
9
+ ## .gitignore
10
+
11
+ Example based on Jaypie monorepo:
12
+
13
+ ```
14
+ .jaypie
15
+
16
+ cdk.out
17
+
18
+ .DS_Store
19
+ node_modules
20
+ dist
21
+
22
+ # Generated repomix files
23
+ /prompts/context
24
+
25
+ # local env files
26
+ .aider*
27
+ .env
28
+ .env.local
29
+ .env.*.local
30
+
31
+ # Log files
32
+ npm-debug.log*
33
+ yarn-debug.log*
34
+ yarn-error.log*
35
+ pnpm-debug.log*
36
+
37
+ # Editor directories and files
38
+ .idea
39
+ *.suo
40
+ *.ntvs*
41
+ *.njsproj
42
+ *.sln
43
+ *.sw?
44
+
45
+ **/.claude/settings.local.json
46
+ *.tsbuildinfo
47
+ ```
48
+
49
+ ## .vscode/settings.json
50
+
51
+ Add project-specific words to spell checker. Example from Jaypie:
52
+
53
+ ```json
54
+ {
55
+ "cSpell.words": [
56
+ "autofix",
57
+ "datadoghq",
58
+ "esmodules",
59
+ "hygen",
60
+ "jaypie",
61
+ "repomix",
62
+ "rollup",
63
+ "supertest",
64
+ "testkit",
65
+ "vite",
66
+ "vitest"
67
+ ]
68
+ }
69
+ ```
70
+
71
+ ## eslint.config.mjs
72
+
73
+ ```javascript
74
+ export { default as default } from "@jaypie/eslint";
75
+ ```
76
+
77
+ ## package.json
78
+
79
+ Jaypie uses Lerna to run commands across all packages. Individual packages can be targeted using npm workspaces.
80
+
81
+ ```json
82
+ {
83
+ "name": "@project-org/project-name",
84
+ "version": "0.0.1",
85
+ "type": "module",
86
+ "private": true,
87
+ "workspaces": [
88
+ "packages/*"
89
+ ],
90
+ "scripts": {
91
+ "build": "lerna run build",
92
+ "clean": "rimraf ./packages/*/dist",
93
+ "format": "npm run format:package && npm run format:lint",
94
+ "format:lint": "eslint --fix --quiet .",
95
+ "format:package": "sort-package-json ./package.json ./packages/*/package.json",
96
+ "lint": "eslint --quiet .",
97
+ "test": "vitest run",
98
+ "typecheck": "npm run typecheck --workspaces"
99
+ },
100
+ "devDependencies": {
101
+ "@jaypie/eslint": "^1.1.0",
102
+ "@jaypie/testkit": "^1.1.0",
103
+ "eslint": "^9.13.0",
104
+ "lerna": "^9.0.0",
105
+ "prettier": "^3.3.3",
106
+ "rimraf": "^6.0.1",
107
+ "rollup": "^4.24.0",
108
+ "sort-package-json": "^3.2.0",
109
+ "vitest": "^3.0.5"
110
+ }
111
+ }
112
+ ```
113
+
114
+ Notes:
115
+ - Use `lerna run build` to build all packages in dependency order
116
+ - Use `npm run build --workspace packages/<package>` to build a single package
117
+ - Install dependencies with `npm install <package> -w packages/<workspace>`
118
+
119
+ ## lerna.json
120
+
121
+ ```json
122
+ {
123
+ "$schema": "node_modules/lerna/schemas/lerna-schema.json",
124
+ "version": "independent"
125
+ }
126
+ ```
127
+
128
+ ## vitest.config.ts
129
+
130
+ Jaypie uses an explicit project list rather than a glob pattern:
131
+
132
+ ```typescript
133
+ import { defineConfig } from "vitest/config";
134
+
135
+ export default defineConfig({
136
+ test: {
137
+ projects: [
138
+ "packages/errors",
139
+ "packages/core",
140
+ // ... list each package explicitly
141
+ ],
142
+ },
143
+ });
144
+ ```
145
+
146
+ Note: Use explicit package paths instead of `packages/*` to have better control over test execution order.
147
+
148
+ ## Package-Level tsconfig.json
149
+
150
+ Each TypeScript package needs its own `tsconfig.json`. Example from `@jaypie/errors`:
151
+
152
+ ```json
153
+ {
154
+ "compilerOptions": {
155
+ "target": "ES2020",
156
+ "module": "ESNext",
157
+ "moduleResolution": "node",
158
+ "declaration": true,
159
+ "outDir": "./dist",
160
+ "strict": true,
161
+ "esModuleInterop": true,
162
+ "skipLibCheck": true,
163
+ "forceConsistentCasingInFileNames": true
164
+ },
165
+ "include": ["src/**/*"],
166
+ "exclude": ["node_modules", "dist"]
167
+ }
168
+ ```
169
+
170
+ ## Package-Level rollup.config
171
+
172
+ ### TypeScript Package (Dual ESM/CJS)
173
+
174
+ For TypeScript packages that need both ESM and CommonJS builds (`@jaypie/errors` pattern):
175
+
176
+ ```javascript
177
+ import typescript from "@rollup/plugin-typescript";
178
+
179
+ export default [
180
+ // ES modules version
181
+ {
182
+ input: "src/index.ts",
183
+ output: {
184
+ dir: "dist/esm",
185
+ format: "es",
186
+ sourcemap: true,
187
+ },
188
+ plugins: [
189
+ typescript({
190
+ tsconfig: "./tsconfig.json",
191
+ declaration: true,
192
+ outDir: "dist/esm",
193
+ }),
194
+ ],
195
+ external: [],
196
+ },
197
+ // CommonJS version
198
+ {
199
+ input: "src/index.ts",
200
+ output: {
201
+ dir: "dist/cjs",
202
+ format: "cjs",
203
+ sourcemap: true,
204
+ exports: "named",
205
+ entryFileNames: "[name].cjs",
206
+ },
207
+ plugins: [
208
+ typescript({
209
+ tsconfig: "./tsconfig.json",
210
+ declaration: true,
211
+ outDir: "dist/cjs",
212
+ }),
213
+ ],
214
+ external: [],
215
+ },
216
+ ];
217
+ ```
218
+
219
+ Package.json exports for this pattern:
220
+
221
+ ```json
222
+ {
223
+ "exports": {
224
+ ".": {
225
+ "types": "./dist/esm/index.d.ts",
226
+ "require": "./dist/cjs/index.cjs",
227
+ "import": "./dist/esm/index.js",
228
+ "default": "./dist/esm/index.js"
229
+ }
230
+ },
231
+ "main": "./dist/cjs/index.cjs",
232
+ "module": "./dist/esm/index.js",
233
+ "types": "./dist/esm/index.d.ts"
234
+ }
235
+ ```
236
+
237
+ ### JavaScript Package (ESM with CJS fallback)
238
+
239
+ For JavaScript packages (`@jaypie/core` pattern):
240
+
241
+ ```javascript
242
+ import autoExternal from "rollup-plugin-auto-external";
243
+ import commonjs from "@rollup/plugin-commonjs";
244
+ import resolve from "@rollup/plugin-node-resolve";
245
+
246
+ export default {
247
+ input: "src/index.js",
248
+ output: [
249
+ {
250
+ file: "dist/package-name.cjs",
251
+ format: "cjs",
252
+ },
253
+ {
254
+ file: "dist/package-name.esm.js",
255
+ format: "esm",
256
+ },
257
+ ],
258
+ plugins: [
259
+ autoExternal(),
260
+ resolve(),
261
+ commonjs(),
262
+ ],
263
+ };
264
+ ```
265
+
266
+ ## Package-Level package.json
267
+
268
+ Example from `@jaypie/express`:
269
+
270
+ ```json
271
+ {
272
+ "name": "@jaypie/express",
273
+ "version": "1.1.18",
274
+ "repository": {
275
+ "type": "git",
276
+ "url": "https://github.com/finlaysonstudio/jaypie"
277
+ },
278
+ "license": "MIT",
279
+ "author": "Finlayson Studio",
280
+ "type": "module",
281
+ "exports": {
282
+ ".": {
283
+ "types": "./dist/esm/index.d.ts",
284
+ "import": "./dist/esm/index.js",
285
+ "require": "./dist/cjs/index.cjs"
286
+ }
287
+ },
288
+ "main": "./dist/cjs/index.cjs",
289
+ "module": "./dist/esm/index.js",
290
+ "types": "./dist/esm/index.d.ts",
291
+ "files": [
292
+ "dist"
293
+ ],
294
+ "scripts": {
295
+ "build": "rollup --config",
296
+ "format": "npm run format:package && npm run format:lint",
297
+ "format:lint": "eslint --fix .",
298
+ "format:package": "sort-package-json ./package.json",
299
+ "lint": "eslint .",
300
+ "test": "vitest run .",
301
+ "typecheck": "tsc --noEmit"
302
+ },
303
+ "publishConfig": {
304
+ "access": "public"
305
+ }
306
+ }
307
+ ```
308
+
309
+ Key points:
310
+ - Use `"type": "module"` for ESM
311
+ - Include only `dist` in published package via `files` field
312
+ - Set `publishConfig.access` to "public" for npm publishing
313
+ - Scripts use local paths (`.`) not workspace patterns
314
+
315
+ ## Key Differences from Template
316
+
317
+ The Jaypie monorepo does NOT use:
318
+ - Root-level `tsconfig.base.json` or `tsconfig.json` with project references
319
+ - `vitest.workspace.js` with glob patterns
320
+ - `npm run build --workspaces` (uses `lerna run build` instead)
321
+
322
+ The Jaypie monorepo DOES use:
323
+ - Individual package-level `tsconfig.json` files
324
+ - Explicit vitest project list in root `vitest.config.ts`
325
+ - Lerna for running commands across packages in dependency order
326
+ - npm workspaces for installing dependencies and running individual package commands
@@ -0,0 +1,93 @@
1
+ ---
2
+ description: Template files for creating a new subpackage within a Jaypie monorepo
3
+ ---
4
+
5
+ # Project Subpackage Templates
6
+
7
+ Templates for creating a new subpackage within a Jaypie monorepo.
8
+
9
+ ## package.json
10
+
11
+ ```json
12
+ {
13
+ "name": "@project-org/project-name",
14
+ "version": "0.0.1",
15
+ "type": "module",
16
+ "private": true,
17
+ "scripts": {
18
+ "build": "vite build",
19
+ "clean": "rimraf dist",
20
+ "format": "eslint --fix",
21
+ "format:package": "sort-package-json",
22
+ "lint": "eslint",
23
+ "test": "vitest run",
24
+ "test:watch": "vitest watch",
25
+ "typecheck": "tsc --noEmit"
26
+ }
27
+ }
28
+ ```
29
+
30
+ ## tsconfig.json
31
+
32
+ ```json
33
+ {
34
+ "extends": "../../tsconfig.base.json",
35
+ "compilerOptions": {
36
+ "rootDir": "src",
37
+ "outDir": "dist"
38
+ },
39
+ "include": [
40
+ "src"
41
+ ],
42
+ "references": []
43
+ }
44
+ ```
45
+
46
+ ## vite.config.ts
47
+
48
+ ```typescript
49
+ import { defineConfig } from "vite";
50
+ import dts from "vite-plugin-dts";
51
+ import { resolve } from "path";
52
+
53
+ export default defineConfig({
54
+ build: {
55
+ lib: {
56
+ entry: resolve(__dirname, "src/index.ts"),
57
+ formats: ["es"],
58
+ fileName: "index",
59
+ },
60
+ rollupOptions: {
61
+ external: ["jaypie"],
62
+ },
63
+ },
64
+ plugins: [
65
+ dts({
66
+ exclude: ["**/*.spec.ts"],
67
+ }),
68
+ ],
69
+ });
70
+ ```
71
+
72
+ ## vitest.config.ts
73
+
74
+ ```typescript
75
+ import { defineConfig } from "vite";
76
+
77
+ export default defineConfig({
78
+ test: {
79
+ setupFiles: ["./vitest.setup.ts"],
80
+ },
81
+ });
82
+ ```
83
+
84
+ ## vitest.setup.ts
85
+
86
+ ```typescript
87
+ import { matchers as jaypieMatchers } from "@jaypie/testkit";
88
+ import * as extendedMatchers from "jest-extended";
89
+ import { expect } from "vitest";
90
+
91
+ expect.extend(extendedMatchers);
92
+ expect.extend(jaypieMatchers);
93
+ ```