Skip to content

Commit e983517

Browse files
committed
Engine structure tweaks
1 parent 1690777 commit e983517

26 files changed

+92
-43
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { Level } from '@/components/Level';
2+
import { getEngines } from '@/engines';
3+
4+
5+
6+
export default function List() {
7+
8+
const rows = getEngines().map((engine) => {
9+
return (<tr key={`engine_${engine.handle}`}><td>{engine.short_name}</td><td><Level level={engine.level}/></td></tr>);
10+
});
11+
12+
const total = getEngines().length;
13+
const working = getEngines().filter(engine => engine.test_url).length;
14+
15+
return (
16+
<>
17+
<h1>Engines</h1>
18+
<table className="table table-striped">
19+
<thead>
20+
<tr>
21+
<th>Name</th>
22+
<th>Level</th>
23+
</tr>
24+
</thead>
25+
<tbody>
26+
{rows}
27+
</tbody>
28+
</table>
29+
<p>
30+
<Level level="alpha"/>: {getEngines().filter(engine => engine.level === 'alpha').length}<br/>
31+
<Level level="beta"/>: {getEngines().filter(engine => engine.level === 'beta').length}<br/>
32+
<Level level="golden"/>: {getEngines().filter(engine => engine.level === 'golden').length}<br/>
33+
Total working: {working}<br />
34+
<Level level="notimplemented"/>: {getEngines().filter(engine => engine.level === 'notimplemented').length}<br/>
35+
Grand total: {total}
36+
</p>
37+
</>
38+
);
39+
}

src/app/robots.txt/route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ Disallow: /
1414
Sitemap: https://www.regexplanet.com/sitemap.xml
1515
1616
User-agent: *
17+
Disallow: /int
1718
Disallow: /honeypot.txt
18-
`
19+
`;
1920
}
2021

2122
return new Response(robotsTxt, {

src/components/Level.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
type LevelProps = {
2+
level: string;
3+
}
4+
5+
export function Level({ level }: LevelProps) {
6+
if (level === 'alpha') {
7+
return (<span className="badge bg-danger">{level}</span>);
8+
}
9+
if (level === 'beta') {
10+
return (<span className="badge bg-warning">{level}</span>);
11+
}
12+
if (level === 'golden') {
13+
return (<span className="badge bg-success">{level}</span>);
14+
}
15+
if (level === 'notimplemented') {
16+
return (<i>(not implemented yet)</i>);
17+
}
18+
return (<>{level}</>)
19+
}

src/components/TestResults.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function TestResults({ onClear, testOutput }: props) {
1111
return (
1212
<>
1313
<h2 className="pt-3">Results <button className="btn btn-outline-primary btn-sm" onClick={onClear}>Clear</button></h2>
14-
{ testOutput.message ? <div className={messageClass}>{testOutput.message}</div> : <></>}
14+
{ testOutput.message && testOutput.message != "OK" ? <div className={messageClass}>{testOutput.message}</div> : <></>}
1515
{ testOutput.html ? <div dangerouslySetInnerHTML={{ __html: testOutput.html }} /> : <></> }
1616
<hr/>
1717
</>

src/engines/RegexEngine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export type RegexEngine = {
2727
links: Record<string, string>; // A map of (name: url) for other help links. These will be displayed on the support page under “Official Documentation”
2828
logo_icon: string; // SVG icon (just the logo, no text) in a square
2929
logo_ar21: string; // SVG logo (including language name) in a 2:1 aspect ratio
30-
nodeping_url?: string; // URL of the nodeping status page
30+
nodeping_id: string; // ID of the nodeping status check
3131
notfound?: string[]; // A list of handles that this is a substitute for (i.e. nodejs is a substitute for javascript)
3232
options: RegexOption[]; // A list of which options it supports.
3333
option_notes?: string; // Notes to display on the options page (html allowed)

src/engines/browser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ export const browser: RegexEngine = {
77
help_url:
88
"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",
99
handle: "browser",
10-
level: "alpha",
10+
level: "golden",
1111
links: {},
1212
logo_icon: "/images/browsers/browser-icon.svg",
1313
logo_ar21: "/images/browsers/browser-ar21.svg",
14-
nodeping_url: undefined,
14+
nodeping_id: "N/A",
1515
notfound: ["javascript", "typescript"],
1616
options: [
1717
{

src/engines/bun.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const bun: RegexEngine = {
77
help_url:
88
"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",
99
handle: "bun",
10-
level: "beta",
10+
level: "golden",
1111
links: {
1212
"MDN RegExp Object":
1313
"https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp",
@@ -16,8 +16,7 @@ export const bun: RegexEngine = {
1616
},
1717
logo_icon: "https://www.vectorlogo.zone/logos/bunsh/bunsh-icon.svg",
1818
logo_ar21: "https://www.vectorlogo.zone/logos/bunsh/bunsh-ar21.svg",
19-
nodeping_url:
20-
"https://nodeping.com/reports/checks/iajucfo0-kq0e-47ql-82sk-xoji0l2ejmfw",
19+
nodeping_id: "iajucfo0-kq0e-47ql-82sk-xoji0l2ejmfw",
2120
notfound: ["javascript", "typescript"],
2221
options: [
2322
{

src/engines/deno.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const deno: RegexEngine = {
77
help_url:
88
"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",
99
handle: "deno",
10-
level: "beta",
10+
level: "golden",
1111
links: {
1212
"MDN RegExp Object":
1313
"https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/RegExp",
@@ -16,8 +16,7 @@ export const deno: RegexEngine = {
1616
},
1717
logo_icon: "https://www.vectorlogo.zone/logos/deno/deno-icon.svg",
1818
logo_ar21: "https://www.vectorlogo.zone/logos/deno/deno-ar21.svg",
19-
nodeping_url:
20-
"https://nodeping.com/reports/checks/iajucfo0-kq0e-47ql-82sk-xoji0l2ejmfw",
19+
nodeping_id: "9z4pmj0b-ve3m-42s9-8s07-6c53rlel69iy",
2120
notfound: ["javascript", "typescript"],
2221
options: [
2322
{

src/engines/dotnet.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ export const dotnet: RegexEngine = {
2020
},
2121
logo_icon: "https://www.vectorlogo.zone/logos/dotnet/dotnet-icon.svg",
2222
logo_ar21: "https://www.vectorlogo.zone/logos/dotnet/dotnet-ar21.svg",
23+
nodeping_id: "9z4pmj0b-ve3m-42s9-8s07-6c53rlel69iy",
2324
options: [],
2425
short_name: ".NET",
26+
source_url: "https://github.com/regexplanet/regexplanet-dotnet",
2527
status_url: "https://dotnet.gcr.regexplanet.com/status.json",
2628
test_url: "https://dotnet.gcr.regexplanet.com/test.json",
2729
};

src/engines/empty.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const LATER: RegexEngine = {
1010
links: {},
1111
logo_icon: "https://www.vectorlogo.zone/logos/LATER/LATER-icon.svg",
1212
logo_ar21: "https://www.vectorlogo.zone/logos/LATER/LATER-ar21.svg",
13-
nodeping_url: "https://nodeping.com/reports/checks/LATER",
13+
nodeping_id: "LATER",
1414
options: [],
1515
short_name: "LATER",
1616
source_url: "https://github.com/regexplanet/regexplanet-LATER",

0 commit comments

Comments
 (0)