froggy-docs 1.1.0 → 1.1.3

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.
@@ -0,0 +1,21 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(head -80 /home/kmt/.pub-cache/hosted/pub.dev/jaspr-0.23.1/lib/src/dom/html/html.dart)",
5
+ "Read(//home/kmt/.pub-cache/hosted/pub.dev/jaspr-0.23.1/lib/src/dom/html/**)",
6
+ "Bash(cat /home/kmt/.pub-cache/hosted/pub.dev/jaspr-0.23.1/lib/src/dom/events.dart | head -100)",
7
+ "Read(//home/kmt/.pub-cache/hosted/pub.dev/jaspr-0.23.1/lib/src/dom/**)",
8
+ "Read(//home/kmt/.pub-cache/hosted/pub.dev/jaspr-0.23.1/**)",
9
+ "Bash(python3 -c \"import json,sys; d=json.load\\(sys.stdin\\); [print\\(p['name'],p.get\\('rootUri',''\\)\\) for p in d['packages'] if 'web' in p['name'].lower\\(\\) or 'universal' in p['name'].lower\\(\\)]\")",
10
+ "Bash(head -20 /home/kmt/.pub-cache/hosted/pub.dev/universal_web-1.1.1+1/lib/web.dart 2>/dev/null)",
11
+ "Read(//home/kmt/.pub-cache/hosted/pub.dev/universal_web-1.1.1+1/lib/**)",
12
+ "Bash(dart test *)",
13
+ "Bash(find /home/kmt/.pub-cache/hosted/pub.dev/jaspr-0.23.1 -name \"*.dart\" | xargs grep -l \"sort_children_last\\\\|div\\(classes\" 2>/dev/null | head -5 && echo \"---\" && find /home/kmt/.pub-cache/hosted/pub.dev/jaspr_lints* -name \"*.dart\" 2>/dev/null | head -5)",
14
+ "Read(//home/kmt/.pub-cache/hosted/pub.dev/**)",
15
+ "Bash(dart analyze *)",
16
+ "Bash(echo \"Exit code: $?\")",
17
+ "Bash(npm --version)",
18
+ "Bash(node -e \"const p = require.resolve\\('npm/package.json'\\); console.log\\(require\\('path'\\).dirname\\(p\\)\\)\")"
19
+ ]
20
+ }
21
+ }
@@ -0,0 +1,59 @@
1
+ name: FroggyDocs CI/CD
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ permissions:
10
+ contents: read
11
+ pages: write
12
+ id-token: write
13
+
14
+ concurrency:
15
+ group: "pages"
16
+ cancel-in-progress: false
17
+
18
+ jobs:
19
+ build:
20
+ runs-on: ubuntu-latest
21
+
22
+ steps:
23
+ - name: Checkout repository
24
+ uses: actions/checkout@v4
25
+
26
+ - name: Setup Dart SDK
27
+ uses: dart-lang/setup-dart@v1
28
+ with:
29
+ sdk: stable
30
+
31
+ - name: Install dependencies
32
+ run: dart pub get
33
+
34
+ - name: Run analyzer
35
+ run: dart analyze
36
+
37
+ - name: Run tests
38
+ run: dart test
39
+
40
+ - name: Build FroggyDocs
41
+ run: dart run bin/froggy_docs.dart build --output docs/froggy_docs.json
42
+
43
+ - name: Upload artifact
44
+ uses: actions/upload-pages-artifact@v3
45
+ with:
46
+ path: frontend/web/
47
+
48
+ deploy:
49
+ needs: build
50
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
51
+ runs-on: ubuntu-latest
52
+ environment:
53
+ name: github-pages
54
+ url: ${{ steps.deployment.outputs.page_url }}
55
+
56
+ steps:
57
+ - name: Deploy to GitHub Pages
58
+ id: deployment
59
+ uses: actions/deploy-pages@v4
package/ABOUT.md ADDED
@@ -0,0 +1,99 @@
1
+ # 🐸 FroggyDocs Project Guide
2
+
3
+ ## Overview
4
+
5
+ FroggyDocs is a cross-platform tool designed to auto-generate interactive API documentation from code annotations. It supports multiple programming languages (JavaScript, Python, Go, Ruby, etc.) and provides a modern web interface for viewing and testing API endpoints.
6
+
7
+ ### Core Technologies
8
+ - **Language:** Dart (SDK ^3.11.5)
9
+ - **Frontend Framework:** [Jaspr](https://pub.dev/packages/jaspr) (Dart web framework)
10
+ - **HTTP Server:** [Shelf](https://pub.dev/packages/shelf)
11
+ - **CLI Utilities:** `package:args`, `package:watcher`
12
+ - **Specification:** OpenAPI 3.0.0
13
+
14
+ ### Architecture
15
+ - **CLI (`bin/froggy_docs.dart`):** The entry point for commands like `serve` and `watch`.
16
+ - **Parser Engine (`lib/src/parser_engine.dart`):** Scans source files for comments starting with `@api` and other tags to build the OpenAPI specification.
17
+ - **Web Server (`lib/src/web_server.dart`):** Serves the generated documentation and handles API proxying for the "Try It Out" feature.
18
+ - **Frontend (`frontend/`):** A client-side Jaspr application that consumes the generated `froggy_docs.json` and renders the UI.
19
+
20
+ ---
21
+
22
+ ## Getting Started
23
+
24
+ ### Prerequisites
25
+ - Dart SDK installed and configured.
26
+ - (Optional) Node.js/npm for global installation.
27
+ - (Optional) Docker for containerized deployment.
28
+
29
+ ### Development Setup
30
+ 1. **Install dependencies:**
31
+ ```bash
32
+ dart pub get
33
+ cd frontend && dart pub get
34
+ ```
35
+
36
+ 2. **Run the CLI locally:**
37
+ ```bash
38
+ dart bin/froggy_docs.dart serve
39
+ ```
40
+
41
+ 3. **Build the frontend:**
42
+ ```bash
43
+ cd frontend
44
+ dart run build_runner build
45
+ ```
46
+
47
+ ### Testing
48
+ Run tests using the standard Dart test runner:
49
+ ```bash
50
+ dart test
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Development Conventions
56
+
57
+ ### Annotation Syntax
58
+ The parser scans for specific tags in comments. Supported languages use their standard comment prefixes (e.g., `//` for JS/Dart, `#` for Python).
59
+
60
+ | Tag | Description | Example |
61
+ |-----|-------------|---------|
62
+ | `@api` | Defines the method and path | `@api POST /api/users` |
63
+ | `@desc` | Brief description of the endpoint | `@desc Create a new user` |
64
+ | `@tag` | Groups endpoints in the UI | `@tag Users` |
65
+ | `@body` | Defines a request body field | `@body name string User's full name` |
66
+ | `@body-json` | Inline JSON schema for the body | `@body-json {"id": 1}` |
67
+ | `@auth` | Marks the endpoint as requiring authentication | `@auth` |
68
+
69
+ ### Coding Standards
70
+ - Follow the [Dart Style Guide](https://dart.dev/guides/language/effective-dart/style).
71
+ - Use `package:lints/recommended.yaml` for static analysis.
72
+ - Ensure all new logic is added to `lib/src/` and properly exported if necessary.
73
+ - Frontend components should be modular Jaspr components located in `frontend/lib/`.
74
+
75
+ ---
76
+
77
+ ## Deployment and Distribution
78
+
79
+ ### npm
80
+ The project includes a `package.json` for distribution via npm. The main executable is linked to `bin/froggy-docs` (which may be a wrapper script or compiled binary in the distributed package).
81
+
82
+ ### Docker
83
+ A `Dockerfile` is provided for containerization.
84
+ ```bash
85
+ docker build -t froggy-docs .
86
+ docker run -p 8080:8080 froggy-docs
87
+ ```
88
+
89
+ ### Pub
90
+ Distributed as a Dart package on [pub.dev](https://pub.dev/packages/froggy_docs).
91
+
92
+ ---
93
+
94
+ ## Key Files
95
+ - `bin/froggy_docs.dart`: CLI entry point and command handling.
96
+ - `lib/src/parser_engine.dart`: Core logic for parsing annotations and generating OpenAPI JSON.
97
+ - `lib/src/web_server.dart`: Shelf-based server with proxy support.
98
+ - `frontend/lib/app.dart`: Main frontend logic and UI rendering.
99
+ - `frontend/web/froggy_docs.json`: The generated OpenAPI specification used by the frontend.
package/MILESTONE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 🐸 FroggyDocs Milestone
2
2
 
3
- ## Date: April 28, 2026
3
+ ## Date: May 1, 2026
4
4
 
5
5
  ---
6
6
 
@@ -39,6 +39,7 @@
39
39
  - [x] Serves froggy_docs.json at `/froggy_docs.json`
40
40
  - [x] Static file serving (CSS, JS)
41
41
  - [x] Mock API endpoints for Try It Out testing
42
+ - [x] **NEW** Proxy support for forwarding API requests to backend server (`--proxy` option)
42
43
 
43
44
  ### Frontend UI
44
45
  - [x] Sidebar with tag groups (collapsible)
@@ -49,6 +50,7 @@
49
50
  - [x] "Try It Out" button with live API calls
50
51
  - [x] Response display on page
51
52
  - [x] Method badges (color-coded GET/POST/PUT/DELETE)
53
+ - [x] **CHANGED** Replaced Jaspr (Dart) with vanilla JavaScript for better compatibility
52
54
 
53
55
  ### Deployment
54
56
  - [x] Standalone executable (dart compile exe)
@@ -57,7 +59,7 @@
57
59
  - [x] Dockerfile
58
60
  - [x] .froggyrc.example config
59
61
  - [x] GitHub Actions CI workflow
60
- - [x] Published to npm
62
+ - [x] Published to npm as `froggy-docs`
61
63
 
62
64
  ---
63
65
 
@@ -66,22 +68,28 @@
66
68
  ```
67
69
  froggy_docs/
68
70
  ├── bin/froggy_docs.dart # CLI entrypoint
71
+ ├── bin/froggy-docs # Compiled executable
69
72
  ├── lib/
70
73
  │ └── src/
71
74
  │ ├── parser_engine.dart # Annotation parser
72
- │ ├── watcher_engine.dart # File watcher
73
- │ └── web_server.dart # HTTP server + mock API
75
+ │ ├── watcher_engine.dart # File watcher
76
+ │ └── web_server.dart # HTTP server + proxy
74
77
  ├── frontend/
75
- │ ├── lib/app.dart # Jaspr UI
76
- └── web/styles.css # Styling
78
+ │ ├── web/
79
+ │ ├── index.html # Main UI
80
+ │ │ ├── app.js # JavaScript frontend
81
+ │ │ ├── styles.css # Styling
82
+ │ │ └── froggy_docs.json # Generated docs
83
+ │ └── pubspec.yaml
77
84
  ├── docs/
78
- │ └── annotations.md # Full annotation guide
79
- ├── package.json # npm package config
80
- ├── package.js # npm wrapper
81
- ├── install.sh # Shell installer
82
- ├── Dockerfile # Docker image
83
- ├── .froggyrc.example # Config example
84
- └── README.md # Documentation
85
+ │ └── annotations.md # Full annotation guide
86
+ ├── package.json # npm package config
87
+ ├── package.js # npm wrapper
88
+ ├── install.sh # Shell installer
89
+ ├── Dockerfile # Docker image
90
+ ├── .froggyrc.example # Config example
91
+ ├── pubspec.yaml # Dart dependencies
92
+ └── README.md # Documentation
85
93
  ```
86
94
 
87
95
  ---
@@ -93,11 +101,14 @@ froggy_docs/
93
101
  npm install -g froggy-docs
94
102
  froggy-docs serve
95
103
 
104
+ # With proxy to backend API (e.g., Express on port 3000)
105
+ froggy-docs serve --proxy http://localhost:3000
106
+
96
107
  # Via Docker
97
108
  docker run -p 8080:8080 froggy-docs
98
109
 
99
110
  # Via binary
100
- ./froggy-docs serve -p 8080
111
+ ./froggy-docs serve -p 8080 --proxy http://localhost:3000
101
112
  ```
102
113
 
103
114
  ---
@@ -134,12 +145,13 @@ app.post('/api/users', handler);
134
145
  Built with:
135
146
  - [Shelf](https://pub.dev/packages/shelf) - HTTP server
136
147
  - [Watcher](https://pub.dev/packages/watcher) - File watching
137
- - [Jaspr](https://pub.dev/packages/jaspr) - Web framework
138
148
 
139
149
  ---
140
150
 
141
- **Status: Ready for Production Use**
151
+ ## 📦 Latest Version
152
+
153
+ **Version: 1.1.1**
142
154
 
143
155
  npm: `npm install -g froggy-docs`
144
156
  Docker: `docker run -p 8080:8080 froggy-docs`
145
- GitHub: [Releases](https://github.com/yourusername/froggy-docs/releases)
157
+ GitHub: [Releases](https://github.com/Kaung-Myat/froggydocs/releases)
@@ -1,48 +1,6 @@
1
- import 'dart:io';
2
- import 'dart:async';
3
- import 'package:args/args.dart';
4
- import 'package:froggy_docs/src/watcher_engine.dart';
5
- import 'package:froggy_docs/src/web_server.dart';
1
+ import 'package:froggy_docs/src/cli_runner.dart';
6
2
 
7
3
  void main(List<String> arguments) async {
8
- final parser = ArgParser();
9
- parser.addCommand('watch');
10
- parser.addCommand('serve');
11
- parser.addOption(
12
- 'port',
13
- abbr: 'p',
14
- help: 'Port for server',
15
- defaultsTo: '8080',
16
- );
17
- parser.addOption(
18
- 'proxy',
19
- abbr: 'x',
20
- help: 'Proxy API requests to this URL (e.g., http://localhost:3000)',
21
- defaultsTo: '',
22
- );
23
-
24
- try {
25
- final results = parser.parse(arguments);
26
-
27
- if (results.command?.name == 'watch') {
28
- print('🐸 FroggyDocs is watching your API project...');
29
- final watcher = WatcherEngine();
30
- watcher.startWatching(Directory.current.path);
31
- } else if (results.command?.name == 'serve') {
32
- final port = int.parse(results['port'] as String);
33
- final proxyUrl = results['proxy'] as String;
34
- print('🐸 Starting FroggyDocs server with live reload...');
35
- if (proxyUrl.isNotEmpty) {
36
- print('🔄 Proxy enabled: API requests will be forwarded to $proxyUrl');
37
- }
38
-
39
- // Start server and watcher
40
- await startServer(port: port, proxyUrl: proxyUrl);
41
- final watcher = WatcherEngine();
42
- watcher.startWatching(Directory.current.path);
43
- }
44
- } catch (e) {
45
- print('Error: ${e.toString()}');
46
- exit(1);
47
- }
4
+ final runner = CliRunner();
5
+ runner.run(arguments);
48
6
  }