Skip to content

Suggestion: package argument #15

@dhorkin

Description

@dhorkin

I've got an expensive command that I only want to run when a specific dependency's version changes. While I can manually log the hash to a file, it would be preferable to be able to include this within the packagehash from package-changed.

My imagined usage would go something like this:

const {
  isChanged,
  monitoredPackagesChanged, // Record<packageName, isChanged for that package>
  writeHash,
} = await isPackageChanged({
  hashFilename: '.packagehash',
  monitorPackages: ['foo']
});

if (isChanged) {
  // do some stuff always
  ...

  if (monitoredPackagesChanged.foo) {
    // do the expensive thing here
  }
  writeHash();
}

I imagine that would necessitate turning the packagehash file into a JSON object

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions