New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

@teambit/dependencies

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@teambit/dependencies

1.0.517
Version published
Weekly downloads
358
-76.78%
Maintainers
15
Weekly downloads
 
Created

Dependencies Cache Mechanism

To improve component-loading performance, the dependencies data is cached in the filesystem.

The component's cache gets invalidated in the following scenario:

  • The component-dir or sub-dirs have been changed. (modified-date of the dirs paths)
  • One of the component files have been changed.
  • A component config file (component.json/package.json) has modified.

The entire cache of all component dependencies is invalidated if one of the following happened:

  • workspace-config file (workspace.jsonc) has changed.
  • package.json file has changed.
  • node_modules-dir (only root dir, not sub-dirs) has changed. - not sure if needed.
  • On completion of "bit link".
  • On completion of "bit install".
  • During 'bit tag --persist', before loading the components.

A component is not entered to the cache in the first place in the following cases:

  • No root-dir/track-dir (legacy).
  • Component has one of the following issues: missingPackagesDependenciesOnFs, untrackedDependencies.

Limitations:

  • If a user deleted the dists directories of a component in node-modules, we don't know about it and bit-status won't show any error.
  • If a user deleted a package from node-modules dir manually, we don't know about it.

Disabling the cache

set the "no-fs-cache" feature. For one command, prefix your command with BIT_FEATURES=no-fs-cache. Or you can configure it on the machine level for all commands/workspaces: bit config set features='no-fs-cache'

FAQs

Package last updated on 17 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts