Skip to content

Commit 03207a1

Browse files
authored
Initial commit
0 parents  commit 03207a1

File tree

8 files changed

+218
-0
lines changed

8 files changed

+218
-0
lines changed

.github/workflows/build.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Build spec
2+
3+
on: [pull_request, push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: ljharb/actions/node/install@main
12+
name: 'nvm install lts/* && npm install'
13+
with:
14+
node-version: lts/*
15+
- run: npm run build

.github/workflows/deploy.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Deploy gh-pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: ljharb/actions/node/install@main
15+
name: 'nvm install lts/* && npm install'
16+
with:
17+
node-version: lts/*
18+
- run: npm run build
19+
- uses: JamesIves/[email protected]
20+
with:
21+
branch: gh-pages
22+
folder: build
23+
clean: true

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# Runtime data
7+
pids
8+
*.pid
9+
*.seed
10+
11+
# Directory for instrumented libs generated by jscoverage/JSCover
12+
lib-cov
13+
14+
# Coverage directory used by tools like istanbul
15+
coverage
16+
17+
# nyc test coverage
18+
.nyc_output
19+
20+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
21+
.grunt
22+
23+
# node-waf configuration
24+
.lock-wscript
25+
26+
# Compiled binary addons (http://nodejs.org/api/addons.html)
27+
build/Release
28+
29+
# Dependency directories
30+
node_modules
31+
jspm_packages
32+
33+
# Optional npm cache directory
34+
.npm
35+
36+
# Optional REPL history
37+
.node_repl_history
38+
39+
# Only apps should have lockfiles
40+
yarn.lock
41+
package-lock.json
42+
npm-shrinkwrap.json
43+
pnpm-lock.yaml
44+
45+
# Build directory
46+
build

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 ECMA TC39 and contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# template-for-proposals
2+
3+
A repository template for ECMAScript proposals.
4+
5+
## Before creating a proposal
6+
7+
Please ensure the following:
8+
1. You have read the [process document](https://tc39.github.io/process-document/)
9+
1. You have reviewed the [existing proposals](https://github.com/tc39/proposals/)
10+
1. You are aware that your proposal requires being a member of TC39, or locating a TC39 delegate to “champion” your proposal
11+
12+
## Create your proposal repo
13+
14+
Follow these steps:
15+
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)
16+
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`.
17+
1. Go to your repo settings page:
18+
1. Under “General”, under “Features”, ensure “Issues” is checked, and disable “Wiki”, and “Projects” (unless you intend to use Projects)
19+
1. Under “Pull Requests”, check “Always suggest updating pull request branches” and “automatically delete head branches”
20+
1. Under the “Pages” section on the left sidebar, and set the source to “deploy from a branch”, select “gh-pages” in the branch dropdown, and then ensure that “Enforce HTTPS” is checked.
21+
1. Under the “Actions” section on the left sidebar, under “General”, select “Read and write permissions” under “Workflow permissions” and click “Save”
22+
1. [“How to write a good explainer”][explainer] explains how to make a good first impression.
23+
24+
> Each TC39 proposal should have a `README.md` file which explains the purpose
25+
> of the proposal and its shape at a high level.
26+
>
27+
> ...
28+
>
29+
> The rest of this page can be used as a template ...
30+
31+
Your explainer can point readers to the `index.html` generated from `spec.emu`
32+
via markdown like
33+
34+
```markdown
35+
You can browse the [ecmarkup output](https://ACCOUNT.github.io/PROJECT/)
36+
or browse the [source](https://github.com/ACCOUNT/PROJECT/blob/HEAD/spec.emu).
37+
```
38+
39+
where *ACCOUNT* and *PROJECT* are the first two path elements in your project's Github URL.
40+
For example, for github.com/**tc39**/**template-for-proposals**, *ACCOUNT* is “tc39”
41+
and *PROJECT* is “template-for-proposals”.
42+
43+
44+
## Maintain your proposal repo
45+
46+
1. Make your changes to `spec.emu` (ecmarkup uses HTML syntax, but is not HTML, so I strongly suggest not naming it “.html”)
47+
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.
48+
1. Whenever you update `ecmarkup`, run `npm run build` to verify that the build will succeed and the output looks as expected.
49+
50+
[explainer]: https://github.com/tc39/how-we-work/blob/HEAD/explainer.md

package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"private": true,
3+
"name": "template-for-proposals",
4+
"description": "A repository template for ECMAScript proposals.",
5+
"scripts": {
6+
"start": "npm run build-loose -- --watch",
7+
"build": "npm run build-loose -- --strict",
8+
"build-loose": "node -e 'fs.mkdirSync(\"build\", { recursive: true })' && ecmarkup --load-biblio @tc39/ecma262-biblio --verbose spec.emu build/index.html --lint-spec"
9+
},
10+
"homepage": "https://github.com/tc39/template-for-proposals#readme",
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/tc39/template-for-proposals.git"
14+
},
15+
"license": "MIT",
16+
"devDependencies": {
17+
"@tc39/ecma262-biblio": "^2.1.2775",
18+
"ecmarkup": "^20.0.0"
19+
},
20+
"engines": {
21+
"node": ">= 12"
22+
}
23+
}

spec.emu

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!doctype html>
2+
<meta charset="utf8">
3+
<link rel="stylesheet" href="./spec.css">
4+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/styles/github.min.css">
5+
<script src="./spec.js"></script>
6+
<pre class="metadata">
7+
title: Proposal Title Goes Here
8+
stage: -1
9+
contributors: Your Name(s) Here
10+
</pre>
11+
12+
<emu-clause id="sec-demo-clause">
13+
<h1>This is an emu-clause</h1>
14+
<p>This is an algorithm:</p>
15+
<emu-alg>
16+
1. Let _proposal_ be *undefined*.
17+
1. If IsAccepted(_proposal_) is *true*, then
18+
1. Let _stage_ be *0*<sub>ℤ</sub>.
19+
1. Else,
20+
1. Let _stage_ be *-1*<sub>ℤ</sub>.
21+
1. Return ? ToString(_stage_).
22+
</emu-alg>
23+
</emu-clause>
24+
25+
<emu-clause id="sec-is-accepted" type="abstract operation">
26+
<h1>
27+
IsAccepted (
28+
_proposal_: an ECMAScript language value
29+
): a Boolean
30+
</h1>
31+
<dl class="header">
32+
<dt>description</dt>
33+
<dd>Tells you if the proposal was accepted</dd>
34+
</dl>
35+
<emu-alg>
36+
1. If _proposal_ is not a String, or is not accepted, return *false*.
37+
1. Return *true*.
38+
</emu-alg>
39+
</emu-clause>

0 commit comments

Comments
 (0)