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

repo: cleanup dependencies #10717

Merged
merged 1 commit into from
Feb 17, 2022
Merged

repo: cleanup dependencies #10717

merged 1 commit into from
Feb 17, 2022

Conversation

vince-fugnitto
Copy link
Member

What it does

The pull-request includes the following changes:

  • removes any unused dependencies (dependencies declared but not actually used).
  • adds any dependencies which are used but never declared in the respective package.json.

How to test

  • confirm that the repo builds, and the application starts normally
  • confirm that the tests pass
  • confirm that the removed dependencies aren't actually used for the given extension

Review checklist

Reminder for reviewers

Signed-off-by: vince-fugnitto [email protected]

@vince-fugnitto vince-fugnitto added quality issues related to code and application quality dependencies pull requests that update a dependency file labels Feb 7, 2022
@vince-fugnitto vince-fugnitto self-assigned this Feb 7, 2022
@msujew msujew self-requested a review February 7, 2022 16:53
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

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

I took this opportunity to run depcheck on our project. Running it just on the core package gave me this output:

Unused dependencies
* @babel/runtime
* es6-promise
Missing dependencies
* chai: ./src/node/backend-application-config-provider.spec.ts
* temp: ./src/node/logger-cli-contribution.spec.ts
* sinon: ./src/node/logger-cli-contribution.spec.ts
* electron-store: ./src/electron-main/electron-main-application.ts
* vscode-jsonrpc: ./src/electron-main/messaging/electron-messaging-service.ts
* electron: ./src/electron-browser/electron-clipboard-service.ts
* native-keymap: ./src/common/keyboard/keyboard-layout-provider.ts
* jsdom: ./src/browser/test/jsdom.ts
* vscode-languageserver-types: ./shared/vscode-languageserver-types/index.d.ts

While es6-promise is a false positive, since it's invoked in generated js code, everything else seems to be correct. (I tested removing @babel/runtime) I believe we can find more unnecessary dependencies if you run that on every package. WDYT?

@vince-fugnitto
Copy link
Member Author

vince-fugnitto commented Feb 7, 2022

I took this opportunity to run depcheck on our project. Running it just on the core package gave me this output:

@msujew right, I went over the repo with depcheck to help with the pull-request 👍

