File tree Expand file tree Collapse file tree 3 files changed +56
-0
lines changed Expand file tree Collapse file tree 3 files changed +56
-0
lines changed Original file line number Diff line number Diff line change @@ -29659,6 +29659,8 @@ function shouldUseSymlinks() {
2965929659
2966029660async function detectFrameworks(rootPath = './') {
2966129661 const detectors = [
29662+ detectBun,
29663+ detectDeno,
2966229664 detectGo,
2966329665 detectHomebrew,
2966429666 detectJava,
@@ -29677,6 +29679,20 @@ async function detectFrameworks(rootPath = './') {
2967729679 }
2967829680 return detected;
2967929681}
29682+ async function detectBun(rootPath) {
29683+ let detected = [];
29684+ if (external_node_fs_namespaceObject.existsSync(external_node_path_namespaceObject.join(rootPath, 'bun.lock'))) {
29685+ detected.push('bun');
29686+ }
29687+ return detected;
29688+ }
29689+ async function detectDeno(rootPath) {
29690+ let detected = [];
29691+ if (external_node_fs_namespaceObject.existsSync(external_node_path_namespaceObject.join(rootPath, 'deno.lock'))) {
29692+ detected.push('deno');
29693+ }
29694+ return detected;
29695+ }
2968029696async function detectGo(rootPath) {
2968129697 let detected = [];
2968229698 if (external_node_fs_namespaceObject.existsSync(external_node_path_namespaceObject.join(rootPath, 'go.mod'))) {
Original file line number Diff line number Diff line change @@ -8,6 +8,24 @@ beforeEach(() => {
88 vol . reset ( ) ; // reset the state of in-memory fs
99} ) ;
1010
11+ test ( 'detects bun' , async ( ) => {
12+ vol . fromJSON ( {
13+ 'mockdata/bun.lock' : '' ,
14+ } ) ;
15+
16+ const detected = await detectFrameworks ( 'mockdata' ) ;
17+ expect ( detected ) . toContain ( 'bun' ) ;
18+ } ) ;
19+
20+ test ( 'detects deno' , async ( ) => {
21+ vol . fromJSON ( {
22+ 'mockdata/deno.lock' : '' ,
23+ } ) ;
24+
25+ const detected = await detectFrameworks ( 'mockdata' ) ;
26+ expect ( detected ) . toContain ( 'deno' ) ;
27+ } ) ;
28+
1129test ( 'detects go mod' , async ( ) => {
1230 vol . fromJSON ( {
1331 'mockdata/go.mod' : '' ,
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ import * as path from "node:path";
33
44export async function detectFrameworks ( rootPath = './' ) : Promise < string [ ] > {
55 const detectors : Array < ( rootPath : string ) => Promise < string [ ] > > = [
6+ detectBun ,
7+ detectDeno ,
68 detectGo ,
79 detectHomebrew ,
810 detectJava ,
@@ -24,6 +26,26 @@ export async function detectFrameworks(rootPath = './'): Promise<string[]> {
2426 return detected ;
2527}
2628
29+ async function detectBun ( rootPath : string ) : Promise < string [ ] > {
30+ let detected : string [ ] = [ ] ;
31+
32+ if ( fs . existsSync ( path . join ( rootPath , 'bun.lock' ) ) ) {
33+ detected . push ( 'bun' ) ;
34+ }
35+
36+ return detected ;
37+ }
38+
39+ async function detectDeno ( rootPath : string ) : Promise < string [ ] > {
40+ let detected : string [ ] = [ ] ;
41+
42+ if ( fs . existsSync ( path . join ( rootPath , 'deno.lock' ) ) ) {
43+ detected . push ( 'deno' ) ;
44+ }
45+
46+ return detected ;
47+ }
48+
2749async function detectGo ( rootPath : string ) : Promise < string [ ] > {
2850 let detected : string [ ] = [ ] ;
2951
You can’t perform that action at this time.
0 commit comments