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

refactor, extract legacy timer into a new component teambit.toolbox/time/timer #9017

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 9 additions & 1 deletion .bitmap
Original file line number Diff line number Diff line change
Expand Up @@ -2157,6 +2157,14 @@
"mainFile": "index.ts",
"rootDir": "scopes/toolbox/time/time-format"
},
"time/timer": {
"name": "time/timer",
"scope": "",
"version": "",
"defaultScope": "teambit.toolbox",
"mainFile": "index.ts",
"rootDir": "scopes/toolbox/time/timer"
},
"tracker": {
"name": "tracker",
"scope": "teambit.component",
Expand Down Expand Up @@ -2761,4 +2769,4 @@
}
},
"$schema-version": "17.0.0"
}
}
2 changes: 1 addition & 1 deletion scopes/defender/formatter/format.cmd.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TimerResponse, Timer } from '@teambit/legacy/dist/toolbox/timer';
import { TimerResponse, Timer } from '@teambit/toolbox.time.timer';
import { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';
import { Command, CommandOptions } from '@teambit/cli';
import { ComponentFactory, ComponentID } from '@teambit/component';
Expand Down
2 changes: 1 addition & 1 deletion scopes/defender/linter/lint.cmd.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TimerResponse, Timer } from '@teambit/legacy/dist/toolbox/timer';
import { TimerResponse, Timer } from '@teambit/toolbox.time.timer';
import { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';
import { Command, CommandOptions } from '@teambit/cli';
import { ComponentFactory, ComponentID } from '@teambit/component';
Expand Down
2 changes: 1 addition & 1 deletion scopes/defender/tester/test.cmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Command, CommandOptions } from '@teambit/cli';
import chalk from 'chalk';
import { Logger } from '@teambit/logger';
import { OutsideWorkspaceError, Workspace } from '@teambit/workspace';
import { Timer } from '@teambit/legacy/dist/toolbox/timer';
import { Timer } from '@teambit/toolbox.time.timer';
import { COMPONENT_PATTERN_HELP } from '@teambit/legacy/dist/constants';
import type { TesterMain } from './tester.main.runtime';

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { expect } from 'chai';

import { sleep } from '../sleep';
import { TimerAlreadyRunning, TimerNotStarted } from './exceptions';
import { Timer } from './timer';

async function sleep(time: number) {
await new Promise((resolve) => setTimeout(resolve, time));
}

describe('Timer', () => {
it('should stop after 300ms', async () => {
const timer = Timer.create();
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion src/toolbox/sleep/index.ts

This file was deleted.

7 changes: 0 additions & 7 deletions src/toolbox/sleep/sleep.ts

This file was deleted.