Skip to content

Commit 81ce92d

Browse files
Enes Yağızclaude
andcommitted
fix(packagist): register Packagist in the test registries and the home page copy
The registry tests build their own client list and checked a package id that is not a vendor/name; the SSR smoke test and index.html still named four registries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 90ac58e commit 81ce92d

4 files changed

Lines changed: 20 additions & 15 deletions

File tree

‎src/backend/PkgDiff.Tests/Registries/RegistryClientTests.cs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public class RegistryClientTests
2222
[InlineData("PyPI", "pypi", "PyPI", VersionScheme.Pep440, true, false)]
2323
[InlineData("pub", "pub.dev", "PubDev", VersionScheme.SemVer, true, true)]
2424
[InlineData("pub.dev", "pub.dev", "PubDev", VersionScheme.SemVer, true, true)]
25+
[InlineData("composer", "packagist", "Packagist", VersionScheme.Composer, true, false)]
2526
public void Every_spelling_of_a_registry_reaches_its_one_client(
2627
string spelling, string id, string label, VersionScheme scheme, bool includesStart, bool publishesNotes)
2728
{
@@ -65,7 +66,8 @@ public void Every_registry_name_has_a_client_and_a_package_id_grammar()
6566
{
6667
Assert.Equal(name, factory.GetClient(name).Id);
6768
Assert.Equal(name, RegistryNames.Canonical(name.ToUpperInvariant()));
68-
Assert.True(PkgDiff.Shared.Validation.PackageIdRules.IsValidPackageId(name, "abc"));
69+
var sample = name == RegistryNames.Packagist ? "abc/def" : "abc";
70+
Assert.True(PkgDiff.Shared.Validation.PackageIdRules.IsValidPackageId(name, sample));
6971
});
7072
Assert.Equal(new[] { "pub.dev", "pub" }, RegistryNames.SpellingsOf("PUB"));
7173
Assert.Equal(new[] { "npm" }, RegistryNames.SpellingsOf("npm"));

‎src/backend/PkgDiff.Tests/TestDoubles/TestRegistries.cs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ public static RegistryServiceFactory Create(
1818
IVersionFilterService? versionFilter = null,
1919
GitHubFirstScrapingStrategy? githubFirst = null,
2020
NuGetFirstScrapingStrategy? nugetFirst = null,
21-
PubDevScrapingStrategy? pubDevStrategy = null)
21+
PubDevScrapingStrategy? pubDevStrategy = null,
22+
IPackagistService? packagist = null)
2223
{
2324
versionFilter ??= new VersionFilterService(
2425
new FakeUnitOfWork(), new MemoryCache(new MemoryCacheOptions()), NullLogger<VersionFilterService>.Instance);
@@ -28,7 +29,8 @@ public static RegistryServiceFactory Create(
2829
new NuGetRegistryClient(nuget!, nugetPage!, githubFirst!, nugetFirst!),
2930
new NpmRegistryClient(npm!, githubFirst!, versionFilter, NullLogger<NpmRegistryClient>.Instance),
3031
new PyPIRegistryClient(pypi!, githubFirst!, versionFilter, NullLogger<PyPIRegistryClient>.Instance),
31-
new PubDevRegistryClient(pubDev!, pubDevStrategy!, versionFilter, NullLogger<PubDevRegistryClient>.Instance)
32+
new PubDevRegistryClient(pubDev!, pubDevStrategy!, versionFilter, NullLogger<PubDevRegistryClient>.Instance),
33+
new PackagistRegistryClient(packagist!, githubFirst!, versionFilter, NullLogger<PackagistRegistryClient>.Instance)
3234
]);
3335
}
3436
}

‎src/frontend/src/index.html‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
})();
1616
</script>
1717
<meta charset="utf-8">
18-
<title>pkgdiff — Compare NuGet, npm, PyPI & Pub Packages</title>
18+
<title>pkgdiff — Compare NuGet, npm, PyPI, Pub & Packagist Packages</title>
1919
<base href="/">
2020
<meta name="viewport" content="width=device-width, initial-scale=1">
2121
<meta name="description"
22-
content="Free tool to compare package versions across NuGet, npm, PyPI & Pub. Track breaking changes, view release notes, and analyze version differences between any two versions.">
22+
content="Free tool to compare package versions across NuGet, npm, PyPI, Pub & Packagist. Track breaking changes, view release notes, and analyze version differences between any two versions.">
2323
<meta name="author" content="Enes Yağız (fleizean)">
2424
<meta name="publisher" content="pkgdiff">
2525
<meta name="robots" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1">
@@ -35,29 +35,29 @@
3535
<meta property="og:type" content="website">
3636
<meta property="og:site_name" content="pkgdiff">
3737
<meta property="og:title"
38-
content="pkgdiff — Compare NuGet, npm, PyPI & Pub Packages">
38+
content="pkgdiff — Compare NuGet, npm, PyPI, Pub & Packagist Packages">
3939
<meta property="og:description"
40-
content="Free tool to compare package versions across NuGet, npm, PyPI & Pub. Track breaking changes, view release notes, and analyze version differences between any two versions.">
40+
content="Free tool to compare package versions across NuGet, npm, PyPI, Pub & Packagist. Track breaking changes, view release notes, and analyze version differences between any two versions.">
4141
<meta property="og:url" content="https://pkgdiff.dev/">
4242
<meta property="og:locale" content="en_US">
4343
<meta property="og:image" content="https://pkgdiff.dev/og-image/home.png">
4444
<meta property="og:image:secure_url" content="https://pkgdiff.dev/og-image/home.png">
4545
<meta property="og:image:type" content="image/png">
4646
<meta property="og:image:width" content="1200">
4747
<meta property="og:image:height" content="630">
48-
<meta property="og:image:alt" content="pkgdiff — Compare Package Versions Across NuGet, npm, PyPI & Pub">
48+
<meta property="og:image:alt" content="pkgdiff — Compare Package Versions Across NuGet, npm, PyPI, Pub & Packagist">
4949

