Remove eval() call from the bundle (#6129)

master
Lucas Duailibe 2019-05-17 10:15:45 -03:00 committed by GitHub
parent eca23e111f
commit bb1fd59e00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 6 deletions

View File

@ -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

View File

@ -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",

View File

@ -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 "));

View File

@ -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",

View File

@ -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"