Skip to content

Commit

Permalink
Merge 9fdfcc0 into ca2961f
Browse files Browse the repository at this point in the history
  • Loading branch information
amitgilad3 authored Jan 8, 2018
2 parents ca2961f + 9fdfcc0 commit aaef87f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- [#540](https://github.com/teambit/bit/issues/540) support yarn as package manager
- [#541](https://github.com/teambit/bit/issues/541) add package manager config to bit.json
- [#543](https://github.com/teambit/bit/issues/543) remove imported component not working
- [#537](https://github.com/teambit/bit/issues/537) - change dist flag to --ignore-dist and by default create dist files


## [0.12.0-ext.11] - 2018-01-02
Expand Down
20 changes: 10 additions & 10 deletions e2e/commands/import.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ describe('bit import', function () {
const expectedLocationImprelDist = path.join(imprelDir, 'dist', 'imprel.js');
const expectedLocationImprelSpecDist = path.join(imprelDir, 'dist', 'imprel.spec.js');
const expectedLocationMyUtilDist = path.join(imprelDir, 'dist', 'utils', 'myUtil.js');
describe('with --dist flag', () => {
describe('without --no-dist flag', () => {
before(() => {
helper.reInitLocalScope();
helper.addRemoteScope();
helper.importComponent('imprel/impreldist --dist');
helper.importComponent('imprel/impreldist');
localConsumerFiles = helper.getConsumerFiles();
});
it('should write the internal files according to their relative paths', () => {
Expand Down Expand Up @@ -238,12 +238,12 @@ describe('bit import', function () {
});
});
});
describe('with --dist flag when dist is set to a non-default directory', () => {
describe('with --no-dis flag set to false when dist is set to a non-default directory', () => {
before(() => {
helper.reInitLocalScope();
helper.addRemoteScope();
helper.modifyFieldInBitJson('dist', { target: 'another-dist' });
helper.importComponent('imprel/impreldist --dist');
helper.importComponent('imprel/impreldist');
localConsumerFiles = helper.getConsumerFiles();
});
it('should write the dist files according to the new dist-target set in bit.json', () => {
Expand All @@ -256,11 +256,11 @@ describe('bit import', function () {
expect(localConsumerFiles).to.include(newLocationMyUtilDist);
});
});
describe('without --dist flag', () => {
describe('with --no-dist flag', () => {
before(() => {
helper.reInitLocalScope();
helper.addRemoteScope();
helper.importComponent('imprel/impreldist');
helper.importComponent('imprel/impreldist --ignore-dist');
localConsumerFiles = helper.getConsumerFiles();
});
it('should write the internal files according to their relative paths', () => {
Expand Down Expand Up @@ -1072,7 +1072,7 @@ describe('bit import', function () {
helper.exportAllComponents();
helper.reInitLocalScope();
helper.addRemoteScope();
helper.importComponent('bar/foo --dist');
helper.importComponent('bar/foo');
localConsumerFiles = helper.getConsumerFiles();
});
const isStringLocation = path.join(
Expand Down Expand Up @@ -1190,11 +1190,11 @@ describe('bit import', function () {
const result = helper.runCmd('node app.js');
expect(result.trim()).to.equal('got is-type and got is-string and got foo');
});
describe('importing without --dist flag', () => {
describe('importing with --no-dist flag', () => {
before(() => {
helper.reInitLocalScope();
helper.addRemoteScope();
helper.importComponent('bar/foo');
helper.importComponent('bar/foo --ignore-dist');
localConsumerFiles = helper.getConsumerFiles();
});
it('should not write anything to the dist folder of the main component', () => {
Expand All @@ -1207,7 +1207,7 @@ describe('bit import', function () {
expect(indexFileContent).to.have.string("require('./bar/foo')");
expect(indexFileContent).to.not.have.string('dist');
});
describe('bit build after importing without --dist flag', () => {
describe('bit build after importing without --no-dist flag', () => {
before(() => {
helper.build('bar/foo');
});
Expand Down
2 changes: 1 addition & 1 deletion e2e/e2e-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export default class Helper {
fs.removeSync(path.join(this.localScopePath, 'components'));
this.runCmd('bit init');
this.addRemoteScope();
return withDist ? this.runCmd('bit import --dist') : this.runCmd('bit import');
return withDist ? this.runCmd('bit import') : this.runCmd('bit import --ignore-dist');
}

getConsumerFiles(ext: string = '*.{js,ts}', includeDot: boolean = true) {
Expand Down
8 changes: 4 additions & 4 deletions src/cli/commands/public-cmds/import-cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default class Import extends Command {
['d', 'display-dependencies', 'display the imported dependencies'],
['f', 'force', 'ignore local changes'],
['v', 'verbose', 'showing verbose output for inspection'],
['', 'dist', 'write dist files (when exist) to the configured directory'],
['', 'ignore-dist', 'write dist files (when exist) to the configured directory'],
['', 'conf', 'write the configuration file (bit.json)'],
[
'',
Expand All @@ -48,7 +48,7 @@ export default class Import extends Command {
environment,
force = false,
verbose = false,
dist = false,
ignoreDist = false,
conf = false,
skipNpmInstall = false,
ignorePackageJson = false
Expand All @@ -61,7 +61,7 @@ export default class Import extends Command {
displayDependencies?: boolean,
environment?: boolean,
force?: boolean,
dist?: boolean,
ignoreDist?: boolean,
conf?: boolean,
skipNpmInstall?: boolean,
ignorePackageJson?: boolean
Expand All @@ -80,7 +80,7 @@ export default class Import extends Command {
prefix,
environment,
force,
dist,
dist: !ignoreDist,
conf,
installNpmPackages: !skipNpmInstall,
withPackageJson: !ignorePackageJson
Expand Down

0 comments on commit aaef87f

Please sign in to comment.