diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..854640b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,15 @@ +name: Build spec + +on: [pull_request, push] + +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 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..43206c8 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,23 @@ +name: Deploy gh-pages + +on: + push: + branches: + - main + +jobs: + deploy: + 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: JamesIves/github-pages-deploy-action@v4.3.3 + with: + branch: gh-pages + folder: build + clean: true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d3cae16 --- /dev/null +++ b/.gitignore @@ -0,0 +1,46 @@ +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules +jspm_packages + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history + +# Only apps should have lockfiles +yarn.lock +package-lock.json +npm-shrinkwrap.json +pnpm-lock.yaml + +# Build directory +build diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..43c97e7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6e78ec9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 ECMA TC39 and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..bfc7817 --- /dev/null +++ b/README.md @@ -0,0 +1,50 @@ +# template-for-proposals + +A repository template for ECMAScript proposals. + +## Before creating a proposal + +Please ensure the following: + 1. You have read the [process document](https://tc39.github.io/process-document/) + 1. You have reviewed the [existing proposals](https://github.com/tc39/proposals/) + 1. You are aware that your proposal requires being a member of TC39, or locating a TC39 delegate to “champion” your proposal + +## Create your proposal repo + +Follow these steps: + 1. Click the green [“use this template”](https://github.com/tc39/template-for-proposals/generate) button in the repo header. (Note: Do not fork this repo in GitHub's web interface, as that will later prevent transfer into the TC39 organization) + 1. Update ecmarkup and the biblio to the latest version: `npm install --save-dev ecmarkup@latest && npm install --save-dev --save-exact @tc39/ecma262-biblio@latest`. + 1. Go to your repo settings page: + 1. Under “General”, under “Features”, ensure “Issues” is checked, and disable “Wiki”, and “Projects” (unless you intend to use Projects) + 1. Under “Pull Requests”, check “Always suggest updating pull request branches” and “automatically delete head branches” + 1. Under the “Pages” section on the left sidebar, and set the source to “deploy from a branch” and check “Enforce HTTPS” + 1. Under the “Actions” section on the left sidebar, under “General”, select “Read and write permissions” under “Workflow permissions” and click “Save” + 1. [“How to write a good explainer”][explainer] explains how to make a good first impression. + + > Each TC39 proposal should have a `README.md` file which explains the purpose + > of the proposal and its shape at a high level. + > + > ... + > + > The rest of this page can be used as a template ... + + Your explainer can point readers to the `index.html` generated from `spec.emu` + via markdown like + + ```markdown + You can browse the [ecmarkup output](https://ACCOUNT.github.io/PROJECT/) + or browse the [source](https://github.com/ACCOUNT/PROJECT/blob/HEAD/spec.emu). + ``` + + where *ACCOUNT* and *PROJECT* are the first two path elements in your project's Github URL. + For example, for github.com/**tc39**/**template-for-proposals**, *ACCOUNT* is “tc39” + and *PROJECT* is “template-for-proposals”. + + +## Maintain your proposal repo + + 1. Make your changes to `spec.emu` (ecmarkup uses HTML syntax, but is not HTML, so I strongly suggest not naming it “.html”) + 1. Any commit that makes meaningful changes to the spec, should run `npm run build` to verify that the build will succeed and the output looks as expected. + 1. Whenever you update `ecmarkup`, run `npm run build` to verify that the build will succeed and the output looks as expected. + + [explainer]: https://github.com/tc39/how-we-work/blob/HEAD/explainer.md diff --git a/package.json b/package.json new file mode 100644 index 0000000..842c0cc --- /dev/null +++ b/package.json @@ -0,0 +1,23 @@ +{ + "private": true, + "name": "template-for-proposals", + "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" + }, + "homepage": "https://github.com/tc39/template-for-proposals#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/tc39/template-for-proposals.git" + }, + "license": "MIT", + "devDependencies": { + "@tc39/ecma262-biblio": "^2.1.2571", + "ecmarkup": "^17.0.0" + }, + "engines": { + "node": ">= 12" + } +} diff --git a/spec.emu b/spec.emu new file mode 100644 index 0000000..5d05685 --- /dev/null +++ b/spec.emu @@ -0,0 +1,39 @@ + + + + + +
+title: Proposal Title Goes Here
+stage: -1
+contributors: Your Name(s) Here
+
+ + +

This is an emu-clause

+

This is an algorithm:

+ + 1. Let _proposal_ be *undefined*. + 1. If IsAccepted(_proposal_) is *true*, then + 1. Let _stage_ be *0*. + 1. Else, + 1. Let _stage_ be *-1*. + 1. Return ? ToString(_stage_). + +
+ + +

+ IsAccepted ( + _proposal_: an ECMAScript language value + ): a Boolean +

+
+
description
+
Tells you if the proposal was accepted
+
+ + 1. If _proposal_ is not a String, or is not accepted, return *false*. + 1. Return *true*. + +