froggy-docs 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/.codex +0 -0
- package/.dockerignore +34 -0
- package/.froggyrc.example +36 -0
- package/.github/workflows/ci.yml +31 -0
- package/CHANGELOG.md +3 -0
- package/Dockerfile +49 -0
- package/LICENSE +21 -0
- package/README.md +218 -0
- package/analysis_options.yaml +30 -0
- package/bin/froggy_docs.dart +38 -0
- package/docs/annotations.md +174 -0
- package/frontend/README.md +15 -0
- package/frontend/analysis_options.yaml +46 -0
- package/frontend/lib/app.dart +377 -0
- package/frontend/lib/constants/theme.dart +27 -0
- package/frontend/lib/main.client.dart +12 -0
- package/frontend/lib/main.client.options.dart +25 -0
- package/frontend/pubspec.yaml +20 -0
- package/frontend/web/favicon.ico +0 -0
- package/frontend/web/froggy_docs.json +134 -0
- package/frontend/web/images/logo.svg +16 -0
- package/frontend/web/index.html +12 -0
- package/frontend/web/styles.css +405 -0
- package/install.sh +109 -0
- package/lib/froggy_docs.dart +2 -0
- package/lib/src/cli_runner.dart +0 -0
- package/lib/src/mock.json +5 -0
- package/lib/src/parser_engine.dart +390 -0
- package/lib/src/test_api.js +41 -0
- package/lib/src/watcher_engine.dart +58 -0
- package/lib/src/web_server.dart +164 -0
- package/package.js +124 -0
- package/package.json +42 -0
- package/pubspec.yaml +33 -0
package/package.js
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* FroggyDocs - npm wrapper that downloads and runs the Dart executable
|
|
5
|
+
* This script handles installation and provides CLI interface
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { execSync, spawn } = require('child_process');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const fs = require('fs');
|
|
11
|
+
const os = require('os');
|
|
12
|
+
const https = require('https');
|
|
13
|
+
const zlib = require('zlib');
|
|
14
|
+
const { createReadStream, createWriteStream } = require('fs');
|
|
15
|
+
const { pipeline } = require('stream');
|
|
16
|
+
|
|
17
|
+
const PACKAGE_VERSION = '1.0.0';
|
|
18
|
+
const PACKAGE_NAME = 'froggy-docs';
|
|
19
|
+
|
|
20
|
+
function getInstallDir() {
|
|
21
|
+
return path.join(os.homedir(), '.froggy-docs');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function getBinaryPath() {
|
|
25
|
+
const ext = os.platform() === 'win32' ? '.exe' : '';
|
|
26
|
+
return path.join(getInstallDir(), `froggy-docs${ext}`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async function downloadAndInstall() {
|
|
30
|
+
const installDir = getInstallDir();
|
|
31
|
+
const binaryPath = getBinaryPath();
|
|
32
|
+
|
|
33
|
+
if (fs.existsSync(binaryPath)) {
|
|
34
|
+
console.log('✅ FroggyDocs already installed');
|
|
35
|
+
return binaryPath;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
console.log('📦 Installing FroggyDocs...');
|
|
39
|
+
|
|
40
|
+
if (!fs.existsSync(installDir)) {
|
|
41
|
+
fs.mkdirSync(installDir, { recursive: true });
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// For now, we provide instructions since we're not hosting the binary
|
|
45
|
+
// In production, upload the compiled binary to GitHub releases
|
|
46
|
+
console.log('⚠️ Manual installation required:');
|
|
47
|
+
console.log(' 1. Download from: https://github.com/yourusername/froggy-docs/releases');
|
|
48
|
+
console.log(' 2. Extract to:', installDir);
|
|
49
|
+
console.log(' 3. Rename to: froggy-docs' + (os.platform() === 'win32' ? '.exe' : ''));
|
|
50
|
+
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function runCommand(args) {
|
|
55
|
+
const binaryPath = getBinaryPath();
|
|
56
|
+
|
|
57
|
+
if (!fs.existsSync(binaryPath)) {
|
|
58
|
+
console.error('❌ FroggyDocs not installed. Run: froggy-docs install');
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return new Promise((resolve, reject) => {
|
|
63
|
+
const child = spawn(binaryPath, args, {
|
|
64
|
+
stdio: 'inherit',
|
|
65
|
+
shell: os.platform() === 'win32'
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
child.on('close', (code) => {
|
|
69
|
+
process.exit(code);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
child.on('error', reject);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async function main() {
|
|
77
|
+
const args = process.argv.slice(2);
|
|
78
|
+
const command = args[0];
|
|
79
|
+
|
|
80
|
+
if (!command || command === '--help' || command === '-h') {
|
|
81
|
+
console.log(`
|
|
82
|
+
🐸 FroggyDocs v${PACKAGE_VERSION}
|
|
83
|
+
|
|
84
|
+
Install:
|
|
85
|
+
froggy-docs install Install the Dart runtime and binary
|
|
86
|
+
|
|
87
|
+
Usage:
|
|
88
|
+
froggy-docs serve Start server with live documentation
|
|
89
|
+
froggy-docs watch Watch for changes and regenerate docs
|
|
90
|
+
froggy-docs generate Generate static documentation
|
|
91
|
+
froggy-docs help Show this help message
|
|
92
|
+
|
|
93
|
+
Options:
|
|
94
|
+
-p, --port <port> Port number (default: 8080)
|
|
95
|
+
-h, --host <host> Host address (default: localhost)
|
|
96
|
+
--project <path> Project directory to scan
|
|
97
|
+
|
|
98
|
+
Examples:
|
|
99
|
+
froggy-docs serve --port 3000
|
|
100
|
+
froggy-docs serve --host 0.0.0.0 --port 8080
|
|
101
|
+
froggy-docs watch --project ./my-api
|
|
102
|
+
`);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
switch (command) {
|
|
107
|
+
case 'install':
|
|
108
|
+
await downloadAndInstall();
|
|
109
|
+
break;
|
|
110
|
+
|
|
111
|
+
case 'serve':
|
|
112
|
+
case 'watch':
|
|
113
|
+
case 'generate':
|
|
114
|
+
await runCommand(args);
|
|
115
|
+
break;
|
|
116
|
+
|
|
117
|
+
default:
|
|
118
|
+
console.error(`Unknown command: ${command}`);
|
|
119
|
+
console.log('Run: froggy-docs --help');
|
|
120
|
+
process.exit(1);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
main().catch(console.error);
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "froggy-docs",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Auto-generate API documentation from code annotations. Works with any programming language.",
|
|
5
|
+
"author": "Kaung Mrat Thu <kaungmyatthuu.dev@gmail.com>",
|
|
6
|
+
"homepage": "https://github.com/Kaung-Myat/froggydocs",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/Kaung-Myat/froggydocs.git"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"api",
|
|
14
|
+
"documentation",
|
|
15
|
+
"openapi",
|
|
16
|
+
"swagger",
|
|
17
|
+
"auto-generate",
|
|
18
|
+
"api-docs",
|
|
19
|
+
"developer-tools"
|
|
20
|
+
],
|
|
21
|
+
"bin": {
|
|
22
|
+
"froggy-docs": "./bin/froggy_docs.dart"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"postinstall": "dart pub get",
|
|
26
|
+
"prepublish": "dart compile exe bin/froggy_docs.dart -o froggy-docs"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=14.0.0"
|
|
30
|
+
},
|
|
31
|
+
"os": [
|
|
32
|
+
"darwin",
|
|
33
|
+
"linux",
|
|
34
|
+
"win32"
|
|
35
|
+
],
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"registry": "https://registry.npmjs.org"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"froggy_docs": "^1.0.0"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/pubspec.yaml
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: froggy_docs
|
|
2
|
+
description: >
|
|
3
|
+
Auto-generate API documentation from code annotations.
|
|
4
|
+
Works with any programming language (JavaScript, Python, Go, Ruby, etc.)
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
repository: https://github.com/yourusername/froggy-docs
|
|
7
|
+
homepage: https://github.com/yourusername/froggy-docs
|
|
8
|
+
issue_tracker: https://github.com/yourusername/froggy-docs/issues
|
|
9
|
+
|
|
10
|
+
environment:
|
|
11
|
+
sdk: ^3.11.5
|
|
12
|
+
|
|
13
|
+
executables:
|
|
14
|
+
froggy_docs: null
|
|
15
|
+
|
|
16
|
+
dependencies:
|
|
17
|
+
args: ^2.7.0
|
|
18
|
+
path: ^1.9.1
|
|
19
|
+
watcher: ^1.2.1
|
|
20
|
+
shelf: ^1.4.2
|
|
21
|
+
shelf_router: ^1.1.4
|
|
22
|
+
|
|
23
|
+
dev_dependencies:
|
|
24
|
+
lints: ^6.0.0
|
|
25
|
+
test: ^1.25.6
|
|
26
|
+
|
|
27
|
+
topics:
|
|
28
|
+
- api
|
|
29
|
+
- documentation
|
|
30
|
+
- openapi
|
|
31
|
+
- swagger
|
|
32
|
+
- generator
|
|
33
|
+
- developer-tools
|