mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-04-12 09:49:42 +00:00

* Update component props and add GitLab link - Made `ref` prop optional in TauriLink component - Added GitLab mirror URL to GitHubProvenanceCard - Included a link to the GitLab mirror in the card layout - Adjusted layout for StoreExtDetail component for better responsiveness - Imported Tooltip component for potential future use * chore: add parse-github-url dependency and update GitHub parsing logic - Added `parse-github-url` package as a dependency in `package.json`. - Updated `parseGitHubRepoFromUri` function to utilize `parse-github-url` for improved URI parsing. - Introduced `getGitHubRepoMetadata` function to fetch repository metadata using Octokit. - Updated validation data structure to include optional `repoId`. - Enhanced tests to cover new functionality and error handling for invalid URIs. * fix typo * refactor: update validation data structure and improve function documentation - Removed optional `repoId` from `ExtensionPublishValidationData` and adjusted related function to reflect this change. - Added a note in the `validateJsrPackageAsKunkunExtension` function documentation to clarify frontend/backend verification logic. - Updated `ExtPublishMetadata` to rename `repoId` to `repoNodeId` for clarity. * refactor: remove GitLab mirror link from GitHubProvenanceCard - Removed the GitLab mirror URL and its associated link from the GitHubProvenanceCard component. - Commented out the layout for the GitLab mirror instead of deleting it, preserving the structure for potential future use. * refactor: simplify GitHub repository URI parsing - Removed dependency on `parse-github-url` and implemented a regex-based approach for parsing GitHub repository URIs in the `parseGitHubRepoFromUri` function. - Enhanced error handling for invalid URIs while maintaining the function's output structure. * feat: add Gitea mirror link to GitHubProvenanceCard - Introduced a new link to the Gitea mirror repository in the GitHubProvenanceCard component. - Updated the layout to reflect the new mirror link while removing the commented-out GitLab mirror section. * refactor: enhance Globe component's location handling - Updated the Globe component to conditionally render markers based on the provided locations prop. - Simplified the destructuring of props for better readability. - Retained default marker locations for cases where no locations are provided. * pnpm lock
16 lines
573 B
TypeScript
16 lines
573 B
TypeScript
import { expect, test } from "bun:test"
|
|
import { getGitHubRepoMetadata, parseGitHubRepoFromUri } from "../github"
|
|
|
|
test("parse github repo from uri", () => {
|
|
expect(parseGitHubRepoFromUri("https://github.com/kunkunsh/kunkun-ext-ossinsight")).toEqual({
|
|
owner: "kunkunsh",
|
|
repo: "kunkun-ext-ossinsight"
|
|
})
|
|
expect(() => parseGitHubRepoFromUri("invalid-uri")).toThrow("Invalid GitHub repository URI")
|
|
})
|
|
|
|
test("get github repo metadata", async () => {
|
|
const metadata = await getGitHubRepoMetadata("kunkunsh", "kunkun-ext-ossinsight")
|
|
expect(metadata).toBeDefined()
|
|
})
|