diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index e9afa7c4c..ad99c26d1 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -256,6 +256,10 @@ function Foo() { } ``` +### API: Prettier now works in Atom again ([#6129] by [@duailibe]) + +Atom has a security feature where code containing `eval` is not allowed to be run. One of Prettier's dependencies uses `eval` to prevent bundlers from including debug code. We've now made sure that this `eval` does not end up in the code we ship to npm, making Prettier play nice with Atom again. + [#5979]: https://github.com/prettier/prettier/pull/5979 [#6086]: https://github.com/prettier/prettier/pull/6086 [#6088]: https://github.com/prettier/prettier/pull/6088 @@ -265,6 +269,7 @@ function Foo() { [#6116]: https://github.com/prettier/prettier/pull/6116 [#6119]: https://github.com/prettier/prettier/pull/6119 [#6127]: https://github.com/prettier/prettier/pull/6127 +[#6129]: https://github.com/prettier/prettier/pull/6129 [#6130]: https://github.com/prettier/prettier/pull/6130 [@belochub]: https://github.com/belochub [@brainkim]: https://github.com/brainkim diff --git a/package.json b/package.json index f2def1ca0..57b8e44be 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "@babel/code-frame": "7.0.0", "@babel/parser": "7.2.0", "@glimmer/syntax": "0.30.3", - "@iarna/toml": "2.0.0", + "@iarna/toml": "2.2.3", "@typescript-eslint/typescript-estree": "1.6.0", "angular-estree-parser": "1.1.5", "angular-html-parser": "1.2.0", diff --git a/scripts/build/build.js b/scripts/build/build.js index dafae2ad3..3db6ec13a 100644 --- a/scripts/build/build.js +++ b/scripts/build/build.js @@ -99,7 +99,7 @@ async function run(params) { await execa("rm", ["-rf", ".cache"]); } - const bundleCache = new Cache(".cache/", "v11"); + const bundleCache = new Cache(".cache/", "v12"); await bundleCache.load(); console.log(chalk.inverse(" Building packages ")); diff --git a/scripts/build/config.js b/scripts/build/config.js index 9c6e8d89c..d661a7e10 100644 --- a/scripts/build/config.js +++ b/scripts/build/config.js @@ -109,7 +109,11 @@ const coreBundles = [ input: "index.js", type: "core", target: "node", - external: [path.resolve("src/common/third-party.js")] + external: [path.resolve("src/common/third-party.js")], + replace: { + // from @iarna/toml/parse-string + "eval(\"require('util').inspect\")": "require('util').inspect" + } }, { input: "src/doc/index.js", diff --git a/yarn.lock b/yarn.lock index 254c404d8..712fa0427 100644 --- a/yarn.lock +++ b/yarn.lock @@ -634,9 +634,9 @@ dependencies: "@glimmer/util" "^0.30.3" -"@iarna/toml@2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@iarna/toml/-/toml-2.0.0.tgz#7802115684397785b3b6dc8a3ba50e30d7a7422b" +"@iarna/toml@2.2.3": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@iarna/toml/-/toml-2.2.3.tgz#f060bf6eaafae4d56a7dac618980838b0696e2ab" "@types/node@^10.11.7": version "10.12.0"