diff --git a/.gitignore b/.gitignore index 0ac33fc2..5cbc1611 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ node_modules .vercel plugin-images-metadata.json +.local.env \ No newline at end of file diff --git a/components/plugin-info/index.js b/components/plugin-info/index.js index a802b71e..e733838f 100644 --- a/components/plugin-info/index.js +++ b/components/plugin-info/index.js @@ -14,14 +14,14 @@ export default ({ npmData: plugin, variant }) => { action: 'Opened install modal', category: 'plugin', label: 'open_install_modal', - value: plugin.collected.metadata.name, + value: plugin.name, }) setModalOpen(true) } return <> setModalOpen(false)} /> @@ -30,14 +30,14 @@ export default ({ npmData: plugin, variant }) => {
- {plugin.collected.metadata.publisher.username} + {plugin.publisher.username}
- {plugin.collected.npm.downloads[2].count > 0 ? ( + {plugin.downloads > 0 ? ( <> - {plugin.collected.npm.downloads[2].count.toLocaleString()}{' '} + {plugin.downloads.toLocaleString()}{' '} downloads in the last month ) : ( @@ -45,7 +45,7 @@ export default ({ npmData: plugin, variant }) => { )} { {variant === 'description' ? ( view source code ) : ( view description )} - Version {plugin.collected.metadata.version} + Version {plugin.version} { const npmData = await ( - await fetch(`https://api.npms.io/v2/package/${params.name}`) + await fetch(`${WEBSITE_URL}/api/getPackageMetadata?name=${params.name}`) ).json() const plugin = { diff --git a/pages/store/[name]/source.js b/pages/store/[name]/source.js index 1d66aa3f..8e3e22b5 100644 --- a/pages/store/[name]/source.js +++ b/pages/store/[name]/source.js @@ -5,6 +5,7 @@ import Page from 'components/page' import PluginInfo from 'components/plugin-info' import { File, Directory } from 'components/icons' import styles from 'styles/pages/store/source.module.css' +import { WEBSITE_URL } from 'utils/constants' const formatFileName = (path) => path.replace(/^\/+|\/+$/g, '') @@ -113,7 +114,7 @@ export async function getStaticProps({ params }) { } const npmData = await ( - await fetch(`https://api.npms.io/v2/package/${plugin.name}`) + await fetch(`${WEBSITE_URL}/api/getPackageMetadata?name=${params.name}`) ).json() const pluginMeta = await ( diff --git a/plugins.json b/plugins.json index 5d26feb6..16b2e8ae 100644 --- a/plugins.json +++ b/plugins.json @@ -635,5 +635,39 @@ "#9272dc" ], "dateAdded": "1597807892019" + }, + { + "name": "hyper-gh-dark-default", + "type": "theme", + "description": "A port of the GitHub Dark default theme for Hyper.app", + "preview": "https://raw.githubusercontent.com/milovangudelj/hyper-gh-dark-default/master/screenshot.png", + "colors": [ + "#0d1117", + "#ff7b72", + "#3fb950", + "#d29922", + "#58a6ff", + "#bc8cff", + "#76e3ea", + "#b1bac4", + "#161b22", + "#ffa198", + "#56d364", + "#e3b341", + "#79c0ff", + "#d2a8ff", + "#b3f0ff", + "#b1bac4", + "#b1bac4", + "#484f58", + "#010409", + "#0d1117", + "#c9d1d9", + "#30363d", + "#58A6FF", + "#f78166", + "rgba(56,139,253,0.15)" + ], + "dateAdded": "1675163504003" } ] diff --git a/public/store/hyper-gh-dark-default.png b/public/store/hyper-gh-dark-default.png new file mode 100644 index 00000000..dc6ea5f3 Binary files /dev/null and b/public/store/hyper-gh-dark-default.png differ diff --git a/utils/constants.js b/utils/constants.js new file mode 100644 index 00000000..0ecaf3a1 --- /dev/null +++ b/utils/constants.js @@ -0,0 +1,4 @@ +export const WEBSITE_URL = + process.env.NODE_ENV === 'development' + ? 'http://localhost:3000' + : 'https://hyper.milovangudelj.com'