docspec 0.1.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.
Files changed (42) hide show
  1. package/README.md +121 -0
  2. package/dist/__tests__/cli.test.d.ts +2 -0
  3. package/dist/__tests__/cli.test.d.ts.map +1 -0
  4. package/dist/__tests__/cli.test.js +257 -0
  5. package/dist/__tests__/cli.test.js.map +1 -0
  6. package/dist/__tests__/constants.test.d.ts +2 -0
  7. package/dist/__tests__/constants.test.d.ts.map +1 -0
  8. package/dist/__tests__/constants.test.js +67 -0
  9. package/dist/__tests__/constants.test.js.map +1 -0
  10. package/dist/__tests__/generator.test.d.ts +2 -0
  11. package/dist/__tests__/generator.test.d.ts.map +1 -0
  12. package/dist/__tests__/generator.test.js +118 -0
  13. package/dist/__tests__/generator.test.js.map +1 -0
  14. package/dist/__tests__/validator.test.d.ts +2 -0
  15. package/dist/__tests__/validator.test.d.ts.map +1 -0
  16. package/dist/__tests__/validator.test.js +375 -0
  17. package/dist/__tests__/validator.test.js.map +1 -0
  18. package/dist/cli.d.ts +3 -0
  19. package/dist/cli.d.ts.map +1 -0
  20. package/dist/cli.js +134 -0
  21. package/dist/cli.js.map +1 -0
  22. package/dist/constants.d.ts +13 -0
  23. package/dist/constants.d.ts.map +1 -0
  24. package/dist/constants.js +55 -0
  25. package/dist/constants.js.map +1 -0
  26. package/dist/generator.d.ts +12 -0
  27. package/dist/generator.d.ts.map +1 -0
  28. package/dist/generator.js +77 -0
  29. package/dist/generator.js.map +1 -0
  30. package/dist/index.d.ts +8 -0
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.js +15 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/types.d.ts +16 -0
  35. package/dist/types.d.ts.map +1 -0
  36. package/dist/types.js +3 -0
  37. package/dist/types.js.map +1 -0
  38. package/dist/validator.d.ts +7 -0
  39. package/dist/validator.d.ts.map +1 -0
  40. package/dist/validator.js +173 -0
  41. package/dist/validator.js.map +1 -0
  42. package/package.json +38 -0
