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 src/prompts into a new component teambit.legacy/cli/prompts #9021

Merged
merged 2 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
8 changes: 8 additions & 0 deletions .bitmap
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,14 @@
"mainFile": "index.ts",
"rootDir": "scopes/toolbox/tables/cli-table"
},
"cli/prompts": {
"name": "cli/prompts",
"scope": "",
"version": "",
"defaultScope": "teambit.legacy",
"mainFile": "index.ts",
"rootDir": "components/legacy/cli/prompts"
},
"cli/webpack-events-listener": {
"name": "cli/webpack-events-listener",
"scope": "teambit.preview",
Expand Down
2 changes: 1 addition & 1 deletion components/legacy/analytics/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
CFG_USER_NAME_KEY,
DEFAULT_BIT_ENV,
} from '@teambit/legacy/dist/constants';
import { analyticsPrompt, errorReportingPrompt } from '@teambit/legacy/dist/prompts';
import { analyticsPrompt, errorReportingPrompt } from '@teambit/legacy.cli.prompts';

const LEVEL = {
DEBUG: 'debug',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ const analyticsPrompt = prompt(analyticsSchema);
const errorReportingPrompt = prompt(errorReportingSchema);

export { approveOperation, resolveConflictPrompt, analyticsPrompt, errorReportingPrompt };
export { PromptCanceled } from './exceptions';
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import prompt from 'prompt';

import loader from '../cli/loader';
import loader from '@teambit/legacy/dist/cli/loader';
import { PromptCanceled } from './exceptions';

const DEFAULT_PROMPT_MSG = '';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BASE_COMMUNITY_DOMAIN } from '../../constants';
import { BASE_COMMUNITY_DOMAIN } from '@teambit/legacy/dist/constants';

/**
* schema for analytics.
Expand Down
2 changes: 1 addition & 1 deletion scopes/component/merging/merge-version/merge-version.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import chalk from 'chalk';
import { BitError } from '@teambit/bit-error';
import { resolveConflictPrompt } from '@teambit/legacy/dist/prompts';
import { resolveConflictPrompt } from '@teambit/legacy.cli.prompts';

export const mergeOptionsCli = { o: 'ours', t: 'theirs', m: 'manual' };
export const MergeOptions = { ours: 'ours', theirs: 'theirs', manual: 'manual' };
Expand Down
2 changes: 1 addition & 1 deletion scopes/lanes/lanes/lane.cmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { OutsideWorkspaceError, Workspace } from '@teambit/workspace';
import { Command, CommandOptions } from '@teambit/cli';
import { LaneData, serializeLaneData } from '@teambit/legacy/dist/scope/lanes/lanes';
import { BitError } from '@teambit/bit-error';
import { approveOperation } from '@teambit/legacy/dist/prompts';
import { approveOperation } from '@teambit/legacy.cli.prompts';
import { COMPONENT_PATTERN_HELP, DEFAULT_CLOUD_DOMAIN } from '@teambit/legacy/dist/constants';
import { CreateLaneOptions, LanesMain } from './lanes.main.runtime';
import { SwitchCmd } from './switch.cmd';
Expand Down
2 changes: 1 addition & 1 deletion scopes/lanes/merge-lanes/last-merged.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import fs from 'fs-extra';
import yesno from 'yesno';
import chalk from 'chalk';
import { BitMap } from '@teambit/legacy.bit-map';
import { PromptCanceled } from '@teambit/legacy/dist/prompts/exceptions';
import { PromptCanceled } from '@teambit/legacy.cli.prompts';
import { ScopeMain } from '@teambit/scope';
import { Lane } from '@teambit/legacy/dist/scope/models';
import { StagedSnaps } from '@teambit/legacy/dist/scope/staged-snaps';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs from 'fs-extra';
import { join } from 'path';
import globby from 'globby';
import chalk from 'chalk';
import { PromptCanceled } from '@teambit/legacy/dist/prompts/exceptions';
import { PromptCanceled } from '@teambit/legacy.cli.prompts';
import pMapSeries from 'p-map-series';
import { ConsumerNotFound } from '@teambit/legacy/dist/consumer/exceptions';
import yesno from 'yesno';
Expand Down