Skip to content

Commit

Permalink
Merge pull request #2463 from teambit/harmony/config
Browse files Browse the repository at this point in the history
- new workspace config (see #2456)
- provide a way for an extension to write configs to a component (see #2456)
- drop support of config dir
- drop support of external files to envs
  • Loading branch information
GiladShoham authored Mar 23, 2020
2 parents baf6157 + 8417256 commit 7231cf2
Show file tree
Hide file tree
Showing 195 changed files with 1,996 additions and 2,953 deletions.
1 change: 1 addition & 0 deletions e2e/api/add-many.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ describe('bit add many programmatically', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
const components = [
{
Expand Down
1 change: 1 addition & 0 deletions e2e/api/list.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ describe('api', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
1 change: 1 addition & 0 deletions e2e/api/show.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ describe('show api', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
1 change: 1 addition & 0 deletions e2e/bit-hub/import-from-bit-hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ chai.use(require('chai-fs'));
let scopeAfterExport;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
bitsrcTester = new BitsrcTester();
barFooDir = path.join(helper.scopes.localPath, 'components', 'bar', 'foo');
return bitsrcTester
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/_scope.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ describe('bit _scope command', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
3 changes: 2 additions & 1 deletion e2e/commands/add.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ describe('bit add command', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});

after(() => {
Expand All @@ -57,7 +58,7 @@ describe('bit add command', function() {
helper.fs.deletePath('.bit');
helper.fs.deletePath('bit.json');
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
helper.scopeHelper.initLocalScope('bit init');
helper.scopeHelper.initLocalScope();
helper.fs.createFile('bar', 'foo.js');
const addCmd = () => helper.command.addComponent('bar/foo.js', { i: 'bar/foo ' });
expect(addCmd).to.not.throw('fatal: scope not found. to create a new scope, please use `bit init`');
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/build.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ describe('bit build', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/checkout.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ describe('bit checkout command', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
before(() => {
helper.scopeHelper.reInitLocalScope();
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/ci-update.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe('bit ci-update', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/config.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ describe('bit config', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});

after(() => {
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/dependency-status.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ describe('bit dependency status', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/deprecate.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ describe('bit deprecate and undeprecate commands', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/diff.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ describe('bit diff command', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
const barFooFile = path.join('bar', 'foo.js');
before(() => {
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/eject.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe('bit eject command', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
describe('local component', () => {
before(() => {
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/export.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('bit export command', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
const createFile = (dir, name) => {
const componentFixture = `module.exports = function foo() { return 'got ${name}'; };`;
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/extentsion.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ describe('bit extension system', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/import-all.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ describe('bit import command with no ids', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/import.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe('bit import', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});

after(() => {
Expand Down
13 changes: 8 additions & 5 deletions e2e/commands/init.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe('run bit init', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down Expand Up @@ -84,9 +85,9 @@ describe('run bit init', function() {
helper.scopeHelper.cleanLocalScope();
helper.scopeHelper.initLocalScopeWithOptions({
'-default-directory': 'my-comps',
'-package-manager': 'yarn',
'-compiler': 'my-compiler',
'-tester': 'my-tester'
'-package-manager': 'yarn'
// '-compiler': 'my-compiler',
// '-tester': 'my-tester'
});
bitJson = helper.bitJson.read();
});
Expand All @@ -96,10 +97,12 @@ describe('run bit init', function() {
it('should set the package manager to yarn', () => {
expect(bitJson.packageManager).to.equal('yarn');
});
it('should set the compiler to my-compiler', () => {
// Disabled until supported by the new config
it.skip('should set the compiler to my-compiler', () => {
expect(bitJson.env.compiler).to.equal('my-compiler');
});
it('should set the tester to my-tester', () => {
// Disabled until supported by the new config
it.skip('should set the tester to my-tester', () => {
expect(bitJson.env.tester).to.equal('my-tester');
});
});
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/isolate.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('run bit isolate', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/link.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe('bit link', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});

after(() => {
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/list.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ describe('bit list command', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/log.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ describe('bit log', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/merge.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ describe('bit merge command', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
before(() => {
helper.scopeHelper.reInitLocalScope();
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/move.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ describe('bit move command', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/remote.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ describe('bit remote command', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
2 changes: 2 additions & 0 deletions e2e/commands/remove.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('bit remove command', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down Expand Up @@ -340,6 +341,7 @@ describe('bit remove command', function() {
let helper2;
before(() => {
helper2 = new Helper();
helper2.command.setFeatures('legacy-workspace-config');
helper2.scopeHelper.setNewLocalAndRemoteScopes();
helper.scopeHelper.setNewLocalAndRemoteScopes();
helper.scopeHelper.addRemoteScope(helper2.scopes.remotePath, helper.scopes.remotePath);
Expand Down
5 changes: 4 additions & 1 deletion e2e/commands/show.e2e.2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as path from 'path';
import R from 'ramda';
import Helper, { VERSION_DELIMITER } from '../../src/e2e-helper/e2e-helper';
import MissingFilesFromComponent from '../../src/consumer/component/exceptions/missing-files-from-component';
import NothingToCompareTo from '../../src/api/consumer/lib/exceptions/nothing-to-compare-to';

const assertArrays = require('chai-arrays');

Expand All @@ -13,6 +14,7 @@ describe('bit show command', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});

after(() => {
Expand Down Expand Up @@ -406,7 +408,8 @@ describe('bit show command', function() {
describe('when adding a component without tagging it', () => {
it('Should throw error nothing to compare no previous versions found', () => {
const showCmd = () => helper.command.showComponent('bar/foo --compare');
expect(showCmd).to.throw('Command failed: bit show bar/foo --compare\nno previous versions to compare\n');
const error = new NothingToCompareTo('bar/foo');
helper.general.expectToThrow(showCmd, error);
});
});
describe('when the component is AUTHORED', () => {
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/status.e2e.2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('bit status command', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/tag.e2e.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe('bit tag command', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/test.e2e.2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('bit test command', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
let clonedScopePath;
before(() => {
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/untag.e2e.2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ describe('bit untag command', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/untrack.e2e.2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe('bit untrack command', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
1 change: 1 addition & 0 deletions e2e/commands/watch.e2e.2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe('bit watch command', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});
after(() => {
helper.scopeHelper.destroy();
Expand Down
1 change: 1 addition & 0 deletions e2e/doctor/doctor-git-exec.e2e.3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ describe('bit doctor - git exec validation', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});

after(() => {
Expand Down
1 change: 1 addition & 0 deletions e2e/doctor/doctor-infra.e2e.3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ describe('bit doctor infra', function() {
let helper: Helper;
before(() => {
helper = new Helper();
helper.command.setFeatures('legacy-workspace-config');
});

after(() => {
Expand Down
5 changes: 5 additions & 0 deletions e2e/fixtures/extensions/gulp-ts/gulp-ts.manifest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
name: 'gulp-ts',
dependencies: [],
provider: async () => {}
};
2 changes: 1 addition & 1 deletion e2e/fixtures/extensions/gulp-ts/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./react.manifest');
module.exports = require('./gulp-ts.manifest');
22 changes: 0 additions & 22 deletions e2e/fixtures/extensions/gulp-ts/react.manifest.js

This file was deleted.

1 change: 1 addition & 0 deletions e2e/fixtures/extensions/react-create-template/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./react-create-template.manifest');
Loading

0 comments on commit 7231cf2

Please sign in to comment.