Skip to content

Commit acff024

Browse files
committed
fix: resolve arrow function boundary detection in React components
- Fix tree-sitter parser to correctly identify nested arrow functions - Modified collectNodesByTypes to recursively traverse function nodes - Arrow functions inside React components now correctly identified with accurate line counts and nesting depths - Update version to 2.2.1 - Add auto-release workflow for GitHub Release automation (with overwrite support) - Remove old manual release workflow - Add value-realization project to README (all language versions)
1 parent cd55ca0 commit acff024

9 files changed

Lines changed: 104 additions & 64 deletions

File tree

.github/workflows/auto-release.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Auto Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'package.json'
9+
10+
jobs:
11+
check-version:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
version-changed: ${{ steps.check.outputs.changed }}
15+
new-version: ${{ steps.check.outputs.version }}
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 2
20+
21+
- name: Check if version changed
22+
id: check
23+
run: |
24+
CURRENT_VERSION=$(node -p "require('./package.json').version")
25+
git checkout HEAD~1 -- package.json 2>/dev/null || echo "First commit"
26+
PREVIOUS_VERSION=$(node -p "require('./package.json').version" 2>/dev/null || echo "0.0.0")
27+
git checkout HEAD -- package.json
28+
29+
echo "Current version: $CURRENT_VERSION"
30+
echo "Previous version: $PREVIOUS_VERSION"
31+
32+
if [ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ]; then
33+
echo "changed=true" >> $GITHUB_OUTPUT
34+
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
35+
else
36+
echo "changed=false" >> $GITHUB_OUTPUT
37+
fi
38+
39+
ci:
40+
needs: check-version
41+
if: needs.check-version.outputs.version-changed == 'true'
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- uses: actions/setup-node@v4
47+
with:
48+
node-version: 20
49+
cache: npm
50+
51+
- run: npm ci
52+
53+
- name: Lint
54+
run: npm run lint
55+
56+
- name: Format check
57+
run: npm run format:check
58+
59+
- name: Build
60+
run: npm run build
61+
62+
- name: Test
63+
run: npx vitest --run
64+
65+
create-release:
66+
needs: [check-version, ci]
67+
if: needs.check-version.outputs.version-changed == 'true'
68+
runs-on: ubuntu-latest
69+
permissions:
70+
contents: write
71+
steps:
72+
- uses: actions/checkout@v4
73+
74+
- name: Create Release
75+
uses: softprops/action-gh-release@v2
76+
with:
77+
tag_name: v${{ needs.check-version.outputs.new-version }}
78+
name: Release v${{ needs.check-version.outputs.new-version }}
79+
body: |
80+
## Changes in v${{ needs.check-version.outputs.new-version }}
81+
82+
See [commits](https://github.com/${{ github.repository }}/commits/v${{ needs.check-version.outputs.new-version }}) for details.
83+
84+
## Installation
85+
86+
```bash
87+
npm install -g eff-u-code@${{ needs.check-version.outputs.new-version }}
88+
```
89+
draft: false
90+
prerelease: false
91+
generate_release_notes: true
92+
make_latest: true

.github/workflows/release.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ MIT
277277

278278
## More Projects
279279

280+
- [Value Realization](https://github.com/Done-0/value-realization) — AI skill for analyzing product value discovery (100K+ views in 24h, 100+ stars on day 1)
280281
- [FateSpiral](https://fatespiral.com/) — AI-driven multiplayer RPG, infinite worlds, evolving stories
281282
- [DestinyTeller](https://destinyteller.com/) — AI-powered destiny reading website
282283
- [Jank](https://github.com/Done-0/Jank) — Open-source blog system in Go

README_RU.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ MIT
280280

281281
## Другие проекты
282282

283+
- [Value Realization](https://github.com/Done-0/value-realization) — AI-навык для анализа ценности продукта (100K+ просмотров за 24ч, 100+ звезд в первый день)
283284
- [FateSpiral](https://fatespiral.com/) — AI-мультиплеерная RPG, бесконечные миры, развивающиеся истории
284285
- [DestinyTeller](https://destinyteller.com/) — AI-сайт предсказаний судьбы
285286
- [Jank](https://github.com/Done-0/Jank) — Блог-система с открытым исходным кодом на Go

README_ZH.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ MIT
277277

278278
## 安利一下
279279

280+
- [Value Realization](https://github.com/Done-0/value-realization) — 产品价值发现分析 AI 技能(24小时内10万+浏览,首日100+星)
280281
- [FateSpiral](https://fatespiral.com/) — AI 驱动的多人 RPG,无限世界,无限剧情
281282
- [玄学工坊](https://destinyteller.com/) — AI 赛博算命网站
282283
- [Jank](https://github.com/Done-0/Jank) — Go 语言开源博客

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eff-u-code",
3-
"version": "2.2.0",
3+
"version": "2.2.1",
44
"description": "Production-grade code quality analyzer with AST parsing and AI integration",
55
"type": "module",
66
"main": "dist/index.js",

src/parser/tree-sitter-parser.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -913,10 +913,13 @@ export class TreeSitterParser implements IParser {
913913
const walk = (node: Parser.SyntaxNode): void => {
914914
if (typeSet.has(node.type)) {
915915
callback(node);
916-
// For comments, continue recursing; for functions/classes, don't
916+
// For comments and imports, continue recursing
917+
// For functions, also continue recursing to find nested functions (e.g., arrow functions in React components)
918+
// For classes, don't recurse (methods will be found separately)
917919
if (
918920
this.config.commentNodeTypes.includes(node.type) ||
919-
this.config.importNodeTypes.includes(node.type)
921+
this.config.importNodeTypes.includes(node.type) ||
922+
this.config.functionNodeTypes.includes(node.type)
920923
) {
921924
for (const child of node.namedChildren) walk(child);
922925
}

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
* Application version - single source of truth
33
* This value is automatically synced from package.json during build
44
*/
5-
export const VERSION = '2.2.0';
5+
export const VERSION = '2.2.1';

0 commit comments

Comments
 (0)