MCPcopy Create free account
hub / github.com/dcastil/tailwind-merge / assertPublished

Function assertPublished

scripts/stamp-dev-version.mjs:99–113  ·  view source on GitHub ↗
(name, version)

Source from the content-addressed store, hash-verified

97}
98
99async function assertPublished(name, version) {
100 const response = await fetch(`${REGISTRY_URL}/${name}/${version}`)
101
102 if (response.status === 404) {
103 fail(
104 `${name}@${version} is not on the registry. A local dev publish needs the same-commit dev release of every pinned workspace dependency; push the commit, let the publish workflow finish, then rerun.`,
105 )
106 }
107
108 if (!response.ok) {
109 fail(`Registry lookup for ${name}@${version} failed with status ${response.status}`)
110 }
111
112 log(`Verified ${name}@${version} exists on the registry`)
113}
114
115function log(message) {
116 console.log(`[stamp-dev-version] ${message}`)

Callers 1

Calls 3

fetchFunction · 0.85
failFunction · 0.70
logFunction · 0.70

Tested by

no test coverage detected