@mg21st/dev-assist 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/.eslintrc.json +17 -0
- package/.github/workflows/ci.yml +42 -0
- package/.github/workflows/docs.yml +49 -0
- package/.github/workflows/publish.yml +49 -0
- package/README.md +117 -0
- package/bin/dev-assist.js +4 -0
- package/dev-assist.config.js +10 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +133 -0
- package/dist/cli/wizard.d.ts +5 -0
- package/dist/cli/wizard.d.ts.map +1 -0
- package/dist/cli/wizard.js +66 -0
- package/dist/config.d.ts +3 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +62 -0
- package/dist/generators/docsGenerator.d.ts +15 -0
- package/dist/generators/docsGenerator.d.ts.map +1 -0
- package/dist/generators/docsGenerator.js +186 -0
- package/dist/generators/testGenerator.d.ts +12 -0
- package/dist/generators/testGenerator.d.ts.map +1 -0
- package/dist/generators/testGenerator.js +185 -0
- package/dist/parser/astParser.d.ts +7 -0
- package/dist/parser/astParser.d.ts.map +1 -0
- package/dist/parser/astParser.js +194 -0
- package/dist/server/index.d.ts +5 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +247 -0
- package/dist/shared/types.d.ts +77 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +3 -0
- package/docs/_config.yml +22 -0
- package/docs/api-reference.md +173 -0
- package/docs/architecture.md +90 -0
- package/docs/configuration.md +52 -0
- package/docs/contributing.md +101 -0
- package/docs/index.md +50 -0
- package/docs/installation.md +95 -0
- package/docs/usage.md +107 -0
- package/package.json +58 -0
- package/src/cli/index.ts +108 -0
- package/src/cli/wizard.ts +63 -0
- package/src/config.ts +29 -0
- package/src/generators/docsGenerator.ts +192 -0
- package/src/generators/testGenerator.ts +174 -0
- package/src/parser/astParser.ts +172 -0
- package/src/server/index.ts +238 -0
- package/src/shared/types.ts +83 -0
- package/tsconfig.build.json +8 -0
- package/tsconfig.json +19 -0
- package/ui/index.html +13 -0
- package/ui/package-lock.json +3086 -0
- package/ui/package.json +31 -0
- package/ui/postcss.config.js +6 -0
- package/ui/src/App.tsx +36 -0
- package/ui/src/components/ApiDocsTab.tsx +184 -0
- package/ui/src/components/ApiTestingTab.tsx +363 -0
- package/ui/src/components/Dashboard.tsx +128 -0
- package/ui/src/components/Layout.tsx +76 -0
- package/ui/src/components/TestsTab.tsx +149 -0
- package/ui/src/main.tsx +10 -0
- package/ui/src/styles/index.css +41 -0
- package/ui/tailwind.config.js +20 -0
- package/ui/tsconfig.json +19 -0
- package/ui/vite.config.ts +19 -0
package/.eslintrc.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
"parser": "@typescript-eslint/parser",
|
|
4
|
+
"plugins": ["@typescript-eslint"],
|
|
5
|
+
"extends": [
|
|
6
|
+
"eslint:recommended",
|
|
7
|
+
"plugin:@typescript-eslint/recommended"
|
|
8
|
+
],
|
|
9
|
+
"env": {
|
|
10
|
+
"node": true,
|
|
11
|
+
"es2020": true
|
|
12
|
+
},
|
|
13
|
+
"rules": {
|
|
14
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
15
|
+
"@typescript-eslint/no-unused-vars": "warn"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
lint-and-build:
|
|
11
|
+
name: Lint & Build
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout repository
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Node.js
|
|
21
|
+
uses: actions/setup-node@v4
|
|
22
|
+
with:
|
|
23
|
+
node-version: '20'
|
|
24
|
+
cache: 'npm'
|
|
25
|
+
cache-dependency-path: |
|
|
26
|
+
package-lock.json
|
|
27
|
+
ui/package-lock.json
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: npm ci
|
|
31
|
+
|
|
32
|
+
- name: Lint
|
|
33
|
+
run: npm run lint
|
|
34
|
+
|
|
35
|
+
- name: Build CLI
|
|
36
|
+
run: npm run build:cli
|
|
37
|
+
|
|
38
|
+
- name: Install UI dependencies
|
|
39
|
+
run: npm ci --prefix ui
|
|
40
|
+
|
|
41
|
+
- name: Build UI
|
|
42
|
+
run: npm run build:ui
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: Deploy Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
paths:
|
|
7
|
+
- 'docs/**'
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
pages: write
|
|
13
|
+
id-token: write
|
|
14
|
+
|
|
15
|
+
concurrency:
|
|
16
|
+
group: pages
|
|
17
|
+
cancel-in-progress: false
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
build:
|
|
21
|
+
name: Build Docs
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- name: Checkout repository
|
|
25
|
+
uses: actions/checkout@v4
|
|
26
|
+
|
|
27
|
+
- name: Setup Pages
|
|
28
|
+
uses: actions/configure-pages@v5
|
|
29
|
+
|
|
30
|
+
- name: Build with Jekyll
|
|
31
|
+
uses: actions/jekyll-build-pages@v1
|
|
32
|
+
with:
|
|
33
|
+
source: ./docs
|
|
34
|
+
destination: ./_site
|
|
35
|
+
|
|
36
|
+
- name: Upload Pages artifact
|
|
37
|
+
uses: actions/upload-pages-artifact@v3
|
|
38
|
+
|
|
39
|
+
deploy:
|
|
40
|
+
name: Deploy to GitHub Pages
|
|
41
|
+
environment:
|
|
42
|
+
name: github-pages
|
|
43
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
needs: build
|
|
46
|
+
steps:
|
|
47
|
+
- name: Deploy to GitHub Pages
|
|
48
|
+
id: deployment
|
|
49
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
name: Build & Publish
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
steps:
|
|
15
|
+
- name: Checkout repository
|
|
16
|
+
uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Set up Node.js
|
|
19
|
+
uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: '20'
|
|
22
|
+
registry-url: 'https://registry.npmjs.org'
|
|
23
|
+
cache: 'npm'
|
|
24
|
+
cache-dependency-path: |
|
|
25
|
+
package-lock.json
|
|
26
|
+
ui/package-lock.json
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: npm ci
|
|
30
|
+
|
|
31
|
+
- name: Build CLI
|
|
32
|
+
run: npm run build:cli
|
|
33
|
+
|
|
34
|
+
- name: Install UI dependencies
|
|
35
|
+
run: npm ci --prefix ui
|
|
36
|
+
|
|
37
|
+
- name: Build UI
|
|
38
|
+
run: npm run build:ui
|
|
39
|
+
|
|
40
|
+
- name: Verify build artifacts
|
|
41
|
+
run: test -f dist/cli/index.js
|
|
42
|
+
|
|
43
|
+
- name: Dry run publish
|
|
44
|
+
run: npm publish --dry-run --access public
|
|
45
|
+
|
|
46
|
+
- name: Publish to npm
|
|
47
|
+
run: npm publish --access public
|
|
48
|
+
env:
|
|
49
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/README.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# DevAssist ๐
|
|
2
|
+
|
|
3
|
+
> All-in-one developer toolkit: Auto Test Generator, API Docs Generator & API Testing UI
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/dev-assist)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- ๐งช **Auto Test Generator** - AST-based test stub generation for JS/TS
|
|
11
|
+
- ๐ **API Docs Generator** - Extract Express routes and generate OpenAPI specs + Markdown
|
|
12
|
+
- ๐ **Local UI Server** - Beautiful React UI with dashboard, tests viewer, API docs browser
|
|
13
|
+
- โก **API Testing Tab** - Lightweight Postman-like HTTP client built-in
|
|
14
|
+
- ๐ง **Interactive CLI Wizard** - Guided setup experience
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install -g dev-assist
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
### Interactive wizard
|
|
25
|
+
```bash
|
|
26
|
+
dev-assist
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Generate tests
|
|
30
|
+
```bash
|
|
31
|
+
dev-assist generate --tests --source ./src --output ./__tests__ --framework jest
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Generate API docs
|
|
35
|
+
```bash
|
|
36
|
+
dev-assist generate --docs --source ./src --output ./docs
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Generate both
|
|
40
|
+
```bash
|
|
41
|
+
dev-assist generate --source ./src
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Start UI server
|
|
45
|
+
```bash
|
|
46
|
+
dev-assist serve --port 3000
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Configuration
|
|
50
|
+
|
|
51
|
+
Create `dev-assist.config.js` in your project root:
|
|
52
|
+
|
|
53
|
+
```js
|
|
54
|
+
module.exports = {
|
|
55
|
+
testFramework: 'jest', // 'jest' | 'vitest'
|
|
56
|
+
sourceDir: './src',
|
|
57
|
+
testOutputDir: './__tests__',
|
|
58
|
+
docsOutputDir: './docs',
|
|
59
|
+
port: 3000,
|
|
60
|
+
watchMode: false,
|
|
61
|
+
baseUrl: 'http://localhost:3000',
|
|
62
|
+
};
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Development Setup
|
|
66
|
+
|
|
67
|
+
### Prerequisites
|
|
68
|
+
- Node.js >= 16
|
|
69
|
+
- npm >= 7
|
|
70
|
+
|
|
71
|
+
### Build
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Install root dependencies
|
|
75
|
+
npm install
|
|
76
|
+
|
|
77
|
+
# Install UI dependencies
|
|
78
|
+
cd ui && npm install && cd ..
|
|
79
|
+
|
|
80
|
+
# Build everything
|
|
81
|
+
npm run build
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Run in development
|
|
85
|
+
```bash
|
|
86
|
+
npm run dev
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Architecture
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
dev-assist/
|
|
93
|
+
bin/ # CLI entry point
|
|
94
|
+
src/
|
|
95
|
+
cli/ # Commander + Inquirer CLI
|
|
96
|
+
generators/ # Test & docs generators
|
|
97
|
+
parser/ # @babel/parser AST parser
|
|
98
|
+
server/ # Express backend API
|
|
99
|
+
shared/ # TypeScript types
|
|
100
|
+
ui/ # React + Vite + Tailwind frontend
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## API Endpoints (Server)
|
|
104
|
+
|
|
105
|
+
| Method | Path | Description |
|
|
106
|
+
|--------|------|-------------|
|
|
107
|
+
| GET | /api/summary | Project statistics |
|
|
108
|
+
| GET | /api/files | Parsed file list |
|
|
109
|
+
| GET | /api/tests | Generated test files |
|
|
110
|
+
| GET | /api/docs | API documentation |
|
|
111
|
+
| POST | /api/generate/tests | Trigger test generation |
|
|
112
|
+
| POST | /api/generate/docs | Trigger docs generation |
|
|
113
|
+
| POST | /api/proxy | Proxy HTTP requests (API testing) |
|
|
114
|
+
|
|
115
|
+
## License
|
|
116
|
+
|
|
117
|
+
MIT
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @type {import('./src/shared/types').DevAssistConfig} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
testFramework: 'jest',
|
|
4
|
+
sourceDir: './src',
|
|
5
|
+
testOutputDir: './__tests__',
|
|
6
|
+
docsOutputDir: './docs',
|
|
7
|
+
port: 3000,
|
|
8
|
+
watchMode: false,
|
|
9
|
+
baseUrl: 'http://localhost:3000',
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
const commander_1 = require("commander");
|
|
41
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
42
|
+
const testGenerator_1 = require("../generators/testGenerator");
|
|
43
|
+
const docsGenerator_1 = require("../generators/docsGenerator");
|
|
44
|
+
const wizard_1 = require("./wizard");
|
|
45
|
+
const config_1 = require("../config");
|
|
46
|
+
const program = new commander_1.Command();
|
|
47
|
+
program
|
|
48
|
+
.name('dev-assist')
|
|
49
|
+
.description('๐ DevAssist - Auto Test Generator, API Docs & Testing UI')
|
|
50
|
+
.version('1.0.0');
|
|
51
|
+
program
|
|
52
|
+
.command('generate')
|
|
53
|
+
.description('Generate tests and/or API docs')
|
|
54
|
+
.option('--tests', 'Generate test files only')
|
|
55
|
+
.option('--docs', 'Generate API docs only')
|
|
56
|
+
.option('-s, --source <dir>', 'Source directory', './src')
|
|
57
|
+
.option('-o, --output <dir>', 'Output directory', './__tests__')
|
|
58
|
+
.option('-f, --framework <framework>', 'Test framework (jest|vitest)', 'jest')
|
|
59
|
+
.action(async (options) => {
|
|
60
|
+
const config = await (0, config_1.loadConfig)();
|
|
61
|
+
const generateTests = options.tests || (!options.docs);
|
|
62
|
+
const generateDocs = options.docs || (!options.tests);
|
|
63
|
+
if (generateTests) {
|
|
64
|
+
console.log(chalk_1.default.cyan('\n๐งช Generating Tests...\n'));
|
|
65
|
+
const generator = new testGenerator_1.TestGenerator();
|
|
66
|
+
await generator.generate({
|
|
67
|
+
sourceDir: options.source || config.sourceDir || './src',
|
|
68
|
+
outputDir: options.output || config.testOutputDir || './__tests__',
|
|
69
|
+
framework: (options.framework || config.testFramework || 'jest'),
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
if (generateDocs) {
|
|
73
|
+
console.log(chalk_1.default.cyan('\n๐ Generating API Docs...\n'));
|
|
74
|
+
const generator = new docsGenerator_1.DocsGenerator();
|
|
75
|
+
await generator.generate({
|
|
76
|
+
sourceDir: options.source || config.sourceDir || './src',
|
|
77
|
+
outputDir: options.output || config.docsOutputDir || './docs',
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
program
|
|
82
|
+
.command('serve')
|
|
83
|
+
.description('Start the local UI server')
|
|
84
|
+
.option('-p, --port <port>', 'Port number', '3000')
|
|
85
|
+
.option('--no-open', 'Do not open browser automatically')
|
|
86
|
+
.action(async (options) => {
|
|
87
|
+
const config = await (0, config_1.loadConfig)();
|
|
88
|
+
const port = parseInt(options.port || config.port?.toString() || '3000', 10);
|
|
89
|
+
console.log(chalk_1.default.cyan(`\n๐ Starting DevAssist UI on port ${port}...\n`));
|
|
90
|
+
const { startServer } = await Promise.resolve().then(() => __importStar(require('../server/index')));
|
|
91
|
+
await startServer({ port, openBrowser: options.open !== false });
|
|
92
|
+
});
|
|
93
|
+
program
|
|
94
|
+
.action(async () => {
|
|
95
|
+
try {
|
|
96
|
+
const answers = await (0, wizard_1.runWizard)();
|
|
97
|
+
if (answers.action === 'serve') {
|
|
98
|
+
const { startServer } = await Promise.resolve().then(() => __importStar(require('../server/index')));
|
|
99
|
+
await startServer({ port: answers.port || 3000, openBrowser: true });
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const config = await (0, config_1.loadConfig)();
|
|
103
|
+
const doTests = answers.action === 'tests' || answers.action === 'both';
|
|
104
|
+
const doDocs = answers.action === 'docs' || answers.action === 'both';
|
|
105
|
+
if (doTests) {
|
|
106
|
+
console.log(chalk_1.default.cyan('\n๐งช Generating Tests...\n'));
|
|
107
|
+
const generator = new testGenerator_1.TestGenerator();
|
|
108
|
+
await generator.generate({
|
|
109
|
+
sourceDir: answers.sourceDir || config.sourceDir || './src',
|
|
110
|
+
outputDir: answers.testOutputDir || config.testOutputDir || './__tests__',
|
|
111
|
+
framework: (answers.testFramework || config.testFramework || 'jest'),
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
if (doDocs) {
|
|
115
|
+
console.log(chalk_1.default.cyan('\n๐ Generating API Docs...\n'));
|
|
116
|
+
const generator = new docsGenerator_1.DocsGenerator();
|
|
117
|
+
await generator.generate({
|
|
118
|
+
sourceDir: answers.sourceDir || config.sourceDir || './src',
|
|
119
|
+
outputDir: answers.docsOutputDir || config.docsOutputDir || './docs',
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
console.log(chalk_1.default.green.bold('\nโ
DevAssist completed successfully!\n'));
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
if (error.code === 'ERR_USE_AFTER_CLOSE') {
|
|
126
|
+
process.exit(0);
|
|
127
|
+
}
|
|
128
|
+
console.error(chalk_1.default.red('\nโ Error:', error));
|
|
129
|
+
process.exit(1);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
program.parse(process.argv);
|
|
133
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wizard.d.ts","sourceRoot":"","sources":["../../src/cli/wizard.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,wBAAsB,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CA0DzF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.runWizard = runWizard;
|
|
7
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
async function runWizard() {
|
|
10
|
+
console.log(chalk_1.default.cyan.bold('\n๐ Welcome to DevAssist CLI Wizard\n'));
|
|
11
|
+
const answers = await inquirer_1.default.prompt([
|
|
12
|
+
{
|
|
13
|
+
type: 'list',
|
|
14
|
+
name: 'action',
|
|
15
|
+
message: 'What would you like to do?',
|
|
16
|
+
choices: [
|
|
17
|
+
{ name: '๐งช Generate Tests', value: 'tests' },
|
|
18
|
+
{ name: '๐ Generate API Docs', value: 'docs' },
|
|
19
|
+
{ name: '๐ฅ Generate Both (Tests + Docs)', value: 'both' },
|
|
20
|
+
{ name: '๐ Start UI Server', value: 'serve' },
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: 'input',
|
|
25
|
+
name: 'sourceDir',
|
|
26
|
+
message: 'Source directory to scan:',
|
|
27
|
+
default: './src',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: 'list',
|
|
31
|
+
name: 'testFramework',
|
|
32
|
+
message: 'Test framework:',
|
|
33
|
+
choices: ['jest', 'vitest'],
|
|
34
|
+
when: (a) => a.action === 'tests' || a.action === 'both',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
type: 'input',
|
|
38
|
+
name: 'testOutputDir',
|
|
39
|
+
message: 'Test output directory:',
|
|
40
|
+
default: './__tests__',
|
|
41
|
+
when: (a) => a.action === 'tests' || a.action === 'both',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: 'input',
|
|
45
|
+
name: 'docsOutputDir',
|
|
46
|
+
message: 'Docs output directory:',
|
|
47
|
+
default: './docs',
|
|
48
|
+
when: (a) => a.action === 'docs' || a.action === 'both',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
type: 'number',
|
|
52
|
+
name: 'port',
|
|
53
|
+
message: 'UI server port:',
|
|
54
|
+
default: 3000,
|
|
55
|
+
when: (a) => a.action === 'serve',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
type: 'confirm',
|
|
59
|
+
name: 'watchMode',
|
|
60
|
+
message: 'Enable watch mode?',
|
|
61
|
+
default: false,
|
|
62
|
+
},
|
|
63
|
+
]);
|
|
64
|
+
return answers;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=wizard.js.map
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAYjD,wBAAsB,UAAU,IAAI,OAAO,CAAC,eAAe,CAAC,CAc3D"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.loadConfig = loadConfig;
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const DEFAULT_CONFIG = {
|
|
40
|
+
testFramework: 'jest',
|
|
41
|
+
sourceDir: './src',
|
|
42
|
+
testOutputDir: './__tests__',
|
|
43
|
+
docsOutputDir: './docs',
|
|
44
|
+
port: 3000,
|
|
45
|
+
watchMode: false,
|
|
46
|
+
baseUrl: 'http://localhost:3000',
|
|
47
|
+
};
|
|
48
|
+
async function loadConfig() {
|
|
49
|
+
const configPath = path.resolve(process.cwd(), 'dev-assist.config.js');
|
|
50
|
+
if (fs.existsSync(configPath)) {
|
|
51
|
+
try {
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
53
|
+
const userConfig = require(configPath);
|
|
54
|
+
return { ...DEFAULT_CONFIG, ...userConfig };
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
// Ignore config load errors
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return DEFAULT_CONFIG;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ApiDoc } from '../shared/types';
|
|
2
|
+
export declare class DocsGenerator {
|
|
3
|
+
private parser;
|
|
4
|
+
constructor();
|
|
5
|
+
generate(options: {
|
|
6
|
+
sourceDir: string;
|
|
7
|
+
outputDir: string;
|
|
8
|
+
baseUrl?: string;
|
|
9
|
+
title?: string;
|
|
10
|
+
}): Promise<ApiDoc>;
|
|
11
|
+
private buildEndpoint;
|
|
12
|
+
private generateMarkdown;
|
|
13
|
+
private generateOpenApiSpec;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=docsGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docsGenerator.d.ts","sourceRoot":"","sources":["../../src/generators/docsGenerator.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAA4B,MAAM,iBAAiB,CAAC;AAEnE,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAY;;IAMpB,QAAQ,CAAC,OAAO,EAAE;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,MAAM,CAAC;IA4CnB,OAAO,CAAC,aAAa;IA6BrB,OAAO,CAAC,gBAAgB;IAuDxB,OAAO,CAAC,mBAAmB;CA4C5B"}
|