@venizia/ignis-docs 0.0.1-4 → 0.0.1-6
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/mcp-server/dist/common/config.d.ts +58 -21
- package/mcp-server/dist/common/config.d.ts.map +1 -1
- package/mcp-server/dist/common/config.js +67 -12
- package/mcp-server/dist/common/config.js.map +1 -1
- package/mcp-server/dist/helpers/docs.helper.d.ts +5 -5
- package/mcp-server/dist/helpers/docs.helper.d.ts.map +1 -1
- package/mcp-server/dist/helpers/docs.helper.js +31 -27
- package/mcp-server/dist/helpers/docs.helper.js.map +1 -1
- package/mcp-server/dist/helpers/github.helper.d.ts +37 -0
- package/mcp-server/dist/helpers/github.helper.d.ts.map +1 -0
- package/mcp-server/dist/helpers/github.helper.js +100 -0
- package/mcp-server/dist/helpers/github.helper.js.map +1 -0
- package/mcp-server/dist/helpers/index.d.ts +1 -0
- package/mcp-server/dist/helpers/index.d.ts.map +1 -1
- package/mcp-server/dist/helpers/index.js +1 -0
- package/mcp-server/dist/helpers/index.js.map +1 -1
- package/mcp-server/dist/index.js +60 -32
- package/mcp-server/dist/index.js.map +1 -1
- package/mcp-server/dist/tools/base.tool.d.ts +6 -10
- package/mcp-server/dist/tools/base.tool.d.ts.map +1 -1
- package/mcp-server/dist/tools/base.tool.js +3 -5
- package/mcp-server/dist/tools/base.tool.js.map +1 -1
- package/mcp-server/dist/tools/{get-doc-content.tool.d.ts → docs/get-document-content.tool.d.ts} +4 -4
- package/mcp-server/dist/tools/docs/get-document-content.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/{get-doc-content.tool.js → docs/get-document-content.tool.js} +12 -11
- package/mcp-server/dist/tools/docs/get-document-content.tool.js.map +1 -0
- package/mcp-server/dist/tools/{get-doc-metadata.tool.d.ts → docs/get-document-metadata.tool.d.ts} +4 -4
- package/mcp-server/dist/tools/docs/get-document-metadata.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/{get-doc-metadata.tool.js → docs/get-document-metadata.tool.js} +11 -10
- package/mcp-server/dist/tools/docs/get-document-metadata.tool.js.map +1 -0
- package/mcp-server/dist/tools/docs/get-package-overview.tool.d.ts +50 -0
- package/mcp-server/dist/tools/docs/get-package-overview.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/docs/get-package-overview.tool.js +221 -0
- package/mcp-server/dist/tools/docs/get-package-overview.tool.js.map +1 -0
- package/mcp-server/dist/tools/docs/index.d.ts +7 -0
- package/mcp-server/dist/tools/docs/index.d.ts.map +1 -0
- package/mcp-server/dist/tools/docs/index.js +23 -0
- package/mcp-server/dist/tools/docs/index.js.map +1 -0
- package/mcp-server/dist/tools/{list-categories.tool.d.ts → docs/list-categories.tool.d.ts} +2 -2
- package/mcp-server/dist/tools/docs/list-categories.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/{list-categories.tool.js → docs/list-categories.tool.js} +7 -6
- package/mcp-server/dist/tools/docs/list-categories.tool.js.map +1 -0
- package/mcp-server/dist/tools/{list-docs.tool.d.ts → docs/list-documents.tool.d.ts} +4 -4
- package/mcp-server/dist/tools/docs/list-documents.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/{list-docs.tool.js → docs/list-documents.tool.js} +10 -9
- package/mcp-server/dist/tools/docs/list-documents.tool.js.map +1 -0
- package/mcp-server/dist/tools/{search-docs.tool.d.ts → docs/search-documents.tool.d.ts} +4 -4
- package/mcp-server/dist/tools/docs/search-documents.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/{search-docs.tool.js → docs/search-documents.tool.js} +19 -18
- package/mcp-server/dist/tools/docs/search-documents.tool.js.map +1 -0
- package/mcp-server/dist/tools/github/index.d.ts +5 -0
- package/mcp-server/dist/tools/github/index.d.ts.map +1 -0
- package/mcp-server/dist/tools/github/index.js +21 -0
- package/mcp-server/dist/tools/github/index.js.map +1 -0
- package/mcp-server/dist/tools/github/list-project-files.tool.d.ts +28 -0
- package/mcp-server/dist/tools/github/list-project-files.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/github/list-project-files.tool.js +98 -0
- package/mcp-server/dist/tools/github/list-project-files.tool.js.map +1 -0
- package/mcp-server/dist/tools/github/search-code.tool.d.ts +42 -0
- package/mcp-server/dist/tools/github/search-code.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/github/search-code.tool.js +194 -0
- package/mcp-server/dist/tools/github/search-code.tool.js.map +1 -0
- package/mcp-server/dist/tools/github/verify-dependencies.tool.d.ts +55 -0
- package/mcp-server/dist/tools/github/verify-dependencies.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/github/verify-dependencies.tool.js +167 -0
- package/mcp-server/dist/tools/github/verify-dependencies.tool.js.map +1 -0
- package/mcp-server/dist/tools/github/view-source-file.tool.d.ts +26 -0
- package/mcp-server/dist/tools/github/view-source-file.tool.d.ts.map +1 -0
- package/mcp-server/dist/tools/github/view-source-file.tool.js +91 -0
- package/mcp-server/dist/tools/github/view-source-file.tool.js.map +1 -0
- package/mcp-server/dist/tools/index.d.ts +3 -7
- package/mcp-server/dist/tools/index.d.ts.map +1 -1
- package/mcp-server/dist/tools/index.js +17 -13
- package/mcp-server/dist/tools/index.js.map +1 -1
- package/package.json +25 -6
- package/wiki/get-started/best-practices/api-usage-examples.md +42 -0
- package/wiki/get-started/best-practices/architectural-patterns.md +42 -1
- package/wiki/get-started/best-practices/code-style-standards.md +41 -0
- package/wiki/get-started/best-practices/contribution-workflow.md +40 -6
- package/wiki/get-started/best-practices/data-modeling.md +126 -0
- package/wiki/get-started/core-concepts/dependency-injection.md +13 -1
- package/wiki/get-started/mcp-docs-server.md +130 -32
- package/wiki/get-started/philosophy.md +198 -25
- package/wiki/public/logo.svg +1 -0
- package/wiki/references/base/application.md +5 -5
- package/wiki/references/base/controllers.md +3 -1
- package/wiki/references/base/dependency-injection.md +6 -5
- package/wiki/references/base/models.md +319 -1
- package/wiki/references/components/index.md +3 -1
- package/wiki/references/components/static-asset.md +1289 -0
- package/wiki/references/helpers/inversion.md +21 -11
- package/wiki/references/helpers/storage.md +538 -11
- package/wiki/references/src-details/core.md +15 -1
- package/wiki/references/src-details/docs.md +19 -9
- package/wiki/references/src-details/mcp-server.md +185 -234
- package/wiki/references/utilities/index.md +1 -1
- package/wiki/references/utilities/request.md +150 -0
- package/mcp-server/dist/tools/get-doc-content.tool.d.ts.map +0 -1
- package/mcp-server/dist/tools/get-doc-content.tool.js.map +0 -1
- package/mcp-server/dist/tools/get-doc-metadata.tool.d.ts.map +0 -1
- package/mcp-server/dist/tools/get-doc-metadata.tool.js.map +0 -1
- package/mcp-server/dist/tools/list-categories.tool.d.ts.map +0 -1
- package/mcp-server/dist/tools/list-categories.tool.js.map +0 -1
- package/mcp-server/dist/tools/list-docs.tool.d.ts.map +0 -1
- package/mcp-server/dist/tools/list-docs.tool.js.map +0 -1
- package/mcp-server/dist/tools/search-docs.tool.d.ts.map +0 -1
- package/mcp-server/dist/tools/search-docs.tool.js.map +0 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ViewSourceFileTool = void 0;
|
|
4
|
+
const helpers_1 = require("@/mcp-server/helpers");
|
|
5
|
+
const tools_1 = require("@mastra/core/tools");
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
const base_tool_1 = require("../base.tool");
|
|
8
|
+
// ----------------------------------------------------------------------------
|
|
9
|
+
// DESCRIPTIONS
|
|
10
|
+
// ----------------------------------------------------------------------------
|
|
11
|
+
const TOOL_DESCRIPTION = `
|
|
12
|
+
Retrieves the full source code content of a specific file from the Ignis GitHub repository.
|
|
13
|
+
|
|
14
|
+
PURPOSE:
|
|
15
|
+
Read contents of a source file. Primary method for inspecting implementation details,
|
|
16
|
+
understanding logic, and viewing exact code.
|
|
17
|
+
|
|
18
|
+
WHEN TO USE:
|
|
19
|
+
- After finding a relevant file with listProjectFiles or searchCode
|
|
20
|
+
- When you need to see implementation of a specific class, function, or component
|
|
21
|
+
- To verify details not present in documentation
|
|
22
|
+
- To extract specific code examples or snippets
|
|
23
|
+
|
|
24
|
+
WHEN NOT TO USE:
|
|
25
|
+
- For discovering files (use listProjectFiles to browse, or searchCode to find by keyword)
|
|
26
|
+
- Do not use on non-text files (images, binaries) or very large files unless necessary
|
|
27
|
+
- For documentation content (use getDocContent instead)
|
|
28
|
+
`;
|
|
29
|
+
const FILE_PATH_DESCRIPTION = `
|
|
30
|
+
The full path to the file from the root of the repository.
|
|
31
|
+
|
|
32
|
+
HOW TO OBTAIN:
|
|
33
|
+
- Use listProjectFiles to browse the project and find valid file paths
|
|
34
|
+
- Use searchCode to find files containing specific keywords or patterns
|
|
35
|
+
- Navigate from root directory down to the specific file
|
|
36
|
+
|
|
37
|
+
EXAMPLES:
|
|
38
|
+
- "packages/core/src/application.ts"
|
|
39
|
+
- "examples/5-mins-qs/src/index.ts"
|
|
40
|
+
- "package.json"
|
|
41
|
+
`;
|
|
42
|
+
// ----------------------------------------------------------------------------
|
|
43
|
+
// SCHEMAS
|
|
44
|
+
// ----------------------------------------------------------------------------
|
|
45
|
+
const InputSchema = zod_1.z.object({
|
|
46
|
+
filePath: zod_1.z.string().min(1).describe(FILE_PATH_DESCRIPTION),
|
|
47
|
+
});
|
|
48
|
+
const OutputSchema = zod_1.z.object({
|
|
49
|
+
filePath: zod_1.z.string(),
|
|
50
|
+
content: zod_1.z.string().optional().describe('The full source code content of the file.'),
|
|
51
|
+
error: zod_1.z
|
|
52
|
+
.string()
|
|
53
|
+
.optional()
|
|
54
|
+
.describe('An error message if the file could not be read (e.g., not found).'),
|
|
55
|
+
});
|
|
56
|
+
// ----------------------------------------------------------------------------
|
|
57
|
+
// TOOL CLASS
|
|
58
|
+
// ----------------------------------------------------------------------------
|
|
59
|
+
class ViewSourceFileTool extends base_tool_1.BaseTool {
|
|
60
|
+
constructor() {
|
|
61
|
+
super(...arguments);
|
|
62
|
+
this.id = 'viewSourceFile';
|
|
63
|
+
this.description = TOOL_DESCRIPTION;
|
|
64
|
+
this.inputSchema = InputSchema;
|
|
65
|
+
this.outputSchema = OutputSchema;
|
|
66
|
+
}
|
|
67
|
+
async execute(opts) {
|
|
68
|
+
const result = await helpers_1.GithubHelper.getFileContent({ filePath: opts.filePath });
|
|
69
|
+
if ('error' in result) {
|
|
70
|
+
return {
|
|
71
|
+
filePath: opts.filePath,
|
|
72
|
+
error: result.error,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
filePath: opts.filePath,
|
|
77
|
+
content: result.content,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
getTool() {
|
|
81
|
+
return (0, tools_1.createTool)({
|
|
82
|
+
id: this.id,
|
|
83
|
+
description: this.description,
|
|
84
|
+
inputSchema: this.inputSchema,
|
|
85
|
+
outputSchema: this.outputSchema,
|
|
86
|
+
execute: async ({ context }) => this.execute(context),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.ViewSourceFileTool = ViewSourceFileTool;
|
|
91
|
+
//# sourceMappingURL=view-source-file.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-source-file.tool.js","sourceRoot":"","sources":["../../../tools/github/view-source-file.tool.ts"],"names":[],"mappings":";;;AAAA,kDAAoD;AACpD,8CAAgD;AAChD,6BAAwB;AACxB,4CAAqD;AAErD,+EAA+E;AAC/E,eAAe;AACf,+EAA+E;AAE/E,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;CAiBxB,CAAC;AAEF,MAAM,qBAAqB,GAAG;;;;;;;;;;;;CAY7B,CAAC;AAEF,+EAA+E;AAC/E,UAAU;AACV,+EAA+E;AAE/E,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC;CAC5D,CAAC,CAAC;AAEH,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;IACpB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;IACpF,KAAK,EAAE,OAAC;SACL,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,mEAAmE,CAAC;CACjF,CAAC,CAAC;AAEH,+EAA+E;AAC/E,aAAa;AACb,+EAA+E;AAE/E,MAAa,kBAAmB,SAAQ,oBAAiD;IAAzF;;QACW,OAAE,GAAG,gBAAgB,CAAC;QACtB,gBAAW,GAAG,gBAAgB,CAAC;QAC/B,gBAAW,GAAG,WAAW,CAAC;QAC1B,iBAAY,GAAG,YAAY,CAAC;IA2BvC,CAAC;IAzBC,KAAK,CAAC,OAAO,CAAC,IAAiC;QAC7C,MAAM,MAAM,GAAG,MAAM,sBAAY,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAE9E,IAAI,OAAO,IAAI,MAAM,EAAE,CAAC;YACtB,OAAO;gBACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,KAAK,EAAE,MAAM,CAAC,KAAK;aACpB,CAAC;QACJ,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,OAAO,EAAE,MAAM,CAAC,OAAO;SACxB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,IAAA,kBAAU,EAAC;YAChB,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;SACtD,CAAC,CAAC;IACL,CAAC;CACF;AA/BD,gDA+BC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export { GetDocContentTool } from './get-doc-content.tool';
|
|
5
|
-
export { GetDocMetadataTool } from './get-doc-metadata.tool';
|
|
6
|
-
export { ListDocsTool } from './list-docs.tool';
|
|
7
|
-
export { ListCategoriesTool } from './list-categories.tool';
|
|
1
|
+
export * from './base.tool';
|
|
2
|
+
export * from './docs';
|
|
3
|
+
export * from './github';
|
|
8
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../tools/index.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../tools/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAG5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC"}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ListCategoriesTool = exports.ListDocsTool = exports.GetDocMetadataTool = exports.GetDocContentTool = exports.SearchDocsTool = exports.BaseTool = void 0;
|
|
4
17
|
// Base class
|
|
5
|
-
|
|
6
|
-
Object.defineProperty(exports, "BaseTool", { enumerable: true, get: function () { return base_tool_1.BaseTool; } });
|
|
18
|
+
__exportStar(require("./base.tool"), exports);
|
|
7
19
|
// Tool classes
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var get_doc_content_tool_1 = require("./get-doc-content.tool");
|
|
11
|
-
Object.defineProperty(exports, "GetDocContentTool", { enumerable: true, get: function () { return get_doc_content_tool_1.GetDocContentTool; } });
|
|
12
|
-
var get_doc_metadata_tool_1 = require("./get-doc-metadata.tool");
|
|
13
|
-
Object.defineProperty(exports, "GetDocMetadataTool", { enumerable: true, get: function () { return get_doc_metadata_tool_1.GetDocMetadataTool; } });
|
|
14
|
-
var list_docs_tool_1 = require("./list-docs.tool");
|
|
15
|
-
Object.defineProperty(exports, "ListDocsTool", { enumerable: true, get: function () { return list_docs_tool_1.ListDocsTool; } });
|
|
16
|
-
var list_categories_tool_1 = require("./list-categories.tool");
|
|
17
|
-
Object.defineProperty(exports, "ListCategoriesTool", { enumerable: true, get: function () { return list_categories_tool_1.ListCategoriesTool; } });
|
|
20
|
+
__exportStar(require("./docs"), exports);
|
|
21
|
+
__exportStar(require("./github"), exports);
|
|
18
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../tools/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../tools/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,aAAa;AACb,8CAA4B;AAE5B,eAAe;AACf,yCAAuB;AACvB,2CAAyB"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venizia/ignis-docs",
|
|
3
|
-
"version": "0.0.1-
|
|
3
|
+
"version": "0.0.1-6",
|
|
4
4
|
"description": "Documentation and MCP Server for Ignis Framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ignis",
|
|
7
|
+
"documentation",
|
|
8
|
+
"docs",
|
|
9
|
+
"guide",
|
|
10
|
+
"wiki",
|
|
11
|
+
"examples",
|
|
12
|
+
"vitepress",
|
|
7
13
|
"mcp",
|
|
8
14
|
"model-context-protocol",
|
|
9
|
-
"
|
|
15
|
+
"mastra",
|
|
16
|
+
"mastra-mcp",
|
|
10
17
|
"ai",
|
|
11
|
-
"
|
|
18
|
+
"ai-gateway",
|
|
19
|
+
"llm-gateway",
|
|
20
|
+
"model-router",
|
|
21
|
+
"ai-development",
|
|
22
|
+
"llm-development",
|
|
23
|
+
"server",
|
|
24
|
+
"cli",
|
|
25
|
+
"tooling",
|
|
26
|
+
"dev-tools",
|
|
27
|
+
"framework",
|
|
28
|
+
"venizia"
|
|
12
29
|
],
|
|
13
30
|
"main": "./mcp-server/dist/index.js",
|
|
14
31
|
"types": "./mcp-server/dist/index.d.ts",
|
|
@@ -37,7 +54,8 @@
|
|
|
37
54
|
"README.md",
|
|
38
55
|
"LICENSE.md",
|
|
39
56
|
"mcp-server/dist",
|
|
40
|
-
"wiki"
|
|
57
|
+
"wiki",
|
|
58
|
+
"!**/*.tsbuildinfo"
|
|
41
59
|
],
|
|
42
60
|
"publishConfig": {
|
|
43
61
|
"access": "public"
|
|
@@ -46,6 +64,7 @@
|
|
|
46
64
|
"bun": ">=1.3"
|
|
47
65
|
},
|
|
48
66
|
"scripts": {
|
|
67
|
+
"force-update": "sh ./scripts/force-update.sh",
|
|
49
68
|
"eslint": "eslint --report-unused-disable-directives .",
|
|
50
69
|
"lint": "bun run eslint && bun run prettier:cli",
|
|
51
70
|
"lint:fix": "bun run eslint --fix && bun run prettier:fix",
|
|
@@ -76,7 +95,7 @@
|
|
|
76
95
|
"bugs": {
|
|
77
96
|
"url": "https://github.com/VENIZIA-AI/ignis/issues"
|
|
78
97
|
},
|
|
79
|
-
"homepage": "https://github.
|
|
98
|
+
"homepage": "https://venizia-ai.github.io/ignis",
|
|
80
99
|
"license": "MIT",
|
|
81
100
|
"dependencies": {
|
|
82
101
|
"@mastra/core": "^0.24.6",
|
|
@@ -92,7 +111,7 @@
|
|
|
92
111
|
"@braintree/sanitize-url": "^7.1.1",
|
|
93
112
|
"@types/bun": "^1.3.4",
|
|
94
113
|
"@types/glob": "^8.1.0",
|
|
95
|
-
"@venizia/dev-configs": "
|
|
114
|
+
"@venizia/dev-configs": "^0.0.1-4",
|
|
96
115
|
"eslint": "^9.36.0",
|
|
97
116
|
"glob": "^10.4.2",
|
|
98
117
|
"prettier": "^3.6.2",
|
|
@@ -219,4 +219,46 @@ const deleted = await configurationRepository.deleteById({
|
|
|
219
219
|
id: newRecord.data!.id,
|
|
220
220
|
options: { shouldReturn: true }, // Option to return the deleted record
|
|
221
221
|
});
|
|
222
|
+
|
|
223
|
+
## Server-Side Rendering (JSX)
|
|
224
|
+
|
|
225
|
+
Ignis supports server-side rendering using Hono's JSX middleware. This is useful for returning HTML content, such as landing pages or simple admin views.
|
|
226
|
+
|
|
227
|
+
**Usage:**
|
|
228
|
+
|
|
229
|
+
Use `defineJSXRoute` in your controller and `htmlResponse` for documentation.
|
|
230
|
+
|
|
231
|
+
```typescript
|
|
232
|
+
import { BaseController, controller, htmlResponse } from '@venizia/ignis';
|
|
233
|
+
|
|
234
|
+
@controller({ path: '/pages' })
|
|
235
|
+
export class PageController extends BaseController {
|
|
236
|
+
|
|
237
|
+
override binding(): void {
|
|
238
|
+
this.defineJSXRoute({
|
|
239
|
+
configs: {
|
|
240
|
+
method: 'get',
|
|
241
|
+
path: '/welcome',
|
|
242
|
+
description: 'Welcome Page',
|
|
243
|
+
responses: htmlResponse({ description: 'HTML Welcome Page' }),
|
|
244
|
+
},
|
|
245
|
+
handler: (c) => {
|
|
246
|
+
const title = 'Welcome to Ignis';
|
|
247
|
+
|
|
248
|
+
// Return JSX directly
|
|
249
|
+
return c.html(
|
|
250
|
+
<html>
|
|
251
|
+
<head><title>{title}</title></head>
|
|
252
|
+
<body>
|
|
253
|
+
<h1>{title}</h1>
|
|
254
|
+
<p>Server-side rendered content.</p>
|
|
255
|
+
</body>
|
|
256
|
+
</html>
|
|
257
|
+
);
|
|
258
|
+
},
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
222
264
|
```
|
|
@@ -126,4 +126,45 @@ export class Application extends BaseApplication {
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
```
|
|
129
|
-
This architecture keeps the main `Application` class clean and focused on high-level assembly, while the details of each feature are neatly encapsulated within their respective components.
|
|
129
|
+
This architecture keeps the main `Application` class clean and focused on high-level assembly, while the details of each feature are neatly encapsulated within their respective components.
|
|
130
|
+
|
|
131
|
+
## 4. Custom Components
|
|
132
|
+
|
|
133
|
+
You can encapsulate your own logic or third-party integrations (like Socket.IO, Redis, specific Cron jobs) into reusable Components.
|
|
134
|
+
|
|
135
|
+
**Structure of a Component:**
|
|
136
|
+
1. Extend `BaseComponent`.
|
|
137
|
+
2. Define default `bindings` (optional configuration/options).
|
|
138
|
+
3. Implement `binding()` to register services, providers, or attach logic to the application.
|
|
139
|
+
|
|
140
|
+
**Example (`SocketIOComponent`):**
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
import { BaseComponent, inject, CoreBindings, Binding } from '@venizia/ignis';
|
|
144
|
+
|
|
145
|
+
export class MySocketComponent extends BaseComponent {
|
|
146
|
+
constructor(
|
|
147
|
+
@inject({ key: CoreBindings.APPLICATION_INSTANCE }) private application: BaseApplication,
|
|
148
|
+
) {
|
|
149
|
+
super({
|
|
150
|
+
scope: MySocketComponent.name,
|
|
151
|
+
// Automatically register bindings when component is loaded
|
|
152
|
+
initDefault: { enable: true, container: application },
|
|
153
|
+
bindings: {
|
|
154
|
+
// Define default configuration binding
|
|
155
|
+
'my.socket.options': Binding.bind({ key: 'my.socket.options' }).toValue({ port: 8080 }),
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// The binding method is called during application startup (preConfigure)
|
|
161
|
+
override binding(): void {
|
|
162
|
+
const options = this.application.get({ key: 'my.socket.options' });
|
|
163
|
+
|
|
164
|
+
this.logger.info('Initializing Socket.IO with options: %j', options);
|
|
165
|
+
|
|
166
|
+
// Perform setup logic, register other services, etc.
|
|
167
|
+
// this.application.bind(...).toValue(...);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
```
|
|
@@ -120,3 +120,44 @@ Use the centralized TypeScript configs:
|
|
|
120
120
|
- `skipLibCheck: true` - Faster compilation
|
|
121
121
|
|
|
122
122
|
See [`@venizia/dev-configs` documentation](../../references/src-details/dev-configs.md) for full details.
|
|
123
|
+
|
|
124
|
+
## Environment Variables Management
|
|
125
|
+
|
|
126
|
+
Avoid using `process.env` directly in your business logic. Instead, use the `applicationEnvironment` helper and define your keys as constants. This ensures type safety and centralized management.
|
|
127
|
+
|
|
128
|
+
**Define Keys (`src/common/environments.ts`):**
|
|
129
|
+
```typescript
|
|
130
|
+
export class EnvironmentKeys {
|
|
131
|
+
static readonly APP_ENV_STRIPE_KEY = 'APP_ENV_STRIPE_KEY';
|
|
132
|
+
static readonly APP_ENV_MAX_RETRIES = 'APP_ENV_MAX_RETRIES';
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Usage:**
|
|
137
|
+
```typescript
|
|
138
|
+
import { applicationEnvironment } from '@venizia/ignis';
|
|
139
|
+
import { EnvironmentKeys } from '@/common/environments';
|
|
140
|
+
|
|
141
|
+
// Correct usage
|
|
142
|
+
const stripeKey = applicationEnvironment.get<string>(EnvironmentKeys.APP_ENV_STRIPE_KEY);
|
|
143
|
+
const retries = applicationEnvironment.get<number>(EnvironmentKeys.APP_ENV_MAX_RETRIES);
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Standardized Error Handling
|
|
147
|
+
|
|
148
|
+
Use the `getError` helper and `HTTP` constants to throw consistent, formatted exceptions that the framework's error handler can process correctly.
|
|
149
|
+
|
|
150
|
+
**Example:**
|
|
151
|
+
```typescript
|
|
152
|
+
import { getError, HTTP } from '@venizia/ignis';
|
|
153
|
+
|
|
154
|
+
if (!record) {
|
|
155
|
+
throw getError({
|
|
156
|
+
statusCode: HTTP.ResultCodes.RS_4.NotFound,
|
|
157
|
+
message: 'Record not found',
|
|
158
|
+
// Optional details
|
|
159
|
+
details: { id: requestedId }
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
@@ -32,13 +32,45 @@ feature/*, fix/*, docs/* (your work)
|
|
|
32
32
|
git clone https://github.com/YOUR_USERNAME/ignis.git
|
|
33
33
|
cd ignis
|
|
34
34
|
|
|
35
|
-
# 3. Install dependencies
|
|
36
|
-
|
|
35
|
+
# 3. Install dependencies (this also runs force-update to fetch latest from NPM)
|
|
36
|
+
make install
|
|
37
|
+
# Or: bun install
|
|
37
38
|
|
|
38
39
|
# 4. Add upstream remote
|
|
39
40
|
git remote add upstream https://github.com/VENIZIA-AI/ignis.git
|
|
40
41
|
```
|
|
41
42
|
|
|
43
|
+
## Makefile Commands
|
|
44
|
+
|
|
45
|
+
The project uses a Makefile for common development tasks:
|
|
46
|
+
|
|
47
|
+
| Command | Description |
|
|
48
|
+
|---------|-------------|
|
|
49
|
+
| `make install` | Install dependencies and force-update from NPM |
|
|
50
|
+
| `make update` | Force update all packages from NPM registry |
|
|
51
|
+
| `make build` | Rebuild all packages in correct order |
|
|
52
|
+
| `make clean` | Clean build artifacts from all packages |
|
|
53
|
+
| `make lint` | Lint all packages |
|
|
54
|
+
| `make help` | Show all available commands |
|
|
55
|
+
|
|
56
|
+
**Individual package builds:**
|
|
57
|
+
```bash
|
|
58
|
+
make core # Build @venizia/ignis (after dependencies)
|
|
59
|
+
make helpers # Build @venizia/ignis-helpers
|
|
60
|
+
make inversion # Build @venizia/ignis-inversion
|
|
61
|
+
make dev-configs # Build @venizia/dev-configs
|
|
62
|
+
make docs # Build documentation
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Force update individual packages:**
|
|
66
|
+
```bash
|
|
67
|
+
make update-core
|
|
68
|
+
make update-helpers
|
|
69
|
+
make update-inversion
|
|
70
|
+
make update-dev-configs
|
|
71
|
+
make update-docs
|
|
72
|
+
```
|
|
73
|
+
|
|
42
74
|
## 2. Development Workflow
|
|
43
75
|
|
|
44
76
|
### Step 1: Create Branch
|
|
@@ -92,11 +124,13 @@ git commit -m "chore: upgrade Hono to v4.0"
|
|
|
92
124
|
### Step 4: Validate
|
|
93
125
|
|
|
94
126
|
```bash
|
|
95
|
-
# Lint and format
|
|
96
|
-
|
|
127
|
+
# Lint and format (from root)
|
|
128
|
+
make lint
|
|
129
|
+
# Or: bun run lint:fix
|
|
97
130
|
|
|
98
|
-
# Build
|
|
99
|
-
|
|
131
|
+
# Build all packages
|
|
132
|
+
make build
|
|
133
|
+
# Or: bun run build
|
|
100
134
|
|
|
101
135
|
# Run tests
|
|
102
136
|
bun run test
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Data Modeling
|
|
2
|
+
|
|
3
|
+
Ignis streamlines data modeling with Drizzle ORM by providing powerful helpers and "enrichers" that reduce boilerplate code for common schema patterns.
|
|
4
|
+
|
|
5
|
+
## 1. Base Entity
|
|
6
|
+
|
|
7
|
+
All entity models should extend `BaseEntity`. This provides integration with the framework's repository layer and automatic schema generation support.
|
|
8
|
+
|
|
9
|
+
**Example (`src/models/entities/configuration.model.ts`):**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import {
|
|
13
|
+
BaseEntity,
|
|
14
|
+
model,
|
|
15
|
+
TTableObject,
|
|
16
|
+
} from '@venizia/ignis';
|
|
17
|
+
import { configurationTable } from './schema'; // Your Drizzle schema
|
|
18
|
+
|
|
19
|
+
// Define types for TypeScript inference
|
|
20
|
+
export type TConfigurationSchema = typeof configurationTable;
|
|
21
|
+
export type TConfiguration = TTableObject<TConfigurationSchema>;
|
|
22
|
+
|
|
23
|
+
@model({ type: 'entity', skipMigrate: false })
|
|
24
|
+
export class Configuration extends BaseEntity<TConfigurationSchema> {
|
|
25
|
+
static readonly TABLE_NAME = Configuration.name;
|
|
26
|
+
|
|
27
|
+
constructor() {
|
|
28
|
+
super({
|
|
29
|
+
name: Configuration.TABLE_NAME,
|
|
30
|
+
schema: configurationTable,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 2. Schema Enrichers
|
|
37
|
+
|
|
38
|
+
Instead of manually defining common columns like primary keys, timestamps, or audit fields in every table, use Ignis "enrichers".
|
|
39
|
+
|
|
40
|
+
**Available Enrichers:**
|
|
41
|
+
|
|
42
|
+
| Enricher | Description | Columns Added |
|
|
43
|
+
|----------|-------------|---------------|
|
|
44
|
+
| `generateIdColumnDefs` | Adds a Primary Key | `id` (string/UUID or number/Serial) |
|
|
45
|
+
| `generateTzColumnDefs` | Adds timestamps | `createdAt`, `modifiedAt` (auto-updating) |
|
|
46
|
+
| `generateUserAuditColumnDefs` | Adds audit fields | `createdBy`, `modifiedBy` |
|
|
47
|
+
| `generateDataTypeColumnDefs` | Adds generic value fields | `nValue` (number), `tValue` (text), `jValue` (json), etc. |
|
|
48
|
+
| `generatePrincipalColumnDefs` | Adds polymorphic relation fields | `principalType`, `principalId` |
|
|
49
|
+
|
|
50
|
+
**Usage Example:**
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
import {
|
|
54
|
+
generateIdColumnDefs,
|
|
55
|
+
generateTzColumnDefs,
|
|
56
|
+
generateUserAuditColumnDefs,
|
|
57
|
+
} from '@venizia/ignis';
|
|
58
|
+
import { pgTable, text } from 'drizzle-orm/pg-core';
|
|
59
|
+
|
|
60
|
+
export const configurationTable = pgTable(
|
|
61
|
+
'Configuration',
|
|
62
|
+
{
|
|
63
|
+
// 1. Auto-generate UUID Primary Key
|
|
64
|
+
...generateIdColumnDefs({ id: { dataType: 'string' } }),
|
|
65
|
+
|
|
66
|
+
// 2. Auto-generate createdAt / modifiedAt
|
|
67
|
+
...generateTzColumnDefs(),
|
|
68
|
+
|
|
69
|
+
// 3. Auto-generate createdBy / modifiedBy
|
|
70
|
+
...generateUserAuditColumnDefs({
|
|
71
|
+
created: { dataType: 'string', columnName: 'created_by' },
|
|
72
|
+
modified: { dataType: 'string', columnName: 'modified_by' },
|
|
73
|
+
}),
|
|
74
|
+
|
|
75
|
+
// 4. Your custom columns
|
|
76
|
+
code: text('code').notNull(),
|
|
77
|
+
description: text('description'),
|
|
78
|
+
group: text('group').notNull(),
|
|
79
|
+
},
|
|
80
|
+
(table) => [
|
|
81
|
+
// Define indexes/constraints here
|
|
82
|
+
unique('UQ_code').on(table.code),
|
|
83
|
+
]
|
|
84
|
+
);
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 3. Defining Relations
|
|
88
|
+
|
|
89
|
+
Use the `createRelations` helper to define relationships cleanly. This abstracts the Drizzle `relations` function and makes it easy to bind to repositories.
|
|
90
|
+
|
|
91
|
+
**Example:**
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
import { createRelations, RelationTypes } from '@venizia/ignis';
|
|
95
|
+
import { userTable } from './user.model';
|
|
96
|
+
|
|
97
|
+
export const configurationRelations = createRelations({
|
|
98
|
+
source: configurationTable,
|
|
99
|
+
relations: [
|
|
100
|
+
{
|
|
101
|
+
name: 'creator',
|
|
102
|
+
type: RelationTypes.ONE,
|
|
103
|
+
schema: userTable,
|
|
104
|
+
metadata: {
|
|
105
|
+
fields: [configurationTable.createdBy],
|
|
106
|
+
references: [userTable.id],
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
This configuration is then passed directly to your Repository:
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
@repository({})
|
|
117
|
+
export class ConfigurationRepository extends DefaultCRUDRepository<TConfigurationSchema> {
|
|
118
|
+
constructor(@inject({ key: 'datasources.PostgresDataSource' }) dataSource: IDataSource) {
|
|
119
|
+
super({
|
|
120
|
+
dataSource,
|
|
121
|
+
entityClass: Configuration,
|
|
122
|
+
relations: configurationRelations.definitions, // <-- Injected here
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
```
|
|
@@ -50,7 +50,7 @@ Before a dependency can be injected, it must be **bound** to the container. This
|
|
|
50
50
|
|
|
51
51
|
The `Application` class provides helper methods for common resource types. These automatically create a binding with a conventional key.
|
|
52
52
|
|
|
53
|
-
| Method |
|
|
53
|
+
| Method | Default Key |
|
|
54
54
|
| :--- | :--- |
|
|
55
55
|
| `app.service(UserService)` | `services.UserService` |
|
|
56
56
|
| `app.repository(UserRepository)` | `repositories.UserRepository` |
|
|
@@ -58,6 +58,18 @@ The `Application` class provides helper methods for common resource types. These
|
|
|
58
58
|
| `app.controller(UserController)` | `controllers.UserController` |
|
|
59
59
|
| `app.component(MyComponent)` | `components.MyComponent` |
|
|
60
60
|
|
|
61
|
+
All these methods accept an optional second parameter to customize the binding key:
|
|
62
|
+
|
|
63
|
+
```typescript
|
|
64
|
+
// Default binding (key: 'controllers.UserController')
|
|
65
|
+
app.controller(UserController);
|
|
66
|
+
|
|
67
|
+
// Custom binding key
|
|
68
|
+
app.controller(UserController, {
|
|
69
|
+
binding: { namespace: 'controllers', key: 'CustomUserController' }
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
61
73
|
### Custom Bindings
|
|
62
74
|
|
|
63
75
|
For other values or more complex setups, use the `bind` method directly.
|