Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
19 changes: 15 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,25 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v2
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2

- name: Build spec
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e #v6.4.0
with:
node-version: 24

- name: Install Deps
run: npm install

- name: Build
run: npm run build

- name: Create `out` dir
run: |
mkdir -p out
curl --retry 2 --fail https://api.csswg.org/bikeshed/ --output out/index.html --header "Accept: text/plain, text/html" -F die-on=fatal -F file=@"index.bs"
mv out.html out/index.html

- name: Upload to Deno Deploy
- name: Upload `out` to Deno Deploy
uses: denoland/deployctl@v1
with:
project: "wintercg-runtime-keys"
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
index.html
.vercel
node_modules/
out.html
spec-injected.html
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Runtime Keys

This repo contains the WinterTC Runtime Keys ECMA Technical Report source and build tooling.

To get started, run `npm install` to install project dependencies
Comment thread
Ethan-Arrowood marked this conversation as resolved.

To build the report run `npm run build`

To view the report open `out.html`

To run the build process in watch mode use `npm run watch`. This script concurrently executes the `build.mjs` script for producing the injected spec document and the `ecmarkup` process for generating the `out.html` file.
41 changes: 41 additions & 0 deletions build.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { readFileSync, writeFileSync } from "node:fs";
import { resolve } from "node:path";

const specPath = resolve(import.meta.dirname, "spec.html");
const dataPath = resolve(import.meta.dirname, "runtime-keys.json");
const outPath = resolve(import.meta.dirname, "spec-injected.html");

const spec = readFileSync(specPath, "utf8");
const { runtimes } = JSON.parse(readFileSync(dataPath, "utf8"));

function escapeHtml(str) {
return str
.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;");
}

function links(runtimeKey) {
let str = '';
if (runtimeKey.website) {
str += `<br><a href="${escapeHtml(runtimeKey.website)}">Website</a>`
}
if (runtimeKey.repository) {
str += `<br><a href="${escapeHtml(runtimeKey.repository)}">Repository</a>`
}
return str;
}

const rows = runtimes
// intentional whitespace so output is human readable
.map((r) => ` <tr>
<td><code>${escapeHtml(r.key)}</code></td>
<td>${escapeHtml(r.organization)} / ${escapeHtml(r.name)}</td>
<td>${escapeHtml(r.description)}${links(r)}</td>
</tr>`
)
.join("\n");
const injected = spec.replace(" <!-- RUNTIME_KEYS_ROWS -->", rows);

writeFileSync(outPath, injected, "utf8");
282 changes: 0 additions & 282 deletions index.bs

This file was deleted.

Loading
Loading