Skip to content

Commit

Permalink
Lukyth/fix error (#2989)
Browse files Browse the repository at this point in the history
* Fix error from duplicated type (T is already declared)

* Fix code format by running `yarn format`

* Fix failed test caused by Babel

More info: #2842 (comment)

* Fix failed test on fs-destructure

Not sure what's the root cause but upgrading all babel dependencies to the current latest version fix the issue.

* Try bumping elm packages version hoping this will fix failed tests

* Fix corejs warning

According to #2842 (comment)

* Upgrade @babel dependencies

* Upgrade elm dependencies
  • Loading branch information
DeMoorJasper committed May 7, 2019
1 parent 4100b9e commit 7b566c7
Show file tree
Hide file tree
Showing 12 changed files with 831 additions and 965 deletions.
2 changes: 1 addition & 1 deletion packages/core/babel-register/package.json
Expand Up @@ -13,6 +13,6 @@
"@babel/core": "^7.0.0"
},
"dependencies": {
"@babel/register": "^7.0.0"
"@babel/register": "^7.4.4"
}
}
2 changes: 1 addition & 1 deletion packages/core/integration-tests/package.json
Expand Up @@ -12,7 +12,7 @@
"test-ci": "yarn test --reporter mocha-multi-reporters --reporter-options configFile=./test/mochareporters.json"
},
"devDependencies": {
"@babel/core": "^7.2.0",
"@babel/core": "^7.4.4",
"@jetbrains/kotlinc-js-api": "^1.2.12",
"@parcel/fs": "^1.11.0",
"@parcel/test-utils": "^1.12.0",
Expand Down
@@ -1,3 +1,6 @@
{
"name": "babel-plugin-autoinstall"
"name": "babel-plugin-autoinstall",
"devDependencies": {
"@babel/core": "^7.4.4"
}
}
Expand Up @@ -6,19 +6,19 @@
"elm-version": "0.19.0",
"dependencies": {
"direct": {
"elm/browser": "1.0.0",
"elm/core": "1.0.0",
"elm/browser": "1.0.1",
"elm/core": "1.0.2",
"elm/html": "1.0.0"
},
"indirect": {
"elm/json": "1.0.0",
"elm/json": "1.1.3",
"elm/time": "1.0.0",
"elm/url": "1.0.0",
"elm/virtual-dom": "1.0.0"
"elm/virtual-dom": "1.0.2"
}
},
"test-dependencies": {
"direct": {},
"indirect": {}
}
}
}
10 changes: 5 additions & 5 deletions packages/core/integration-tests/test/integration/elm/elm.json
Expand Up @@ -6,19 +6,19 @@
"elm-version": "0.19.0",
"dependencies": {
"direct": {
"elm/browser": "1.0.0",
"elm/core": "1.0.0",
"elm/browser": "1.0.1",
"elm/core": "1.0.2",
"elm/html": "1.0.0"
},
"indirect": {
"elm/json": "1.0.0",
"elm/json": "1.1.3",
"elm/time": "1.0.0",
"elm/url": "1.0.0",
"elm/virtual-dom": "1.0.0"
"elm/virtual-dom": "1.0.2"
}
},
"test-dependencies": {
"direct": {},
"indirect": {}
}
}
}
2 changes: 1 addition & 1 deletion packages/core/integration-tests/test/scope-hoisting.js
Expand Up @@ -299,7 +299,7 @@ describe('scope hoisting', function() {
);
} catch (err) {
threw = true;
assert.equal(err.message, "export 'Test' is not defined");
assert.equal(err.message, "Export 'Test' is not defined (1:8)");
}

assert(threw);
Expand Down
29 changes: 15 additions & 14 deletions packages/core/parcel-bundler/package.json
Expand Up @@ -16,17 +16,17 @@
],
"dependencies": {
"@babel/code-frame": "^7.0.0 <7.4.0",
"@babel/core": "^7.0.0 <7.4.0",
"@babel/generator": "^7.0.0 <7.4.0",
"@babel/parser": "^7.0.0 <7.4.0",
"@babel/plugin-transform-flow-strip-types": "^7.0.0 <7.4.0",
"@babel/plugin-transform-modules-commonjs": "^7.0.0 <7.4.0",
"@babel/core": "^7.4.4",
"@babel/generator": "^7.4.4",
"@babel/parser": "^7.4.4",
"@babel/plugin-transform-flow-strip-types": "^7.4.4",
"@babel/plugin-transform-modules-commonjs": "^7.4.4",
"@babel/plugin-transform-react-jsx": "^7.0.0 <7.4.0",
"@babel/preset-env": "^7.0.0 <7.4.0",
"@babel/runtime": "^7.0.0 <7.4.0",
"@babel/template": "^7.0.0 <7.4.0",
"@babel/traverse": "^7.0.0 <7.4.0",
"@babel/types": "^7.0.0 <7.4.0",
"@babel/preset-env": "^7.4.4",
"@babel/runtime": "^7.4.4",
"@babel/template": "^7.4.4",
"@babel/traverse": "^7.4.4",
"@babel/types": "^7.4.4",
"@iarna/toml": "^2.2.0",
"@parcel/fs": "^1.11.0",
"@parcel/logger": "^1.11.0",
Expand All @@ -40,6 +40,7 @@
"clone": "^2.1.1",
"command-exists": "^1.2.6",
"commander": "^2.11.0",
"core-js": "^2.6.5",
"cross-spawn": "^6.0.4",
"css-modules-loader-core": "^1.1.0",
"cssnano": "^4.0.0",
Expand Down Expand Up @@ -74,10 +75,10 @@
"ws": "^5.1.1"
},
"devDependencies": {
"@babel/cli": "^7.0.0 <7.4.0",
"@babel/cli": "^7.4.4",
"@babel/plugin-syntax-export-default-from": "^7.0.0 <7.4.0",
"@babel/plugin-syntax-export-namespace-from": "^7.0.0 <7.4.0",
"@babel/plugin-transform-runtime": "^7.0.0 <7.4.0",
"@babel/plugin-transform-runtime": "^7.4.4",
"@babel/preset-flow": "^7.0.0 <7.4.0",
"@parcel/babel-register": "^1.11.0 <7.4.0",
"@parcel/test-utils": "^1.12.0",
Expand All @@ -89,7 +90,7 @@
"codecov": "^3.0.0",
"coffeescript": "^2.0.3",
"cross-env": "^5.1.1",
"elm": "^0.19.0",
"elm": "^0.19.0-bugfix6",
"elm-hot": "^1.0.1",
"eslint": "^4.13.0",
"glslify-bundle": "^5.0.0",
Expand All @@ -104,7 +105,7 @@
"mocha-multi-reporters": "^1.1.7",
"ncp": "^2.0.0",
"nib": "^1.1.2",
"node-elm-compiler": "^5.0.1",
"node-elm-compiler": "^5.0.3",
"nyc": "^11.1.0",
"postcss-modules": "^1.4.1",
"posthtml-extend": "^0.2.1",
Expand Down
8 changes: 4 additions & 4 deletions packages/core/parcel-bundler/src/Bundler.js
Expand Up @@ -105,8 +105,8 @@ class Bundler extends EventEmitter {
target === 'node'
? false
: typeof options.hmr === 'boolean'
? options.hmr
: watch;
? options.hmr
: watch;
const scopeHoist =
options.scopeHoist !== undefined ? options.scopeHoist : false;
return {
Expand Down Expand Up @@ -145,8 +145,8 @@ class Bundler extends EventEmitter {
typeof options.autoInstall === 'boolean'
? options.autoInstall
: process.env.PARCEL_AUTOINSTALL === 'false'
? false
: !isProduction,
? false
: !isProduction,
scopeHoist: scopeHoist,
contentHash:
typeof options.contentHash === 'boolean'
Expand Down
40 changes: 21 additions & 19 deletions packages/core/parcel-bundler/src/assets/VueAsset.js
Expand Up @@ -214,28 +214,30 @@ class VueAsset extends Asset {
}

compileStyle(generated, scopeId) {
return generated.filter(r => r.type === 'css').reduce((p, r, i) => {
let css = r.value;
let scoped = this.ast.styles[i].scoped;

// Process scoped styles if needed.
if (scoped) {
let {code, errors} = this.vue.compileStyle({
source: css,
filename: this.relativeName,
id: scopeId,
scoped
});
return generated
.filter(r => r.type === 'css')
.reduce((p, r, i) => {
let css = r.value;
let scoped = this.ast.styles[i].scoped;

// Process scoped styles if needed.
if (scoped) {
let {code, errors} = this.vue.compileStyle({
source: css,
filename: this.relativeName,
id: scopeId,
scoped
});

if (errors.length) {
throw errors[0];
}

if (errors.length) {
throw errors[0];
css = code;
}

css = code;
}

return p + css;
}, '');
return p + css;
}, '');
}

compileHMR(generated, optsVar) {
Expand Down
21 changes: 12 additions & 9 deletions packages/core/parcel-bundler/src/transforms/babel/env.js
Expand Up @@ -48,15 +48,18 @@ async function getEnvPlugins(targets, useBuiltIns = false) {
return envCache.get(key);
}

let plugins = presetEnv.default(
{assertVersion: () => true},
{
targets,
modules: false,
useBuiltIns: useBuiltIns ? 'entry' : false,
shippedProposals: true
}
).plugins;
const options = {
targets,
modules: false,
useBuiltIns: useBuiltIns ? 'entry' : false,
shippedProposals: true
};

if (useBuiltIns) {
options.corejs = 2;
}

let plugins = presetEnv.default({assertVersion: () => true}, options).plugins;

envCache.set(key, plugins);
return plugins;
Expand Down
Expand Up @@ -26,4 +26,4 @@ var a: { [a: number]: string; };

class C<+T,-U> {}
function f<+T,-U>() {}
type T<+T,-U> = {}
type D<+T,-U> = {}

0 comments on commit 7b566c7

Please sign in to comment.