@hyphaene/hexa-ts-kit 1.0.0

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/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/cli.js ADDED
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ analyzeCommand,
4
+ lintCommand,
5
+ scaffoldCommand
6
+ } from "./chunk-56VIQG3N.js";
7
+
8
+ // src/cli.ts
9
+ import { program } from "commander";
10
+ import { createRequire } from "module";
11
+ var require2 = createRequire(import.meta.url);
12
+ var { version: VERSION } = require2("../package.json");
13
+ program.name("hexa-ts").description(
14
+ "TypeScript dev kit: architecture linting, scaffolding, knowledge analysis"
15
+ ).version(VERSION);
16
+ program.command("lint [path]").description("Lint files for colocation architecture rules").option("-f, --format <type>", "Output format: console, json", "console").option("--changed", "Only lint files changed in git").option(
17
+ "--rules <rules>",
18
+ "Comma-separated list of rule prefixes to run (COL,NAM,DOM,VUE,etc)"
19
+ ).option("--quiet", "Only show errors, hide warnings and info").option("--debug", "Show debug information").action(lintCommand);
20
+ program.command("analyze [files...]").description("Map files to their associated knowledges").option("--changed", "Analyze files changed in git").option(
21
+ "--knowledge-path <path>",
22
+ "Path to knowledge files",
23
+ "~/.claude/marketplace/shared/knowledge"
24
+ ).action(analyzeCommand);
25
+ program.command("scaffold <type> <path>").description("Generate a colocated feature structure").option("--dry-run", "Show what would be created without writing files").action(scaffoldCommand);
26
+ program.parse();
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
@@ -0,0 +1,104 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ analyzeCore,
4
+ lintCore,
5
+ scaffoldCore
6
+ } from "./chunk-56VIQG3N.js";
7
+
8
+ // src/mcp-server.ts
9
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
10
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
11
+ import { z } from "zod";
12
+ import { createRequire } from "module";
13
+ var require2 = createRequire(import.meta.url);
14
+ var { version: VERSION } = require2("../package.json");
15
+ var server = new McpServer({
16
+ name: "hexa-ts-kit",
17
+ version: VERSION
18
+ });
19
+ server.tool(
20
+ "lint",
21
+ "Lint files for colocation architecture rules. Checks 71 rules across structure (COL, NAM, DOM) and AST (VUE, RUL, TSP) categories. Use --changed for incremental mode on git-modified files only.",
22
+ {
23
+ path: z.string().optional().describe("Path to lint (default: current working directory)"),
24
+ changed: z.boolean().optional().describe("Only lint git-changed files (staged and unstaged)"),
25
+ rules: z.string().optional().describe(
26
+ "Filter by rule prefix, comma-separated (COL, NAM, DOM, VUE, RUL, TSP)"
27
+ ),
28
+ quiet: z.boolean().optional().describe("Only show errors, hide warnings and info")
29
+ },
30
+ async (params) => {
31
+ const result = await lintCore({
32
+ path: params.path,
33
+ changed: params.changed,
34
+ rules: params.rules,
35
+ quiet: params.quiet
36
+ });
37
+ return {
38
+ content: [
39
+ {
40
+ type: "text",
41
+ text: JSON.stringify(result, null, 2)
42
+ }
43
+ ]
44
+ };
45
+ }
46
+ );
47
+ server.tool(
48
+ "analyze",
49
+ "Map files to their associated knowledges. CALL THIS BEFORE writing .composable.ts, .rules.ts, .vue, .controller.ts, .service.ts files to know which knowledge files to read for best practices and patterns.",
50
+ {
51
+ files: z.array(z.string()).optional().describe("Files to analyze (relative or absolute paths)"),
52
+ changed: z.boolean().optional().describe("Analyze git-changed files instead of specified files"),
53
+ knowledgePath: z.string().optional().describe(
54
+ "Path to knowledge files (default: ~/.claude/marketplace/shared/knowledge)"
55
+ )
56
+ },
57
+ async (params) => {
58
+ const result = await analyzeCore({
59
+ files: params.files,
60
+ changed: params.changed,
61
+ knowledgePath: params.knowledgePath
62
+ });
63
+ return {
64
+ content: [
65
+ {
66
+ type: "text",
67
+ text: JSON.stringify(result, null, 2)
68
+ }
69
+ ]
70
+ };
71
+ }
72
+ );
73
+ server.tool(
74
+ "scaffold",
75
+ "Generate a complete colocated feature structure with all required files. Creates Vue features (component, composable, rules, types, query, translations, tests), NestJS features (module, controller, service, types, tests), or Playwright features (spec, page object, fixtures).",
76
+ {
77
+ type: z.enum(["vue-feature", "nestjs-feature", "playwright-feature"]).describe("Type of feature to scaffold"),
78
+ path: z.string().describe("Target path for the feature directory"),
79
+ dryRun: z.boolean().optional().describe("Preview files that would be created without writing them")
80
+ },
81
+ async (params) => {
82
+ const result = await scaffoldCore({
83
+ type: params.type,
84
+ path: params.path,
85
+ dryRun: params.dryRun
86
+ });
87
+ return {
88
+ content: [
89
+ {
90
+ type: "text",
91
+ text: JSON.stringify(result, null, 2)
92
+ }
93
+ ]
94
+ };
95
+ }
96
+ );
97
+ async function main() {
98
+ const transport = new StdioServerTransport();
99
+ await server.connect(transport);
100
+ }
101
+ main().catch((error) => {
102
+ console.error("Failed to start MCP server:", error);
103
+ process.exit(1);
104
+ });
package/package.json ADDED
@@ -0,0 +1,81 @@
1
+ {
2
+ "name": "@hyphaene/hexa-ts-kit",
3
+ "version": "1.0.0",
4
+ "description": "TypeScript dev kit for Claude Code agents: architecture linting, scaffolding, knowledge analysis",
5
+ "type": "module",
6
+ "bin": {
7
+ "hexa-ts": "./bin/hexa-ts.js",
8
+ "hexa-ts-mcp": "./bin/hexa-ts-mcp.js",
9
+ "hts": "./bin/hexa-ts.js"
10
+ },
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "bin"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsup src/cli.ts src/mcp-server.ts --format esm --dts --clean",
20
+ "dev": "tsup src/cli.ts src/mcp-server.ts --format esm --watch",
21
+ "lint": "node bin/hexa-ts.js lint",
22
+ "typecheck": "tsc --noEmit",
23
+ "test": "vitest run",
24
+ "test:watch": "vitest",
25
+ "test:coverage": "vitest run --coverage"
26
+ },
27
+ "repository": {
28
+ "type": "git",
29
+ "url": "https://github.com/hyphaene/hexa-ts-kit.git"
30
+ },
31
+ "keywords": [
32
+ "claude",
33
+ "mcp",
34
+ "lint",
35
+ "scaffold",
36
+ "vue",
37
+ "nestjs",
38
+ "playwright",
39
+ "colocation"
40
+ ],
41
+ "author": "hyphaene",
42
+ "license": "MIT",
43
+ "bugs": {
44
+ "url": "https://github.com/hyphaene/hexa-ts-kit/issues"
45
+ },
46
+ "homepage": "https://github.com/hyphaene/hexa-ts-kit#readme",
47
+ "dependencies": {
48
+ "@modelcontextprotocol/sdk": "^1.25.1",
49
+ "@typescript-eslint/parser": "^8.50.1",
50
+ "@typescript-eslint/typescript-estree": "^8.50.1",
51
+ "commander": "^12.1.0",
52
+ "fast-glob": "^3.3.2",
53
+ "gray-matter": "^4.0.3",
54
+ "minimatch": "^10.0.1",
55
+ "picocolors": "^1.1.1",
56
+ "vue-eslint-parser": "^10.2.0",
57
+ "zod": "^4.3.4"
58
+ },
59
+ "devDependencies": {
60
+ "@types/node": "^22.10.2",
61
+ "@vitest/coverage-v8": "^3.1.4",
62
+ "semantic-release": "^24.2.5",
63
+ "tsup": "^8.3.5",
64
+ "typescript": "^5.7.2",
65
+ "vitest": "^3.1.4"
66
+ },
67
+ "engines": {
68
+ "node": ">=20"
69
+ },
70
+ "release": {
71
+ "branches": [
72
+ "main"
73
+ ],
74
+ "plugins": [
75
+ "@semantic-release/commit-analyzer",
76
+ "@semantic-release/release-notes-generator",
77
+ "@semantic-release/npm",
78
+ "@semantic-release/github"
79
+ ]
80
+ }
81
+ }