@prettier/plugin-ruby
Advanced tools
Comparing version 4.0.0 to 4.0.1
@@ -9,2 +9,8 @@ # Changelog | ||
## [4.0.1] - 2023-07-08 | ||
### Changed | ||
- [#1363](https://github.com/prettier/plugin-ruby/pull/1363) - mscrivo, kddnewton - Ensure all data is read from socket before attempting to parse to JSON. | ||
## [4.0.0] - 2023-07-06 | ||
@@ -1283,3 +1289,4 @@ | ||
[unreleased]: https://github.com/prettier/plugin-ruby/compare/v4.0.0...HEAD | ||
[unreleased]: https://github.com/prettier/plugin-ruby/compare/v4.0.1...HEAD | ||
[4.0.1]: https://github.com/prettier/plugin-ruby/compare/v4.0.0...v4.0.1 | ||
[4.0.0]: https://github.com/prettier/plugin-ruby/compare/v3.2.2...v4.0.0 | ||
@@ -1286,0 +1293,0 @@ [3.2.2]: https://github.com/prettier/plugin-ruby/compare/v3.2.1...v3.2.2 |
{ | ||
"name": "@prettier/plugin-ruby", | ||
"version": "4.0.0", | ||
"version": "4.0.1", | ||
"description": "prettier plugin for the Ruby programming language", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -143,6 +143,3 @@ import { spawn } from "child_process"; | ||
// Formats and sends a request to the parser server. We use netcat (or something | ||
// like it) here since Prettier requires the results of `parse` to be | ||
// synchronous and Node.js does not offer a mechanism for synchronous socket | ||
// requests. | ||
// Formats and sends an asynchronous request to the parser server. | ||
async function parse(parser, source, opts) { | ||
@@ -156,7 +153,15 @@ if (!connectionOptions) { | ||
const socket = new net.Socket(); | ||
let chunks = ""; | ||
socket.on("error", reject); | ||
socket.on("error", (error) => { | ||
reject(error); | ||
}); | ||
socket.on("data", (data) => { | ||
const response = JSON.parse(data.toString("utf-8")); | ||
chunks += data.toString("utf-8"); | ||
}); | ||
socket.on("end", () => { | ||
const response = JSON.parse(chunks); | ||
if (response.error) { | ||
@@ -163,0 +168,0 @@ const error = new Error(response.error); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
132074
344
2