Skip to content

Commit f9c3316

Browse files
2.6.0 (#5374)
1 parent ff13d85 commit f9c3316

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+10080
-8276
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,34 @@ jobs:
1111
strategy:
1212
matrix:
1313
operating-system: [ubuntu-latest, macos-latest, windows-latest]
14-
node-version: [6.x, 8.x, 10.x, 12.x, 14.x, 16.x]
14+
node-version: [10.x, 12.x, 14.x, 16.x]
1515

1616
steps:
1717
- uses: actions/checkout@v2
1818
- name: Use Node.js ${{ matrix.node-version }}
19-
uses: actions/setup-node@v1
19+
uses: actions/setup-node@v2
2020
with:
2121
node-version: ${{ matrix.node-version }}
2222

23-
# Puppeteer runs an install script that requires Node 10+.
24-
# Also, the `npm ci` command doesn’t exist on the version of npm that shipped with Node 6.
25-
- run: node --eval "pjson = JSON.parse(require('fs').readFileSync('./package.json')); delete pjson.devDependencies.puppeteer; require('fs').writeFileSync('./package.json', JSON.stringify(pjson), 'utf8')"
26-
if: matrix.node-version == '6.x' || matrix.node-version == '8.x'
27-
- run: npm install
28-
if: matrix.node-version == '6.x'
2923
- run: npm ci
30-
if: matrix.node-version != '6.x'
31-
32-
- run: node ./bin/cake test
33-
- run: node --harmony ./bin/cake test
34-
35-
- run: node ./bin/cake test:browser
36-
if: matrix.node-version != '6.x' && matrix.node-version != '8.x'
37-
38-
- run: node ./bin/cake test:browser:node
39-
40-
- run: node ./bin/cake test:integrations
4124

25+
# Ensure that we can still build in the current version of Node
4226
- run: node ./bin/cake build:except-parser
4327
- run: node ./bin/cake build:parser
44-
- run: node ./bin/cake build:full
28+
# Build twice to ensure that the latest build of the compiler can still build itself
29+
- run: node ./bin/cake build:except-parser
30+
- run: node ./bin/cake build:parser
31+
# Build the browser compiler for the headless browser test
4532
- run: node ./bin/cake build:browser
4633

34+
# Check that the git diff is clean, to ensure that the updated build output was committed
4735
- run: git diff --exit-code
48-
if: matrix.node-version != '6.x' && matrix.node-version != '8.x'
36+
37+
# Build test.html, so that test:browser uses the latest tests
38+
- run: node ./bin/cake doc:test
39+
40+
# Test
41+
- run: node ./bin/cake test
42+
- run: node ./bin/cake test:browser
43+
- run: node ./bin/cake test:browser:node
44+
- run: node ./bin/cake test:integrations

Cakefile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,11 @@ buildDocs = (watch = no) ->
222222
markdownRenderer = require('markdown-it')
223223
html: yes
224224
typographer: yes
225-
highlight: (str, lang) ->
225+
highlight: (str, language) ->
226226
# From https://github.com/markdown-it/markdown-it#syntax-highlighting
227-
if lang and hljs.getLanguage(lang)
227+
if language and hljs.getLanguage(language)
228228
try
229-
return hljs.highlight(lang, str).value
229+
return hljs.highlight(str, { language }).value
230230
catch ex
231231
return '' # No syntax highlighting
232232

@@ -502,7 +502,7 @@ task 'test:browser', 'run the test suite against the modern browser compiler in
502502
# version of the browser compiler. There’s no reason to run this test in old
503503
# versions of Node (the runtime is the headless Chrome browser, not Node),
504504
# and Puppeteer 3 only supports Node >= 10.18.1, so limit this test to those
505-
# versions. The code below uses `Promise.prototype.finally` because the
505+
# versions. The code below uses `Promise.prototype.finally` because the
506506
# CoffeeScript codebase currently maintains compatibility with Node 6, which
507507
# did not support `async`/`await` syntax. Even though this test doesn’t run
508508
# in Node 6, it needs to still _parse_ in Node 6 so that this file can load.
@@ -537,7 +537,7 @@ task 'test:browser', 'run the test suite against the modern browser compiler in
537537
page = pageHandle
538538
page.goto 'http://localhost:8080/'
539539
).then(->
540-
page.waitFor '#result',
540+
page.waitForSelector '#result',
541541
visible: yes
542542
polling: 'mutation'
543543
).then((element) ->
@@ -548,7 +548,7 @@ task 'test:browser', 'run the test suite against the modern browser compiler in
548548
browser.close()
549549
).finally ->
550550
server.close()
551-
if result and 'failed' not in result
551+
if result and not result.includes('failed')
552552
log result, green
553553
else
554554
log result, red
@@ -570,6 +570,9 @@ task 'test:integrations', 'test the module integrated with other libraries and e
570570
# can be built by such tools; if such a build succeeds, it verifies that no
571571
# Node modules are required as part of the compiler (as opposed to the tests)
572572
# and that therefore the compiler will run in a browser environment.
573+
# Webpack 5 requires Node >= 10.13.0.
574+
[major, minor] = process.versions.node.split('.').map (n) -> parseInt(n, 10)
575+
return if major < 10 or (major is 10 and minor < 13)
573576
tmpdir = os.tmpdir()
574577
webpack = require 'webpack'
575578
webpack {
@@ -594,7 +597,7 @@ task 'test:integrations', 'test the module integrated with other libraries and e
594597
process.exit 1
595598

596599
builtCompiler = path.join tmpdir, 'coffeescript.js'
597-
CoffeeScript = require builtCompiler
600+
{ CoffeeScript } = require builtCompiler
598601
global.testingBrowser = yes
599602
testResults = runTests CoffeeScript
600603
fs.unlinkSync builtCompiler

0 commit comments

Comments
 (0)