File tree Expand file tree Collapse file tree 3 files changed +30
-32
lines changed Expand file tree Collapse file tree 3 files changed +30
-32
lines changed Original file line number Diff line number Diff line change 129129.yarn /install-state.gz
130130.pnp. *
131131
132- # OS files
132+ # Others
133133.DS_Store
134+ .turbo
Original file line number Diff line number Diff line change 1- import type { Item } from "@esonar/core" ;
2- import { parse , scan } from "@esonar/core" ;
3- import { readFileSync } from "fs" ;
1+ import { esonar } from "@esonar/core" ;
42
53const main = async ( ) => {
6- const projects = scan ( ) ;
7- const items : Item [ ] = [ ] ;
8-
9- for ( const project of projects ) {
10- for ( const file of project . files ) {
11- const content = readFileSync ( file , "utf-8" ) ;
12- const module = project . metadata . name ;
13-
14- // console.log(
15- // file,
16- // await parse(content, {
17- // file,
18- // module,
19- // }),
20- // );
21-
22- items . push (
23- ...( await parse ( content , {
24- file,
25- module,
26- } ) ) ,
27- ) ;
28- }
29- }
30-
31- console . log ( items ) ;
4+ await esonar ( ) ;
325} ;
336
347main ( ) . catch ( ( error ) => {
Original file line number Diff line number Diff line change 1- export * from "./parser" ;
2- export * from "./scanner" ;
1+ import { readFileSync } from "fs" ;
2+
3+ import { scan } from "./scanner" ;
4+ import type { Item } from "./entities/item" ;
5+ import { parse } from "./parser" ;
6+
7+ export const esonar = async ( ) => {
8+ const projects = scan ( ) ;
9+ const items : Item [ ] = [ ] ;
10+
11+ for ( const project of projects ) {
12+ for ( const file of project . files ) {
13+ const content = readFileSync ( file , "utf-8" ) ;
14+ const module = project . metadata . name ;
15+
16+ const projectItems = await parse ( content , {
17+ file,
18+ module,
19+ } ) ;
20+
21+ items . push ( ...projectItems ) ;
22+ }
23+ }
24+
25+ console . log ( items ) ;
26+ } ;
You can’t perform that action at this time.
0 commit comments