Skip to content

Commit c893ba7

Browse files
2.7.1 (#5505)
Co-authored-by: Copilot <[email protected]>
1 parent 4aaa755 commit c893ba7

27 files changed

Lines changed: 129 additions & 47 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish to npm
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
if: github.event_name == 'release' || github.ref == 'refs/heads/main'
12+
permissions:
13+
contents: read
14+
id-token: write # Required for npm trusted publishing and provenance
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 24.x
21+
registry-url: https://registry.npmjs.org
22+
23+
# Trusted publishing requires npm 11.5.1 or later
24+
- run: npm install -g npm@latest
25+
- run: npm ci
26+
27+
- run: node ./bin/cake build:full
28+
- run: node ./bin/cake build:browser
29+
- run: node ./bin/cake test
30+
31+
- name: Verify package.json version matches the release tag
32+
if: github.event_name == 'release'
33+
run: test "v$(node -p "require('./package.json').version")" = "${{ github.event.release.tag_name }}"
34+
35+
- run: npm publish

‎Cakefile‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ testBuiltCode = (watch = no) ->
9292
for mod of require.cache when csDir is mod[0 ... csDir.length]
9393
delete require.cache[mod]
9494

95+
# The previous copy of `register` already patched this; clear it so the
96+
# reloaded copy installs its own, otherwise stack trace line numbers are wrong.
97+
Error.prepareStackTrace = undefined
98+
9599
testResults = runTests require csPath
96100
unless watch
97101
process.exit 1 unless testResults

‎docs/v2/annotated-source/register.html‎

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -141,20 +141,39 @@ <h1>register.coffee</h1>
141141
<div class="content"><div class='highlight'><pre>nodeSourceMapsSupportEnabled = process? <span class="hljs-keyword">and</span> (
142142
process.execArgv.includes(<span class="hljs-string">&#x27;--enable-source-maps&#x27;</span>) <span class="hljs-keyword">or</span>
143143
process.env.NODE_OPTIONS?.includes(<span class="hljs-string">&#x27;--enable-source-maps&#x27;</span>)
144-
)
144+
)</pre></div></div>
145+
146+
</li>
147+
148+
149+
<li id="section-3">
150+
<div class="annotation">
151+
152+
<div class="sswrap ">
153+
<a class="ss" href="#section-3">&#x00a7;</a>
154+
</div>
155+
<p>Node 22+ sets its own internal <code>Error.prepareStackTrace</code> (named
156+
<code>ErrorPrepareStackTrace</code>) before any user code runs. Treat that built-in
157+
handler the same as “not set” so CoffeeScript can still install its own
158+
source-map translator.</p>
159+
160+
</div>
161+
162+
<div class="content"><div class='highlight'><pre>isNodeInternalHandler = <span class="hljs-built_in">Error</span>.prepareStackTrace <span class="hljs-keyword">and</span>
163+
<span class="hljs-regexp">/^\s*function ErrorPrepareStackTrace/</span>.test <span class="hljs-built_in">Error</span>.prepareStackTrace.toString()
145164

146-
<span class="hljs-keyword">unless</span> <span class="hljs-built_in">Error</span>.prepareStackTrace <span class="hljs-keyword">or</span> nodeSourceMapsSupportEnabled
165+
<span class="hljs-keyword">unless</span> (<span class="hljs-built_in">Error</span>.prepareStackTrace <span class="hljs-keyword">and</span> <span class="hljs-keyword">not</span> isNodeInternalHandler) <span class="hljs-keyword">or</span> nodeSourceMapsSupportEnabled
147166
cacheSourceMaps = <span class="hljs-literal">true</span>
148167
patchStackTrace()</pre></div></div>
149168

150169
</li>
151170

152171

153-
<li id="section-3">
172+
<li id="section-4">
154173
<div class="annotation">
155174

156175
<div class="sswrap ">
157-
<a class="ss" href="#section-3">&#x00a7;</a>
176+
<a class="ss" href="#section-4">&#x00a7;</a>
158177
</div>
159178
<p>Load and run a CoffeeScript file for Node, stripping any <code>BOM</code>s.</p>
160179

@@ -166,11 +185,11 @@ <h1>register.coffee</h1>
166185
</li>
167186

168187

169-
<li id="section-4">
188+
<li id="section-5">
170189
<div class="annotation">
171190

172191
<div class="sswrap ">
173-
<a class="ss" href="#section-4">&#x00a7;</a>
192+
<a class="ss" href="#section-5">&#x00a7;</a>
174193
</div>
175194
<p>Currently <code>CoffeeScript.compile</code> caches all source maps if present. They
176195
are available in <code>getSourceMap</code> retrieved by <code>filename</code>.</p>
@@ -186,11 +205,11 @@ <h1>register.coffee</h1>
186205
</li>
187206

188207

189-
<li id="section-5">
208+
<li id="section-6">
190209
<div class="annotation">
191210

192211
<div class="sswrap ">
193-
<a class="ss" href="#section-5">&#x00a7;</a>
212+
<a class="ss" href="#section-6">&#x00a7;</a>
194213
</div>
195214
<p>If the installed version of Node supports <code>require.extensions</code>, register
196215
CoffeeScript as an extension.</p>
@@ -204,11 +223,11 @@ <h1>register.coffee</h1>
204223
</li>
205224

206225

207-
<li id="section-6">
226+
<li id="section-7">
208227
<div class="annotation">
209228

210229
<div class="sswrap ">
211-
<a class="ss" href="#section-6">&#x00a7;</a>
230+
<a class="ss" href="#section-7">&#x00a7;</a>
212231
</div>
213232
<p>Patch Node’s module loader to be able to handle multi-dot extensions.
214233
This is a horrible thing that should not be required.</p>
@@ -223,11 +242,11 @@ <h1>register.coffee</h1>
223242
</li>
224243

225244

226-
<li id="section-7">
245+
<li id="section-8">
227246
<div class="annotation">
228247

229248
<div class="sswrap ">
230-
<a class="ss" href="#section-7">&#x00a7;</a>
249+
<a class="ss" href="#section-8">&#x00a7;</a>
231250
</div>
232251
<p>Remove the initial dot from dotfiles.</p>
233252

@@ -238,11 +257,11 @@ <h1>register.coffee</h1>
238257
</li>
239258

240259

241-
<li id="section-8">
260+
<li id="section-9">
242261
<div class="annotation">
243262

244263
<div class="sswrap ">
245-
<a class="ss" href="#section-8">&#x00a7;</a>
264+
<a class="ss" href="#section-9">&#x00a7;</a>
246265
</div>
247266
<p>Start with the longest possible extension and work our way shortwards.</p>
248267

@@ -263,11 +282,11 @@ <h1>register.coffee</h1>
263282
</li>
264283

265284

266-
<li id="section-9">
285+
<li id="section-10">
267286
<div class="annotation">
268287

269288
<div class="sswrap ">
270-
<a class="ss" href="#section-9">&#x00a7;</a>
289+
<a class="ss" href="#section-10">&#x00a7;</a>
271290
</div>
272291
<p>If we’re on Node, patch <code>child_process.fork</code> so that Coffee scripts are able
273292
to fork both CoffeeScript files, and JavaScript files, directly.</p>
@@ -289,11 +308,11 @@ <h1>register.coffee</h1>
289308
</li>
290309

291310

292-
<li id="section-10">
311+
<li id="section-11">
293312
<div class="annotation">
294313

295314
<div class="sswrap ">
296-
<a class="ss" href="#section-10">&#x00a7;</a>
315+
<a class="ss" href="#section-11">&#x00a7;</a>
297316
</div>
298317
<p>Utility function to find the <code>options</code> object attached to the topmost module.</p>
299318

‎docs/v2/browser-compiler-legacy/coffeescript.js‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/v2/browser-compiler-modern/coffeescript.js‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/v2/index.html‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@
704704
<section id="introduction">
705705
<p><strong>CoffeeScript is a little language that compiles into JavaScript.</strong> Underneath that awkward Java-esque patina, JavaScript has always had a gorgeous heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.</p>
706706
<p>The golden rule of CoffeeScript is: <em>“It’s just JavaScript.”</em> The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. You can use any existing JavaScript library seamlessly from CoffeeScript (and vice-versa). The compiled output is readable, pretty-printed, and tends to run as fast or faster than the equivalent handwritten JavaScript.</p>
707-
<p><strong>Latest Version:</strong> <a href="https://github.com/jashkenas/coffeescript/tarball/2.7.0">2.7.0</a></p>
707+
<p><strong>Latest Version:</strong> <a href="https://github.com/jashkenas/coffeescript/tarball/2.7.1">2.7.1</a></p>
708708
<blockquote class="uneditable-code-block"><pre><code class="language-bash"><span class="comment"># Install locally for a project:</span>
709709
npm install --save-dev coffeescript
710710

@@ -5036,7 +5036,7 @@ <h2>Web Chat (IRC)</h2>
50365036
</section>
50375037
<section id="annotated-source">
50385038
<h2>Annotated Source</h2>
5039-
<p>You can browse the CoffeeScript 2.7.0 source in readable, annotated form <a href="annotated-source/">here</a>. You can also jump directly to a particular source file:</p>
5039+
<p>You can browse the CoffeeScript 2.7.1 source in readable, annotated form <a href="annotated-source/">here</a>. You can also jump directly to a particular source file:</p>
50405040
<ul>
50415041
<li><a href="annotated-source/grammar.html">Grammar Rules — src/grammar</a></li>
50425042
<li><a href="annotated-source/lexer.html">Lexing Tokens — src/lexer</a></li>
@@ -5714,6 +5714,18 @@ <h3>Argument parsing and shebang (<code>#!</code>) lines</h3>
57145714
<section id="changelog">
57155715
<h2>Changelog</h2>
57165716

5717+
<section id="2.7.1">
5718+
<h3><a href="https://github.com/jashkenas/coffeescript/compare/2.7.0...2.7.1">2.7.1</a>
5719+
<span class="timestamp"> &mdash; <time datetime="2026-10-20">2026-10-20</time></span>
5720+
</h3><ul>
5721+
<li>Compatibility with Node 22 and later: stack trace patching and source maps now work correctly, and the new <code>with { type: 'json' }</code> import attributes syntax is supported alongside <code>assert</code>.</li>
5722+
<li>Numeric literals now support a capital <code>E</code> in scientific notation, and method calls on numbers with underscores such as <code>1_000.toString()</code> now compile correctly.</li>
5723+
<li>Performance improvements to the <code>flatten</code> helper (no longer recursive), <code>checkShebangLine</code> and the number-matching regular expressions.</li>
5724+
<li>Documentation fixes: code snippets now run correctly again, and a hover line-height shift was fixed.</li>
5725+
<li>Continuous integration now tests Node 16 through 26.</li>
5726+
</ul>
5727+
5728+
</section>
57175729
<section id="2.7.0">
57185730
<h3><a href="https://github.com/jashkenas/coffeescript/compare/2.6.1...2.7.0">2.7.0</a>
57195731
<span class="timestamp"> &mdash; <time datetime="2022-04-23">2022-04-23</time></span>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
```
2+
releaseHeader('2026-10-20', '2.7.1', '2.7.0')
3+
```
4+
5+
* Compatibility with Node 22 and later: stack trace patching and source maps now work correctly, and the new `with { type: 'json' }` import attributes syntax is supported alongside `assert`.
6+
* Numeric literals now support a capital `E` in scientific notation, and method calls on numbers with underscores such as `1_000.toString()` now compile correctly.
7+
* Performance improvements to the `flatten` helper (no longer recursive), `checkShebangLine` and the number-matching regular expressions.
8+
* Documentation fixes: code snippets now run correctly again, and a hover line-height shift was fixed.
9+
* Continuous integration now tests Node 16 through 26.

‎documentation/site/body.html‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@
225225
</section>
226226
<section id="changelog">
227227
<%= htmlFor('changelog') %>
228+
<section id="2.7.1">
229+
<%= htmlFor('changelog/2.7.1') %>
230+
</section>
228231
<section id="2.7.0">
229232
<%= htmlFor('changelog/2.7.0') %>
230233
</section>

‎lib/coffeescript-browser-compiler-legacy/coffeescript.js‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/coffeescript-browser-compiler-modern/coffeescript.js‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)