@@ -0,0 +1,77 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.generateDocspec = generateDocspec;
37
+ exports.generateDocspecContent = generateDocspecContent;
38
+ const constants_1 = require("./constants");
39
+ const fs = __importStar(require("fs/promises"));
40
+ const path = __importStar(require("path"));
41
+ /**
42
+ * Generate a new docspec file at the specified path
43
+ * @param filePath Path where the docspec file should be created
44
+ * @param name Name of the document (used in the header)
45
+ */
46
+ async function generateDocspec(filePath, name) {
47
+ // Extract name from file path if not provided
48
+ const docName = name || extractNameFromPath(filePath);
49
+ // Generate the template content
50
+ const content = (0, constants_1.getDocspecTemplate)(docName);
51
+ // Ensure the directory exists (recursive: true is safe even if dir exists)
52
+ const dir = path.dirname(filePath);
53
+ if (dir !== ".") {
54
+ await fs.mkdir(dir, { recursive: true });
55
+ }
56
+ // Write the file
57
+ await fs.writeFile(filePath, content, "utf-8");
58
+ }
59
+ /**
60
+ * Generate docspec content as a string (for library use)
61
+ * @param name Name of the document
62
+ */
63
+ function generateDocspecContent(name) {
64
+ return (0, constants_1.getDocspecTemplate)(name);
65
+ }
66
+ /**
67
+ * Extract a document name from a file path
68
+ */
69
+ function extractNameFromPath(filePath) {
70
+ const basename = path.basename(filePath, ".docspec.md");
71
+ // Convert kebab-case, snake_case, or camelCase to Title Case
72
+ return basename
73
+ .split(/[-_]/)
74
+ .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
75
+ .join(" ");
76
+ }
77
+ //# sourceMappingURL=generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,0CAeC;AAMD,wDAEC;AAhCD,2CAAiD;AACjD,gDAAkC;AAClC,2CAA6B;AAE7B;;;;GAIG;AACI,KAAK,UAAU,eAAe,CAAC,QAAgB,EAAE,IAAa;IACnE,8CAA8C;IAC9C,MAAM,OAAO,GAAG,IAAI,IAAI,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAEtD,gCAAgC;IAChC,MAAM,OAAO,GAAG,IAAA,8BAAkB,EAAC,OAAO,CAAC,CAAC;IAE5C,2EAA2E;IAC3E,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,GAAG,KAAK,GAAG,EAAE,CAAC;QAChB,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED,iBAAiB;IACjB,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,SAAgB,sBAAsB,CAAC,IAAY;IACjD,OAAO,IAAA,8BAAkB,EAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,SAAS,mBAAmB,CAAC,QAAgB;IAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IACxD,6DAA6D;IAC7D,OAAO,QAAQ;SACZ,KAAK,CAAC,MAAM,CAAC;SACb,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;SACvE,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * docspec - Generate and validate docspec files
3
+ */
4
+ export { validateDocspec } from "./validator";
5
+ export { generateDocspec, generateDocspecContent } from "./generator";
6
+ export type { ValidationResult, DocspecSection } from "./types";
7
+ export { REQUIRED_SECTIONS, SECTION_BOILERPLATE } from "./constants";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACtE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ /**
3
+ * docspec - Generate and validate docspec files
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SECTION_BOILERPLATE = exports.REQUIRED_SECTIONS = exports.generateDocspecContent = exports.generateDocspec = exports.validateDocspec = void 0;
7
+ var validator_1 = require("./validator");
8
+ Object.defineProperty(exports, "validateDocspec", { enumerable: true, get: function () { return validator_1.validateDocspec; } });
9
+ var generator_1 = require("./generator");
10
+ Object.defineProperty(exports, "generateDocspec", { enumerable: true, get: function () { return generator_1.generateDocspec; } });
11
+ Object.defineProperty(exports, "generateDocspecContent", { enumerable: true, get: function () { return generator_1.generateDocspecContent; } });
12
+ var constants_1 = require("./constants");
13
+ Object.defineProperty(exports, "REQUIRED_SECTIONS", { enumerable: true, get: function () { return constants_1.REQUIRED_SECTIONS; } });
14
+ Object.defineProperty(exports, "SECTION_BOILERPLATE", { enumerable: true, get: function () { return constants_1.SECTION_BOILERPLATE; } });
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,yCAA8C;AAArC,4GAAA,eAAe,OAAA;AACxB,yCAAsE;AAA7D,4GAAA,eAAe,OAAA;AAAE,mHAAA,sBAAsB,OAAA;AAEhD,yCAAqE;AAA5D,8GAAA,iBAAiB,OAAA;AAAE,gHAAA,mBAAmB,OAAA"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Result of validating a docspec file
3
+ */
4
+ export interface ValidationResult {
5
+ valid: boolean;
6
+ errors: string[];
7
+ }
8
+ /**
9
+ * Metadata about a docspec section
10
+ */
11
+ export interface DocspecSection {
12
+ name: string;
13
+ content: string;
14
+ lineNumber: number;
15
+ }
16
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB"}
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { ValidationResult } from "./types";
2
+ /**
3
+ * Validate a docspec file
4
+ * @param filePath Path to the docspec file to validate
5
+ */
6
+ export declare function validateDocspec(filePath: string): Promise<ValidationResult>;
7
+ //# sourceMappingURL=validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../src/validator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAkB,MAAM,SAAS,CAAC;AAG3D;;;GAGG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA+CjF"}
@@ -0,0 +1,173 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.validateDocspec = validateDocspec;
37
+ const fs = __importStar(require("fs/promises"));
38
+ const constants_1 = require("./constants");
39
+ /**
40
+ * Validate a docspec file
41
+ * @param filePath Path to the docspec file to validate
42
+ */
43
+ async function validateDocspec(filePath) {
44
+ const errors = [];
45
+ try {
46
+ const content = await fs.readFile(filePath, "utf-8");
47
+ const sections = parseSections(content);
48
+ // Check for all required sections
49
+ const foundSections = new Set();
50
+ for (const section of sections) {
51
+ foundSections.add(section.name);
52
+ }
53
+ // Check for missing sections
54
+ for (const requiredSection of constants_1.REQUIRED_SECTIONS) {
55
+ if (!foundSections.has(requiredSection)) {
56
+ errors.push(`Missing required section: "${requiredSection}"`);
57
+ }
58
+ }
59
+ // Validate each section's content
60
+ for (const section of sections) {
61
+ if (constants_1.REQUIRED_SECTIONS.includes(section.name)) {
62
+ const validationError = validateSectionContent(section);
63
+ if (validationError) {
64
+ errors.push(validationError);
65
+ }
66
+ }
67
+ }
68
+ return {
69
+ valid: errors.length === 0,
70
+ errors,
71
+ };
72
+ }
73
+ catch (error) {
74
+ if (error instanceof Error) {
75
+ return {
76
+ valid: false,
77
+ errors: [`Failed to read file: ${error.message}`],
78
+ };
79
+ }
80
+ return {
81
+ valid: false,
82
+ errors: [`Failed to read file: ${String(error)}`],
83
+ };
84
+ }
85
+ }
86
+ /**
87
+ * Parse markdown content into sections
88
+ */
89
+ function parseSections(content) {
90
+ const sections = [];
91
+ const lines = content.split("\n");
92
+ let currentSection = null;
93
+ let lineNumber = 1;
94
+ for (let i = 0; i < lines.length; i++) {
95
+ const line = lines[i];
96
+ const trimmedLine = line.trim();
97
+ // Check for section headers (## or ###)
98
+ const headerMatch = trimmedLine.match(/^#{2,}\s+(.+)$/);
99
+ if (headerMatch) {
100
+ // Save previous section if exists
101
+ if (currentSection) {
102
+ sections.push(currentSection);
103
+ }
104
+ // Extract section name (remove section number if present)
105
+ let sectionName = headerMatch[1].trim();
106
+ // Remove leading number and period (e.g., "1. Purpose" -> "Purpose")
107
+ sectionName = sectionName.replace(/^\d+\.\s*/, "");
108
+ currentSection = {
109
+ name: sectionName,
110
+ content: "",
111
+ lineNumber: i + 1,
112
+ };
113
+ }
114
+ else if (currentSection) {
115
+ // Accumulate content for current section
116
+ if (currentSection.content) {
117
+ currentSection.content += "\n";
118
+ }
119
+ currentSection.content += line;
120
+ }
121
+ lineNumber++;
122
+ }
123
+ // Add the last section
124
+ if (currentSection) {
125
+ sections.push(currentSection);
126
+ }
127
+ return sections;
128
+ }
129
+ /**
130
+ * Validate that section content differs from boilerplate
131
+ */
132
+ function validateSectionContent(section) {
133
+ const boilerplate = constants_1.SECTION_BOILERPLATE[section.name];
134
+ if (!boilerplate) {
135
+ return null; // Not a required section, skip validation
136
+ }
137
+ // Clean content: remove separator lines (---) and trim
138
+ let content = section.content
139
+ .split("\n")
140
+ .filter(line => line.trim() !== "---")
141
+ .join("\n")
142
+ .trim();
143
+ const boilerplateTrimmed = boilerplate.trim();
144
+ // Check if content is empty
145
+ if (!content) {
146
+ return `Section "${section.name}" (line ${section.lineNumber}) is empty`;
147
+ }
148
+ // Check if content matches boilerplate exactly
149
+ if (content === boilerplateTrimmed) {
150
+ return `Section "${section.name}" (line ${section.lineNumber}) contains only boilerplate text and has not been customized`;
151
+ }
152
+ // Check if content is too similar to boilerplate (only whitespace differences)
153
+ const normalizedContent = normalizeWhitespace(content);
154
+ const normalizedBoilerplate = normalizeWhitespace(boilerplateTrimmed);
155
+ if (normalizedContent === normalizedBoilerplate) {
156
+ return `Section "${section.name}" (line ${section.lineNumber}) is too similar to boilerplate (only whitespace differences)`;
157
+ }
158
+ // Check if content is just a subset of boilerplate (very short)
159
+ if (content.length < 50) {
160
+ return `Section "${section.name}" (line ${section.lineNumber}) appears to be incomplete (too short)`;
161
+ }
162
+ return null;
163
+ }
164
+ /**
165
+ * Normalize whitespace for comparison
166
+ */
167
+ function normalizeWhitespace(text) {
168
+ return text
169
+ .replace(/\s+/g, " ")
170
+ .replace(/\n+/g, "\n")
171
+ .trim();
172
+ }
173
+ //# sourceMappingURL=validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validator.js","sourceRoot":"","sources":["../src/validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,0CA+CC;AAvDD,gDAAkC;AAElC,2CAAqE;AAErE;;;GAGG;AACI,KAAK,UAAU,eAAe,CAAC,QAAgB;IACpD,MAAM,MAAM,GAAa,EAAE,CAAC;IAE5B,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACrD,MAAM,QAAQ,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;QAExC,kCAAkC;QAClC,MAAM,aAAa,GAAG,IAAI,GAAG,EAAU,CAAC;QAExC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;QAED,6BAA6B;QAC7B,KAAK,MAAM,eAAe,IAAI,6BAAiB,EAAE,CAAC;YAChD,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,CAAC;gBACxC,MAAM,CAA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IAAI,CAAC,IAAI,EAAE,KAAK,KAAK,CAAC;SACrC,IAAI,CAAC,IAAI,CAAC;SACV,IAAI,EAAE,CAAC;IACV,MAAM,kBAAkB,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;IAE9C,4BAA4B;IAC5B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,YAAY,OAAO,CAAC,IAAI,WAAW,OAAO,CAAC,UAAU,YAAY,CAAC;IAC3E,CAAC;IAED,+CAA+C;IAC/C,IAAI,OAAO,KAAK,kBAAkB,EAAE,CAAC;QACnC,OAAO,YAAY,OAAO,CAAC,IAAI,WAAW,OAAO,CAAC,UAAU,8DAA8D,CAAC;IAC7H,CAAC;IAED,+EAA+E;IAC/E,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACvD,MAAM,qBAAqB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;IAEtE,IAAI,iBAAiB,KAAK,qBAAqB,EAAE,CAAC;QAChD,OAAO,YAAY,OAAO,CAAC,IAAI,WAAW,OAAO,CAAC,UAAU,+DAA+D,CAAC;IAC9H,CAAC;IAED,gEAAgE;IAChE,IAAI,OAAO,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;QACxB,OAAO,YAAY,OAAO,CAAC,IAAI,WAAW,OAAO,CAAC,UAAU,wCAAwC,CAAC;IACvG,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,SAAS,mBAAmB,CAAC,IAAY;IACvC,OAAO,IAAI;SACR,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC;SACrB,IAAI,EAAE,CAAC;AACZ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "docspec",
3
+ "version": "0.1.0",
4
+ "description": "Generate and validate docspec files (*.docspec.md) with standardized format",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "bin": {
8
+ "docspec": "dist/cli.js"
9
+ },
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "test": "jest",
13
+ "test:watch": "jest --watch",
14
+ "prepublishOnly": "npm run build"
15
+ },
16
+ "keywords": [
17
+ "docspec",
18
+ "documentation",
19
+ "validation",
20
+ "markdown"
21
+ ],
22
+ "author": "",
23
+ "license": "MIT",
24
+ "files": [
25
+ "dist",
26
+ "README.md"
27
+ ],
28
+ "devDependencies": {
29
+ "@types/jest": "^30.0.0",
30
+ "@types/node": "^25.0.2",
31
+ "jest": "^30.2.0",
32
+ "ts-jest": "^29.4.6",
33
+ "typescript": "^5.9.3"
34
+ },
35
+ "dependencies": {
36
+ "commander": "^14.0.2"
37
+ }
38
+ }