@tng-sh/js 0.0.1 → 0.0.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.
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# @tng-sh/js: TNG JavaScript CLI
|
|
2
|
+
|
|
3
|
+
High-performance test generation and context analysis for JavaScript/TypeScript, powered by Rust (NAPI-RS and OXC).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @tng-sh/js --save-dev
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
### 1. Initialize
|
|
14
|
+
Run the init command to create a `tng.config.js` configuration file in your project:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx -p @tng-sh/js tng init
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### 2. Generate Tests
|
|
21
|
+
Generate a test for a specific function in a file:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx -p @tng-sh/js tng -f path/to/file.js -m functionName -t react_component
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Supported Types (`-t`):**
|
|
28
|
+
- `react_component`
|
|
29
|
+
- `express_handler`
|
|
30
|
+
- `graphql_resolver`
|
|
31
|
+
- `nest_js` (Service/Controller)
|
|
32
|
+
- `orm_model`
|
|
33
|
+
- `background_job`
|
|
34
|
+
- `mailer`
|
|
35
|
+
- `utility`
|
|
36
|
+
|
|
37
|
+
### 3. Interactive Mode
|
|
38
|
+
Launch the interactive UI to explore and generate tests visually:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx -p @tng-sh/js tng i
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Features
|
|
45
|
+
|
|
46
|
+
- ⚡️ **Fast AST Analysis**: Powered by Rust and the `oxc` parser for blazing fast static analysis.
|
|
47
|
+
- 🖥️ **Interactive UI**: Rich Go-based terminal UI for managing test generation.
|
|
48
|
+
- 🎨 **Prettier Integration**: Automatically formats generated tests to match your project style.
|
|
49
|
+
- 📘 **TypeScript Support**: First-class support for TypeScript analysis.
|
|
50
|
+
|
|
51
|
+
## Configuration
|
|
52
|
+
|
|
53
|
+
The `tng.config.js` file allows you to customize the behavior:
|
|
54
|
+
|
|
55
|
+
```javascript
|
|
56
|
+
module.exports = {
|
|
57
|
+
// API Configuration
|
|
58
|
+
API_KEY: "your-api-key-here",
|
|
59
|
+
API_URL: "https://app.tng.sh/",
|
|
60
|
+
|
|
61
|
+
// Framework Detection
|
|
62
|
+
// Options: express, nextjs, nestjs, generic
|
|
63
|
+
FRAMEWORK: "express",
|
|
64
|
+
|
|
65
|
+
// Testing Configuration
|
|
66
|
+
// Options: jest, mocha, vitest
|
|
67
|
+
TEST_FRAMEWORK: "jest",
|
|
68
|
+
|
|
69
|
+
// Test Directory
|
|
70
|
+
TEST_DIRECTORY: "tests"
|
|
71
|
+
};
|
|
72
|
+
```
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tng-sh/js",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "TNG JavaScript
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "TNG JavaScript CLI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/tng-sh/tng-js-public.git"
|
|
@@ -44,4 +44,4 @@
|
|
|
44
44
|
"fast-glob": "^3.3.3",
|
|
45
45
|
"prettier": "^2.8.8"
|
|
46
46
|
}
|
|
47
|
-
}
|
|
47
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|