vscode-peacock icon indicating copy to clipboard operation
vscode-peacock copied to clipboard

refactor: break non live-share circular dependencies

Open talohana opened this issue 1 year ago • 1 comments

I'm trying to import this extension and use it in Google, however our TS rules doesn't allow circular dependencies.

Live-share related imports are not needed, hence not resolved.

Output of npx madge --exclude='live-share' --circular --extensions ts ./:

⠋ Finding files=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <5.2.0

YOUR TYPESCRIPT VERSION: 5.4.5

Please only submit bug reports when using the officially supported version.

=============
Processed 53 files (3.4s) 

✔ No circular dependency found!

talohana avatar Apr 13 '24 08:04 talohana

This pull request includes several changes to improve the organization and functionality of the configuration and color management codebase. The most important changes involve refactoring the configuration functions, reordering imports, and modularizing the code.

Refactoring and modularization:

  • src/configuration/foreground-color.ts: Added new functions getDarkForegroundColorOrOverride, getLightForegroundColorOrOverride, getDarkForegroundColor, and getLightForegroundColor to handle foreground color configurations.
  • src/configuration/utils.ts: Introduced a new utility function readConfiguration to read configuration settings.
  • src/configuration/workspace.ts: Moved the function getColorCustomizationConfigFromWorkspace to a separate file for better modularization.

Reordering imports:

  • src/color-library.ts: Reordered and grouped imports for better readability and maintainability.
  • src/configuration/read-configuration.ts: Reorganized imports and removed redundant import statements.

Code cleanup and removal of redundant functions:

  • src/configuration/read-configuration.ts: Removed redundant functions getColorCustomizationConfigFromWorkspace, readConfiguration, getDarkForegroundColor, getDarkForegroundColorOrOverride, getLightForegroundColor, and getLightForegroundColorOrOverride. [1] [2] [3] [4]

johnpapa avatar Jan 24 '25 15:01 johnpapa