Skip to content

Commit

Permalink
Bug/improve build errors (#2051)
Browse files Browse the repository at this point in the history
* better handle external errors from compilers
* upgrade serialize-error ^2.1.0 -> ^5.0.0
* remove deserialize-error (it's now part of serialize-error)
* related to #2023
  • Loading branch information
GiladShoham authored Oct 3, 2019
1 parent cd6c85d commit 1dfd87e
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [unreleased]

- [#2019](https://github.com/teambit/bit/issues/2019) fix `bit import --merge` to not override changed dependencies
- [#2023](https://github.com/teambit/bit/issues/2023) better handle external errors from compilers

## [14.4.1-dev.1] - 2019-09-27

Expand Down
19 changes: 11 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
"comment-json": "^1.1.3",
"debug": "^4.1.1",
"decamelize": "^1.2.0",
"deserialize-error": "0.0.3",
"detect-indent": "^5.0.0",
"detect-newline": "^3.0.0",
"doctrine": "^2.0.2",
Expand Down Expand Up @@ -144,7 +143,7 @@
"regenerator-runtime": "^0.11.0",
"requestify": "^0.2.5",
"semver": "^5.4.1",
"serialize-error": "^2.1.0",
"serialize-error": "^5.0.0",
"ssh2": "^0.5.4",
"string-format": "^0.5.0",
"stringify-package": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/analytics/analytics.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @flow */
import serializeError from 'serialize-error';
import { serializeError } from 'serialize-error';
import path from 'path';
import hashObj from 'object-hash';
import uniqid from 'uniqid';
Expand Down
2 changes: 1 addition & 1 deletion src/cli/command-registrar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @flow */
import serializeError from 'serialize-error';
import { serializeError } from 'serialize-error';
import R from 'ramda';
import commander from 'commander';
import chalk from 'chalk';
Expand Down
5 changes: 4 additions & 1 deletion src/consumer/component-ops/build-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,10 @@ const _runBuild = async ({
logger.info(`build-components, deleting ${tmpFolderFullPath}`);
fs.removeSync(tmpFolderFullPath);
}
const errors = e.errors || [e];
// Some time an external tool might return a complex object or an array of errors
// See for example this issue: https://github.com/teambit/bit/issues/2023#issuecomment-534952085
// (The Vue compiler will return an object with different fields such as details, missing, origin, dependencies, module, name, error)
const errors = e.errors || (e.error ? [e.error] : [e]);
const err = new ExternalBuildErrors(component.id.toString(), errors);
throw err;
});
Expand Down
2 changes: 1 addition & 1 deletion src/logger/logger.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** @flow */
import chalk from 'chalk';
import yn from 'yn';
import serializeError from 'serialize-error';
import { serializeError } from 'serialize-error';
import format from 'string-format';
import winston from 'winston';
import path from 'path';
Expand Down
2 changes: 1 addition & 1 deletion src/scope/ci-ops/run-and-update-ci.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @flow */
import serializeError from 'serialize-error';
import { serializeError } from 'serialize-error';
import { buildInScope, testInScope, modifyCIProps } from '../../api/scope';

async function runAndUpdateCI({
Expand Down
2 changes: 1 addition & 1 deletion src/specs-runner/specs-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import R from 'ramda';
import path from 'path';
import execa from 'execa';
import pEvent from 'p-event';
import deserializeError from 'deserialize-error';
import { deserializeError } from 'serialize-error';
import { Results } from '../consumer/specs-results';
import type { ForkLevel } from '../api/consumer/lib/test';
import { TESTS_FORK_LEVEL } from '../constants';
Expand Down
2 changes: 1 addition & 1 deletion src/specs-runner/worker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow
// TODO - move to language specific driver.
import serializeError from 'serialize-error';
import { serializeError } from 'serialize-error';
import { testInProcess } from '../api/consumer/lib/test';
import loader from '../cli/loader';
import ExternalErrors from '../error/external-errors';
Expand Down

0 comments on commit 1dfd87e

Please sign in to comment.