Skip to content

Commit

Permalink
Switch from toml to @iarna/toml (#2298)
Browse files Browse the repository at this point in the history
As toml is an abandoned package, switch to @iarna/toml
for implementation of the latest toml spec (v0.5.0).
Also remove tomlify-j0.4, as @iarna/toml supports encoding
and decoding.
Resolves #2258.
  • Loading branch information
ABuffSeagull authored and devongovett committed Nov 21, 2018
1 parent 0937705 commit 25b64d9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 25 deletions.
21 changes: 10 additions & 11 deletions packages/core/parcel-bundler/package.json
Expand Up @@ -27,6 +27,12 @@
"@babel/template": "^7.0.0",
"@babel/traverse": "^7.0.0",
"@babel/types": "^7.0.0",
"@iarna/toml": "^2.2.0",
"@parcel/fs": "^1.10.3",
"@parcel/logger": "^1.10.3",
"@parcel/utils": "^1.10.3",
"@parcel/watcher": "1.10.3",
"@parcel/workers": "^1.10.3",
"ansi-to-html": "^0.6.4",
"babylon-walk": "^1.0.2",
"browserslist": "^4.1.0",
Expand Down Expand Up @@ -64,22 +70,17 @@
"serve-static": "^1.12.4",
"source-map": "0.6.1",
"terser": "^3.7.3",
"toml": "^2.3.3",
"tomlify-j0.4": "^3.0.0",
"v8-compile-cache": "^2.0.0",
"ws": "^5.1.1",
"@parcel/watcher": "1.10.3",
"@parcel/workers": "^1.10.3",
"@parcel/logger": "^1.10.3",
"@parcel/utils": "^1.10.3",
"@parcel/fs": "^1.10.3"
"ws": "^5.1.1"
},
"devDependencies": {
"@babel/cli": "^7.0.0",
"@babel/plugin-syntax-export-default-from": "^7.0.0",
"@babel/plugin-syntax-export-namespace-from": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-flow": "^7.0.0",
"@parcel/babel-register": "^1.10.3",
"@parcel/test-utils": "^1.10.3",
"@vue/component-compiler-utils": "^2.0.0",
"babel-core": "^6.26.3",
"babel-preset-env": "^1.7.0",
Expand Down Expand Up @@ -115,9 +116,7 @@
"sugarss": "^2.0.0",
"typescript": "^3.0.0",
"vue": "^2.5.16",
"vue-template-compiler": "^2.5.16",
"@parcel/babel-register": "^1.10.3",
"@parcel/test-utils": "^1.10.3"
"vue-template-compiler": "^2.5.16"
},
"scripts": {
"test": "cross-env NODE_ENV=test mocha",
Expand Down
4 changes: 2 additions & 2 deletions packages/core/parcel-bundler/src/assets/RustAsset.js
Expand Up @@ -3,7 +3,7 @@ const commandExists = require('command-exists');
const childProcess = require('child_process');
const {promisify} = require('@parcel/utils');
const exec = promisify(childProcess.execFile);
const tomlify = require('tomlify-j0.4');
const toml = require('@iarna/toml');
const fs = require('@parcel/fs');
const Asset = require('../Asset');
const config = require('../utils/config');
Expand Down Expand Up @@ -118,7 +118,7 @@ class RustAsset extends Asset {
cargoConfig.lib['crate-type'].push('cdylib');
await fs.writeFile(
path.join(cargoDir, 'Cargo.toml'),
tomlify.toToml(cargoConfig)
toml.stringify(cargoConfig)
);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/core/parcel-bundler/src/assets/TOMLAsset.js
@@ -1,5 +1,5 @@
const Asset = require('../Asset');
const toml = require('toml');
const toml = require('@iarna/toml');
const serializeObject = require('../utils/serializeObject');

class TOMLAsset extends Asset {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/parcel-bundler/src/utils/config.js
Expand Up @@ -4,7 +4,7 @@ const clone = require('clone');

const PARSERS = {
json: require('json5').parse,
toml: require('toml').parse
toml: require('@iarna/toml').parse
};

const existsCache = new Map();
Expand Down
15 changes: 5 additions & 10 deletions yarn.lock
Expand Up @@ -698,6 +698,11 @@
dependencies:
commander "^2.15.1"

"@iarna/toml@^2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@iarna/toml/-/toml-2.2.0.tgz#bd9295ad48ecfc5cf802610d2f06f8e4c462976a"
integrity sha512-ESqb7nwPdXRZ3AXVub1ToyeIf9bkXY4Cs21DSmr+ns705Dcz6KjB7gVXRxH93kwP8Vbx5Lg1dYewAIHmOTSg+A==

"@lerna/add@^3.4.1":
version "3.4.1"
resolved "https://registry.yarnpkg.com/@lerna/add/-/add-3.4.1.tgz#d41068317e30f530df48220d256b5e79690b1877"
Expand Down Expand Up @@ -10211,16 +10216,6 @@ token-stream@0.0.1:
resolved "https://registry.yarnpkg.com/token-stream/-/token-stream-0.0.1.tgz#ceeefc717a76c4316f126d0b9dbaa55d7e7df01a"
integrity sha1-zu78cXp2xDFvEm0LnbqlXX598Bo=

toml@^2.3.3:
version "2.3.3"
resolved "https://registry.yarnpkg.com/toml/-/toml-2.3.3.tgz#8d683d729577cb286231dfc7a8affe58d31728fb"
integrity sha512-O7L5hhSQHxuufWUdcTRPfuTh3phKfAZ/dqfxZFoxPCj2RYmpaSGLEIs016FCXItQwNr08yefUB5TSjzRYnajTA==

tomlify-j0.4@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/tomlify-j0.4/-/tomlify-j0.4-3.0.0.tgz#99414d45268c3a3b8bf38be82145b7bba34b7473"
integrity sha512-2Ulkc8T7mXJ2l0W476YC/A209PR38Nw8PuaCNtk9uI3t1zzFdGQeWYGQvmj2PZkVvRC/Yoi4xQKMRnWc/N29tQ==

tough-cookie@>=2.3.3, tough-cookie@~2.4.3:
version "2.4.3"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781"
Expand Down

0 comments on commit 25b64d9

Please sign in to comment.