Skip to content

Commit

Permalink
Update spec metadata and deploy to match the "minimum common" name
Browse files Browse the repository at this point in the history
This PR updates the URL and repo of the Minimum Common API in the
spec's metadata to reflect the new locations (with the "minimum
common" order, rather than "common minimum"). It also updates the
deploy so that the old URL redirects to the new one.
  • Loading branch information
andreubotella committed Sep 12, 2024
1 parent f91410e commit 12eab86
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ jobs:
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"
- name: Copy file_server.ts
run: cp .github/workflows/file_server.ts out/.file_server.ts

- name: Upload to Deno Deploy
uses: denoland/deployctl@v1
with:
project: "proposal-common-min-api"
entrypoint: "https://deno.land/[email protected]/http/file_server.ts"
entrypoint: ".file_server.ts"
root: out/
19 changes: 19 additions & 0 deletions .github/workflows/file_server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env -S deno run --allow-net --allow-read

import { serveDir } from "https://deno.land/[email protected]/http/file_server.ts";

Deno.serve((req) => {
// If we're *.wintercg.org, 301-redirect to the new URL.
const url = new URL(req.url);
console.log(url);
if (url.hostname.endsWith(".wintercg.org")) {
url.hostname = "min-common-api.proposal.wintercg.org";
return Response.redirect(url, 301);
}

// Otherwise, serve the current dir
return serveDir(req, {
enableCors: true,
showDotfiles: false,
});
});
4 changes: 2 additions & 2 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Shortname: common-web-platform-api
Group: wintercg
Status: w3c/CG-DRAFT
Level: none
URL: https://common-min-api.proposal.wintercg.org/
Repository: https://github.com/wintercg/proposal-common-minimum-api
URL: https://min-common-api.proposal.wintercg.org/
Repository: https://github.com/wintercg/proposal-minimum-common-api
Editor: James M Snell, Cloudflare https://cloudflare.com/, [email protected]
Abstract: Minimum Common Web Platform API for Non-Browser ECMAScript-based runtimes.
Markup Shorthands: markdown yes
Expand Down

0 comments on commit 12eab86

Please sign in to comment.