diff --git a/.bitmap b/.bitmap index 2df2a7ffcefd..f30e1c53195f 100644 --- a/.bitmap +++ b/.bitmap @@ -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", diff --git a/components/legacy/analytics/analytics.ts b/components/legacy/analytics/analytics.ts index 84964d57838e..6428a7fd0a4b 100644 --- a/components/legacy/analytics/analytics.ts +++ b/components/legacy/analytics/analytics.ts @@ -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', diff --git a/src/prompts/exceptions/index.ts b/components/legacy/cli/prompts/exceptions/index.ts similarity index 100% rename from src/prompts/exceptions/index.ts rename to components/legacy/cli/prompts/exceptions/index.ts diff --git a/src/prompts/exceptions/prompt-canceled.ts b/components/legacy/cli/prompts/exceptions/prompt-canceled.ts similarity index 100% rename from src/prompts/exceptions/prompt-canceled.ts rename to components/legacy/cli/prompts/exceptions/prompt-canceled.ts diff --git a/src/prompts/index.ts b/components/legacy/cli/prompts/index.ts similarity index 92% rename from src/prompts/index.ts rename to components/legacy/cli/prompts/index.ts index 335be9438099..e5e531acfd84 100644 --- a/src/prompts/index.ts +++ b/components/legacy/cli/prompts/index.ts @@ -10,3 +10,4 @@ const analyticsPrompt = prompt(analyticsSchema); const errorReportingPrompt = prompt(errorReportingSchema); export { approveOperation, resolveConflictPrompt, analyticsPrompt, errorReportingPrompt }; +export { PromptCanceled } from './exceptions'; diff --git a/src/prompts/prompt.ts b/components/legacy/cli/prompts/prompt.ts similarity index 93% rename from src/prompts/prompt.ts rename to components/legacy/cli/prompts/prompt.ts index 1bf1a7a33b96..41a5bbf2556f 100644 --- a/src/prompts/prompt.ts +++ b/components/legacy/cli/prompts/prompt.ts @@ -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 = ''; diff --git a/src/prompts/schemas/analytics-reporting.ts b/components/legacy/cli/prompts/schemas/analytics-reporting.ts similarity index 92% rename from src/prompts/schemas/analytics-reporting.ts rename to components/legacy/cli/prompts/schemas/analytics-reporting.ts index 1df9d7f8f11b..11939742b99f 100644 --- a/src/prompts/schemas/analytics-reporting.ts +++ b/components/legacy/cli/prompts/schemas/analytics-reporting.ts @@ -1,4 +1,4 @@ -import { BASE_COMMUNITY_DOMAIN } from '../../constants'; +import { BASE_COMMUNITY_DOMAIN } from '@teambit/legacy/dist/constants'; /** * schema for analytics. diff --git a/src/prompts/schemas/approve-operation.ts b/components/legacy/cli/prompts/schemas/approve-operation.ts similarity index 100% rename from src/prompts/schemas/approve-operation.ts rename to components/legacy/cli/prompts/schemas/approve-operation.ts diff --git a/src/prompts/schemas/error-reporting.ts b/components/legacy/cli/prompts/schemas/error-reporting.ts similarity index 100% rename from src/prompts/schemas/error-reporting.ts rename to components/legacy/cli/prompts/schemas/error-reporting.ts diff --git a/src/prompts/schemas/resolve-conflict.ts b/components/legacy/cli/prompts/schemas/resolve-conflict.ts similarity index 100% rename from src/prompts/schemas/resolve-conflict.ts rename to components/legacy/cli/prompts/schemas/resolve-conflict.ts diff --git a/scopes/component/merging/merge-version/merge-version.ts b/scopes/component/merging/merge-version/merge-version.ts index d1328373f010..3e35ce71603a 100644 --- a/scopes/component/merging/merge-version/merge-version.ts +++ b/scopes/component/merging/merge-version/merge-version.ts @@ -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' }; diff --git a/scopes/lanes/lanes/lane.cmd.ts b/scopes/lanes/lanes/lane.cmd.ts index a98d3990da67..575198902519 100644 --- a/scopes/lanes/lanes/lane.cmd.ts +++ b/scopes/lanes/lanes/lane.cmd.ts @@ -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'; diff --git a/scopes/lanes/merge-lanes/last-merged.ts b/scopes/lanes/merge-lanes/last-merged.ts index 55ada95a5ffd..ed8772251005 100644 --- a/scopes/lanes/merge-lanes/last-merged.ts +++ b/scopes/lanes/merge-lanes/last-merged.ts @@ -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'; diff --git a/scopes/workspace/workspace-config-files/workspace-config-files.main.runtime.ts b/scopes/workspace/workspace-config-files/workspace-config-files.main.runtime.ts index 92f63db37862..f3d38606d90d 100644 --- a/scopes/workspace/workspace-config-files/workspace-config-files.main.runtime.ts +++ b/scopes/workspace/workspace-config-files/workspace-config-files.main.runtime.ts @@ -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';