Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall committed Sep 28, 2023
0 parents commit 1999218
Show file tree
Hide file tree
Showing 8 changed files with 218 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
branch: gh-pages
folder: build
clean: true
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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.
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
39 changes: 39 additions & 0 deletions spec.emu
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!doctype html>
<meta charset="utf8">
<link rel="stylesheet" href="./spec.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
<script src="./spec.js"></script>
<pre class="metadata">
title: Proposal Title Goes Here
stage: -1
contributors: Your Name(s) Here
</pre>

<emu-clause id="sec-demo-clause">
<h1>This is an emu-clause</h1>
<p>This is an algorithm:</p>
<emu-alg>
1. Let _proposal_ be *undefined*.
1. If IsAccepted(_proposal_) is *true*, then
1. Let _stage_ be *0*<sub>ℤ</sub>.
1. Else,
1. Let _stage_ be *-1*<sub>ℤ</sub>.
1. Return ? ToString(_stage_).
</emu-alg>
</emu-clause>

<emu-clause id="sec-is-accepted" type="abstract operation">
<h1>
IsAccepted (
_proposal_: an ECMAScript language value
): a Boolean
</h1>
<dl class="header">
<dt>description</dt>
<dd>Tells you if the proposal was accepted</dd>
</dl>
<emu-alg>
1. If _proposal_ is not a String, or is not accepted, return *false*.
1. Return *true*.
</emu-alg>
</emu-clause>

0 comments on commit 1999218

Please sign in to comment.