5050
<meta name="twitter:card" content="summary_large_image">
5151
<meta name="twitter:domain" content="pkgdiff.dev">
5252
<meta name="twitter:url" content="https://pkgdiff.dev/">
5353
<meta name="twitter:site" content="@onlyflei">
5454
<meta name="twitter:creator" content="@onlyflei">
5555
<meta name="twitter:title"
56-
content="pkgdiff — Compare NuGet, npm, PyPI & Pub Packages">
56+
content="pkgdiff — Compare NuGet, npm, PyPI, Pub & Packagist Packages">
5757
<meta name="twitter:description"
58-
content="Free tool to compare package versions across NuGet, npm, PyPI & Pub. Track breaking changes, view release notes, and analyze version differences between any two versions.">
58+
content="Free tool to compare package versions across NuGet, npm, PyPI, Pub & Packagist. Track breaking changes, view release notes, and analyze version differences between any two versions.">
5959
<meta name="twitter:image" content="https://pkgdiff.dev/og-image/home.png">
60-
<meta name="twitter:image:alt" content="pkgdiff — Compare Package Versions Across NuGet, npm, PyPI & Pub">
60+
<meta name="twitter:image:alt" content="pkgdiff — Compare Package Versions Across NuGet, npm, PyPI, Pub & Packagist">
6161

6262
<link rel="icon" type="image/png" href="/favicon/favicon-96x96.png" sizes="96x96" />
6363
<link rel="icon" type="image/svg+xml" href="/favicon/favicon.svg" />
@@ -76,7 +76,7 @@
7676
"name": "pkgdiff",
7777
"alternateName": "Package Diff",
7878
"url": "https://pkgdiff.dev",
79-
"description": "Free tool to compare package versions across NuGet, npm, PyPI & Pub. Track breaking changes, view release notes, and analyze version differences between any two versions.",
79+
"description": "Free tool to compare package versions across NuGet, npm, PyPI, Pub & Packagist. Track breaking changes, view release notes, and analyze version differences between any two versions.",
8080
"applicationCategory": "DeveloperApplication",
8181
"operatingSystem": "Web",
8282
"browserRequirements": "Requires JavaScript. Requires HTML5.",
@@ -91,6 +91,7 @@
9191
"Compare npm package versions",
9292
"Compare PyPI package versions",
9393
"Compare pub.dev package versions",
94+
"Compare Packagist package versions",
9495
"View release notes and changelogs",
9596
"Track version history",
9697
"Analyze package differences"
@@ -126,7 +127,7 @@
126127
style="font-family: Inter, sans-serif; max-width: 720px; margin: 0 auto; padding: 40px 16px; font-size: 16px; line-height: 1.6; color: #111418;">
127128
<h1 style="font-size: 28px; font-weight: 700; margin-bottom: 16px;">pkgdiff — Compare Package Versions Online</h1>
128129
<p style="font-size: 18px; color: #617589; margin-bottom: 24px;">
129-
Compare and analyze package versions across NuGet, npm, PyPI and Pub registries. Track breaking changes,
130+
Compare and analyze package versions across NuGet, npm, PyPI, Pub and Packagist registries. Track breaking changes,
130131
view
131132
detailed release notes, and understand version differences with our free online diff tool. Perfect for
132133
developers upgrading dependencies and managing package updates.

‎src/frontend/ssr-smoke.test.mjs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ test('the home page arrives rendered, with its meta and ready to be hydrated', a
121121
const { status, html } = await page('/');
122122

123123
assert.equal(status, 200);
124-
assert.match(html, /<h1[^>]*>\s*Compare package versions across NuGet, npm, PyPI &amp; Pub/);
124+
assert.match(html, /<h1[^>]*>\s*Compare package versions across NuGet, npm, PyPI, Pub &amp; Packagist/);
125125
assert.match(html, /What you can do with pkgdiff/);
126-
assert.match(html, /<title>pkgdiff — Compare NuGet, npm, PyPI &amp; Pub Packages<\/title>/);
126+
assert.match(html, /<title>pkgdiff — Compare NuGet, npm, PyPI, Pub &amp; Packagist Packages<\/title>/);
127127
assert.equal(count(html, /<link rel="canonical"/g), 1);
128128
assert.match(html, /<link rel="canonical" href="https:\/\/pkgdiff\.dev\/"/);
129129
assert.match(html, /ng-server-context="ssr"/);

0 commit comments

Comments
 (0)