Closed agarzola closed 2 years ago
Tests were failing on Node.js v12 due to rmSync
not being available. That method was introduced in v14. Since v12 is end of life and we have no projects on v12 that use Calliope, I have pushed a commit that:
engines
object in our package.json
to make sure installing the package with a Node.js version <14 throws an error.Tests for the styles
task were failing in Windows due to my ill-advised use of echo
(via child_process.execSync
) to create a contrived .env
file in the tmp directory where tests are run. I just pushed a commit that switches to use fs.writeFileSync
, which is —naturally— platform-independent.
Checks pass! I love that our tests surfaced two issues I could not have easily foreseen with only local testing. Merging this now and publishing a new major version.
Description
This PR updates the default configuration of Calliope to make JS/SCSS linting during development opt-out (that is: enabled by default). It also updates the README to reflect this new behavior, as well as the boilerplate README,
.env
, andcalliope.config.js
files. Finally, tests were adjusted to skip linting while processing stylesheets for tests and to add a test that validates that linting is carried out by default.While running tests, I noticed a deprecation warning for the
fs.rmdirSync
method, so I took this opportunity to switch a helper file to usefs.rmSync
as recommended.Motivation / Context
Wanting JS/SCSS to be linted during development is a more preferable behavior than the alternative (not wanting to lint these files during development), so we should enable linting during development by default, whilst preserving developers’ ability to disable it if desired.
Testing Instructions / How This Has Been Tested
Tested as part of chromatichq/chromatichq-eleventy#274.
Screenshots
This screenshot shows the
chromatichq-eleventy
project as it currently exists in chromatichq/chromatichq-eleventy#274 with no.env
file (ls .env
fails) andyarn start
showing errors for offending code in a JS file:Deprecation warning before the
rmdirSync
-to-rmSync
change in this PR:No deprecation warning after changes in this PR:
Documentation
The main README, sample README, sample
.env
, and samplecalliope.config.js
files have all been updated to reflect the new behavior.