-
-
Notifications
You must be signed in to change notification settings - Fork 194
chore: clean unused code #4314
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
Merged
Merged
chore: clean unused code #4314
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The COMMAND_HELP_FILE_NAME had been used in the past to show the name of the file where the help of all commands is located. Since several years such file does not exist, so remove the variable and its usage in the code.
AB_SERVER and AB_SERVER_PROTO properties were used in the past, we do not need them anymore.
Remove ConfigBase and StaticConfigBase classes to simplify the usage of both `$staticConfig` and `$config` - we do not need the base classes - just move the implementation to the current inheritors
Move deviceEmitter out of appbuilder dir. Also remove all `companion` related services as they are not required anymore. Move the device-log-provider out of appbuilder dir. The purpose of the file is to be used instead of the original deviceLogProvider when CLI is used as a library. This provider emits the device logs instead of writing them on the stdout. To separate the two log providers, rename the one coming from appbuilder dir to `device-log-emitter`. Keep the registration in the `$injector` to be `deviceLogProvider` as it is the only way to keep the current behavior when CLI is used as a library.
Remove deviceAppDataFactory and deviceAppDataProviders which were used in old LiveSync logic.
Remove `$projectConstants` as it has been used in the past, but we no longer need it.
`typeScriptService` was required in the past for `Proton` product (Universal AppBuilder Desktop Client). As this product does not exist anymore, we do not need this service.
Remove `printPluginsService`, `npmPluginsService` and `npmService` - they were used for a product that is no longer supported - Proton.
The implementation had been used for old product that we do not support anymore.
Remove pathFilteringService as it was used in a product that we no longer support - Proton.
The implementation has been used for a product that is no longer supported - Proton.
Remove Project.IProjectCapabilities interface and all of its implementations. They were used for a product that is no longer supported - Proton.
Remove all `Project.` interfaces and their implementations as they were used in a product that is no longer supported - Proton.
Remove all LiveSync related services from appbuilder dir (and the whole dir). Cleanup interfaces and classes used only in the deleted files.
Remove unused `isLiveSyncSupported` methods, which were checking if the application can be LiveSynced via AppBuilder's LiveSync plugin that is no longer supported.
In older implementation there was a requirement to have different capabilities for each platform (Android, iOS, WP8) like deploy via cable, deploy over wi-fi with companion app, etc. This code is no longer used, so delete the capabilities implementation from the codebase.
There's no such module `nativescript-cli` and `AppDataProvider`, so the `$injector.require` is just incorrect and not needed.
The `commandsServiceProvider` has been used when code was shared between AppBuilder CLI and NativeScript CLI. At the moment, we do not share the code with any other library, so we can safely remove the `commandsServiceProvider` as it is not used in NativeScript CLI.
Remove `dynamicHelpService` and `dynamicHelpProvider` - they were used when the code between AppBuilder CLI and NativeScript CLI was shared. The idea of the service was to get the help content of ScreenBuilder commands. Now we do not need such logic, so just remove it and clean the code from the unused interfaces.
Remove `parse5.d.ts` as this package is not used by CLI.
Clean some unused interfaces
Remove `gaze` dependency, which was used for the Cancellation service - use chokidar instead as we already use it for LiveSync watcher and there's no point of having two different watchers.
DimitarTachev
approved these changes
Jan 28, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥇 🥇 🥇
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remove unused code and interfaces, particularly the
lib/common/appbuilder
directory and several other files and interfaces related to it.Notable changes:
lib/common/appbuilder
directory.d.ts
filesnpm-service
and relatednpm search
services fromlib/common
- they were used in the past fortns plugin search
commandisLiveSyncSupported
methods and properties - they were used in the past for AppBuilder and had been implemented in the DeviceApplicationManagers, DevicesService, etc.mobile-platform-capabilities
and related logic - in AppBuilder there was support for LiveSync over the network and some other different use cases, so we had an object containing the information what is supported for each OS. Now, we do not need this logic.commandsServiceProvider
- it was used in AppBuilder to provide the dynamic ScreenBuilder commands. Now we do not have dynamic commandsdynamicHelpService
anddynamicHelpProvider
- again used in the past for AppBuilder and ScreenBuildergaze
as a dependency - it is currently used in the Cancellation service, but it can be replaced with chokidar - we do not need two file system watchers as dependenciesPR Checklist