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

move loader from legacy to harmony #5221

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions .bitmap
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,12 @@
"mainFile": "index.ts",
"rootDir": "scopes/harmony/modules/resolved-component"
},
"modules/cli/loader": {
"scope": "",
"version": "",
"mainFile": "index.ts",
"rootDir": "scopes/harmony/modules/cli/loader"
},
"modules/style-regexps": {
"scope": "teambit.webpack",
"version": "0.0.131",
Expand Down
2 changes: 1 addition & 1 deletion scopes/harmony/bit/load-bit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import { ExtensionDataList } from '@teambit/legacy/dist/consumer/config';
import WorkspaceConfig from '@teambit/legacy/dist/consumer/config/workspace-config';
import { BitIds } from '@teambit/legacy/dist/bit-id';
import { propogateUntil as propagateUntil } from '@teambit/legacy/dist/utils';
import loader from '@teambit/legacy/dist/cli/loader';
import loader from '@teambit/harmony.modules.cli.loader';
import { readdir } from 'fs-extra';
import { resolve } from 'path';
import { manifestsMap } from './manifests';
Expand Down
2 changes: 1 addition & 1 deletion scopes/harmony/cli/cli-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Command } from '@teambit/legacy/dist/cli/command';
import { GroupsType } from '@teambit/legacy/dist/cli/command-groups';
import { loadConsumerIfExist } from '@teambit/legacy/dist/consumer';
import logger from '@teambit/legacy/dist/logger/logger';
import loader from '@teambit/legacy/dist/cli/loader';
import loader from '@teambit/harmony.modules.cli.loader';
import chalk from 'chalk';
import { getCommandId } from './get-command-id';
import { formatHelp } from './help';
Expand Down
2 changes: 1 addition & 1 deletion scopes/harmony/cli/command-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { migrate } from '@teambit/legacy/dist/api/consumer';
import logger, { LoggerLevel } from '@teambit/legacy/dist/logger/logger';
import { CLIArgs, Command, Flags, RenderResult } from '@teambit/legacy/dist/cli/command';
import { parseCommandName } from '@teambit/legacy/dist/cli/command-registry';
import loader from '@teambit/legacy/dist/cli/loader';
import loader from '@teambit/harmony.modules.cli.loader';
import { handleErrorAndExit } from '@teambit/legacy/dist/cli/handle-errors';
import { TOKEN_FLAG_NAME } from '@teambit/legacy/dist/constants';
import globalFlags from '@teambit/legacy/dist/cli/global-flags';
Expand Down
2 changes: 1 addition & 1 deletion scopes/harmony/logger/logger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import loader from '@teambit/legacy/dist/cli/loader';
import loader from '@teambit/harmony.modules.cli.loader';
import logger, { IBitLogger } from '@teambit/legacy/dist/logger/logger';
import chalk from 'chalk';
import stc from 'string-to-color';
Expand Down
3 changes: 3 additions & 0 deletions scopes/harmony/modules/cli/loader/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import loader from './loader';

export default loader;
Comment on lines +1 to +3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's also make at least a doc file for this

3 changes: 3 additions & 0 deletions scopes/harmony/modules/cli/loader/loader.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import loader from '@teambit/legacy/dist/cli/loader';
Copy link
Member

@GiladShoham GiladShoham Jan 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to move the real loader here, we don't allow regular components (which are not aspects) to be dependent on @teambit/legacy
you can by the way just export the loader from another temp workspace, then in this pr only start using it (also in the legacy code)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't do that, because if there are 2 instances of the loader it creates bugs in the cli

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why can't we take the code from src/cli/loader/loader.ts into the loader here
and replace the code in the src/cli/loader/loader.ts to something like
export loader as default from '@teambit/harmony.modules.cli.loader';

And of course, add it to the package.jon once we export


export default loader;
2 changes: 1 addition & 1 deletion scopes/workspace/workspace/watch/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { dirname, sep } from 'path';
import { difference } from 'lodash';
import { ComponentID } from '@teambit/component';
import { BitId } from '@teambit/legacy-bit-id';
import loader from '@teambit/legacy/dist/cli/loader';
import loader from '@teambit/harmony.modules.cli.loader';
import { BIT_MAP, COMPONENT_ORIGINS } from '@teambit/legacy/dist/constants';
import { Consumer } from '@teambit/legacy/dist/consumer';
import logger from '@teambit/legacy/dist/logger/logger';
Expand Down