I confirmed I see the same for @theia/core but they are devDependencies part of the root package.json (and don't need to be cleaned up as far as I am aware). Others like vscode-languageserver-types are false positives since vscode-languageserver-protocol pulls it and we do not want to pull it ourselves at an incompatible version #10500.

@vince-fugnitto
Copy link
Member Author

Here is the output of depcheck across the repo after the pull-request:

$ lerna exec depcheck --no-bail --parallel
depcheck.txt
@theia/ext-scripts: Missing dependencies
@theia/ext-scripts: * glob: ./theia-ts-clean.js
@theia/ext-scripts: * debug: ./theia-ts-clean.js
@theia/ext-scripts: * nsfw: ./theia-ts-clean.js
@theia/ext-scripts: * yargs: ./theia-ts-clean.js
@theia/eslint-plugin: Unused dependencies
@theia/eslint-plugin: * @theia/core
@theia/eslint-plugin: * @theia/ext-scripts
@theia/electron: No depcheck issue
@theia/example-electron: Unused dependencies
@theia/example-electron: * @theia/api-samples
@theia/example-electron: * @theia/bulk-edit
@theia/example-electron: * @theia/callhierarchy
@theia/example-electron: * @theia/console
@theia/example-electron: * @theia/core
@theia/example-electron: * @theia/debug
@theia/example-electron: * @theia/editor
@theia/example-electron: * @theia/editor-preview
@theia/example-electron: * @theia/electron
@theia/example-electron: * @theia/external-terminal
@theia/example-electron: * @theia/file-search
@theia/example-electron: * @theia/filesystem
@theia/example-electron: * @theia/getting-started
@theia/example-electron: * @theia/git
@theia/example-electron: * @theia/keymaps
@theia/example-electron: * @theia/markers
@theia/example-electron: * @theia/messages
@theia/example-electron: * @theia/metrics
@theia/example-electron: * @theia/mini-browser
@theia/example-electron: * @theia/monaco
@theia/example-electron: * @theia/navigator
@theia/example-electron: * @theia/outline-view
@theia/example-electron: * @theia/output
@theia/example-electron: * @theia/plugin-dev
@theia/example-electron: * @theia/plugin-ext
@theia/example-electron: * @theia/plugin-ext-vscode
@theia/example-electron: * @theia/preferences
@theia/example-electron: * @theia/preview
@theia/example-electron: * @theia/process
@theia/example-electron: * @theia/property-view
@theia/example-electron: * @theia/scm
@theia/example-electron: * @theia/scm-extra
@theia/example-electron: * @theia/search-in-workspace
@theia/example-electron: * @theia/task
@theia/example-electron: * @theia/terminal
@theia/example-electron: * @theia/timeline
@theia/example-electron: * @theia/typehierarchy
@theia/example-electron: * @theia/userstorage
@theia/example-electron: * @theia/variable-resolver
@theia/example-electron: * @theia/vsx-registry
@theia/example-electron: * @theia/workspace
@theia/example-electron: Missing dependencies
@theia/example-electron: * chai: ./test/basic-example.espec.ts
@theia/ovsx-client: Missing dependencies
@theia/ovsx-client: * chai: ./src/ovsx-client.spec.ts
@theia/ffmpeg: Missing dependencies
@theia/ffmpeg: * electron: ./src/ffmpeg.ts
@theia/ffmpeg: * fs-extra: ./src/hash.ts
@theia/localization-manager: No depcheck issue
@theia/re-exports: Missing dependencies
@theia/re-exports: * chai: ./src/utility.spec.ts
@theia/application-package: Missing dependencies
@theia/application-package: * temp: ./src/application-package.spec.ts
@theia/application-package: * sinon: ./src/application-package.spec.ts
@theia/application-package: * electron: ./src/application-props.ts
@theia/userstorage: No depcheck issue
@theia/cli: No depcheck issue
@theia/application-manager: Unused dependencies
@theia/application-manager: * @babel/core
@theia/application-manager: * @babel/plugin-transform-classes
@theia/application-manager: * @babel/plugin-transform-runtime
@theia/application-manager: * @babel/preset-env
@theia/application-manager: * babel-loader
@theia/application-manager: * buffer
@theia/application-manager: * circular-dependency-plugin
@theia/application-manager: * compression-webpack-plugin
@theia/application-manager: * copy-webpack-plugin
@theia/application-manager: * css-loader
@theia/application-manager: * electron-rebuild
@theia/application-manager: * ignore-loader
@theia/application-manager: * less
@theia/application-manager: * node-abi
@theia/application-manager: * setimmediate
@theia/application-manager: * source-map-loader
@theia/application-manager: * source-map-support
@theia/application-manager: * style-loader
@theia/application-manager: * umd-compat-loader
@theia/application-manager: * webpack
@theia/application-manager: * webpack-cli
@theia/application-manager: * worker-loader
@theia/application-manager: Unused devDependencies
@theia/application-manager: * @types/node-abi
@theia/application-manager: Missing dependencies
@theia/application-manager: * electron: ./src/application-package-manager.ts
@theia/external-terminal: No depcheck issue
@theia/getting-started: No depcheck issue
@theia/metrics: Missing dependencies
@theia/metrics: * chai: ./src/node/prometheus.spec.ts
@theia/editor-preview: No depcheck issue
@theia/api-tests: Missing dependencies
@theia/api-tests: * @theia/api-samples: ./src/contribution-filter.spec.js
@theia/api-tests: * @theia/file-search: ./src/file-search.spec.js
@theia/api-tests: * @theia/editor: ./src/find-replace.spec.js
@theia/api-tests: * @theia/workspace: ./src/find-replace.spec.js
@theia/api-tests: * @theia/navigator: ./src/find-replace.spec.js
@theia/api-tests: * @theia/terminal: ./src/keybindings.spec.js
@theia/api-tests: * @theia/filesystem: ./src/launch-preferences.spec.js
@theia/api-tests: * @theia/monaco: ./src/launch-preferences.spec.js
@theia/api-tests: * @theia/preferences: ./src/launch-preferences.spec.js
@theia/api-tests: * @theia/callhierarchy: ./src/menus.spec.js
@theia/api-tests: * @theia/scm: ./src/menus.spec.js
@theia/api-tests: * @theia/scm-extra: ./src/menus.spec.js
@theia/api-tests: * @theia/outline-view: ./src/menus.spec.js
@theia/api-tests: * @theia/output: ./src/menus.spec.js
@theia/api-tests: * @theia/plugin-ext: ./src/menus.spec.js
@theia/api-tests: * @theia/markers: ./src/menus.spec.js
@theia/api-tests: * @theia/property-view: ./src/menus.spec.js
@theia/api-tests: * @theia/search-in-workspace: ./src/menus.spec.js
@theia/api-tests: * @theia/task: ./src/task-configurations.spec.js
@theia/bulk-edit: Missing dependencies
@theia/bulk-edit: * chai: ./lib/browser/bulk-edit-tree/bulk-edit-tree.spec.js
@theia/bulk-edit: * sinon: ./lib/browser/bulk-edit-tree/bulk-edit-tree.spec.js
@theia/bulk-edit: * @theia/application-package: ./lib/browser/bulk-edit-tree/bulk-edit-tree.spec.js
@theia/console: No depcheck issue
@theia/file-search: Missing dependencies
@theia/file-search: * chai: ./src/node/file-search-service-impl.spec.ts
@theia/typehierarchy: No depcheck issue
@theia/plugin: No depcheck issue
@theia/messages: Missing dependencies
@theia/messages: * chai: ./src/browser/notification-content-renderer.spec.ts
@theia/keymaps: Unused devDependencies
@theia/keymaps: * @types/temp
@theia/keymaps: * temp
@theia/outline-view: No depcheck issue
@theia/api-samples: No depcheck issue
@theia/timeline: No depcheck issue
@theia/variable-resolver: Missing dependencies
@theia/variable-resolver: * @theia/application-package: ./src/browser/variable-resolver-frontend-contribution.spec.ts
@theia/variable-resolver: * chai: ./src/browser/variable-resolver-frontend-contribution.spec.ts
@theia/scm-extra: No depcheck issue
@theia/plugin-ext-vscode: Unused dependencies
@theia/plugin-ext-vscode: * @theia/plugin
@theia/plugin-ext-vscode: * @types/request
@theia/plugin-ext-vscode: * request
@theia/preview: Unused dependencies
@theia/preview: * @types/highlight.js
@theia/preview: * @types/markdown-it-anchor
@theia/preview: Missing dependencies
@theia/preview: * @theia/application-package: ./src/browser/markdown/markdown-preview-handler.spec.ts
@theia/preview: * chai: ./src/browser/markdown/markdown-preview-handler.spec.ts
@theia/preview: * chai-string: ./src/browser/markdown/markdown-preview-handler.spec.ts
@theia/callhierarchy: No depcheck issue
@theia/output: Missing dependencies
@theia/output: * chai: ./src/common/output-uri.spec.ts
@theia/plugin-metrics: No depcheck issue
@theia/property-view: Missing dependencies
@theia/property-view: * chai: ./src/browser/resource-property-view/resource-property-data-service.spec.ts
@theia/property-view: * @theia/application-package: ./src/browser/resource-property-view/resource-property-data-service.spec.ts
@theia/plugin-dev: No depcheck issue
@theia/mini-browser: No depcheck issue
@theia/markers: Missing dependencies
@theia/markers: * @theia/application-package: ./lib/browser/marker-tree-label-provider.spec.js
@theia/markers: * chai: ./lib/browser/marker-tree-label-provider.spec.js
@theia/markers: * temp: ./lib/browser/marker-tree-label-provider.spec.js
@theia/playwright: Unused devDependencies
@theia/playwright: * allure-playwright
@theia/process: Missing dependencies
@theia/process: * chai: ./src/node/multi-ring-buffer.spec.ts
@theia/process: * temp: ./src/node/raw-process.spec.ts
@theia/process: * chalk: ./src/common/shell-command-builder.slow-spec.ts
@theia/vsx-registry: No depcheck issue
@theia/navigator: Missing dependencies
@theia/navigator: * @theia/application-package: ./src/browser/navigator-diff.spec.ts
@theia/navigator: * chai: ./src/browser/navigator-diff.spec.ts
@theia/terminal: Missing dependencies
@theia/terminal: * chai: ./src/node/shell-terminal-server.spec.ts
@theia/editor: Missing dependencies
@theia/editor: * chai: ./src/browser/navigation/navigation-location-service.spec.ts
@theia/search-in-workspace: Missing dependencies
@theia/search-in-workspace: * temp: ./src/node/ripgrep-search-in-workspace-server.slow-spec.ts
@theia/search-in-workspace: * chai: ./src/node/ripgrep-search-in-workspace-server.slow-spec.ts
@theia/scm: Unused dependencies
@theia/scm: * @types/diff
@theia/scm: Missing dependencies
@theia/scm: * chai: ./src/browser/dirty-diff/content-lines.spec.ts
@theia/scm: * chai-string: ./src/browser/dirty-diff/content-lines.spec.ts
@theia/workspace: Missing dependencies
@theia/workspace: * @theia/application-package: ./src/browser/workspace-frontend-contribution.spec.ts
@theia/workspace: * chai: ./src/browser/workspace-frontend-contribution.spec.ts
@theia/workspace: * sinon: ./lib/browser/workspace-uri-contribution.spec.js
@theia/workspace: * temp: ./lib/browser/workspace-uri-contribution.spec.js
@theia/preferences: Missing dependencies
@theia/preferences: * @theia/application-package: ./src/browser/util/preference-tree-label-provider.spec.ts
@theia/preferences: * chai: ./src/browser/util/preference-tree-label-provider.spec.ts
@theia/monaco: Unused dependencies
@theia/monaco: * @theia/monaco-editor-core
@theia/task: Missing dependencies
@theia/task: * chai: ./src/node/task-problem-collector.spec.ts
@theia/task: * reflect-metadata: ./lib/node/task-server.slow-spec.d.ts
@theia/git: Unused dependencies
@theia/git: * @types/diff
@theia/git: * diff
@theia/git: * octicons
@theia/git: * ts-md5
@theia/git: Missing dependencies
@theia/git: * temp: ./src/node/dugite-git-watcher.slow-spec.ts
@theia/git: * chai: ./src/node/dugite-git-watcher.slow-spec.ts
@theia/git: * @theia/application-package: ./lib/browser/git-repository-provider.spec.js
@theia/git: * sinon: ./lib/browser/git-repository-provider.spec.js
@theia/filesystem: Missing dependencies
@theia/filesystem: * temp: ./src/node/nsfw-watcher/nsfw-filesystem-watcher.spec.ts
@theia/filesystem: * chai: ./src/node/nsfw-watcher/nsfw-filesystem-watcher.spec.ts
@theia/debug: Missing dependencies
@theia/debug: * @theia/plugin: ./src/node/inline-debug-adapter.ts
@theia/plugin-ext: Unused dependencies
@theia/plugin-ext: * @theia/bulk-edit
@theia/plugin-ext: * @theia/messages
@theia/plugin-ext: * @theia/preferences
@theia/plugin-ext: * @types/mime
@theia/plugin-ext: Missing dependencies
@theia/plugin-ext: * chai: ./src/plugin/path.spec.ts
@theia/core: Unused dependencies
@theia/core: * @babel/runtime
@theia/core: * es6-promise
@theia/core: Missing dependencies
@theia/core: * chai: ./src/node/backend-application-config-provider.spec.ts
@theia/core: * temp: ./src/node/logger-cli-contribution.spec.ts
@theia/core: * sinon: ./src/node/logger-cli-contribution.spec.ts
@theia/core: * electron-store: ./src/electron-main/electron-main-application.ts
@theia/core: * vscode-jsonrpc: ./src/electron-main/messaging/electron-messaging-service.ts
@theia/core: * electron: ./src/electron-browser/electron-clipboard-service.ts
@theia/core: * native-keymap: ./src/common/keyboard/keyboard-layout-provider.ts
@theia/core: * jsdom: ./src/browser/test/jsdom.ts
@theia/core: * vscode-languageserver-types: ./shared/vscode-languageserver-types/index.d.ts
@theia/example-browser: Missing dependencies
@theia/example-browser: * webpack: ./gen-webpack.config.js
@theia/example-browser: * yargs: ./gen-webpack.config.js
@theia/example-browser: * copy-webpack-plugin: ./gen-webpack.config.js
@theia/example-browser: * circular-dependency-plugin: ./gen-webpack.config.js
@theia/example-browser: * compression-webpack-plugin: ./gen-webpack.config.js
@theia/example-browser: * @theia/application-manager: ./webpack.config.js
@theia/example-browser: * es6-promise: ./src-gen/frontend/index.js
@theia/example-browser: * reflect-metadata: ./src-gen/frontend/index.js
@theia/example-browser: * setimmediate: ./src-gen/frontend/index.js
@theia/example-browser: * inversify: ./src-gen/frontend/index.js
@theia/example-browser: * express: ./src-gen/backend/server.js
@theia/example-browser: * onigasm: ./lib/vendors-node_modules_fast-plist_release_src_main_js-node_modules_onigasm_lib_index_js-node_mo-4101e7.bundle.js
@theia/example-browser: * oniguruma: ./lib/vendors-node_modules_fast-plist_release_src_main_js-node_modules_onigasm_lib_index_js-node_mo-4101e7.bundle.js

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

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

Alright, thank you for the explanation :)

Everything looks good to me, the app continues to build and run as expected 👍

The commit performs the following changes:
- removes an unused dependencies from `@theia` extensions
- adds any missing dependencies (declared but never added to the
  respective `package.json`)

Signed-off-by: vince-fugnitto <[email protected]>
Copy link
Member

@paul-marechal paul-marechal left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the cleanup!

packages/preferences/package.json Show resolved Hide resolved
@paul-marechal paul-marechal merged commit 924eda3 into master Feb 17, 2022
@paul-marechal paul-marechal deleted the vf/dep-cleanup branch February 17, 2022 15:59
@github-actions github-actions bot added this to the 1.23.0 milestone Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies pull requests that update a dependency file quality issues related to code and application quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants