shadowdocs 2.1.5 → 2.1.7
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/CONTRIBUTING.md +34 -66
- package/LICENSE +1 -1
- package/README.md +119 -78
- package/SECURITY.md +25 -42
- package/dist/services/ai.d.ts +7 -0
- package/dist/services/ai.d.ts.map +1 -1
- package/dist/services/ai.js +167 -77
- package/dist/services/ai.js.map +1 -1
- package/dist/ui/components/Generator.d.ts.map +1 -1
- package/dist/ui/components/Generator.js +22 -10
- package/dist/ui/components/Generator.js.map +1 -1
- package/dist/ui/components/Menu.d.ts.map +1 -1
- package/dist/ui/components/Menu.js +3 -3
- package/dist/ui/components/Menu.js.map +1 -1
- package/package.json +1 -1
- package/src/services/ai.ts +185 -80
- package/src/ui/components/Generator.tsx +30 -12
- package/src/ui/components/Menu.tsx +6 -11
package/CONTRIBUTING.md
CHANGED
|
@@ -1,83 +1,51 @@
|
|
|
1
1
|
# Contributing to ShadowDocs
|
|
2
|
+
==========================
|
|
2
3
|
|
|
3
|
-
Thank you for
|
|
4
|
-
|
|
5
|
-
## Code of Conduct
|
|
6
|
-
|
|
7
|
-
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
|
|
8
|
-
|
|
9
|
-
- Be respectful and inclusive
|
|
10
|
-
- No harassment or discrimination
|
|
11
|
-
- No offensive language or behavior
|
|
12
|
-
- Violations will result in immediate account suspension
|
|
13
|
-
|
|
14
|
-
## How to Contribute
|
|
15
|
-
|
|
16
|
-
### Reporting Bugs
|
|
17
|
-
|
|
18
|
-
1. Check existing issues first
|
|
19
|
-
2. Create a detailed bug report with:
|
|
20
|
-
- Clear title and description
|
|
21
|
-
- Steps to reproduce
|
|
22
|
-
- Expected vs actual behavior
|
|
23
|
-
- Environment details (OS, Node version, etc.)
|
|
24
|
-
|
|
25
|
-
### Suggesting Features
|
|
26
|
-
|
|
27
|
-
1. Search existing feature requests
|
|
28
|
-
2. Provide clear use case
|
|
29
|
-
3. Explain why this feature would be useful
|
|
30
|
-
4. Be open to discussion
|
|
31
|
-
|
|
32
|
-
### Pull Requests
|
|
33
|
-
|
|
34
|
-
1. Fork the repository
|
|
35
|
-
2. Create a feature branch: `git checkout -b feature/amazing-feature`
|
|
36
|
-
3. Make your changes
|
|
37
|
-
4. Add tests if applicable
|
|
38
|
-
5. Ensure code style is consistent
|
|
39
|
-
6. Commit with clear messages: `git commit -m 'Add amazing feature'`
|
|
40
|
-
7. Push to your fork: `git push origin feature/amazing-feature`
|
|
41
|
-
8. Open a Pull Request
|
|
4
|
+
Thank you for considering contributing to ShadowDocs, an AI-powered documentation generator for developer projects. This guide outlines the process for contributing to the project, including development setup, testing requirements, and guidelines for submitting changes.
|
|
42
5
|
|
|
43
6
|
## Development Setup
|
|
7
|
+
--------------------
|
|
44
8
|
|
|
45
|
-
|
|
46
|
-
git clone https://github.com/shadowofficial206/shadowdocs.git
|
|
47
|
-
cd shadowdocs
|
|
48
|
-
npm install
|
|
49
|
-
```
|
|
9
|
+
To start contributing to ShadowDocs, follow these steps:
|
|
50
10
|
|
|
51
|
-
|
|
11
|
+
1. **Clone the repository**: Clone the ShadowDocs repository using Git: `git clone https://github.com/[repository-url].git`
|
|
12
|
+
2. **Install dependencies**: Install the required dependencies by running `npm install` or `yarn install` in the project root directory.
|
|
13
|
+
3. **Build the project**: Run `npm run build` or `yarn build` to build the project.
|
|
14
|
+
4. **Start the development server**: Run `npm run dev` or `yarn dev` to start the development server in watch mode.
|
|
52
15
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
shadowdocs
|
|
56
|
-
```
|
|
16
|
+
## Testing Requirements
|
|
17
|
+
----------------------
|
|
57
18
|
|
|
58
|
-
|
|
19
|
+
Before submitting changes, ensure that the following testing requirements are met:
|
|
59
20
|
|
|
60
|
-
|
|
61
|
-
npm test
|
|
62
|
-
|
|
21
|
+
1. **Type checking**: Run `npm run typecheck` or `yarn typecheck` to verify that the code is type-safe.
|
|
22
|
+
2. **Unit tests**: Run `npm test` or `yarn test` to execute the unit tests.
|
|
23
|
+
3. **Integration tests**: Run `npm run test:integration` or `yarn test:integration` to execute the integration tests.
|
|
63
24
|
|
|
64
|
-
##
|
|
25
|
+
## Guidelines for Contributing
|
|
26
|
+
-----------------------------
|
|
65
27
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
- Use meaningful variable names
|
|
28
|
+
1. **Code style**: Follow the existing code style and formatting conventions.
|
|
29
|
+
2. **Commit messages**: Use descriptive and concise commit messages that follow the standard GitHub guidelines.
|
|
30
|
+
3. **Pull requests**: Submit changes as pull requests, including a clear description of the changes and any relevant testing or verification.
|
|
31
|
+
4. **Code reviews**: Participate in code reviews to ensure that changes meet the project's standards and requirements.
|
|
71
32
|
|
|
72
|
-
##
|
|
33
|
+
## Submitting Changes
|
|
34
|
+
--------------------
|
|
73
35
|
|
|
74
|
-
|
|
75
|
-
- Don't open issues for general questions
|
|
36
|
+
To submit changes to ShadowDocs, follow these steps:
|
|
76
37
|
|
|
77
|
-
|
|
38
|
+
1. **Create a new branch**: Create a new branch from the main branch using `git checkout -b [branch-name]`.
|
|
39
|
+
2. **Make changes**: Make the desired changes to the codebase.
|
|
40
|
+
3. **Commit changes**: Commit the changes using `git commit -m "[commit-message]"`.
|
|
41
|
+
4. **Push changes**: Push the changes to the remote repository using `git push origin [branch-name]`.
|
|
42
|
+
5. **Create a pull request**: Create a pull request from the new branch to the main branch, including a clear description of the changes.
|
|
78
43
|
|
|
79
|
-
|
|
44
|
+
## Additional Resources
|
|
45
|
+
-----------------------
|
|
80
46
|
|
|
81
|
-
|
|
47
|
+
* **Project structure**: Familiarize yourself with the project structure, including the `src`, `bin`, and `ui` directories.
|
|
48
|
+
* **Dependencies**: Review the project dependencies and dev dependencies listed in `package.json`.
|
|
49
|
+
* **Security**: Review the security guidelines and best practices outlined in `SECURITY.md`.
|
|
82
50
|
|
|
83
|
-
|
|
51
|
+
By following these guidelines and requirements, you can help ensure that your contributions to ShadowDocs are high-quality, effective, and align with the project's goals and standards. Thank you for your contributions!
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,100 +1,141 @@
|
|
|
1
1
|
# ShadowDocs
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
================
|
|
3
|
+
AI-powered documentation generator for developer projects.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
-----------------
|
|
7
|
+
|
|
8
|
+
1. [Introduction](#introduction)
|
|
9
|
+
2. [Getting Started](#getting-started)
|
|
10
|
+
3. [Project Structure](#project-structure)
|
|
11
|
+
4. [Installation](#installation)
|
|
12
|
+
5. [Usage](#usage)
|
|
13
|
+
6. [API Documentation](#api-documentation)
|
|
14
|
+
7. [Contributing](#contributing)
|
|
15
|
+
8. [Security](#security)
|
|
16
|
+
9. [License](#license)
|
|
17
|
+
|
|
18
|
+
## Introduction
|
|
19
|
+
------------
|
|
20
|
+
|
|
21
|
+
ShadowDocs is a module designed to generate high-quality documentation for developer projects using AI-powered technology. With ShadowDocs, you can easily create and maintain accurate and up-to-date documentation for your projects.
|
|
22
|
+
|
|
23
|
+
## Getting Started
|
|
24
|
+
---------------
|
|
25
|
+
|
|
26
|
+
To get started with ShadowDocs, follow these steps:
|
|
27
|
+
|
|
28
|
+
1. Install the required dependencies using npm or yarn.
|
|
29
|
+
2. Run the `build` script to compile the TypeScript code.
|
|
30
|
+
3. Run the `start` script to start the ShadowDocs CLI.
|
|
31
|
+
|
|
32
|
+
## Project Structure
|
|
33
|
+
------------------
|
|
34
|
+
|
|
35
|
+
The ShadowDocs project is structured as follows:
|
|
36
|
+
```markdown
|
|
37
|
+
shadowdocs/
|
|
38
|
+
├── bin/
|
|
39
|
+
├── cli.js
|
|
40
|
+
├── src/
|
|
41
|
+
├── core/
|
|
42
|
+
├── config.ts
|
|
43
|
+
├── events.ts
|
|
44
|
+
├── index.ts
|
|
45
|
+
├── types.ts
|
|
46
|
+
├── ui.ts
|
|
47
|
+
├── services/
|
|
48
|
+
├── ai.ts
|
|
49
|
+
├── analyzer.ts
|
|
50
|
+
├── index.ts
|
|
51
|
+
├── scanner.ts
|
|
52
|
+
├── ui/
|
|
53
|
+
├── components/
|
|
54
|
+
├── contexts/
|
|
55
|
+
├── hooks/
|
|
56
|
+
├── App.tsx
|
|
57
|
+
├── cli-ink.ts
|
|
58
|
+
├── ink.tsx
|
|
59
|
+
├── interactive.ts
|
|
60
|
+
├── CONTRIBUTING.md
|
|
61
|
+
├── LICENSE
|
|
62
|
+
├── package-lock.json
|
|
63
|
+
├── package.json
|
|
64
|
+
├── README.md
|
|
65
|
+
├── SECURITY.md
|
|
66
|
+
├── shadowdocs-2.0.1.tgz
|
|
67
|
+
├── tsconfig.json
|
|
68
|
+
```
|
|
18
69
|
## Installation
|
|
70
|
+
------------
|
|
71
|
+
|
|
19
72
|
To install ShadowDocs, run the following command:
|
|
20
73
|
```bash
|
|
21
74
|
npm install shadowdocs
|
|
22
75
|
```
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
```javascript
|
|
27
|
-
// Import ShadowDocs
|
|
28
|
-
const { generateDocs } = require('shadowdocs');
|
|
29
|
-
|
|
30
|
-
// Generate documentation
|
|
31
|
-
generateDocs({
|
|
32
|
-
// Project path
|
|
33
|
-
path: './my-project',
|
|
34
|
-
// Output path
|
|
35
|
-
output: './docs',
|
|
36
|
-
});
|
|
76
|
+
or
|
|
77
|
+
```bash
|
|
78
|
+
yarn add shadowdocs
|
|
37
79
|
```
|
|
80
|
+
## Usage
|
|
81
|
+
-----
|
|
38
82
|
|
|
39
|
-
|
|
40
|
-
ShadowDocs exports the following functions:
|
|
41
|
-
- `generateDocs(options)`: Generates documentation for a project.
|
|
42
|
-
- `options.path`: The path to the project.
|
|
43
|
-
- `options.output`: The output path for the generated documentation.
|
|
44
|
-
|
|
45
|
-
## Configuration
|
|
46
|
-
ShadowDocs provides the following configuration options:
|
|
47
|
-
- `path`: The path to the project.
|
|
48
|
-
- `output`: The output path for the generated documentation.
|
|
49
|
-
- `language`: The programming language of the project.
|
|
50
|
-
|
|
51
|
-
## Development
|
|
52
|
-
To set up the development environment, run the following commands:
|
|
83
|
+
To use ShadowDocs, run the following command:
|
|
53
84
|
```bash
|
|
54
|
-
|
|
55
|
-
npm run dev
|
|
85
|
+
npx shadowdocs
|
|
56
86
|
```
|
|
57
|
-
This will start the
|
|
87
|
+
This will start the ShadowDocs CLI. You can then follow the prompts to generate documentation for your project.
|
|
58
88
|
|
|
59
|
-
|
|
60
|
-
|
|
89
|
+
### Example Usage
|
|
90
|
+
|
|
91
|
+
Here is an example of how to use ShadowDocs to generate documentation for a sample project:
|
|
61
92
|
```bash
|
|
62
|
-
|
|
93
|
+
# Create a new project
|
|
94
|
+
mkdir myproject
|
|
95
|
+
cd myproject
|
|
96
|
+
|
|
97
|
+
# Initialize a new npm project
|
|
98
|
+
npm init -y
|
|
99
|
+
|
|
100
|
+
# Install ShadowDocs
|
|
101
|
+
npm install shadowdocs
|
|
102
|
+
|
|
103
|
+
# Run ShadowDocs
|
|
104
|
+
npx shadowdocs
|
|
63
105
|
```
|
|
64
|
-
This will
|
|
106
|
+
This will generate documentation for the `myproject` project.
|
|
65
107
|
|
|
66
|
-
##
|
|
67
|
-
|
|
108
|
+
## API Documentation
|
|
109
|
+
------------------
|
|
68
110
|
|
|
69
|
-
|
|
111
|
+
The ShadowDocs API is documented below:
|
|
70
112
|
|
|
71
|
-
|
|
72
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
73
|
-
in the Software without restriction, including without limitation the rights
|
|
74
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
75
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
76
|
-
furnished to do so, subject to the following conditions:
|
|
113
|
+
### Core
|
|
77
114
|
|
|
78
|
-
|
|
79
|
-
|
|
115
|
+
* `config.ts`: Configuration module for ShadowDocs.
|
|
116
|
+
* `events.ts`: Event handling module for ShadowDocs.
|
|
117
|
+
* `index.ts`: Main entry point for ShadowDocs.
|
|
118
|
+
* `types.ts`: Type definitions for ShadowDocs.
|
|
119
|
+
* `ui.ts`: UI component module for ShadowDocs.
|
|
80
120
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
SOFTWARE.
|
|
121
|
+
### Services
|
|
122
|
+
|
|
123
|
+
* `ai.ts`: AI-powered documentation generation module.
|
|
124
|
+
* `analyzer.ts`: Code analysis module for ShadowDocs.
|
|
125
|
+
* `index.ts`: Main entry point for services module.
|
|
126
|
+
* `scanner.ts`: Code scanner module for ShadowDocs.
|
|
88
127
|
|
|
89
128
|
## Contributing
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
129
|
+
------------
|
|
130
|
+
|
|
131
|
+
To contribute to ShadowDocs, please see the [CONTRIBUTING.md](CONTRIBUTING.md) file.
|
|
132
|
+
|
|
133
|
+
## Security
|
|
134
|
+
---------
|
|
95
135
|
|
|
96
|
-
|
|
97
|
-
|
|
136
|
+
To report a security vulnerability, please see the [SECURITY.md](SECURITY.md) file.
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
-------
|
|
98
140
|
|
|
99
|
-
|
|
100
|
-
We are committed to creating a welcoming and inclusive environment for all contributors. We expect all contributors to be respectful, inclusive, and professional. Harassment, discrimination, or any other form of unacceptable behavior will not be tolerated and will result in immediate suspension of privileges.
|
|
141
|
+
ShadowDocs is licensed under the [MIT License](LICENSE).
|
package/SECURITY.md
CHANGED
|
@@ -1,52 +1,35 @@
|
|
|
1
|
-
#
|
|
1
|
+
# SECURITY.md
|
|
2
|
+
## Introduction
|
|
3
|
+
The shadowdocs project takes the security of its users seriously. We are committed to ensuring the integrity and confidentiality of the data used with our AI-powered documentation generator.
|
|
2
4
|
|
|
3
|
-
##
|
|
5
|
+
## Reporting Security Vulnerabilities
|
|
6
|
+
If you believe you have found a security vulnerability in shadowdocs, please report it to us immediately. We appreciate your help in making shadowdocs more secure.
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
| ------- | ------------------- |
|
|
7
|
-
| 1.2.x | ✓ :white_check_mark: |
|
|
8
|
-
| 1.1.x | ✓ :white_check_mark: |
|
|
9
|
-
| < 1.1 | ✗ |
|
|
8
|
+
To report a security vulnerability, please follow these steps:
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
1. **Do not** open an issue on the GitHub issue tracker. Instead, send an email to [security@shadowdocs.io](mailto:security@shadowdocs.io) with the subject "Security Vulnerability Report".
|
|
11
|
+
2. Provide a detailed description of the vulnerability, including:
|
|
12
|
+
* A clear explanation of the issue
|
|
13
|
+
* Steps to reproduce the issue (if applicable)
|
|
14
|
+
* Any relevant code snippets or logs
|
|
15
|
+
3. We will respond to your email within **3 business days** to acknowledge receipt of your report and provide a timeline for addressing the issue.
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
## Security Information
|
|
18
|
+
The shadowdocs project uses the following security measures:
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- Description of the vulnerability
|
|
20
|
-
- Steps to reproduce
|
|
21
|
-
- Potential impact
|
|
22
|
-
- Any suggested fixes (optional)
|
|
23
|
-
|
|
24
|
-
## Scope
|
|
25
|
-
|
|
26
|
-
- API key exposure vulnerabilities
|
|
27
|
-
- Code injection risks
|
|
28
|
-
- Data privacy issues
|
|
29
|
-
- Authentication/authorization bypasses
|
|
30
|
-
|
|
31
|
-
## Out of Scope
|
|
32
|
-
|
|
33
|
-
- Social engineering attacks
|
|
34
|
-
- Physical security
|
|
35
|
-
- Denial of service (unless severe)
|
|
36
|
-
- Issues in third-party dependencies (report to maintainers)
|
|
20
|
+
* **Dependencies**: We regularly review and update our dependencies to ensure we are using the latest secure versions.
|
|
21
|
+
* **Code Reviews**: All code changes are reviewed by at least one other developer before being merged into the main branch.
|
|
22
|
+
* **Testing**: We have a comprehensive test suite to ensure our code is working as expected.
|
|
37
23
|
|
|
38
24
|
## Response Timeline
|
|
25
|
+
We strive to address security vulnerabilities in a timely and responsible manner. Our response timeline is as follows:
|
|
39
26
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
## Security Updates
|
|
45
|
-
|
|
46
|
-
Security updates will be released as patch versions and announced on:
|
|
47
|
-
- GitHub Security Advisories
|
|
48
|
-
- npm security alerts
|
|
27
|
+
* **Acknowledgement**: We will respond to your initial report within **3 business days** to acknowledge receipt of your report.
|
|
28
|
+
* **Initial Fix**: We will provide an initial fix for the vulnerability within **7 business days** of acknowledging the report.
|
|
29
|
+
* **Final Fix**: We will provide a final fix for the vulnerability, including any necessary updates to our dependencies, within **14 business days** of acknowledging the report.
|
|
49
30
|
|
|
50
|
-
|
|
31
|
+
## Contact Information
|
|
32
|
+
For any security-related questions or concerns, please contact us at [security@shadowdocs.io](mailto:security@shadowdocs.io).
|
|
51
33
|
|
|
52
|
-
|
|
34
|
+
## Versioning
|
|
35
|
+
This SECURITY.md document applies to all versions of shadowdocs, including the current version (2.1.6). We will update this document as necessary to reflect changes to our security policies and procedures.
|
package/dist/services/ai.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { DocResult } from '../core/types.js';
|
|
2
|
+
export interface GeneratedDocs {
|
|
3
|
+
content?: string;
|
|
4
|
+
readme: string;
|
|
5
|
+
contributing: string;
|
|
6
|
+
license: string;
|
|
7
|
+
security: string;
|
|
8
|
+
}
|
|
2
9
|
export declare function generateDocs(projectData: Record<string, unknown>, mode?: 'generate' | 'improve' | 'explain'): Promise<DocResult>;
|
|
3
10
|
export declare function validateApiKey(apiKey: string): Promise<boolean>;
|
|
4
11
|
//# sourceMappingURL=ai.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../src/services/ai.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AA6D7C,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,GAAE,UAAU,GAAG,SAAS,GAAG,SAAsB,GAAG,OAAO,CAAC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../src/services/ai.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AA6D7C,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,GAAE,UAAU,GAAG,SAAS,GAAG,SAAsB,GAAG,OAAO,CAAC,SAAS,CAAC,CA+ClJ;AA0MD,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA2BrE"}
|