@theglitchking/hit-em-with-the-docs 2.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/.claude-plugin/marketplace.json +46 -0
- package/.claude-plugin/plugin.json +114 -0
- package/LICENSE +21 -0
- package/MIGRATION.md +255 -0
- package/README.backup.md +714 -0
- package/README.md +869 -0
- package/action.yml +56 -0
- package/dist/action/action/index.d.ts +2 -0
- package/dist/action/action/index.d.ts.map +1 -0
- package/dist/action/cli/index.d.ts +3 -0
- package/dist/action/cli/index.d.ts.map +1 -0
- package/dist/action/core/audit/auditor.d.ts +43 -0
- package/dist/action/core/audit/auditor.d.ts.map +1 -0
- package/dist/action/core/audit/rules.d.ts +37 -0
- package/dist/action/core/audit/rules.d.ts.map +1 -0
- package/dist/action/core/discover/antipatterns.d.ts +24 -0
- package/dist/action/core/discover/antipatterns.d.ts.map +1 -0
- package/dist/action/core/discover/dependencies.d.ts +57 -0
- package/dist/action/core/discover/dependencies.d.ts.map +1 -0
- package/dist/action/core/discover/patterns.d.ts +38 -0
- package/dist/action/core/discover/patterns.d.ts.map +1 -0
- package/dist/action/core/discover/standards.d.ts +58 -0
- package/dist/action/core/discover/standards.d.ts.map +1 -0
- package/dist/action/core/domains/classifier.d.ts +41 -0
- package/dist/action/core/domains/classifier.d.ts.map +1 -0
- package/dist/action/core/domains/constants.d.ts +40 -0
- package/dist/action/core/domains/constants.d.ts.map +1 -0
- package/dist/action/core/domains/detector.d.ts +35 -0
- package/dist/action/core/domains/detector.d.ts.map +1 -0
- package/dist/action/core/integrate/integrator.d.ts +35 -0
- package/dist/action/core/integrate/integrator.d.ts.map +1 -0
- package/dist/action/core/links/checker.d.ts +64 -0
- package/dist/action/core/links/checker.d.ts.map +1 -0
- package/dist/action/core/links/tracker.d.ts +69 -0
- package/dist/action/core/links/tracker.d.ts.map +1 -0
- package/dist/action/core/maintain/orchestrator.d.ts +39 -0
- package/dist/action/core/maintain/orchestrator.d.ts.map +1 -0
- package/dist/action/core/metadata/generator.d.ts +26 -0
- package/dist/action/core/metadata/generator.d.ts.map +1 -0
- package/dist/action/core/metadata/schema.d.ts +201 -0
- package/dist/action/core/metadata/schema.d.ts.map +1 -0
- package/dist/action/core/metadata/sync.d.ts +36 -0
- package/dist/action/core/metadata/sync.d.ts.map +1 -0
- package/dist/action/generators/index-generator.d.ts +19 -0
- package/dist/action/generators/index-generator.d.ts.map +1 -0
- package/dist/action/generators/registry-generator.d.ts +11 -0
- package/dist/action/generators/registry-generator.d.ts.map +1 -0
- package/dist/action/generators/scaffold.d.ts +30 -0
- package/dist/action/generators/scaffold.d.ts.map +1 -0
- package/dist/action/generators/templates/document.d.ts +14 -0
- package/dist/action/generators/templates/document.d.ts.map +1 -0
- package/dist/action/generators/templates/domain-index.d.ts +6 -0
- package/dist/action/generators/templates/domain-index.d.ts.map +1 -0
- package/dist/action/generators/templates/domain-registry.d.ts +6 -0
- package/dist/action/generators/templates/domain-registry.d.ts.map +1 -0
- package/dist/action/index.d.ts +31 -0
- package/dist/action/index.d.ts.map +1 -0
- package/dist/action/index.js +17 -0
- package/dist/action/index.js.map +1 -0
- package/dist/action/package.json +3 -0
- package/dist/action/reports/audit-report.d.ts +15 -0
- package/dist/action/reports/audit-report.d.ts.map +1 -0
- package/dist/action/reports/health-report.d.ts +15 -0
- package/dist/action/reports/health-report.d.ts.map +1 -0
- package/dist/action/reports/link-report.d.ts +15 -0
- package/dist/action/reports/link-report.d.ts.map +1 -0
- package/dist/action/utils/frontmatter.d.ts +50 -0
- package/dist/action/utils/frontmatter.d.ts.map +1 -0
- package/dist/action/utils/glob.d.ts +63 -0
- package/dist/action/utils/glob.d.ts.map +1 -0
- package/dist/action/utils/logger.d.ts +42 -0
- package/dist/action/utils/logger.d.ts.map +1 -0
- package/dist/action/utils/markdown.d.ts +89 -0
- package/dist/action/utils/markdown.d.ts.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +287 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/audit/auditor.d.ts +43 -0
- package/dist/core/audit/auditor.d.ts.map +1 -0
- package/dist/core/audit/auditor.js +273 -0
- package/dist/core/audit/auditor.js.map +1 -0
- package/dist/core/audit/rules.d.ts +37 -0
- package/dist/core/audit/rules.d.ts.map +1 -0
- package/dist/core/audit/rules.js +223 -0
- package/dist/core/audit/rules.js.map +1 -0
- package/dist/core/discover/antipatterns.d.ts +24 -0
- package/dist/core/discover/antipatterns.d.ts.map +1 -0
- package/dist/core/discover/antipatterns.js +354 -0
- package/dist/core/discover/antipatterns.js.map +1 -0
- package/dist/core/discover/dependencies.d.ts +57 -0
- package/dist/core/discover/dependencies.d.ts.map +1 -0
- package/dist/core/discover/dependencies.js +311 -0
- package/dist/core/discover/dependencies.js.map +1 -0
- package/dist/core/discover/patterns.d.ts +38 -0
- package/dist/core/discover/patterns.d.ts.map +1 -0
- package/dist/core/discover/patterns.js +371 -0
- package/dist/core/discover/patterns.js.map +1 -0
- package/dist/core/discover/standards.d.ts +58 -0
- package/dist/core/discover/standards.d.ts.map +1 -0
- package/dist/core/discover/standards.js +359 -0
- package/dist/core/discover/standards.js.map +1 -0
- package/dist/core/domains/classifier.d.ts +41 -0
- package/dist/core/domains/classifier.d.ts.map +1 -0
- package/dist/core/domains/classifier.js +208 -0
- package/dist/core/domains/classifier.js.map +1 -0
- package/dist/core/domains/constants.d.ts +40 -0
- package/dist/core/domains/constants.d.ts.map +1 -0
- package/dist/core/domains/constants.js +252 -0
- package/dist/core/domains/constants.js.map +1 -0
- package/dist/core/domains/detector.d.ts +35 -0
- package/dist/core/domains/detector.d.ts.map +1 -0
- package/dist/core/domains/detector.js +176 -0
- package/dist/core/domains/detector.js.map +1 -0
- package/dist/core/integrate/integrator.d.ts +35 -0
- package/dist/core/integrate/integrator.d.ts.map +1 -0
- package/dist/core/integrate/integrator.js +216 -0
- package/dist/core/integrate/integrator.js.map +1 -0
- package/dist/core/links/checker.d.ts +64 -0
- package/dist/core/links/checker.d.ts.map +1 -0
- package/dist/core/links/checker.js +190 -0
- package/dist/core/links/checker.js.map +1 -0
- package/dist/core/links/tracker.d.ts +69 -0
- package/dist/core/links/tracker.d.ts.map +1 -0
- package/dist/core/links/tracker.js +184 -0
- package/dist/core/links/tracker.js.map +1 -0
- package/dist/core/maintain/orchestrator.d.ts +39 -0
- package/dist/core/maintain/orchestrator.d.ts.map +1 -0
- package/dist/core/maintain/orchestrator.js +372 -0
- package/dist/core/maintain/orchestrator.js.map +1 -0
- package/dist/core/metadata/generator.d.ts +26 -0
- package/dist/core/metadata/generator.d.ts.map +1 -0
- package/dist/core/metadata/generator.js +221 -0
- package/dist/core/metadata/generator.js.map +1 -0
- package/dist/core/metadata/schema.d.ts +201 -0
- package/dist/core/metadata/schema.d.ts.map +1 -0
- package/dist/core/metadata/schema.js +184 -0
- package/dist/core/metadata/schema.js.map +1 -0
- package/dist/core/metadata/sync.d.ts +36 -0
- package/dist/core/metadata/sync.d.ts.map +1 -0
- package/dist/core/metadata/sync.js +195 -0
- package/dist/core/metadata/sync.js.map +1 -0
- package/dist/generators/index-generator.d.ts +19 -0
- package/dist/generators/index-generator.d.ts.map +1 -0
- package/dist/generators/index-generator.js +191 -0
- package/dist/generators/index-generator.js.map +1 -0
- package/dist/generators/registry-generator.d.ts +11 -0
- package/dist/generators/registry-generator.d.ts.map +1 -0
- package/dist/generators/registry-generator.js +156 -0
- package/dist/generators/registry-generator.js.map +1 -0
- package/dist/generators/scaffold.d.ts +30 -0
- package/dist/generators/scaffold.d.ts.map +1 -0
- package/dist/generators/scaffold.js +213 -0
- package/dist/generators/scaffold.js.map +1 -0
- package/dist/generators/templates/document.d.ts +14 -0
- package/dist/generators/templates/document.d.ts.map +1 -0
- package/dist/generators/templates/document.js +305 -0
- package/dist/generators/templates/document.js.map +1 -0
- package/dist/generators/templates/domain-index.d.ts +6 -0
- package/dist/generators/templates/domain-index.d.ts.map +1 -0
- package/dist/generators/templates/domain-index.js +68 -0
- package/dist/generators/templates/domain-index.js.map +1 -0
- package/dist/generators/templates/domain-registry.d.ts +6 -0
- package/dist/generators/templates/domain-registry.d.ts.map +1 -0
- package/dist/generators/templates/domain-registry.js +59 -0
- package/dist/generators/templates/domain-registry.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/reports/audit-report.d.ts +15 -0
- package/dist/reports/audit-report.d.ts.map +1 -0
- package/dist/reports/audit-report.js +150 -0
- package/dist/reports/audit-report.js.map +1 -0
- package/dist/reports/health-report.d.ts +15 -0
- package/dist/reports/health-report.d.ts.map +1 -0
- package/dist/reports/health-report.js +175 -0
- package/dist/reports/health-report.js.map +1 -0
- package/dist/reports/link-report.d.ts +15 -0
- package/dist/reports/link-report.d.ts.map +1 -0
- package/dist/reports/link-report.js +165 -0
- package/dist/reports/link-report.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +50 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +93 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/glob.d.ts +63 -0
- package/dist/utils/glob.d.ts.map +1 -0
- package/dist/utils/glob.js +128 -0
- package/dist/utils/glob.js.map +1 -0
- package/dist/utils/logger.d.ts +42 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +118 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/markdown.d.ts +89 -0
- package/dist/utils/markdown.d.ts.map +1 -0
- package/dist/utils/markdown.js +192 -0
- package/dist/utils/markdown.js.map +1 -0
- package/package.json +100 -0
- package/templates/claude/CLAUDE.md +204 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Domain } from '../core/domains/constants.js';
|
|
2
|
+
export interface ScaffoldOptions {
|
|
3
|
+
rootPath: string;
|
|
4
|
+
overwrite?: boolean;
|
|
5
|
+
domains?: Domain[];
|
|
6
|
+
silent?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface ScaffoldResult {
|
|
9
|
+
success: boolean;
|
|
10
|
+
created: string[];
|
|
11
|
+
skipped: string[];
|
|
12
|
+
errors: string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Create the complete documentation scaffold
|
|
16
|
+
*/
|
|
17
|
+
export declare function createScaffold(options: ScaffoldOptions): Promise<ScaffoldResult>;
|
|
18
|
+
/**
|
|
19
|
+
* Check if scaffold already exists
|
|
20
|
+
*/
|
|
21
|
+
export declare function scaffoldExists(rootPath: string): Promise<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* Get scaffold status
|
|
24
|
+
*/
|
|
25
|
+
export declare function getScaffoldStatus(rootPath: string): Promise<{
|
|
26
|
+
exists: boolean;
|
|
27
|
+
domains: Domain[];
|
|
28
|
+
missingDomains: Domain[];
|
|
29
|
+
}>;
|
|
30
|
+
//# sourceMappingURL=scaffold.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../src/generators/scaffold.ts"],"names":[],"mappings":"AAEA,OAAO,EAA+B,KAAK,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAQxF,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAsDtF;AA6KD;;GAEG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGvE;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IACjE,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC,CA4BD"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { mkdir, writeFile } from 'fs/promises';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { DOMAINS, DOMAIN_DEFINITIONS } from '../core/domains/constants.js';
|
|
4
|
+
import { generateRootIndex } from './index-generator.js';
|
|
5
|
+
import { generateRootRegistry } from './registry-generator.js';
|
|
6
|
+
import { generateDomainIndex } from './templates/domain-index.js';
|
|
7
|
+
import { generateDomainRegistry } from './templates/domain-registry.js';
|
|
8
|
+
import { logger } from '../utils/logger.js';
|
|
9
|
+
import { pathExists } from '../utils/glob.js';
|
|
10
|
+
/**
|
|
11
|
+
* Create the complete documentation scaffold
|
|
12
|
+
*/
|
|
13
|
+
export async function createScaffold(options) {
|
|
14
|
+
const { rootPath, overwrite = false, domains = [...DOMAINS], silent = false, } = options;
|
|
15
|
+
const result = {
|
|
16
|
+
success: true,
|
|
17
|
+
created: [],
|
|
18
|
+
skipped: [],
|
|
19
|
+
errors: [],
|
|
20
|
+
};
|
|
21
|
+
if (!silent) {
|
|
22
|
+
logger.header('Creating Documentation Scaffold');
|
|
23
|
+
logger.info(`Root path: ${rootPath}`);
|
|
24
|
+
logger.info(`Domains: ${domains.length}`);
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
// Create root directory
|
|
28
|
+
await createDirectory(rootPath, result, overwrite);
|
|
29
|
+
// Create root files
|
|
30
|
+
await createRootFiles(rootPath, result, overwrite);
|
|
31
|
+
// Create domain directories and files
|
|
32
|
+
for (const domain of domains) {
|
|
33
|
+
await createDomainStructure(rootPath, domain, result, overwrite);
|
|
34
|
+
}
|
|
35
|
+
// Create special directories
|
|
36
|
+
await createSpecialDirectories(rootPath, result, overwrite);
|
|
37
|
+
if (!silent) {
|
|
38
|
+
logger.newline();
|
|
39
|
+
logger.success(`Scaffold created successfully!`);
|
|
40
|
+
logger.info(`Created: ${result.created.length} files/directories`);
|
|
41
|
+
if (result.skipped.length > 0) {
|
|
42
|
+
logger.warn(`Skipped: ${result.skipped.length} (already exist)`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
result.success = false;
|
|
48
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
49
|
+
result.errors.push(message);
|
|
50
|
+
if (!silent) {
|
|
51
|
+
logger.error(`Failed to create scaffold: ${message}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Create a directory if it doesn't exist
|
|
58
|
+
*/
|
|
59
|
+
async function createDirectory(path, result, overwrite) {
|
|
60
|
+
const exists = await pathExists(path);
|
|
61
|
+
if (exists && !overwrite) {
|
|
62
|
+
result.skipped.push(path);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
await mkdir(path, { recursive: true });
|
|
66
|
+
result.created.push(path);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Create a file if it doesn't exist
|
|
70
|
+
*/
|
|
71
|
+
async function createFile(path, content, result, overwrite) {
|
|
72
|
+
const exists = await pathExists(path);
|
|
73
|
+
if (exists && !overwrite) {
|
|
74
|
+
result.skipped.push(path);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
await writeFile(path, content, 'utf-8');
|
|
78
|
+
result.created.push(path);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Create root-level files
|
|
82
|
+
*/
|
|
83
|
+
async function createRootFiles(rootPath, result, overwrite) {
|
|
84
|
+
// INDEX.md
|
|
85
|
+
const indexContent = generateRootIndex();
|
|
86
|
+
await createFile(join(rootPath, 'INDEX.md'), indexContent, result, overwrite);
|
|
87
|
+
// REGISTRY.md
|
|
88
|
+
const registryContent = generateRootRegistry();
|
|
89
|
+
await createFile(join(rootPath, 'REGISTRY.md'), registryContent, result, overwrite);
|
|
90
|
+
// README.md
|
|
91
|
+
const readmeContent = generateRootReadme();
|
|
92
|
+
await createFile(join(rootPath, 'README.md'), readmeContent, result, overwrite);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Create domain directory structure
|
|
96
|
+
*/
|
|
97
|
+
async function createDomainStructure(rootPath, domain, result, overwrite) {
|
|
98
|
+
const domainPath = join(rootPath, domain);
|
|
99
|
+
const def = DOMAIN_DEFINITIONS[domain];
|
|
100
|
+
// Create domain directory
|
|
101
|
+
await createDirectory(domainPath, result, overwrite);
|
|
102
|
+
// Create INDEX.md
|
|
103
|
+
const indexContent = generateDomainIndex(domain, def);
|
|
104
|
+
await createFile(join(domainPath, 'INDEX.md'), indexContent, result, overwrite);
|
|
105
|
+
// Create REGISTRY.md
|
|
106
|
+
const registryContent = generateDomainRegistry(domain, def);
|
|
107
|
+
await createFile(join(domainPath, 'REGISTRY.md'), registryContent, result, overwrite);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Create special directories (drafts, reports)
|
|
111
|
+
*/
|
|
112
|
+
async function createSpecialDirectories(rootPath, result, overwrite) {
|
|
113
|
+
// Drafts directory
|
|
114
|
+
await createDirectory(join(rootPath, 'drafts'), result, overwrite);
|
|
115
|
+
// Reports directory
|
|
116
|
+
await createDirectory(join(rootPath, 'reports'), result, overwrite);
|
|
117
|
+
// Create .gitkeep files to preserve empty directories
|
|
118
|
+
await createFile(join(rootPath, 'drafts', '.gitkeep'), '# This file ensures the drafts directory is tracked by git\n', result, overwrite);
|
|
119
|
+
await createFile(join(rootPath, 'reports', '.gitkeep'), '# This file ensures the reports directory is tracked by git\n', result, overwrite);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Generate root README content
|
|
123
|
+
*/
|
|
124
|
+
function generateRootReadme() {
|
|
125
|
+
return `# Documentation
|
|
126
|
+
|
|
127
|
+
This documentation system uses a hierarchical 15-domain structure for optimal organization and discoverability.
|
|
128
|
+
|
|
129
|
+
## Quick Navigation
|
|
130
|
+
|
|
131
|
+
- **[INDEX.md](INDEX.md)** - Complete document listing with metadata
|
|
132
|
+
- **[REGISTRY.md](REGISTRY.md)** - Quick reference tables
|
|
133
|
+
|
|
134
|
+
## Domains
|
|
135
|
+
|
|
136
|
+
| Domain | Description |
|
|
137
|
+
|--------|-------------|
|
|
138
|
+
${DOMAINS.map((d) => `| [${d}](${d}/) | ${DOMAIN_DEFINITIONS[d].description} |`).join('\n')}
|
|
139
|
+
|
|
140
|
+
## Adding New Documentation
|
|
141
|
+
|
|
142
|
+
1. Identify the correct domain for your document
|
|
143
|
+
2. Create the file in the domain directory
|
|
144
|
+
3. Add YAML frontmatter with required metadata
|
|
145
|
+
4. Run \`npx hit-em-with-the-docs integrate <file>\` to register
|
|
146
|
+
|
|
147
|
+
## Metadata Schema
|
|
148
|
+
|
|
149
|
+
Every document should include:
|
|
150
|
+
|
|
151
|
+
\`\`\`yaml
|
|
152
|
+
---
|
|
153
|
+
title: "Document Title"
|
|
154
|
+
tier: guide|standard|example|reference|admin
|
|
155
|
+
domains: [primary-domain]
|
|
156
|
+
status: draft|active|deprecated|archived
|
|
157
|
+
last_updated: 'YYYY-MM-DD'
|
|
158
|
+
version: '1.0.0'
|
|
159
|
+
---
|
|
160
|
+
\`\`\`
|
|
161
|
+
|
|
162
|
+
## Maintenance
|
|
163
|
+
|
|
164
|
+
Run weekly maintenance with:
|
|
165
|
+
|
|
166
|
+
\`\`\`bash
|
|
167
|
+
npx hit-em-with-the-docs maintain
|
|
168
|
+
\`\`\`
|
|
169
|
+
|
|
170
|
+
This will:
|
|
171
|
+
- Sync metadata across all documents
|
|
172
|
+
- Check for broken links
|
|
173
|
+
- Audit compliance
|
|
174
|
+
- Generate health reports
|
|
175
|
+
`;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Check if scaffold already exists
|
|
179
|
+
*/
|
|
180
|
+
export async function scaffoldExists(rootPath) {
|
|
181
|
+
const indexPath = join(rootPath, 'INDEX.md');
|
|
182
|
+
return pathExists(indexPath);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Get scaffold status
|
|
186
|
+
*/
|
|
187
|
+
export async function getScaffoldStatus(rootPath) {
|
|
188
|
+
const exists = await scaffoldExists(rootPath);
|
|
189
|
+
if (!exists) {
|
|
190
|
+
return {
|
|
191
|
+
exists: false,
|
|
192
|
+
domains: [],
|
|
193
|
+
missingDomains: [...DOMAINS],
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
const presentDomains = [];
|
|
197
|
+
const missingDomains = [];
|
|
198
|
+
for (const domain of DOMAINS) {
|
|
199
|
+
const domainPath = join(rootPath, domain);
|
|
200
|
+
if (await pathExists(domainPath)) {
|
|
201
|
+
presentDomains.push(domain);
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
missingDomains.push(domain);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return {
|
|
208
|
+
exists: true,
|
|
209
|
+
domains: presentDomains,
|
|
210
|
+
missingDomains,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=scaffold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../src/generators/scaffold.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAe,MAAM,8BAA8B,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAA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AkB,CAAC,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC1F,CAAC;AACF,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,QAAgB;IACnD,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC7C,OAAO,UAAU,CAAC,SAAS,CAAC,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,QAAgB;IAKtD,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAC;IAE9C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO;YACL,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,EAAE;YACX,cAAc,EAAE,CAAC,GAAG,OAAO,CAAC;SAC7B,CAAC;IACJ,CAAC;IAED,MAAM,cAAc,GAAa,EAAE,CAAC;IACpC,MAAM,cAAc,GAAa,EAAE,CAAC;IAEpC,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC1C,IAAI,MAAM,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YACjC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;aAAM,CAAC;YACN,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IAED,OAAO;QACL,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,cAAc;QACvB,cAAc;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Domain } from '../../core/domains/constants.js';
|
|
2
|
+
import type { Tier } from '../../core/domains/classifier.js';
|
|
3
|
+
export interface DocumentTemplateOptions {
|
|
4
|
+
title: string;
|
|
5
|
+
tier?: Tier;
|
|
6
|
+
domain?: Domain;
|
|
7
|
+
author?: string;
|
|
8
|
+
tags?: string[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Generate a new document template with frontmatter
|
|
12
|
+
*/
|
|
13
|
+
export declare function generateDocumentTemplate(options: DocumentTemplateOptions): string;
|
|
14
|
+
//# sourceMappingURL=document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../src/generators/templates/document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kCAAkC,CAAC;AAG7D,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,CAkCjF"}
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { formatDate } from '../../core/metadata/generator.js';
|
|
2
|
+
/**
|
|
3
|
+
* Generate a new document template with frontmatter
|
|
4
|
+
*/
|
|
5
|
+
export function generateDocumentTemplate(options) {
|
|
6
|
+
const { title, tier = 'guide', domain = 'features', author, tags = [], } = options;
|
|
7
|
+
const now = formatDate(new Date());
|
|
8
|
+
let frontmatter = `---
|
|
9
|
+
title: "${title}"
|
|
10
|
+
tier: ${tier}
|
|
11
|
+
domains:
|
|
12
|
+
- ${domain}
|
|
13
|
+
audience:
|
|
14
|
+
- all
|
|
15
|
+
tags:
|
|
16
|
+
${tags.length > 0 ? tags.map((t) => ` - ${t}`).join('\n') : ' []'}
|
|
17
|
+
status: draft
|
|
18
|
+
last_updated: '${now}'
|
|
19
|
+
version: '1.0.0'
|
|
20
|
+
`;
|
|
21
|
+
if (author) {
|
|
22
|
+
frontmatter += `author: "${author}"\n`;
|
|
23
|
+
}
|
|
24
|
+
frontmatter += `---`;
|
|
25
|
+
const body = getTemplateBody(tier, title);
|
|
26
|
+
return `${frontmatter}\n\n${body}`;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get tier-specific template body
|
|
30
|
+
*/
|
|
31
|
+
function getTemplateBody(tier, title) {
|
|
32
|
+
switch (tier) {
|
|
33
|
+
case 'guide':
|
|
34
|
+
return getGuideTemplate(title);
|
|
35
|
+
case 'standard':
|
|
36
|
+
return getStandardTemplate(title);
|
|
37
|
+
case 'example':
|
|
38
|
+
return getExampleTemplate(title);
|
|
39
|
+
case 'reference':
|
|
40
|
+
return getReferenceTemplate(title);
|
|
41
|
+
case 'admin':
|
|
42
|
+
return getAdminTemplate(title);
|
|
43
|
+
default:
|
|
44
|
+
return getGuideTemplate(title);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function getGuideTemplate(title) {
|
|
48
|
+
return `# ${title}
|
|
49
|
+
|
|
50
|
+
## Overview
|
|
51
|
+
|
|
52
|
+
[Brief description of what this guide covers and who it's for.]
|
|
53
|
+
|
|
54
|
+
## Prerequisites
|
|
55
|
+
|
|
56
|
+
- [ ] Prerequisite 1
|
|
57
|
+
- [ ] Prerequisite 2
|
|
58
|
+
|
|
59
|
+
## Steps
|
|
60
|
+
|
|
61
|
+
### Step 1: [First Step Title]
|
|
62
|
+
|
|
63
|
+
[Instructions for the first step.]
|
|
64
|
+
|
|
65
|
+
\`\`\`bash
|
|
66
|
+
# Example command
|
|
67
|
+
\`\`\`
|
|
68
|
+
|
|
69
|
+
### Step 2: [Second Step Title]
|
|
70
|
+
|
|
71
|
+
[Instructions for the second step.]
|
|
72
|
+
|
|
73
|
+
### Step 3: [Third Step Title]
|
|
74
|
+
|
|
75
|
+
[Instructions for the third step.]
|
|
76
|
+
|
|
77
|
+
## Verification
|
|
78
|
+
|
|
79
|
+
To verify the setup is correct:
|
|
80
|
+
|
|
81
|
+
1. [Verification step 1]
|
|
82
|
+
2. [Verification step 2]
|
|
83
|
+
|
|
84
|
+
## Troubleshooting
|
|
85
|
+
|
|
86
|
+
### Common Issue 1
|
|
87
|
+
|
|
88
|
+
**Problem:** [Description]
|
|
89
|
+
|
|
90
|
+
**Solution:** [How to fix]
|
|
91
|
+
|
|
92
|
+
### Common Issue 2
|
|
93
|
+
|
|
94
|
+
**Problem:** [Description]
|
|
95
|
+
|
|
96
|
+
**Solution:** [How to fix]
|
|
97
|
+
|
|
98
|
+
## Related Documentation
|
|
99
|
+
|
|
100
|
+
- [Related Doc 1](path/to/doc1.md)
|
|
101
|
+
- [Related Doc 2](path/to/doc2.md)
|
|
102
|
+
`;
|
|
103
|
+
}
|
|
104
|
+
function getStandardTemplate(title) {
|
|
105
|
+
return `# ${title}
|
|
106
|
+
|
|
107
|
+
## Overview
|
|
108
|
+
|
|
109
|
+
[Description of what this standard covers and why it exists.]
|
|
110
|
+
|
|
111
|
+
## Rules
|
|
112
|
+
|
|
113
|
+
### Rule 1: [Rule Name]
|
|
114
|
+
|
|
115
|
+
**DO:**
|
|
116
|
+
- [Correct approach]
|
|
117
|
+
|
|
118
|
+
**DON'T:**
|
|
119
|
+
- [Incorrect approach]
|
|
120
|
+
|
|
121
|
+
**Example:**
|
|
122
|
+
|
|
123
|
+
\`\`\`typescript
|
|
124
|
+
// Good
|
|
125
|
+
const example = 'correct';
|
|
126
|
+
|
|
127
|
+
// Bad
|
|
128
|
+
const example = 'incorrect';
|
|
129
|
+
\`\`\`
|
|
130
|
+
|
|
131
|
+
### Rule 2: [Rule Name]
|
|
132
|
+
|
|
133
|
+
[Rule description and rationale.]
|
|
134
|
+
|
|
135
|
+
## Exceptions
|
|
136
|
+
|
|
137
|
+
[Any exceptions to these rules and when they apply.]
|
|
138
|
+
|
|
139
|
+
## Enforcement
|
|
140
|
+
|
|
141
|
+
- [ ] Automated by linter
|
|
142
|
+
- [ ] Checked in code review
|
|
143
|
+
- [ ] Manual verification required
|
|
144
|
+
|
|
145
|
+
## References
|
|
146
|
+
|
|
147
|
+
- [External Reference 1](https://example.com)
|
|
148
|
+
- [Related Standard](path/to/standard.md)
|
|
149
|
+
`;
|
|
150
|
+
}
|
|
151
|
+
function getExampleTemplate(title) {
|
|
152
|
+
return `# ${title}
|
|
153
|
+
|
|
154
|
+
## Overview
|
|
155
|
+
|
|
156
|
+
[Brief description of what this example demonstrates.]
|
|
157
|
+
|
|
158
|
+
## Use Case
|
|
159
|
+
|
|
160
|
+
[When you would use this pattern/approach.]
|
|
161
|
+
|
|
162
|
+
## Code Example
|
|
163
|
+
|
|
164
|
+
\`\`\`typescript
|
|
165
|
+
// Example implementation
|
|
166
|
+
function example() {
|
|
167
|
+
// Your code here
|
|
168
|
+
}
|
|
169
|
+
\`\`\`
|
|
170
|
+
|
|
171
|
+
## Explanation
|
|
172
|
+
|
|
173
|
+
1. **Line X:** [Explanation of what this part does]
|
|
174
|
+
2. **Line Y:** [Explanation of what this part does]
|
|
175
|
+
|
|
176
|
+
## Variations
|
|
177
|
+
|
|
178
|
+
### Variation 1: [Name]
|
|
179
|
+
|
|
180
|
+
\`\`\`typescript
|
|
181
|
+
// Alternative approach
|
|
182
|
+
\`\`\`
|
|
183
|
+
|
|
184
|
+
## Related Examples
|
|
185
|
+
|
|
186
|
+
- [Related Example 1](path/to/example1.md)
|
|
187
|
+
- [Related Example 2](path/to/example2.md)
|
|
188
|
+
`;
|
|
189
|
+
}
|
|
190
|
+
function getReferenceTemplate(title) {
|
|
191
|
+
return `# ${title}
|
|
192
|
+
|
|
193
|
+
## Overview
|
|
194
|
+
|
|
195
|
+
[Description of what this reference documents.]
|
|
196
|
+
|
|
197
|
+
## API Reference
|
|
198
|
+
|
|
199
|
+
### Method/Function Name
|
|
200
|
+
|
|
201
|
+
\`\`\`typescript
|
|
202
|
+
function methodName(param1: Type, param2: Type): ReturnType
|
|
203
|
+
\`\`\`
|
|
204
|
+
|
|
205
|
+
**Parameters:**
|
|
206
|
+
|
|
207
|
+
| Name | Type | Required | Description |
|
|
208
|
+
|------|------|----------|-------------|
|
|
209
|
+
| param1 | Type | Yes | Description |
|
|
210
|
+
| param2 | Type | No | Description |
|
|
211
|
+
|
|
212
|
+
**Returns:**
|
|
213
|
+
|
|
214
|
+
\`ReturnType\` - Description of return value.
|
|
215
|
+
|
|
216
|
+
**Example:**
|
|
217
|
+
|
|
218
|
+
\`\`\`typescript
|
|
219
|
+
const result = methodName('value1', 'value2');
|
|
220
|
+
\`\`\`
|
|
221
|
+
|
|
222
|
+
## Types
|
|
223
|
+
|
|
224
|
+
### TypeName
|
|
225
|
+
|
|
226
|
+
\`\`\`typescript
|
|
227
|
+
interface TypeName {
|
|
228
|
+
property1: string;
|
|
229
|
+
property2: number;
|
|
230
|
+
}
|
|
231
|
+
\`\`\`
|
|
232
|
+
|
|
233
|
+
## Constants
|
|
234
|
+
|
|
235
|
+
| Name | Value | Description |
|
|
236
|
+
|------|-------|-------------|
|
|
237
|
+
| CONSTANT_1 | 'value' | Description |
|
|
238
|
+
|
|
239
|
+
## See Also
|
|
240
|
+
|
|
241
|
+
- [Related Reference](path/to/reference.md)
|
|
242
|
+
`;
|
|
243
|
+
}
|
|
244
|
+
function getAdminTemplate(title) {
|
|
245
|
+
return `# ${title}
|
|
246
|
+
|
|
247
|
+
## Overview
|
|
248
|
+
|
|
249
|
+
[Description of this administrative procedure.]
|
|
250
|
+
|
|
251
|
+
## Prerequisites
|
|
252
|
+
|
|
253
|
+
- [ ] Required access/permissions
|
|
254
|
+
- [ ] Required tools installed
|
|
255
|
+
|
|
256
|
+
## Configuration
|
|
257
|
+
|
|
258
|
+
### Setting 1
|
|
259
|
+
|
|
260
|
+
\`\`\`yaml
|
|
261
|
+
# Configuration example
|
|
262
|
+
setting: value
|
|
263
|
+
\`\`\`
|
|
264
|
+
|
|
265
|
+
## Procedures
|
|
266
|
+
|
|
267
|
+
### Procedure 1: [Name]
|
|
268
|
+
|
|
269
|
+
1. [Step 1]
|
|
270
|
+
2. [Step 2]
|
|
271
|
+
3. [Step 3]
|
|
272
|
+
|
|
273
|
+
### Procedure 2: [Name]
|
|
274
|
+
|
|
275
|
+
1. [Step 1]
|
|
276
|
+
2. [Step 2]
|
|
277
|
+
|
|
278
|
+
## Monitoring
|
|
279
|
+
|
|
280
|
+
[How to monitor this system/service.]
|
|
281
|
+
|
|
282
|
+
## Backup & Recovery
|
|
283
|
+
|
|
284
|
+
### Backup Procedure
|
|
285
|
+
|
|
286
|
+
1. [Backup step 1]
|
|
287
|
+
2. [Backup step 2]
|
|
288
|
+
|
|
289
|
+
### Recovery Procedure
|
|
290
|
+
|
|
291
|
+
1. [Recovery step 1]
|
|
292
|
+
2. [Recovery step 2]
|
|
293
|
+
|
|
294
|
+
## Troubleshooting
|
|
295
|
+
|
|
296
|
+
| Symptom | Cause | Resolution |
|
|
297
|
+
|---------|-------|------------|
|
|
298
|
+
| [Symptom] | [Cause] | [Fix] |
|
|
299
|
+
|
|
300
|
+
## Related Documentation
|
|
301
|
+
|
|
302
|
+
- [Related Admin Doc](path/to/admin.md)
|
|
303
|
+
`;
|
|
304
|
+
}
|
|
305
|
+
//# sourceMappingURL=document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../../src/generators/templates/document.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAU9D;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAgC;IACvE,MAAM,EACJ,KAAK,EACL,IAAI,GAAG,OAAO,EACd,MAAM,GAAG,UAAU,EACnB,MAAM,EACN,IAAI,GAAG,EAAE,GACV,GAAG,OAAO,CAAC;IAEZ,MAAM,GAAG,GAAG,UAAU,CAAC,IAAI,IAAI,EAA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;;;;;;;;;;;;;CA4ClB,CAAC;AACF,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa;IACvC,OAAO,KAAK,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoClB,CAAC;AACF,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAa;IACzC,OAAO,KAAK,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDlB,CAAC;AACF,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAa;IACrC,OAAO,KAAK,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DlB,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Domain, DomainDefinition } from '../../core/domains/constants.js';
|
|
2
|
+
/**
|
|
3
|
+
* Generate initial domain INDEX.md content
|
|
4
|
+
*/
|
|
5
|
+
export declare function generateDomainIndex(domain: Domain, def: DomainDefinition): string;
|
|
6
|
+
//# sourceMappingURL=domain-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-index.d.ts","sourceRoot":"","sources":["../../../src/generators/templates/domain-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGhF;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB,GAAG,MAAM,CA+DjF"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { formatDate } from '../../core/metadata/generator.js';
|
|
2
|
+
/**
|
|
3
|
+
* Generate initial domain INDEX.md content
|
|
4
|
+
*/
|
|
5
|
+
export function generateDomainIndex(domain, def) {
|
|
6
|
+
const now = formatDate(new Date());
|
|
7
|
+
return `---
|
|
8
|
+
title: ${def.name} Documentation Index
|
|
9
|
+
tier: reference
|
|
10
|
+
domains:
|
|
11
|
+
- ${domain}
|
|
12
|
+
status: active
|
|
13
|
+
last_updated: '${now}'
|
|
14
|
+
version: '1.0.0'
|
|
15
|
+
purpose: Complete listing of ${domain} documentation
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# ${def.name} Documentation
|
|
19
|
+
|
|
20
|
+
> ${def.description}
|
|
21
|
+
|
|
22
|
+
## Overview
|
|
23
|
+
|
|
24
|
+
- **Domain:** \`${domain}/\`
|
|
25
|
+
- **Category:** ${def.category}
|
|
26
|
+
- **Load Priority:** ${def.loadPriority}/10
|
|
27
|
+
|
|
28
|
+
## Documents
|
|
29
|
+
|
|
30
|
+
*No documents in this domain yet.*
|
|
31
|
+
|
|
32
|
+
### Adding Documents
|
|
33
|
+
|
|
34
|
+
1. Create a markdown file in this directory
|
|
35
|
+
2. Add YAML frontmatter with required metadata:
|
|
36
|
+
|
|
37
|
+
\`\`\`yaml
|
|
38
|
+
---
|
|
39
|
+
title: "Your Document Title"
|
|
40
|
+
tier: guide
|
|
41
|
+
domains:
|
|
42
|
+
- ${domain}
|
|
43
|
+
status: draft
|
|
44
|
+
last_updated: '${now}'
|
|
45
|
+
version: '1.0.0'
|
|
46
|
+
---
|
|
47
|
+
\`\`\`
|
|
48
|
+
|
|
49
|
+
3. Run \`npx hit-em-with-the-docs integrate <file>\` to register
|
|
50
|
+
|
|
51
|
+
## Keywords
|
|
52
|
+
|
|
53
|
+
This domain covers topics related to:
|
|
54
|
+
|
|
55
|
+
${def.keywords.map((k) => `- ${k}`).join('\n')}
|
|
56
|
+
|
|
57
|
+
## Related Resources
|
|
58
|
+
|
|
59
|
+
- [Domain Registry](REGISTRY.md) - Quick reference
|
|
60
|
+
- [Root Index](../INDEX.md) - All documentation
|
|
61
|
+
- [Standards](../standards/) - Coding standards
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
*Last updated: ${now}*
|
|
66
|
+
`;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=domain-index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-index.js","sourceRoot":"","sources":["../../../src/generators/templates/domain-index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAc,EAAE,GAAqB;IACvE,MAAM,GAAG,GAAG,UAAU,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IAEnC,OAAO;SACA,GAAG,CAAC,IAAI;;;MAGX,MAAM;;iBAEK,GAAG;;+BAEW,MAAM;;;IAGjC,GAAG,CAAC,IAAI;;IAER,GAAG,CAAC,WAAW;;;;kBAID,MAAM;kBACN,GAAG,CAAC,QAAQ;uBACP,GAAG,CAAC,YAAY;;;;;;;;;;;;;;;;MAgBjC,MAAM;;iBAEK,GAAG;;;;;;;;;;;EAWlB,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;iBAU7B,GAAG;CACnB,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Domain, DomainDefinition } from '../../core/domains/constants.js';
|
|
2
|
+
/**
|
|
3
|
+
* Generate initial domain REGISTRY.md content
|
|
4
|
+
*/
|
|
5
|
+
export declare function generateDomainRegistry(domain: Domain, def: DomainDefinition): string;
|
|
6
|
+
//# sourceMappingURL=domain-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-registry.d.ts","sourceRoot":"","sources":["../../../src/generators/templates/domain-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGhF;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAsDpF"}
|