diff --git a/src/manifest.rs b/src/manifest.rs index fdd7d157..dc25085a 100644 --- a/src/manifest.rs +++ b/src/manifest.rs @@ -126,6 +126,18 @@ pub struct Package { /// Example: true #[serde(default)] pub private: bool, + + /// URL of the package homepage. + /// + /// Example: "https://github.com/sleitnick/knit" + #[serde(default)] + pub homepage: Option, + + /// URL of the package source repository. + /// + /// Example: "https://github.com/Sleitnick/Knit.git" + #[serde(default)] + pub repository: Option, } // Metadata we require when this manifest will be used to generate package folders diff --git a/src/test_package.rs b/src/test_package.rs index 8929fa01..d7284d69 100644 --- a/src/test_package.rs +++ b/src/test_package.rs @@ -39,6 +39,8 @@ impl PackageBuilder { include: Vec::new(), exclude: Vec::new(), private: false, + homepage: None, + repository: None, }, place: Default::default(), dependencies: Default::default(), diff --git a/test-projects/manifestlinks/default.project.json b/test-projects/manifestlinks/default.project.json new file mode 100644 index 00000000..dd40fd97 --- /dev/null +++ b/test-projects/manifestlinks/default.project.json @@ -0,0 +1,6 @@ +{ + "name": "minimal", + "tree": { + "$path": "src" + } +} \ No newline at end of file diff --git a/test-projects/manifestlinks/src/init.lua b/test-projects/manifestlinks/src/init.lua new file mode 100644 index 00000000..f5407de7 --- /dev/null +++ b/test-projects/manifestlinks/src/init.lua @@ -0,0 +1 @@ +return "hey" \ No newline at end of file diff --git a/test-projects/manifestlinks/wally.toml b/test-projects/manifestlinks/wally.toml new file mode 100644 index 00000000..62ade855 --- /dev/null +++ b/test-projects/manifestlinks/wally.toml @@ -0,0 +1,8 @@ +[package] +name = "biff/minimal" +version = "0.1.0" +license = "MIT" +realm = "server" +registry = "test-registries/primary-registry" +repository = "https://github.com/UpliftGames/player-module.git" +homepage = "https://github.com/UpliftGames/player-module" \ No newline at end of file diff --git a/test-registries/primary-registry/contents/biff/manifestlinks/0.1.0.zip b/test-registries/primary-registry/contents/biff/manifestlinks/0.1.0.zip new file mode 100644 index 00000000..8c1eaa00 Binary files /dev/null and b/test-registries/primary-registry/contents/biff/manifestlinks/0.1.0.zip differ diff --git a/test-registries/primary-registry/index/biff/manifestlinks b/test-registries/primary-registry/index/biff/manifestlinks new file mode 100644 index 00000000..46e3c976 --- /dev/null +++ b/test-registries/primary-registry/index/biff/manifestlinks @@ -0,0 +1 @@ +{"package":{"name":"biff/minimal","version":"0.1.0","registry":"test-registries/primary-registry","realm":"server","description":null,"license":"MIT","authors":[],"include":[],"exclude":[],"private":false,"homepage":"https://github.com/UpliftGames/player-module","repository":"https://github.com/UpliftGames/player-module.git"},"place":{"shared-packages":null,"server-packages":null},"dependencies":{},"server-dependencies":{},"dev-dependencies":{}} \ No newline at end of file diff --git a/wally-registry-frontend/package-lock.json b/wally-registry-frontend/package-lock.json index 1dd96698..91ee9862 100644 --- a/wally-registry-frontend/package-lock.json +++ b/wally-registry-frontend/package-lock.json @@ -7430,8 +7430,7 @@ "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "node_modules/function.prototype.name": { "version": "1.1.5", @@ -11326,8 +11325,7 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-to-regexp": { "version": "1.8.0", diff --git a/wally-registry-frontend/src/pages/Package.tsx b/wally-registry-frontend/src/pages/Package.tsx index 8665bc82..5fd4ab14 100644 --- a/wally-registry-frontend/src/pages/Package.tsx +++ b/wally-registry-frontend/src/pages/Package.tsx @@ -295,7 +295,7 @@ export default function Package() { const packageMetadata = packageHistory?.find( (item: WallyPackageMetadata) => item.package.version === packageVersion ) - + console.log(packageMetadata) if (packageMetadata == undefined) { return ( <> @@ -418,6 +418,22 @@ export default function Package() { )} */} + {packageMetadata?.package.homepage && ( + + + {packageMetadata?.package.homepage.replace("https://", "")} + + + )} + + {packageMetadata?.package.repository && ( + + + {packageMetadata?.package.repository} + + + )} + {packageMetadata.package.authors.length > 0 && ( {packageMetadata.package.authors.map((author) => ( diff --git a/wally-registry-frontend/src/types/wally.d.ts b/wally-registry-frontend/src/types/wally.d.ts index ee65c196..0e089103 100644 --- a/wally-registry-frontend/src/types/wally.d.ts +++ b/wally-registry-frontend/src/types/wally.d.ts @@ -14,6 +14,8 @@ export interface WallyPackageMetadata { realm: string registry: string version: string + homepage: string + repository: string } place: {