fix: replace invalid Discord invite links with canonical URL (#3056)
Closes #2699 The Discord badge in README.md pointed to https://discord.gg/gsd (expired vanity URL) and the Pi ecosystem doc used an old invite code. Both now use the canonical invite https://discord.com/invite/nKXTsAcmbT that was established in commit 0a1dad9a. Adds a regression test that validates all Discord invite links in user-facing files match the canonical URL. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
fad23944e7
commit
fb0fb5582e
3 changed files with 49 additions and 2 deletions
|
|
@ -7,7 +7,7 @@
|
|||
[](https://www.npmjs.com/package/gsd-pi)
|
||||
[](https://www.npmjs.com/package/gsd-pi)
|
||||
[](https://github.com/gsd-build/GSD-2)
|
||||
[](https://discord.gg/gsd)
|
||||
[](https://discord.com/invite/nKXTsAcmbT)
|
||||
[](LICENSE)
|
||||
[](https://dexscreener.com/solana/dwudwjvan7bzkw9zwlbyv6kspdlvhwzrqy6ebk8xzxkv)
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,6 @@ Or just use conventional directory names (`extensions/`, `skills/`, `prompts/`,
|
|||
|
||||
- [Package gallery](https://shittycodingagent.ai/packages)
|
||||
- [npm search](https://www.npmjs.com/search?q=keywords%3Api-package)
|
||||
- [Discord community](https://discord.com/invite/3cU7Bz4UPx)
|
||||
- [Discord community](https://discord.com/invite/nKXTsAcmbT)
|
||||
|
||||
---
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
import assert from "node:assert/strict";
|
||||
import { describe, it } from "node:test";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
|
||||
/**
|
||||
* Validates that all Discord invite links in user-facing files point to valid,
|
||||
* consistent invite URLs — not expired vanity links.
|
||||
*
|
||||
* Regression test for https://github.com/gsd-build/gsd-2/issues/2699
|
||||
*/
|
||||
|
||||
const ROOT = process.cwd();
|
||||
|
||||
/** Canonical Discord invite for the GSD community. */
|
||||
const VALID_INVITE = "https://discord.com/invite/nKXTsAcmbT";
|
||||
|
||||
/** Files that contain user-facing Discord invite links. */
|
||||
const FILES_WITH_INVITE_LINKS: string[] = [
|
||||
"README.md",
|
||||
"docs/what-is-pi/15-pi-packages-the-ecosystem.md",
|
||||
];
|
||||
|
||||
describe("Discord invite links (#2699)", () => {
|
||||
for (const relPath of FILES_WITH_INVITE_LINKS) {
|
||||
it(`${relPath} contains only the canonical Discord invite`, () => {
|
||||
const content = readFileSync(join(ROOT, relPath), "utf8");
|
||||
|
||||
// Extract all Discord invite URLs (discord.gg/X or discord.com/invite/X)
|
||||
const invitePattern = /https?:\/\/(?:discord\.gg|discord\.com\/invite)\/[A-Za-z0-9]+/g;
|
||||
const matches = content.match(invitePattern);
|
||||
|
||||
assert.ok(
|
||||
matches && matches.length > 0,
|
||||
`Expected at least one Discord invite link in ${relPath}`,
|
||||
);
|
||||
|
||||
for (const link of matches) {
|
||||
assert.equal(
|
||||
link,
|
||||
VALID_INVITE,
|
||||
`Invalid Discord invite in ${relPath}: found "${link}", expected "${VALID_INVITE}"`,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
Loading…
Add table
Reference in a new issue