@@ -6,9 +6,10 @@ import { getWorkingEngines } from "@/engines";
6
6
7
7
type Project = {
8
8
name : string ;
9
- nodeping_id : string ;
9
+ nodeping_id ?: string ;
10
+ workflow : string ;
10
11
source_url : string ;
11
- url : string ;
12
+ url ? : string ;
12
13
test_url ?: string ;
13
14
} ;
14
15
@@ -18,33 +19,37 @@ const non_engine_projects: Project[] = [
18
19
nodeping_id : "e6od3bui-a5wl-49ff-8698-0cbtjc52rqw1" ,
19
20
source_url : "https://github.com/regexplanet/regexplanet-next" ,
20
21
url : "https://www.regexplanet.com/" ,
22
+ workflow : "gcr-deploy" ,
21
23
} ,
22
24
{
23
25
name : "Regex Zone" ,
24
26
nodeping_id : "e6od3bui-a5wl-49ff-8698-0cbtjc52rqw1" ,
25
27
source_url : "https://github.com/regexplanet/regex-zone" ,
26
28
url : "https://www.regex.zone/" ,
29
+ workflow : "gcr-deploy" ,
27
30
} ,
28
31
] ;
29
32
30
33
const make_row = ( project : Project ) => {
31
- const name = `[${ project . name } ](${ project . url } )` ;
32
- let deploy = `[](${ project . source_url } /actions/workflows/gcr-deploy.yaml)` ;
33
- if ( project . test_url && project . test_url . indexOf ( "appspot.com" ) != - 1 ) {
34
- deploy = `[](${ project . source_url } /actions/workflows/appengine-deploy.yaml)` ;
35
- }
34
+ const name = project . url ? `[${ project . name } ](${ project . url } )` : project . name ;
35
+ const deploy = project . workflow
36
+ ? `[](${ project . source_url } /actions/workflows/${ project . workflow } .yaml)`
37
+ : "n/a" ;
36
38
const repo = project . source_url . split ( "/" ) . slice ( - 1 ) [ 0 ] ;
37
39
const issues = `` ;
38
40
const prs = `` ;
39
- const status = `` ;
40
- const uptime = `` ;
41
+ const status = project . nodeping_id
42
+ ? ``
43
+ : "n/a" ;
44
+ const uptime = project . nodeping_id
45
+ ? ``
46
+ : "n/a" ;
41
47
const source = `[source](${ project . source_url } )` ;
42
48
43
49
return `| ${ name } | ${ deploy } | ${ issues } | ${ prs } | ${ status } | ${ uptime } | ${ source } |` ;
44
50
} ;
45
51
46
52
export async function GET ( ) {
47
-
48
53
const engines = getWorkingEngines ( )
49
54
. filter ( ( engine ) => engine . nodeping_id != "N/A" )
50
55
. map ( ( engine ) => {
@@ -54,6 +59,10 @@ export async function GET() {
54
59
source_url : engine . source_url || "" ,
55
60
test_url : engine . test_url ,
56
61
url : `https://www.regexplanet.com/advanced/${ engine . handle } /index.html` ,
62
+ workflow :
63
+ engine . test_url && engine . test_url . indexOf ( "appspot.com" ) != - 1
64
+ ? "appengine-deploy"
65
+ : "gcr-deploy" ,
57
66
} ) ;
58
67
} ) ;
59
68
@@ -63,7 +72,18 @@ export async function GET() {
63
72
|---------|-------|--------|-----|--------|--------|--------|
64
73
${ non_engine_projects . map ( make_row ) . join ( "\n" ) }
65
74
${ engines . join ( "\n" ) }
66
- | Common library | n/a | n/a | n/a | [source](https://github.com/regexplanet/regexplanet-common) |
75
+ ${ make_row ( {
76
+ name : "Common library" ,
77
+ source_url : "https://github.com/regexplanet/regexplanet-common" ,
78
+ url : "https://jsr.io/@regexplanet/common" ,
79
+ workflow : "publish" ,
80
+ } ) }
81
+ ${ make_row ( {
82
+ name : "Javascript Template" ,
83
+ source_url : "https://github.com/regexplanet/regexplanet-template" ,
84
+ url : "https://jsr.io/@regexplanet/template" ,
85
+ workflow : "publish" ,
86
+ } ) }
67
87
` ;
68
88
69
89
return new Response ( readme , {
0 commit comments