Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from teambit:master #6

Merged
merged 29 commits into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ffd560d
bump teambit version to 0.2.50 [skip ci]
Sep 12, 2023
b178601
ipc-events, clear SSE client cache after install (#7900)
davidfirst Sep 12, 2023
dceb4c8
add an e2e-test for #7896 - ignore component-issues for deleted comps…
davidfirst Sep 12, 2023
4cf61bf
fix(watch), default to not use fsevents until a new chokidar release …
davidfirst Sep 12, 2023
3750ccd
fix(ui server): open dev server in the default browser (#7899)
luvkapur Sep 12, 2023
d08e2e8
deprecate --multiple flag of bit sign (#7903)
davidfirst Sep 12, 2023
a462de0
bump @teambit/legacy version to 1.0.557 [skip ci]
Sep 13, 2023
cc589ed
bump teambit version to 0.2.51 [skip ci]
Sep 13, 2023
1817f1c
fix: bit new vue should work (#7894)
zkochan Sep 13, 2023
7b73c20
chore(deps) - remove core-js from react-env, replace deprecated babel…
GiladShoham Sep 13, 2023
0aae070
bump @teambit/legacy version to 1.0.558 [skip ci]
Sep 13, 2023
5359a03
bump teambit version to 0.2.52 [skip ci]
Sep 13, 2023
a899063
fix(schema): allow overriding context and tsserver path when extracti…
luvkapur Sep 13, 2023
86a87c3
fix(checkout), stop the checkout if some components failed (#7904)
davidfirst Sep 13, 2023
8f268d2
bump @teambit/legacy version to 1.0.559 [skip ci]
Sep 14, 2023
d8eaa73
bump teambit version to 0.2.53 [skip ci]
Sep 14, 2023
a241be7
chore(base template) - add eslint plugins to base template policy (#7…
NitsanCohen770 Sep 14, 2023
e14d9f5
feat(semantics/api-ref): API Transformer and Enrich Schemas with Addi…
luvkapur Sep 14, 2023
d50b48f
chore(deps) - update @babel/preset-react and @babel/preset-typesscrip…
GiladShoham Sep 14, 2023
1826893
outputs(generator) - Improve error message when a component template …
NitsanCohen770 Sep 14, 2023
ec9fda4
fix: yarn's peer deps should always be installed as deps of bit (#7909)
zkochan Sep 14, 2023
6a983f0
chore(deps) - remove @types/webpack-dev-server" (#7911)
GiladShoham Sep 14, 2023
b279fd5
bump @teambit/legacy version to 1.0.560 [skip ci]
Sep 14, 2023
c8b97aa
bump teambit version to 0.2.54 [skip ci]
Sep 14, 2023
b37fe9e
fix(_tag), show descriptive error when there is no scope available (#…
davidfirst Sep 14, 2023
53c3be3
bump teambit version to 0.2.55 [skip ci]
Sep 15, 2023
f3f6b36
fix(watch), use forked @teambit/chokidar and switch back to FsEvents …
davidfirst Sep 15, 2023
e8ed161
bump @teambit/legacy version to 1.0.561 [skip ci]
Sep 16, 2023
04120d4
bump teambit version to 0.2.56 [skip ci]
Sep 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
668 changes: 340 additions & 328 deletions .bitmap

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ module.exports = function (api) {
'babel-plugin-transform-typescript-metadata',
['@babel/plugin-proposal-decorators', { legacy: true }],
['@babel/plugin-transform-runtime'],
['@babel/plugin-proposal-object-rest-spread'],
['@babel/plugin-proposal-class-properties'],
['@babel/plugin-transform-object-rest-spread'],
['@babel/plugin-transform-class-properties'],
];

return {
Expand Down
4 changes: 4 additions & 0 deletions components/ui/inputs/lane-selector/lane-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ export function LaneSelector(props: LaneSelectorProps) {
const [allLanes, setAllLanes] = useState<LaneModel[]>([]);
const [loadingState, setLoading] = useState<boolean>(loading ?? false);

useEffect(() => {
if (hasMore !== hasMoreState) setHasMore(!!hasMore);
}, [hasMore]);

useEffect(() => {
if (loading !== loadingState) setLoading(!!loading);
}, [loading]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"presets": ["@babel/preset-env", "@babel/typescript"],
"plugins": [
"@babel/plugin-proposal-class-properties"
"@babel/plugin-transform-class-properties"
],
"sourceMaps": true
}
}
2 changes: 1 addition & 1 deletion e2e/harmony/babel.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('babel compiler', function () {
dependencies: {
'@babel/runtime': '^7.12.0',
'@babel/core': '7.11.6',
'@babel/preset-env': '7.11.5',
'@babel/preset-env': '7.22.15',
},
},
});
Expand Down
52 changes: 52 additions & 0 deletions e2e/harmony/delete.e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { IssuesClasses } from '@teambit/component-issues';
import { expect } from 'chai';
import Helper from '../../src/e2e-helper/e2e-helper';
import NpmCiRegistry, { supportNpmCiRegistryTesting } from '../npm-ci-registry';

describe('bit delete command', function () {
let helper: Helper;
let npmCiRegistry: NpmCiRegistry;
this.timeout(0);
before(() => {
helper = new Helper();
});
after(() => {
helper.scopeHelper.destroy();
});
/**
* comp1 -> comp2 -> comp3
* deleting comp2 and comp3, now comp1 has a missing dependency, installing comp2 as a package from main.
* all should be fine now. however, when snapping, it used to check for issues also the deleted components.
* this makes sure that deleted components are not part of issues-checking for both: bit snap and bit status.
*/
(supportNpmCiRegistryTesting ? describe : describe.skip)(
'deleting two components which are dependency of each other then installing the missing dep',
() => {
before(async () => {
helper = new Helper({ scopesOptions: { remoteScopeWithDot: true } });
helper.scopeHelper.setNewLocalAndRemoteScopes();
helper.fixtures.populateComponents(3);
npmCiRegistry = new NpmCiRegistry(helper);
npmCiRegistry.configureCiInPackageJsonHarmony();
await npmCiRegistry.init();
helper.command.tagAllComponents();
helper.command.export();
helper.command.createLane();
helper.command.snapAllComponentsWithoutBuild('--unmodified');
helper.command.export();
helper.command.softRemoveOnLane('comp3');
helper.command.softRemoveOnLane('comp2');
helper.command.install(helper.general.getPackageNameByCompName('comp2'));
});
after(() => {
npmCiRegistry.destroy();
});
it('bit status should not show RemovedDependencies issues', () => {
helper.command.expectStatusToNotHaveIssue(IssuesClasses.RemovedDependencies.name);
});
it('bit snap should fail due to removedDependencies error', () => {
expect(() => helper.command.snapAllComponentsWithoutBuild()).not.to.throw();
});
}
);
});
49 changes: 42 additions & 7 deletions e2e/harmony/lanes/bit-checkout-on-lanes.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ describe('bit checkout command when on a lane', function () {
});
describe('checkout head when some components are merge-pending', () => {
let originalWs: string;
let output: string;
let comp1Head: string;
let comp2RemoteHead: string;
before(() => {
Expand All @@ -32,18 +31,16 @@ describe('bit checkout command when on a lane', function () {
helper.command.snapComponentWithoutBuild('comp1', '--unmodified');
comp1Head = helper.command.getHeadOfLane('dev', 'comp1');
helper.command.import();
output = helper.command.checkoutHead();
});
it('should not allow checking out to head because it is merge pending', () => {
expect(output).to.have.string('component is merge-pending and cannot be checked out');
// should not allow checking out to head because it is merge pending
expect(() => helper.command.checkoutHead()).to.throw('component is merge-pending and cannot be checked out');
});
it('should leave the merge-pending component with the current version', () => {
const bitmap = helper.bitMap.read();
expect(bitmap.comp1.version).to.equal(comp1Head);
});
it('should update the non-merge-pending component to the latest', () => {
it('should not update the non-merge-pending component to the latest', () => {
const bitmap = helper.bitMap.read();
expect(bitmap.comp2.version).to.equal(comp2RemoteHead);
expect(bitmap.comp2.version).to.not.equal(comp2RemoteHead);
});
});
describe('checkout head on main when some components are not available on main', () => {
Expand Down Expand Up @@ -75,4 +72,42 @@ describe('bit checkout command when on a lane', function () {
expect(list).to.have.lengthOf(2);
});
});
describe('checkout when some are pending-merge', () => {
before(() => {
helper.scopeHelper.setNewLocalAndRemoteScopes();
helper.fixtures.populateComponents(3);
helper.command.tagWithoutBuild();
helper.command.export();

helper.command.createLane();
helper.command.snapAllComponentsWithoutBuild('--unmodified');
helper.command.export();

helper.command.switchLocalLane('main', '-x');
helper.command.tagWithoutBuild('comp1', '--unmodified');
helper.command.export();

helper.command.switchLocalLane('dev', '-x');
helper.command.mergeLane('main', '-x'); // comp1 is now pending-merge

const originalWs = helper.scopeHelper.cloneLocalScope();

helper.scopeHelper.reInitLocalScope();
helper.scopeHelper.addRemoteScope();
helper.command.importLane('dev');

helper.fs.outputFile(`${helper.scopes.remote}/comp3/index.js`, 'console.log("v2");');
helper.command.snapComponentWithoutBuild('comp3');
helper.command.export();

helper.scopeHelper.getClonedLocalScope(originalWs);
});
it('checkout head should stop with an error', () => {
expect(() => helper.command.checkoutHead('-x')).to.throw();
});
it('should not merged the head of other components', () => {
const comp3File = helper.fs.readFile('comp3/index.js');
expect(comp3File).to.not.include('v2');
});
});
});
22 changes: 9 additions & 13 deletions e2e/harmony/sign.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('sign command', function () {
helper.scopeHelper.addRemoteScope(undefined, helper.scopes.remotePath);
const ids = [`${helper.scopes.remote}/comp1`, `${helper.scopes.remote}/comp2`];
// console.log('sign-command', `bit sign ${ids.join(' ')}`);
signOutput = helper.command.sign(ids, '--push', helper.scopes.remotePath);
signOutput = helper.command.sign(ids, '--push --original-scope', helper.scopes.remotePath);
});
it('on the workspace, the build status should be pending', () => {
const comp1 = helper.command.catComponent(`${helper.scopes.remote}/comp1@latest`);
Expand Down Expand Up @@ -69,7 +69,7 @@ describe('sign command', function () {
helper.command.export();
const ids = [`${helper.scopes.remote}/comp1`, `${helper.scopes.remote}/comp2`];
// console.log('sign-command', `bit sign ${ids.join(' ')}`);
signOutput = helper.command.sign(ids, '', helper.scopes.remotePath);
signOutput = helper.command.sign(ids, '--original-scope', helper.scopes.remotePath);
});
it('on the workspace, the build status should be pending', () => {
const comp1 = helper.command.catComponent(`${helper.scopes.remote}/comp1@latest`);
Expand All @@ -92,11 +92,7 @@ describe('sign command', function () {
});
it('should sign the last successfully', () => {
helper.scopeHelper.addRemoteScope(helper.scopes.remotePath, signRemote.scopePath);
const signOutput = helper.command.sign(
[`${helper.scopes.remote}/comp1@${firstSnap}`],
`--multiple`,
signRemote.scopePath
);
const signOutput = helper.command.sign([`${helper.scopes.remote}/comp1@${firstSnap}`], '', signRemote.scopePath);
expect(signOutput).to.include('the following component(s) were already signed successfully');
expect(signOutput).to.include('no more components left to sign');
});
Expand All @@ -109,7 +105,7 @@ describe('sign command', function () {
helper.command.tagAllWithoutBuild();
helper.command.export();
// console.log('sign-command', `bit sign ${ids.join(' ')}`);
signOutput = helper.command.sign([], '', helper.scopes.remotePath);
signOutput = helper.command.sign([], '--original-scope', helper.scopes.remotePath);
});
it('should sign successfully', () => {
expect(signOutput).to.include('the following 2 component(s) were signed with build-status "succeed"');
Expand All @@ -130,7 +126,7 @@ describe('sign command', function () {
helper.scopeHelper.addRemoteScope(undefined, helper.scopes.remotePath);
const ids = [`${helper.scopes.remote}/bar`];
// console.log('sign-command', `bit sign ${ids.join(' ')}`);
signOutput = helper.command.sign(ids, '--always-succeed --push', helper.scopes.remotePath);
signOutput = helper.command.sign(ids, '--always-succeed --push --original-scope', helper.scopes.remotePath);
});
it('on the workspace, the build status should be pending', () => {
const comp1 = helper.command.catComponent(`${helper.scopes.remote}/bar@latest`);
Expand Down Expand Up @@ -181,7 +177,7 @@ describe('sign command', function () {
helper.scopeHelper.addRemoteScope(helper.scopes.remotePath, signRemote.scopePath);
signOutput = helper.command.sign(
[`${secondScopeName}/comp1@${snapHash}`],
`--multiple --lane ${helper.scopes.remote}/dev`,
`--lane ${helper.scopes.remote}/dev`,
signRemote.scopePath
);
expect(signOutput).to.include('the following 1 component(s) were signed with build-status "succeed"');
Expand All @@ -192,7 +188,7 @@ describe('sign command', function () {
helper.scopeHelper.addRemoteScope(helper.scopes.remotePath, signRemote.scopePath);
signOutput = helper.command.sign(
[`${secondScopeName}/comp1@${firstSnapHash}`],
`--multiple --lane ${helper.scopes.remote}/dev`,
`--lane ${helper.scopes.remote}/dev`,
signRemote.scopePath
);
expect(signOutput).to.include('the following 1 component(s) were signed with build-status "succeed"');
Expand All @@ -202,7 +198,7 @@ describe('sign command', function () {
helper.scopeHelper.addRemoteScope(helper.scopes.remotePath, signRemote.scopePath);
signOutput = helper.command.sign(
[`${secondScopeName}/comp1@${snapHash}`],
`--multiple --lane ${helper.scopes.remote}/dev --push`,
`--lane ${helper.scopes.remote}/dev --push`,
signRemote.scopePath
);
expect(signOutput).to.include('the following 1 component(s) were signed with build-status "succeed"');
Expand All @@ -229,7 +225,7 @@ describe('sign command', function () {
helper.scopeHelper.addRemoteScope(secondRemote.scopePath, signRemote.scopePath);
signOutput = helper.command.sign(
[`${helper.scopes.remote}/comp1`, `${secondRemote.scopeName}/comp2`],
'--multiple',
'',
signRemote.scopePath
);
});
Expand Down
5 changes: 3 additions & 2 deletions e2e/harmony/snap.e2e.2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,9 @@ describe('bit snap command', function () {
expect(status.mergePendingComponents).to.have.lengthOf(0);
});
it('should block checking out the component', () => {
const output = helper.command.checkoutVersion(firstSnap, 'bar/foo', '--auto-merge-resolve manual');
expect(output).to.have.string('is in during-merge state');
expect(() => helper.command.checkoutVersion(firstSnap, 'bar/foo', '--auto-merge-resolve manual')).to.throw(
'is in during-merge state'
);
});
describe('tagging or snapping the component', () => {
beforeEach(() => {
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@teambit/legacy",
"version": "1.0.556",
"version": "1.0.561",
"license": "Apache-2.0",
"main": "./dist/api.js",
"preferGlobal": true,
Expand Down Expand Up @@ -129,7 +129,7 @@
"cacache": "15.0.5",
"chalk": "2.4.2",
"checksum": "0.1.1",
"chokidar": "3.5.3",
"@teambit/chokidar": "3.5.6",
"cli-spinners": "1.3.1",
"comment-json": "3.0.3",
"core-js": "3.9.0",
Expand Down Expand Up @@ -231,14 +231,14 @@
},
"devDependencies": {
"@babel/cli": "7.19.3",
"@babel/plugin-proposal-class-properties": "7.18.6",
"@babel/plugin-transform-class-properties": "7.22.5",
"@babel/plugin-proposal-decorators": "7.20.0",
"@babel/plugin-proposal-object-rest-spread": "7.19.4",
"@babel/plugin-transform-object-rest-spread": "7.22.15",
"@babel/plugin-transform-modules-commonjs": "7.19.6",
"@babel/plugin-transform-runtime": "7.19.6",
"@babel/preset-env": "7.19.4",
"@babel/preset-react": "7.18.6",
"@babel/preset-typescript": "7.18.6",
"@babel/preset-env": "7.22.15",
"@babel/preset-react": "7.22.15",
"@babel/preset-typescript": "7.22.15",
"@babel/register": "7.18.9",
"@types/bluebird": "3.5.33",
"@types/cacache": "12.0.1",
Expand Down
Loading