Skip to content

Commit 5e53889

Browse files
authored
Merge pull request #119 from nanoapi-io/fix/imporve-symbol-extraction-python
fix/imporve symbol extraction python
2 parents a009fa2 + 73db72d commit 5e53889

File tree

6 files changed

+412
-424
lines changed

6 files changed

+412
-424
lines changed

WEEKLY_UPDATE_LOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Weekly Update Log
2+
3+
This log tracks significant changes, improvements, and new features implemented in the NAPI project on a weekly basis. It serves as a quick reference for team members and users to stay informed about the project's progress and recent developments.
4+
5+
## Week of April 21-27, 2024
6+
7+
### Feature Improvements
8+
9+
- Improved Python symbol extraction with better handling of partial imports
10+
- Enhanced visual representation of nodes for large codebases
11+
- Updated highlighting mechanism for better code navigation
12+
- Implemented extraction mode with API integration and symbol editing capabilities
13+
- Fixed Python error AST node cleanup for more reliable extraction
14+
- Added C# metrics feature for enhanced code analysis capabilities
15+
16+
### Build System and Package Management Improvements
17+
18+
- Switched from using published `@nanoapi.io/shared` package to bundling it directly with the CLI
19+
- Added `tsup` for improved bundling configuration
20+
- Updated package versions and dependencies across the workspace
21+
- Made the root package private and updated workspace configurations
22+
23+
### CLI Enhancements
24+
25+
- Enhanced version checking with detailed update instructions
26+
- Fixed path resolution for static file serving
27+
- Improved build process with better bundling configuration
28+
- Added proper shebang handling for the CLI executable
29+
30+
### Build System Updates
31+
32+
- Removed separate build step for shared package
33+
- Updated build scripts to use tsup for better bundling
34+
- Fixed path resolution in development and production environments
35+
- Improved static file serving configuration
36+
37+
### Version Management
38+
39+
- Updated CLI version to 1.0.3
40+
- Set shared package version to 0.0.0 since it's now bundled
41+
- Added proper version checking middleware with detailed update instructions

packages/cli/src/helpers/fileSystem/index.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
import {
2-
existsSync,
3-
mkdirSync,
4-
readFileSync,
5-
rmdirSync,
6-
writeFileSync,
7-
} from "fs";
1+
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
82
import { globSync } from "glob";
93
import { dirname, join } from "path";
104
import { csharpLanguage, pythonLanguage } from "../treeSitter/parsers.js";
@@ -89,7 +83,7 @@ export function writeFilesToDirectory(
8983
) {
9084
// empty the directory first
9185
if (existsSync(dir)) {
92-
rmdirSync(dir, { recursive: true });
86+
rmSync(dir, { recursive: true });
9387
}
9488
mkdirSync(dir, { recursive: true });
9589

packages/cli/src/languagePlugins/python/symbolExtractor/index.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ class Application:
333333
expect(result.get("services/user_service.py")).toBeDefined();
334334
expect(result.get("services/user_service.py")?.content.trim()).toEqual(
335335
`
336+
from models.user import User
336337
from database.repository import Repository
337338
338339
class UserService:
@@ -349,6 +350,7 @@ class UserService:
349350
expect(result.get("services/auth_service.py")).toBeDefined();
350351
expect(result.get("services/auth_service.py")?.content.trim()).toEqual(
351352
`
353+
from models.user import User
352354
from services.user_service import UserService
353355
import hashlib
354356

0 commit comments

Comments
 (0)