@voodocs/cli 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.
- package/LICENSE +37 -0
- package/README.md +153 -0
- package/USAGE.md +314 -0
- package/cli.py +1340 -0
- package/examples/.cursorrules +437 -0
- package/examples/instructions/.claude/instructions.md +372 -0
- package/examples/instructions/.cursorrules +437 -0
- package/examples/instructions/.windsurfrules +437 -0
- package/examples/instructions/VOODOCS_INSTRUCTIONS.md +437 -0
- package/examples/math_example.py +41 -0
- package/examples/phase2_test.py +24 -0
- package/examples/test_compound_conditions.py +40 -0
- package/examples/test_math_example.py +186 -0
- package/lib/darkarts/README.md +115 -0
- package/lib/darkarts/__init__.py +16 -0
- package/lib/darkarts/annotations/__init__.py +34 -0
- package/lib/darkarts/annotations/parser.py +618 -0
- package/lib/darkarts/annotations/types.py +181 -0
- package/lib/darkarts/cli.py +128 -0
- package/lib/darkarts/core/__init__.py +32 -0
- package/lib/darkarts/core/interface.py +256 -0
- package/lib/darkarts/core/loader.py +231 -0
- package/lib/darkarts/core/plugin.py +215 -0
- package/lib/darkarts/core/registry.py +146 -0
- package/lib/darkarts/exceptions.py +51 -0
- package/lib/darkarts/parsers/typescript/dist/cli.d.ts +9 -0
- package/lib/darkarts/parsers/typescript/dist/cli.d.ts.map +1 -0
- package/lib/darkarts/parsers/typescript/dist/cli.js +69 -0
- package/lib/darkarts/parsers/typescript/dist/cli.js.map +1 -0
- package/lib/darkarts/parsers/typescript/dist/parser.d.ts +111 -0
- package/lib/darkarts/parsers/typescript/dist/parser.d.ts.map +1 -0
- package/lib/darkarts/parsers/typescript/dist/parser.js +365 -0
- package/lib/darkarts/parsers/typescript/dist/parser.js.map +1 -0
- package/lib/darkarts/parsers/typescript/package-lock.json +51 -0
- package/lib/darkarts/parsers/typescript/package.json +19 -0
- package/lib/darkarts/parsers/typescript/src/cli.ts +41 -0
- package/lib/darkarts/parsers/typescript/src/parser.ts +408 -0
- package/lib/darkarts/parsers/typescript/tsconfig.json +19 -0
- package/lib/darkarts/plugins/voodocs/__init__.py +379 -0
- package/lib/darkarts/plugins/voodocs/ai_native_plugin.py +151 -0
- package/lib/darkarts/plugins/voodocs/annotation_validator.py +280 -0
- package/lib/darkarts/plugins/voodocs/api_spec_generator.py +486 -0
- package/lib/darkarts/plugins/voodocs/documentation_generator.py +610 -0
- package/lib/darkarts/plugins/voodocs/html_exporter.py +260 -0
- package/lib/darkarts/plugins/voodocs/instruction_generator.py +706 -0
- package/lib/darkarts/plugins/voodocs/pdf_exporter.py +66 -0
- package/lib/darkarts/plugins/voodocs/test_generator.py +636 -0
- package/package.json +70 -0
- package/requirements.txt +13 -0
- package/templates/ci/github-actions.yml +73 -0
- package/templates/ci/gitlab-ci.yml +35 -0
- package/templates/ci/pre-commit-hook.sh +26 -0
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@voodocs/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "AI-Native Documentation System - Generate docs, tests, and API specs from @voodocs annotations using the DarkArts language",
|
|
5
|
+
"main": "cli.py",
|
|
6
|
+
"bin": {
|
|
7
|
+
"voodocs": "./cli.py"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"postinstall": "cd lib/darkarts/parsers/typescript && npm install && npm run build",
|
|
11
|
+
"test": "python3 -m pytest",
|
|
12
|
+
"build-ts-parser": "cd lib/darkarts/parsers/typescript && npm install && npm run build"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"documentation",
|
|
16
|
+
"ai",
|
|
17
|
+
"voodocs",
|
|
18
|
+
"darkarts",
|
|
19
|
+
"testing",
|
|
20
|
+
"api-spec",
|
|
21
|
+
"openapi",
|
|
22
|
+
"code-generation",
|
|
23
|
+
"ai-assistant",
|
|
24
|
+
"cursor",
|
|
25
|
+
"claude",
|
|
26
|
+
"property-based-testing",
|
|
27
|
+
"hypothesis"
|
|
28
|
+
],
|
|
29
|
+
"author": "3vilEnterprises <contact@3vil.enterprises>",
|
|
30
|
+
"license": "Commercial",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://github.com/3vilEnterprises/vooodooo-magic.git",
|
|
34
|
+
"directory": "packages/voodocs"
|
|
35
|
+
},
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/3vilEnterprises/vooodooo-magic/issues"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://voodocs.com",
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=16.0.0",
|
|
42
|
+
"python": ">=3.7.0"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {},
|
|
45
|
+
"devDependencies": {},
|
|
46
|
+
"files": [
|
|
47
|
+
"cli.py",
|
|
48
|
+
"lib/darkarts/annotations/",
|
|
49
|
+
"lib/darkarts/core/",
|
|
50
|
+
"lib/darkarts/exceptions.py",
|
|
51
|
+
"lib/darkarts/parsers/typescript/dist/",
|
|
52
|
+
"lib/darkarts/parsers/typescript/src/",
|
|
53
|
+
"lib/darkarts/parsers/typescript/package.json",
|
|
54
|
+
"lib/darkarts/parsers/typescript/package-lock.json",
|
|
55
|
+
"lib/darkarts/parsers/typescript/tsconfig.json",
|
|
56
|
+
"lib/darkarts/plugins/voodocs/",
|
|
57
|
+
"lib/darkarts/__init__.py",
|
|
58
|
+
"examples/",
|
|
59
|
+
"templates/",
|
|
60
|
+
"README.md",
|
|
61
|
+
"LICENSE",
|
|
62
|
+
"USAGE.md",
|
|
63
|
+
"requirements.txt"
|
|
64
|
+
],
|
|
65
|
+
"os": [
|
|
66
|
+
"darwin",
|
|
67
|
+
"linux",
|
|
68
|
+
"win32"
|
|
69
|
+
]
|
|
70
|
+
}
|
package/requirements.txt
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# VooDocs Python Dependencies
|
|
2
|
+
# Python 3.7+ required
|
|
3
|
+
# Install with: pip3 install -r requirements.txt
|
|
4
|
+
|
|
5
|
+
# YAML processing for API spec generation
|
|
6
|
+
PyYAML>=6.0.0
|
|
7
|
+
|
|
8
|
+
# Optional dependencies for development and testing:
|
|
9
|
+
# pytest>=7.0.0 # For running unit tests
|
|
10
|
+
# hypothesis>=6.0.0 # For property-based testing (used in generated tests)
|
|
11
|
+
|
|
12
|
+
# Note: VooDocs core uses only Python standard library.
|
|
13
|
+
# PyYAML is the only required external dependency for API spec generation.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
name: VooDocs Validation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, develop ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
validate:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v3
|
|
15
|
+
|
|
16
|
+
- name: Set up Python
|
|
17
|
+
uses: actions/setup-python@v4
|
|
18
|
+
with:
|
|
19
|
+
python-version: '3.11'
|
|
20
|
+
|
|
21
|
+
- name: Set up Node.js
|
|
22
|
+
uses: actions/setup-node@v3
|
|
23
|
+
with:
|
|
24
|
+
node-version: '18'
|
|
25
|
+
|
|
26
|
+
- name: Install VooDocs
|
|
27
|
+
run: |
|
|
28
|
+
pip install pyyaml
|
|
29
|
+
# TODO: Replace with: pip install voodocs
|
|
30
|
+
# For now, clone and install locally
|
|
31
|
+
|
|
32
|
+
- name: Validate Annotations
|
|
33
|
+
run: |
|
|
34
|
+
voodocs validate . --strict --format json > validation-report.json
|
|
35
|
+
|
|
36
|
+
- name: Check Coverage
|
|
37
|
+
run: |
|
|
38
|
+
voodocs check --min-coverage 80 --min-quality 70
|
|
39
|
+
|
|
40
|
+
- name: Upload Validation Report
|
|
41
|
+
if: always()
|
|
42
|
+
uses: actions/upload-artifact@v3
|
|
43
|
+
with:
|
|
44
|
+
name: voodocs-validation-report
|
|
45
|
+
path: validation-report.json
|
|
46
|
+
|
|
47
|
+
- name: Comment PR with Results
|
|
48
|
+
if: github.event_name == 'pull_request'
|
|
49
|
+
uses: actions/github-script@v6
|
|
50
|
+
with:
|
|
51
|
+
script: |
|
|
52
|
+
const fs = require('fs');
|
|
53
|
+
const report = JSON.parse(fs.readFileSync('validation-report.json', 'utf8'));
|
|
54
|
+
|
|
55
|
+
const comment = `## VooDocs Validation Report
|
|
56
|
+
|
|
57
|
+
📊 **Summary**
|
|
58
|
+
- Files validated: ${report.files_validated}
|
|
59
|
+
- Files with issues: ${report.files_with_issues}
|
|
60
|
+
- Total issues: ${report.summary.total}
|
|
61
|
+
- Errors: ${report.summary.errors}
|
|
62
|
+
- Warnings: ${report.summary.warnings}
|
|
63
|
+
- Info: ${report.summary.info}
|
|
64
|
+
|
|
65
|
+
${report.summary.errors > 0 ? '❌ Validation failed' : report.summary.warnings > 0 ? '⚠️ Validation passed with warnings' : '✅ Validation passed'}
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
github.rest.issues.createComment({
|
|
69
|
+
issue_number: context.issue.number,
|
|
70
|
+
owner: context.repo.owner,
|
|
71
|
+
repo: context.repo.repo,
|
|
72
|
+
body: comment
|
|
73
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
stages:
|
|
2
|
+
- validate
|
|
3
|
+
- check
|
|
4
|
+
|
|
5
|
+
voodocs-validate:
|
|
6
|
+
stage: validate
|
|
7
|
+
image: python:3.11
|
|
8
|
+
before_script:
|
|
9
|
+
- apt-get update && apt-get install -y nodejs npm
|
|
10
|
+
- pip install pyyaml
|
|
11
|
+
# TODO: Replace with: pip install voodocs
|
|
12
|
+
script:
|
|
13
|
+
- voodocs validate . --strict --format json > validation-report.json
|
|
14
|
+
artifacts:
|
|
15
|
+
reports:
|
|
16
|
+
junit: validation-report.json
|
|
17
|
+
paths:
|
|
18
|
+
- validation-report.json
|
|
19
|
+
expire_in: 1 week
|
|
20
|
+
allow_failure: false
|
|
21
|
+
|
|
22
|
+
voodocs-check:
|
|
23
|
+
stage: check
|
|
24
|
+
image: python:3.11
|
|
25
|
+
before_script:
|
|
26
|
+
- apt-get update && apt-get install -y nodejs npm
|
|
27
|
+
- pip install pyyaml
|
|
28
|
+
# TODO: Replace with: pip install voodocs
|
|
29
|
+
script:
|
|
30
|
+
- voodocs check --min-coverage 80 --min-quality 70
|
|
31
|
+
allow_failure: false
|
|
32
|
+
only:
|
|
33
|
+
- main
|
|
34
|
+
- develop
|
|
35
|
+
- merge_requests
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# VooDocs Pre-Commit Hook
|
|
3
|
+
# Validates annotations before allowing commit
|
|
4
|
+
|
|
5
|
+
echo "🔍 VooDocs: Validating annotations..."
|
|
6
|
+
|
|
7
|
+
# Get list of staged Python/TypeScript files
|
|
8
|
+
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(py|ts|js)$')
|
|
9
|
+
|
|
10
|
+
if [ -z "$STAGED_FILES" ]; then
|
|
11
|
+
echo "✅ No code files to validate"
|
|
12
|
+
exit 0
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
# Run validation
|
|
16
|
+
voodocs validate $STAGED_FILES --strict
|
|
17
|
+
|
|
18
|
+
if [ $? -ne 0 ]; then
|
|
19
|
+
echo ""
|
|
20
|
+
echo "❌ VooDocs validation failed!"
|
|
21
|
+
echo " Fix the annotation issues above or use 'git commit --no-verify' to skip validation."
|
|
22
|
+
exit 1
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
echo "✅ VooDocs validation passed!"
|
|
26
|
+
exit 0
|