Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infrastructure fixes #220

Merged
merged 23 commits into from
Feb 6, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove playground changes for another branch
kaleidawave committed Jan 12, 2025
commit 5789c9235af294e581de73b49097a97fa8314ae0
22 changes: 2 additions & 20 deletions src/playground/assets/index.css
Original file line number Diff line number Diff line change
@@ -30,30 +30,18 @@ main {
font-size: 16px;
}

.diagnostics>li {
cursor: pointer;
}

#build-config>input:not(:last-child) {
border-right: 2px solid white;
}

a {
color: coral;
color: rgb(255, 217, 80);
}

a:visited {
color: rgb(222 174 154);
color: coral;
}

hr {
margin: 40px 0;
}

pre#build-output {
tab-size: 4;
}

button {
margin: 20px 0;
padding: 6px 20px;
@@ -68,12 +56,6 @@ button:hover {
cursor: pointer;
}

body.component>header,
body.component .extras,
body.component>footer {
display: none;
}

@media (max-width: 700px) {
header {
flex-direction: column;
17 changes: 3 additions & 14 deletions src/playground/comparison/comparison_generator.mjs
Original file line number Diff line number Diff line change
@@ -9,17 +9,6 @@ const { compressToEncodedURIComponent } = lz;

const dirname = import.meta.dirname;

function escapeHTML(code) {
const lookup = {
'&': "&",
'"': """,
'\'': "'",
'<': "&lt;",
'>': "&gt;"
};
return s.replace(/[&"'<>]/g, c => lookup[c]);
}

function getSpecificationSections() {
const content = readFileSync(join(dirname, "../../../checker/specification/specification.md")).toString();
const output = lexer(content);
@@ -96,7 +85,7 @@ async function renderDifferences(sections) {
const tscPlaygroundLink = `https://www.typescriptlang.org/play?#code/${codeCompressed}`;

acc += `<li>
<h3 id="${href}">${escapeHTML(title)}</h3>
<h3 id="${href}">${title}</h3>
<div>
${highlightedCode}
<div>
@@ -105,14 +94,14 @@ async function renderDifferences(sections) {
<img src="./assets/ezno.svg" alt="ezno" height="14px">
<a href="${eznoPlaygroundLink}">(Playground)</a>
</div>
<ul>${row.ezno.map(msg => `<li>${escapeHTML(msg)}</li>`).join("")}</ul>
<ul>${row.ezno.map(msg => `<li>${msg}</li>`).join("")}</ul>
</div>
<div class="tsc-diagnostics">
<div class="checker-name">
<img src="./assets/typescript.svg" alt="typescript" height="20px">
<a href="${tscPlaygroundLink}">(Playground)</a>
</div>
<ul>${row.tsc.map(msg => `<li>${escapeHTML(msg)}</li>`).join("")}</ul>
<ul>${row.tsc.map(msg => `<li>${msg}</li>`).join("")}</ul>
</div>
</div>
</div>
37 changes: 11 additions & 26 deletions src/playground/index.html
Original file line number Diff line number Diff line change
@@ -7,16 +7,16 @@
<title>Ezno Playground</title>
<!-- Vite doesn't rewrite them :( https://github.com/vitejs/vite/issues/7362 -->
<!-- Also maybe they should be in the parent directory? -->
<meta property="twitter:image" content="assets/banner.png">
<meta property="og:image" content="assets/banner.png">
<meta property="twitter:image" content="/ezno/playground/assets/banner.png">
<meta property="og:image" content="/ezno/playground/assets/banner.png">

<link rel="stylesheet" href="/assets/index.css">
<link rel="icon" href="/assets/ezno.svg">
<link rel="stylesheet" href="assets/index.css">
<link rel="icon" href="assets/ezno.svg">
</head>

<body>
<header>
<img src="/assets/ezno.svg" alt="EZNO" height="40px">
<img src="assets/ezno.svg" alt="EZNO" height="40px">
<p>
Playground for the Ezno type checker.
<a href="https://kaleidawave.github.io/posts/the-quest-continues/#there-is-a-new-web-based-playground">See
@@ -36,27 +36,12 @@ <h3>Diagnostics</h3>
<ol class="diagnostics">
</ol>
</div>
<div class="extras">
<button id="share">Share</button>
<button id="build">Build</button>
<details>
<summary>More:</summary>
<div id="version"></div>
<div id="time"></div>
</details>
<details>
<summary>Build config:</summary>
<form id="build-config">
<label for="">Strip whitespace</label>
<input type="checkbox" name="strip_whitespace" id="strip_whitespace">
<label for="">Tree shake</label>
<input type="checkbox" name="tree_shake" id="tree_shake">
<!-- <label for="">Run linter</label>
<input type="checkbox" name="run-linter" id="run-linter"> -->
</form>
</details>
<pre id="build-output"></pre>
</div>
<button id="share">Share</button>
<details>
<summary>More:</summary>
<div id="version"></div>
<div id="time"></div>
</details>
</main>
<footer>
<hr>
Loading