Skip to content

Commit

Permalink
Revive legacy JS API and restructure legacy spec directory (WebAssemb…
Browse files Browse the repository at this point in the history
…ly#303)

This adds `core` and `js-api` directory in `document/legacy/exceptions`,
moves all core spec files into `core/`, and restores the deleted legacy
JS API files in `js-api/`.

The core legacy spec only contains the EH instructions, which is easier
to view, but it is hard to precisely carve out the modified part from
the JS API file, so this adds the whole file for the legacy spec.
  • Loading branch information
aheejin committed May 24, 2024
1 parent e0de089 commit f3ebba3
Show file tree
Hide file tree
Showing 21 changed files with 1,540 additions and 26 deletions.
70 changes: 45 additions & 25 deletions .github/workflows/ci-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,6 @@ jobs:
name: core-rendered
path: document/core/_build/html

build-legacy-exceptions-spec:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Setup TexLive
run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
- name: Setup Sphinx
run: pip install six && pip install sphinx==5.1.0
- name: Build main spec
run: cd document/legacy/exceptions && make main
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: legacy-exceptions-rendered
path: document/legacy/exceptions/_build/html

build-js-api-spec:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -90,9 +71,43 @@ jobs:
name: web-api-rendered
path: document/web-api/index.html

build-legacy-exceptions-core-spec:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Setup TexLive
run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
- name: Setup Sphinx
run: pip install six && pip install sphinx==5.1.0
- name: Build main spec
run: cd document/legacy/exceptions/core && make main
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: legacy-exceptions-core-rendered
path: document/legacy/exceptions/core/_build/html

build-legacy-exceptions-js-api-spec:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Bikeshed
run: pip install bikeshed && bikeshed update
- name: Run Bikeshed
run: bikeshed spec "document/legacy/exceptions/js-api/index.bs" "document/legacy/exceptions/js-api/index.html"
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: legacy-exceptions-js-api-rendered
path: document/legacy/exceptions/js-api/index.html

publish-spec:
runs-on: ubuntu-latest
needs: [build-core-spec, build-legacy-exceptions-spec, build-js-api-spec, build-web-api-spec]
needs: [build-core-spec, build-js-api-spec, build-web-api-spec, build-legacy-exceptions-core-spec, build-legacy-exceptions-js-api-spec]
steps:
- name: Checkout repo
uses: actions/checkout@v2
Expand All @@ -103,11 +118,6 @@ jobs:
with:
name: core-rendered
path: _output/core
- name: Download legacy exceptions spec artifact
uses: actions/download-artifact@v2
with:
name: legacy-exceptions-rendered
path: _output/legacy/exceptions
- name: Download JS API spec artifact
uses: actions/download-artifact@v2
with:
Expand All @@ -118,6 +128,16 @@ jobs:
with:
name: web-api-rendered
path: _output/web-api
- name: Download legacy exceptions core spec artifact
uses: actions/download-artifact@v2
with:
name: legacy-exceptions-core-rendered
path: _output/legacy/exceptions/core
- name: Download legacy exceptions JS API spec artifact
uses: actions/download-artifact@v2
with:
name: legacy-exceptions-js-api-rendered
path: _output/legacy/exceptions/js-api
- name: Publish to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
Expand Down
2 changes: 1 addition & 1 deletion document/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DIRS = core js-api web-api legacy/exceptions
DIRS = core js-api web-api legacy/exception-handling
FILES = index.html
BUILDDIR = _build

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions document/legacy/exceptions/js-api/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
BUILDDIR = _build
STATICDIR = _static
DOWNLOADDIR = _download
NAME = WebAssembly

.PHONY: all
all:
mkdir -p $(BUILDDIR)/html
bikeshed spec index.bs $(BUILDDIR)/html/index.html
@echo "Build finished. The HTML pages are in `pwd`/$(BUILDDIR)/html."

.PHONY: publish
publish:
(cd ..; make publish-js-api)

.PHONY: clean
clean:
rm -rf $(BUILDDIR)
rm -rf $(STATICDIR)

.PHONY: diff
diff: all
@echo "Downloading the old single-file html spec..."
curl `grep "^TR" index.bs | cut -d' ' -f2` -o $(BUILDDIR)/html/old.html
@echo "Done."
@echo "Diffing new against old..."
perl ../util/htmldiff.pl $(BUILDDIR)/html/old.html $(BUILDDIR)/html/index.html $(BUILDDIR)/html/diff.html
@echo "Done. The diff is at $(BUILDDIR)/html/diff.html"

.PHONY: WD-tar
WD-tar:
bikeshed echidna --just-tar index.bs $(BUILDDIR)/html/index.html
mv test.tar $(BUILDDIR)/WD.tar
@echo "Built $(BUILDDIR)/WD.tar."

.PHONY: WD-echidna
WD-echidna:
@if [ -z $(W3C_USERNAME) ] || \
[ -z $(W3C_PASSWORD) ] || \
[ -z $(DECISION_URL) ] ; then \
echo "Must provide W3C_USERNAME, W3C_PASSWORD, and DECISION_URL environment variables"; \
exit 1; \
fi
bikeshed echidna index.bs --u $(W3C_USERNAME) --p $(W3C_PASSWORD) --d $(DECISION_URL)
Loading

0 comments on commit f3ebba3

Please sign in to comment.