Skip to content

Commit

Permalink
Merge pull request #3 from tc39/void-binding-spec
Browse files Browse the repository at this point in the history
Spec text for discards as `void` bindings
  • Loading branch information
rbuckton authored Mar 28, 2024
2 parents 741d8ac + 2ee9fdd commit c5d6791
Show file tree
Hide file tree
Showing 10 changed files with 1,001 additions and 72 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
index.html -diff merge=ours
spec.js -diff merge=ours
spec.css -diff merge=ours
28 changes: 17 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
name: Build spec

on: [pull_request, push]

name: Publish Spec to gh-pages
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: ljharb/actions/node/install@main
name: 'nvm install lts/* && npm install'
with:
node-version: lts/*
- run: npm run build
- uses: actions/checkout@v3
- uses: ljharb/actions/node/install@main
name: 'nvm install lts/* && npm install'
with:
node-version: lts/*
- run: npm run build
- name: Deploy
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: build
clean-exclude: |
pr
23 changes: 0 additions & 23 deletions .github/workflows/deploy.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish PR to gh-pages/pr/
on:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event.number }}
steps:
- uses: actions/checkout@v3
- uses: ljharb/actions/node/install@main
name: 'nvm install lts/* && npm install'
with:
node-version: lts/*
- run: npm run build
- name: Deploy
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: build
target-folder: pr/${{ github.event.number }}/
- id: get-preview-url
name: Get preview url
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
url=(gh api "repos/$GITHUB_REPOSITORY/pages" --jq '.html_url')
echo "preview-url=https://tc39.es/$(basename $GITHUB_REPOSITORY)pr/${{ github.event.number }}" >> "$GITHUB_OUTPUT"
shell: bash
- name: Post Preview Comment
uses: phulsechinmay/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMENT_IDENTIFIER: tc39_pr_preview_comment
message: |
A preview of this PR can be found at ${{ steps.get-preview-url.outputs.preview-url }}.
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"rbuckton.grammarkdown-vscode",
"rbuckton.ecmarkup-vscode"
]
}
17 changes: 17 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"[markdown]": {
"files.trimTrailingWhitespace": false
},
"[html]": {
"editor.insertSpaces": true,
"editor.tabSize": 2,
},
"[ecmarkup]": {
"editor.insertSpaces": true,
"editor.tabSize": 2,
},
"files.associations": {
// "*.html": "ecmarkup",
"*.emu": "ecmarkup"
}
}
15 changes: 15 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "gulp",
"task": "default",
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
37 changes: 37 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const del = require("del");
const path = require("path");
const gulp = require("gulp");
const emu = require("gulp-emu");
const rename = require("gulp-rename");
const gls = require("gulp-live-server");

gulp.task("clean", () => del("build/**/*"));

gulp.task("build", () => gulp
.src(["spec.emu"])
.pipe(emu({
log: require("ecmarkup/lib/utils").logVerbose,
warn: err => {
const file = path.resolve(err.file || "spec.emu");
const message = `Warning: ${file}:${typeof err.line === "number" ? `${err.line}:${err.column}:` : ""} ${err.message}`;
require("ecmarkup/lib/utils").logWarning(message);
},
ecma262Biblio: false,
}))
.pipe(rename("index.html"))
.pipe(gulp.dest("build")));

gulp.task("watch", () => gulp
.watch(["spec.emu"], gulp.task("build")));

gulp.task("start", gulp.parallel("watch", () => {
const server = gls.static("build", 8080);
const promise = server.start();
(/** @type {import("chokidar").FSWatcher}*/(gulp.watch(["build/**/*"])))
.on("change", file => {
server.notify({ path: path.resolve(file) });
});
return promise;
}));

gulp.task("default", gulp.task("build"));
20 changes: 12 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
{
"private": true,
"name": "template-for-proposals",
"name": "proposal-discard-binding",
"description": "A repository template for ECMAScript proposals.",
"scripts": {
"start": "npm run build-loose -- --watch",
"build": "npm run build-loose -- --strict",
"build-loose": "node -e 'fs.mkdirSync(\"build\", { recursive: true })' && ecmarkup --load-biblio @tc39/ecma262-biblio --verbose spec.emu build/index.html --lint-spec"
"build": "gulp build",
"start": "gulp start"
},
"homepage": "https://github.com/tc39/template-for-proposals#readme",
"homepage": "https://github.com/tc39/proposal-discard-binding#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/tc39/template-for-proposals.git"
"url": "git+https://github.com/tc39/proposal-discard-binding.git"
},
"license": "MIT",
"license": "SEE LICENSE IN https://tc39.es/ecma262/#sec-copyright-and-software-license",
"devDependencies": {
"@tc39/ecma262-biblio": "^2.1.2571",
"ecmarkup": "^17.0.0"
"del": "^6.0.0",
"ecmarkup": "^18.0.0",
"gulp": "^4.0.2",
"gulp-emu": "^2.2.0",
"gulp-live-server": "0.0.31",
"gulp-rename": "^2.0.0"
},
"engines": {
"node": ">= 12"
Expand Down
Loading

0 comments on commit c5d6791

Please sign in to comment.