Releases: jfmengels/node-elm-review
Bugfix: Passing Elm files to the CLI does not lead to an error anymore
- Fix Elm files being passed directly as CLI arguments e4f2f0a
Stop ignoring Elm files in `node_modules`
new-package, new-rule, report changes, and perf
New subcommands
First of all, there are 2 new subcommands:
new-package
: Creates a new package aimed at publishingelm-review
rulesnew-rule
: Adds a new rule to your review configuration/project
These aim to help you create good rules and consistent review packages. Try them out, and let us know what you think!
Changes to the error report
- Running with
--no-details
hides the details from an error message. - The separator between errors now includes the name of the file. This helps avoid having to scroll to know which file the error is for.
- The header (and separator) now contain the line and column for each error, which allows you to go straight from your terminal to the error.
- There is now a summary of the number of errors at the end of the report.
- In watch mode, a message is shown when the analysis is running after a change.
Performance
- Changes in watch mode are being batched more than before. This should prevent the CLI from running over and over for each file or from crashing.
elm-json
has been upgraded to0.2.7
, which contains a lot of performance improvements thatelm-review
will benefit from.
Bug fixes
- The compilation error message was not being shown.
- Debug messages were not being shown.
Batch changes when a lot of files change
- Add a message when the review is running in watch mode 7c876cc
- Batch changes when multiple files are changed at the same time 7e84f3e
- Fix debug messages not showing up c51311d
- Update chokidar 7e26192
- Bump elm-json to 0.2.7 772e29e
- Fix missing error message when elm-json could not be found 9f7e094
- Make all elm-review packages start with elm-review 15dccda
Add new-package and new-rule subcommands
Adds 2 new subcommands:
new-package
: Creates a new package aimed at publishingelm-review
rulesnew-rule
: Adds a new rule to your review configuration/project
Individual commits
Fixed output sometimes being partially text-less
In some cases, the output of the report (in non-json output) got hidden, and you couldn't see the text in the terminal.
I haven't investigated enough, but basically, it's because of trying to wrap a colored output with terminal link which ended up creating this problem.
This problem was introduced in v2.1.2
Individual commits:
Bug fixes, and less disk space in elm-stuff
Bug fixes
- Fix files not being ignored when cwd is not the project root 3df4c61
- Add missing abortWithDetails port in app-wrapper 50b8467
Taking less disk space in elm-stuff
The compilation now happens in a temporary folder, getting rid of the review application's compilation artifacts inside elm-stuff
(one that is nested in your project's elm-stuff
)
Links to rule docs and bug fixes
Highlights
- In the terminals that support it, you will now be able to click the name of the rule to get linked to its documentation on the Elm packages website.
- Adds
--ignore-problematic-dependencies
flag, to work around elm/project-metadata-utils#12 - Fix not being able to ignore errors in elm.json and README using a relative path
- Fix unexpected errors not being formatted as advertised when using
--report=json
List of commits:
- Add --ignore-problematic-dependencies option d53ef70
- Fix elm.json and README not having an absolute path d8d0771
- Add clarification about the name in the tooling integration document 17cd64a
- Remove duplicate word in init help cad7d5c
- Display only the last report in new fix-all e22db59
- Add new CLI option b79c8a5
- Remove the need to stringify/parse docs links 28b0137
- Give a nice error message when the project's elm.json can't be found f26ee67
- Avoid trying to find the project elm.json when in running --help/--init d77a923
- Format unexpected errors like expected errors 8efcbce
- Add stack trace to unexpected errors in debug mode b0f6adc
- Document links in the JSON output in the tooling-integration document 2960186
- Display link to rule's documentation in terminal 4c28b9b
- Add link in formatted JSON dda2ad6
- Add link to a rule's documentation in the JSON report b0cba99
- Store the links in the review application d7329b6
- Collect links to the rule's documentation 645ac26
- Make it possible for files/folders to review to be absolute paths a5bf1c7
- Specify the version where --report=json was added a5d350e
v2.1.1
v2.1.0
New requirements
New requirement, this version of node-elm-review
requires you to use at least version 2.1.0
of the jfmengels/elm-review
package. This is necessary to add new features useful for JSON reporting. You can run the following commands to update it.
cd your-project/
cd review/
npx elm-json install jfmengels/elm-review@2
Highlights
- JSON reports: You can now use
--report=json
to get a report in the JSON format. This will pave the way to supporting runningelm-review
in editors (:tada:) and other environments than just the terminal. - I wrote about how editor and other tools should work with
node-elm-review
https://github.com/jfmengels/node-elm-review/blob/master/documentation/tooling-integration.md. - Parallelization of parsing: When you run
elm-review
, the files that are not parsed into ASTs (and cached) yet get parsed. This is now done in parallel in separate worker_threads. This will not be available if you use Node.js v10, but it will if you use v12 or higher (due to the availability ofworker_threads
). - Stability: A lot of work went into making the CLI more stable
- Avoiding memory leaks in watch mode: We now run the review application in a separate
worker_thread
, which we can dispose of to avoid memory leaks. Changing your configuration while in watch should now not increase the memory usage until it all explodes. Also, re-running after the configuration has changed should be a bit faster now. elm-format
is now applied to the fixed files without it first being written to the file system. Much thanks to @sparksp for tackling this! (I failed at making this work months ago and he made it work easily. That's embarassing.)- Better offline support: We used to download dependencies' information at every run if they could not be found in
ELM_HOME
. These are now downloaded and cached separately. This should let you runelm-review
while offline.
- Avoiding memory leaks in watch mode: We now run the review application in a separate
- The diff you see in fix proposals now shows only the changed sections, instead of all the code between the first and last changed lines.
Individual commits
- Create SUPPORT.md 5d39f79
- Fix configuration watcher not being closed 44574e5
- Don't print watch errors in JSON report e782887
- Don't quit the watch mode on a compilation error 3be8065
- Move node-elm-compiler fdeea38
- Remove unused functions from vendored node-elm-compiler ec4619d
- Remove Lodash from vendorized node-elm-compiler afaa4ce
- Vendorize node-elm-compiler 0298497
- Get the compilation errors inside the JSON output, and improve error messages 43841e1
- Avoid copying unnecessary files ef9251d
- Remove note about running
elm-format
after saving to the file system 8a04fb3 - Use --stdin option of elm-format (#11) eae4962
- Fix recommended version in version mismatch error 002e411
- Bump xo a038ccc
- Fix the npm audit issues 72edbeb
- Fix typo in tooling documentation (#10) eacf99d
- Write how other tooling should work with elm-review 571f121
- Make it clearer for "elm.json not found" that we are looking into a directory ad7bf0a
- Fix XO and Flow warnings 77954c1
- Bump template dependencies 1a126e7
- Change ruleName to rule in JSON output 2692337
- Wrap JSON report and errors reports inside a record b4ddc90
- Remove unused exports 5023151
- Remove unused File.encode function bbda136
- Don't validate the version when you are running a local version of the Elm package c95329e
- Introduce namespaces for the elm-stuff 647b68a
- Use custom errors when we can't find the comiler binary e34d834
- Use custom errors for abort errors 4df01b2
- Run elm-json using
npx --no-install
aa394e7 - Use custom errors for missing Internet access a740627
- Use custom errors in autofix 359e746
- Refactor custom error messages 5e21e47
- Add stacktraces to errors 78d6953
- Add file paths to custom errors 066a019
- Add warnings when using jfmengels/elm-review < v1.1 4c7ecb7
- Add fixes in the JSON report f780183
- Fix fixed files not being reloaded deed05e
- Make applyAllFixes tail-recursive fa6ba88
- Wrap errors in JSON when using the JSON format 4d33126
- Change the separator between diff sections 5d27936
- Remove wrapping of JSON output 4b15775
- Split chunks into sections 911fe55
- Simplify/shorten the JSON format output e5dfc08
- Add formatted output to the JSON format b509378
- Align line numbers to the right in reports e96a89b
- Group errors by file in JSON format 5aa4798
- Explicit the ports to subscribe to in the template 721dd63
- Wrap file data in non-primitive types 78fa2c6
- Get JSON format closer to Elm's JSON output 8948959
- Remove background color from Text d464a37
- Compute and send over ports only the requested report mode 368a8b0
- Move reporting out into a separate module b656874
- Group Texts together when they have the same styling a1fcdfd
- Avoid re-computing the AST when the timestamp has changed but not the source 89159a7
- Avoid re-reading a file in watch mode if we still have it in memory b89f93f
- Only subscribe to flushing stdin once 5acbab8
- Avoid patching console.warn multiple times in watch mode 64e2323
- Only run app in worker thread in watch mode 55521f5
- Wrap the Elm app and run it in a worker 3c9c38a
- Create a wrapper around app, to run the Elm application in a disposabl thread 22bf431
- Cache dependencies' information 75082d3
- Display an error message when dependencies' information could not be found/downloaded d9676c3
- Avoid compiling the project if there is no Internet access b7d3162
- Fix formatReport tests d5b8704
- Say "no more" when fixes have previously been applied 04d9b98
- Simplify Reporter.formatReport 4347fa4
- Add option to get for a JSON-formatted report 2c9cb26
- Create debug utility module 191714d
- Move README state from watch to state ecdce50
- Move state in autofix to state abcca56
- Format fixable files with elm-format only if they are Elm files c093c9c
- Simplify startReview port 6547700
- Create utility to promisify sending and receiving data from Elm bf7b6c7
- Store unsubscription logic in state 47d3e31
- Make in-memory cache handling more TEA-like 3cb9e7e
- Create local builds with the
-local
suffix 3348804 - Fix compilation when using local elm-review package 4d374a0
- Move the in-memory file cache to state.js ba7c675
- Rename the model file to state 748d8c9
- Make update in model.js mutate the model 538dd3e
- Terminate the workers once all the parsing has finished 61fcbad
- Remove unnecessary argument to xo 8eaa5f3
- Remove need to send & return the file path when parsing an Elm file 641c0de
- Split the Elm parsing worker from the main thread a444688
- Reorder test suite 53ceaed
- Make worker queue a bit faster dd28517
- Fine-tune number of worker threads to spawn 567717b
- Prevent crash on Node v10, due to unavailability of worker_threads 9f11f3b
- Create a pool of worker threads to parse the Elm code in parallel 3eecbdf
- Spawn a worker to parse Elm files 7c6e714
- Re-organize local states around a single central state 8d84f98
- Wait until all cache writes have finished before exiting. 315c182
- Cache parsed files 98b6933
- Add parseElm sub-project, to parse Elm code in workers 4e9d4af
https://github.com/jfmengels/node-elm-review/compare/v2.0.2......v2.1.0