MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / npmrc_minimum_release_age

Function npmrc_minimum_release_age

tools/ci/src/main.rs:152–181  ·  view source on GitHub ↗
(path: &Path, expected_minimum_release_age: u64)

Source from the content-addressed store, hash-verified

150}
151
152fn npmrc_minimum_release_age(path: &Path, expected_minimum_release_age: u64) -> Result<u64> {
153 let contents = fs::read_to_string(path).map_err(|err| {
154 if err.kind() == std::io::ErrorKind::NotFound {
155 anyhow::anyhow!(
156 "{} is tracked but missing from the working tree. Restore it with:\nminimum-release-age={}",
157 path.display(),
158 expected_minimum_release_age
159 )
160 } else {
161 anyhow::anyhow!(
162 "failed to read {} while checking pnpm minimum package age: {err}",
163 path.display()
164 )
165 }
166 })?;
167 contents
168 .lines()
169 .find_map(|line| {
170 let line = line.trim();
171 let value = line.strip_prefix("minimum-release-age=")?.trim();
172 value.parse::<u64>().ok()
173 })
174 .ok_or_else(|| {
175 anyhow::anyhow!(
176 "{} must contain `minimum-release-age={}` to match root pnpm-workspace.yaml",
177 path.display(),
178 expected_minimum_release_age
179 )
180 })
181}
182
183fn check_pnpm_release_age_policy() -> Result<()> {
184 ensure_repo_root()?;

Callers 1

Calls 2

kindMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…