Skip to main content

Crate monochange_npm

Crate monochange_npm 

Source
Expand description

§monochange_npm

monochange_npm discovers npm-family packages and normalizes them for shared planning.

Reach for this crate when you want one adapter for npm, pnpm, and Bun workspaces that emits monochange_core package and dependency records.

§Why use it?

  • discover several JavaScript package-manager layouts with one crate
  • normalize workspace metadata into the same graph used by the rest of monochange
  • capture dependency edges from package.json and pnpm-workspace.yaml

§Best for

  • scanning JavaScript or TypeScript monorepos into normalized package records
  • supporting npm, pnpm, and Bun with one discovery surface
  • feeding JS workspace topology into shared planning code

§Public entry points

  • discover_npm_packages(root) discovers npm, pnpm, and Bun workspaces plus standalone packages
  • NpmAdapter exposes the shared adapter interface

§Scope

  • package.json workspaces
  • pnpm-workspace.yaml
  • Bun lockfile detection
  • normalized dependency extraction

Re-exports§

pub use analysis::NpmSemanticAnalyzer;
pub use analysis::semantic_analyzer;

Modules§

analysis
lints
npm-family manifest lint suite.

Structs§

NpmAdapter
Shared npm-family ecosystem adapter.

Enums§

NpmVersionedFileKind

Constants§

PACKAGE_JSON_FILE
PNPM_WORKSPACE_FILE

Functions§

adapter
Return the shared npm-family ecosystem adapter.
append_npm_trust_environment_arg
build_npm_trust_command
default_dependency_fields
Return the manifest fields that usually contain dependency versions.
default_dependency_version_prefix
default_lockfile_commands
Return the default lockfile refresh commands for package.
discover_lockfiles
Discover lockfiles that should be refreshed for package.
discover_npm_packages
Discover npm, pnpm, and Bun packages rooted at root.
load_configured_npm_package
Load one explicitly configured npm package without recursively scanning the repo.
render_npm_trust_command
supported_versioned_file_kind
Classify an npm-family versioned file path.
update_bun_lock
Update text-based Bun lockfiles by replacing package version literals.
update_bun_lock_binary
Update a binary bun.lockb file in place.
update_json_dependency_fields
Update dependency sections inside a parsed package.json-style value.
update_package_lock
Update versions embedded in a parsed package-lock.json document.
update_pnpm_lock
Update versions embedded in a parsed pnpm-lock.yaml mapping.
update_pnpm_lock_text
Update pnpm-lock.yaml text in place using direct YAML-aware replacements.
validate_versioned_file
Return the default dependency-version prefix for this ecosystem. Validate that an npm/deno versioned file contains a readable version field.
write_npm_placeholder_manifest