@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.
- package/dist/datadog.d.ts +212 -0
- package/dist/index.js +1461 -6
- package/dist/index.js.map +1 -1
- package/package.json +9 -5
- package/prompts/Development_Process.md +57 -35
- package/prompts/Jaypie_CDK_Constructs_and_Patterns.md +143 -19
- package/prompts/Jaypie_Express_Package.md +35 -15
- package/prompts/Jaypie_Init_Express_on_Lambda.md +66 -38
- package/prompts/Jaypie_Init_Lambda_Package.md +202 -83
- package/prompts/Jaypie_Init_Project_Subpackage.md +21 -26
- package/prompts/Jaypie_Legacy_Patterns.md +4 -0
- package/prompts/Jaypie_Repokit.md +103 -0
- package/prompts/Templates_CDK_Subpackage.md +113 -0
- package/prompts/Templates_Express_Subpackage.md +183 -0
- package/prompts/Templates_Project_Monorepo.md +326 -0
- package/prompts/Templates_Project_Subpackage.md +93 -0
- package/prompts/Jaypie_Mongoose_Models_Package.md +0 -231
- package/prompts/Jaypie_Mongoose_with_Express_CRUD.md +0 -1000
- package/prompts/templates/cdk-subpackage/bin/cdk.ts +0 -11
- package/prompts/templates/cdk-subpackage/cdk.json +0 -19
- package/prompts/templates/cdk-subpackage/lib/cdk-app.ts +0 -41
- package/prompts/templates/cdk-subpackage/lib/cdk-infrastructure.ts +0 -15
- package/prompts/templates/express-subpackage/index.ts +0 -8
- package/prompts/templates/express-subpackage/src/app.ts +0 -18
- package/prompts/templates/express-subpackage/src/handler.config.ts +0 -44
- package/prompts/templates/express-subpackage/src/routes/resource/__tests__/resourceGet.route.spec.ts +0 -29
- package/prompts/templates/express-subpackage/src/routes/resource/resourceGet.route.ts +0 -22
- package/prompts/templates/express-subpackage/src/routes/resource.router.ts +0 -11
- package/prompts/templates/express-subpackage/src/types/express.ts +0 -9
- package/prompts/templates/project-monorepo/.vscode/settings.json +0 -72
- package/prompts/templates/project-monorepo/eslint.config.mjs +0 -1
- package/prompts/templates/project-monorepo/gitignore +0 -11
- package/prompts/templates/project-monorepo/package.json +0 -20
- package/prompts/templates/project-monorepo/tsconfig.base.json +0 -18
- package/prompts/templates/project-monorepo/tsconfig.json +0 -6
- package/prompts/templates/project-monorepo/vitest.workspace.js +0 -3
- package/prompts/templates/project-subpackage/package.json +0 -16
- package/prompts/templates/project-subpackage/tsconfig.json +0 -11
- package/prompts/templates/project-subpackage/vite.config.ts +0 -21
- package/prompts/templates/project-subpackage/vitest.config.ts +0 -7
- package/prompts/templates/project-subpackage/vitest.setup.ts +0 -6
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import cdk from "aws-cdk-lib";
|
|
4
|
-
import { AppStack } from "../lib/cdk-app.ts";
|
|
5
|
-
import { InfrastructureStack } from "../lib/cdk-infrastructure.ts";
|
|
6
|
-
|
|
7
|
-
const app = new cdk.App();
|
|
8
|
-
|
|
9
|
-
new InfrastructureStack(app, "InfrastructureStack");
|
|
10
|
-
|
|
11
|
-
new AppStack(app, "AppStack");
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"app": "npx ts-node --prefer-ts-exts bin/cdk.ts",
|
|
3
|
-
"watch": {
|
|
4
|
-
"include": [
|
|
5
|
-
"**"
|
|
6
|
-
],
|
|
7
|
-
"exclude": [
|
|
8
|
-
"README.md",
|
|
9
|
-
"cdk*.json",
|
|
10
|
-
"**/*.d.ts",
|
|
11
|
-
"**/*.js",
|
|
12
|
-
"tsconfig.json",
|
|
13
|
-
"package*.json",
|
|
14
|
-
"yarn.lock",
|
|
15
|
-
"node_modules",
|
|
16
|
-
"test"
|
|
17
|
-
]
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
JaypieAppStack,
|
|
3
|
-
JaypieApiGateway,
|
|
4
|
-
JaypieExpressLambda,
|
|
5
|
-
JaypieMongoDbSecret,
|
|
6
|
-
JaypieLambda,
|
|
7
|
-
} from "@jaypie/constructs";
|
|
8
|
-
|
|
9
|
-
import * as cdk from "aws-cdk-lib";
|
|
10
|
-
import { Construct } from "constructs";
|
|
11
|
-
import * as lambda from "aws-cdk-lib/aws-lambda";
|
|
12
|
-
|
|
13
|
-
export class AppStack extends JaypieAppStack {
|
|
14
|
-
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
|
|
15
|
-
super(scope, id, props);
|
|
16
|
-
|
|
17
|
-
const mongoConnectionString = new JaypieMongoDbSecret(this);
|
|
18
|
-
|
|
19
|
-
const expressLambda = new JaypieExpressLambda(this, "expressLambda", {
|
|
20
|
-
code: lambda.Code.fromAsset("../express"),
|
|
21
|
-
handler: "dist/index.expressLambda",
|
|
22
|
-
secrets: [mongoConnectionString],
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
new JaypieApiGateway(this, "apiGateway", {
|
|
26
|
-
handler: expressLambda,
|
|
27
|
-
host: "api.example.com",
|
|
28
|
-
zone: "example.com",
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
new JaypieLambda(
|
|
32
|
-
this,
|
|
33
|
-
"lambdaWorker",
|
|
34
|
-
{
|
|
35
|
-
code: lambda.Code.fromAsset("../lambda"),
|
|
36
|
-
handler: "dist/index.lambdaWorker",
|
|
37
|
-
secrets: [mongoConnectionString],
|
|
38
|
-
},
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
JaypieInfrastructureStack,
|
|
3
|
-
JaypieWebDeploymentBucket,
|
|
4
|
-
} from "@jaypie/constructs";
|
|
5
|
-
|
|
6
|
-
export class InfrastructureStack extends JaypieInfrastructureStack {
|
|
7
|
-
constructor(scope, id, props = {}) {
|
|
8
|
-
super(scope, id, props);
|
|
9
|
-
|
|
10
|
-
new JaypieWebDeploymentBucket(this, "DeploymentBucket", {
|
|
11
|
-
// * host is not needed if CDK_ENV_WEB_SUBDOMAIN and CDK_ENV_WEB_HOSTED_ZONE or CDK_ENV_HOSTED_ZONE
|
|
12
|
-
// * zone is not needed if CDK_ENV_WEB_HOSTED_ZONE or CDK_ENV_HOSTED_ZONE
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { cors, echoRoute, EXPRESS, noContentRoute, notFoundRoute } from "jaypie";
|
|
2
|
-
import express from "express";
|
|
3
|
-
import resourceRouter from "./routes/resource.router.js";
|
|
4
|
-
|
|
5
|
-
const app = express();
|
|
6
|
-
|
|
7
|
-
// Built-in Jaypie routes
|
|
8
|
-
app.get(EXPRESS.PATH.ROOT, noContentRoute);
|
|
9
|
-
app.use("/_sy/echo", cors(), echoRoute);
|
|
10
|
-
|
|
11
|
-
// Application routes
|
|
12
|
-
app.use(/^\/resource$/, cors(), resourceRouter);
|
|
13
|
-
app.use("/resource/", cors(), resourceRouter);
|
|
14
|
-
|
|
15
|
-
// Catch-all
|
|
16
|
-
app.all(EXPRESS.PATH.ANY, notFoundRoute);
|
|
17
|
-
|
|
18
|
-
export default app;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { force } from "jaypie";
|
|
2
|
-
|
|
3
|
-
interface HandlerConfigOptions {
|
|
4
|
-
locals?: Record<string, any>;
|
|
5
|
-
setup?: Array<() => void | Promise<void>>;
|
|
6
|
-
teardown?: Array<() => void | Promise<void>>;
|
|
7
|
-
validate?: Array<() => boolean | Promise<boolean>>;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
interface HandlerConfig {
|
|
11
|
-
name: string;
|
|
12
|
-
locals: Record<string, any>;
|
|
13
|
-
setup: Array<() => void | Promise<void>>;
|
|
14
|
-
teardown: Array<() => void | Promise<void>>;
|
|
15
|
-
validate: Array<() => boolean | Promise<boolean>>;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const handlerConfig = (
|
|
19
|
-
nameOrConfig: string | (HandlerConfig & { name: string }),
|
|
20
|
-
options: HandlerConfigOptions = {}
|
|
21
|
-
): HandlerConfig => {
|
|
22
|
-
let name: string;
|
|
23
|
-
let locals: Record<string, any>;
|
|
24
|
-
let setup: Array<() => void | Promise<void>>;
|
|
25
|
-
let teardown: Array<() => void | Promise<void>>;
|
|
26
|
-
let validate: Array<() => boolean | Promise<boolean>>;
|
|
27
|
-
|
|
28
|
-
if (typeof nameOrConfig === "object") {
|
|
29
|
-
({ name, locals = {}, setup = [], teardown = [], validate = [] } = nameOrConfig);
|
|
30
|
-
} else {
|
|
31
|
-
name = nameOrConfig;
|
|
32
|
-
({ locals = {}, setup = [], teardown = [], validate = [] } = options);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
name,
|
|
37
|
-
locals: { ...force.object(locals) },
|
|
38
|
-
setup: [...force.array(setup)],
|
|
39
|
-
teardown: [...force.array(teardown)],
|
|
40
|
-
validate: [...force.array(validate)],
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export default handlerConfig;
|
package/prompts/templates/express-subpackage/src/routes/resource/__tests__/resourceGet.route.spec.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import resourceGet from "../resourceGet.route.js";
|
|
3
|
-
|
|
4
|
-
describe("Resource Get Route", () => {
|
|
5
|
-
it("returns resource data", async () => {
|
|
6
|
-
const mockRequest = {
|
|
7
|
-
query: { search: "test" },
|
|
8
|
-
locals: {},
|
|
9
|
-
} as any;
|
|
10
|
-
|
|
11
|
-
const response = await resourceGet(mockRequest);
|
|
12
|
-
|
|
13
|
-
expect(response.message).toBe("Resource endpoint");
|
|
14
|
-
expect(response.query).toEqual({ search: "test" });
|
|
15
|
-
expect(response.timestamp).toBeDefined();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it("handles empty query", async () => {
|
|
19
|
-
const mockRequest = {
|
|
20
|
-
query: {},
|
|
21
|
-
locals: {},
|
|
22
|
-
} as any;
|
|
23
|
-
|
|
24
|
-
const response = await resourceGet(mockRequest);
|
|
25
|
-
|
|
26
|
-
expect(response.message).toBe("Resource endpoint");
|
|
27
|
-
expect(response.query).toEqual({});
|
|
28
|
-
});
|
|
29
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { expressHandler } from "jaypie";
|
|
2
|
-
import type { Request } from "express";
|
|
3
|
-
import handlerConfig from "../../handler.config.js";
|
|
4
|
-
|
|
5
|
-
interface ResourceGetResponse {
|
|
6
|
-
message: string;
|
|
7
|
-
query: Record<string, any>;
|
|
8
|
-
timestamp: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default expressHandler(
|
|
12
|
-
handlerConfig("resourceGet"),
|
|
13
|
-
async (req: Request): Promise<ResourceGetResponse> => {
|
|
14
|
-
const { query } = req;
|
|
15
|
-
|
|
16
|
-
return {
|
|
17
|
-
message: "Resource endpoint",
|
|
18
|
-
query,
|
|
19
|
-
timestamp: new Date().toISOString(),
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import express from "express";
|
|
2
|
-
import { EXPRESS } from "jaypie";
|
|
3
|
-
import resourceGetRoute from "./resource/resourceGet.route.js";
|
|
4
|
-
|
|
5
|
-
const router = express.Router();
|
|
6
|
-
router.use(express.json({ strict: false }));
|
|
7
|
-
|
|
8
|
-
// Single example route
|
|
9
|
-
router.get(EXPRESS.PATH.ROOT, resourceGetRoute);
|
|
10
|
-
|
|
11
|
-
export default router;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"cSpell.words": [
|
|
3
|
-
"addgroup",
|
|
4
|
-
"adduser",
|
|
5
|
-
"arcxp",
|
|
6
|
-
"autofix",
|
|
7
|
-
"buildvcs",
|
|
8
|
-
"CDKTAG",
|
|
9
|
-
"certificatemanager",
|
|
10
|
-
"cicd",
|
|
11
|
-
"civisibility",
|
|
12
|
-
"clonedeep",
|
|
13
|
-
"codegenie",
|
|
14
|
-
"cogenticat",
|
|
15
|
-
"composables",
|
|
16
|
-
"coreutils",
|
|
17
|
-
"datadoghq",
|
|
18
|
-
"ddsource",
|
|
19
|
-
"ddtags",
|
|
20
|
-
"dnsutils",
|
|
21
|
-
"dushi",
|
|
22
|
-
"e2bdev",
|
|
23
|
-
"ejectability",
|
|
24
|
-
"elif",
|
|
25
|
-
"envsubst",
|
|
26
|
-
"esmodules",
|
|
27
|
-
"Ferdinandi",
|
|
28
|
-
"Finlayson",
|
|
29
|
-
"finlaysonstudio",
|
|
30
|
-
"finstu",
|
|
31
|
-
"finstuapps",
|
|
32
|
-
"fontface",
|
|
33
|
-
"hola",
|
|
34
|
-
"hygen",
|
|
35
|
-
"iconsets",
|
|
36
|
-
"importx",
|
|
37
|
-
"initzero",
|
|
38
|
-
"invokeid",
|
|
39
|
-
"isequal",
|
|
40
|
-
"jaypie",
|
|
41
|
-
"jsonapi",
|
|
42
|
-
"knowdev",
|
|
43
|
-
"knowtrace",
|
|
44
|
-
"modelcontextprotocol",
|
|
45
|
-
"nobuild",
|
|
46
|
-
"npmjs",
|
|
47
|
-
"nuxt",
|
|
48
|
-
"oidc",
|
|
49
|
-
"openmeteo",
|
|
50
|
-
"pinia",
|
|
51
|
-
"pipefail",
|
|
52
|
-
"procps",
|
|
53
|
-
"repomix",
|
|
54
|
-
"retryable",
|
|
55
|
-
"rimfaf",
|
|
56
|
-
"roboto",
|
|
57
|
-
"rollup",
|
|
58
|
-
"sorpresa",
|
|
59
|
-
"ssoins",
|
|
60
|
-
"stddev",
|
|
61
|
-
"subpackages",
|
|
62
|
-
"supertest",
|
|
63
|
-
"testkit",
|
|
64
|
-
"unplugin",
|
|
65
|
-
"vendia",
|
|
66
|
-
"vite",
|
|
67
|
-
"vitest",
|
|
68
|
-
"vuekit",
|
|
69
|
-
"vuetify",
|
|
70
|
-
"wght"
|
|
71
|
-
]
|
|
72
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as default } from "@jaypie/eslint";
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@project-org/project-name",
|
|
3
|
-
"version": "0.0.1",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"private": true,
|
|
6
|
-
"workspaces": [
|
|
7
|
-
"packages/*"
|
|
8
|
-
],
|
|
9
|
-
"scripts": {
|
|
10
|
-
"build": "npm run build --workspaces",
|
|
11
|
-
"clean": "npm run clean --workspaces && npm run clean:root",
|
|
12
|
-
"clean:root": "rimraf node_modules package-lock.json",
|
|
13
|
-
"format": "eslint --fix",
|
|
14
|
-
"format:package": "sort-package-json ./package.json ./packages/*/package.json",
|
|
15
|
-
"lint": "eslint",
|
|
16
|
-
"test": "vitest run",
|
|
17
|
-
"test:watch": "vitest watch",
|
|
18
|
-
"typecheck": "npm run typecheck --workspaces"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2020",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "Node",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
"forceConsistentCasingInFileNames": true,
|
|
10
|
-
"declaration": true,
|
|
11
|
-
"sourceMap": true,
|
|
12
|
-
"composite": true,
|
|
13
|
-
"paths": {
|
|
14
|
-
"@pkg-a/*": ["packages/pkg-a/src/*"],
|
|
15
|
-
"@pkg-b/*": ["packages/pkg-b/src/*"]
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@project-org/project-name",
|
|
3
|
-
"version": "0.0.1",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"private": true,
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "vite build",
|
|
8
|
-
"clean": "rimfaf dist",
|
|
9
|
-
"format": "eslint --fix",
|
|
10
|
-
"format:package": "sort-package-json",
|
|
11
|
-
"lint": "eslint",
|
|
12
|
-
"test": "vitest run",
|
|
13
|
-
"test:watch": "vitest watch",
|
|
14
|
-
"typecheck": "tsc --noEmit"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "vite";
|
|
2
|
-
import dts from "vite-plugin-dts";
|
|
3
|
-
import { resolve } from "path";
|
|
4
|
-
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
build: {
|
|
7
|
-
lib: {
|
|
8
|
-
entry: resolve(__dirname, "src/index.ts"),
|
|
9
|
-
formats: ["es"],
|
|
10
|
-
fileName: "index",
|
|
11
|
-
},
|
|
12
|
-
rollupOptions: {
|
|
13
|
-
external: ["jaypie"],
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
plugins: [
|
|
17
|
-
dts({
|
|
18
|
-
exclude: ["**/*.spec.ts"],
|
|
19
|
-
}),
|
|
20
|
-
],
|
|
21
|
-
});
|