Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: build #80

Merged
14 commits merged into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/deploy_cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: "Deploy to CloudFlare"
on: [push, pull_request]

env:
NODE_OPTIONS: ${{ secrets.NODE_OPTIONS }}
NODE_OPTIONS: --max-old-space-size=16384

jobs:
deploy:
Expand All @@ -27,8 +27,8 @@ jobs:
- name: Submodule update
shell: bash
run: git submodule update --init --recursive
- name: Update module

- name: Update module
shell: bash
run: git submodule sync && git submodule update --remote --force

Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
12 changes: 12 additions & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export enum ExternalLinks {
QQ = "https://qm.qq.com/cgi-bin/qm/qr?k=qrfLNFTLxvThCgcF0fqPc2YFtDzMiUcm&authKey=8hGDPVzLLlTvX4SCBAeYc8TlaumsgvpTIdSUs3%2FU0K8U5piBp3znAYD%2Bd9n6vfEC",
COINGECKO = "https://www.coingecko.com/en/coins/beam/usd",
CMC = "https://coinmarketcap.com/currencies/beam/",
BEAMASSETS = "https://beamassets.com/",

// Other links
DOCS_SOURCES = "https://github.com/BeamMW/docs-gitbook",
Expand Down Expand Up @@ -65,6 +66,7 @@ export enum ExternalLinksTitle {
QQ = "QQ",
COINGECKO = "CoinGecko",
CMC = "CoinMarketCap",
BEAMASSETS = "BeamAssets",
}

/**
Expand Down Expand Up @@ -211,6 +213,11 @@ export const exchangesBuy = [
image: "exchanges/mexc",
link: "https://www.mexc.com/exchange/BEAM_USDT?_from=market",
},
{
title: "Uniswap",
image: "exchanges/uniswap",
link: "https://app.uniswap.org/swap?outputCurrency=0xE5AcBB03D73267c03349c76EaD672Ee4d941F499&inputCurrency=ETH",
},
{
title: "CoinEx",
image: "exchanges/coinex",
Expand All @@ -221,6 +228,11 @@ export const exchangesBuy = [
image: "exchanges/tradeogre",
link: "https://tradeogre.com/exchange/BTC-BEAM",
},
{
title: "NonKYC",
image: "exchanges/nonkyc",
link: "https://nonkyc.io/market/BEAM_USDT",
},
{
title: "Bitforex",
image: "exchanges/bitforex",
Expand Down
35 changes: 20 additions & 15 deletions app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ const route = useRoute();
const router = useRouter();

watch(
route,
(route) => {
() => route.fullPath,
(_routeFullPath) => {
currentRoute.value = getRouteName(route.name);
},
{ deep: true, immediate: true }
{ immediate: true },
);

defineRobotMeta();
Expand All @@ -43,11 +43,11 @@ const whereToBuyScroll = async () => {
};

onMounted(() =>
eventBus.on(UserInteractionEvents.SCROLL_TO_WHERE_TO_BUY, whereToBuyScroll)
eventBus.on(UserInteractionEvents.SCROLL_TO_WHERE_TO_BUY, whereToBuyScroll),
);

onUnmounted(() =>
eventBus.off(UserInteractionEvents.SCROLL_TO_WHERE_TO_BUY, whereToBuyScroll)
eventBus.off(UserInteractionEvents.SCROLL_TO_WHERE_TO_BUY, whereToBuyScroll),
);
</script>

Expand Down Expand Up @@ -94,7 +94,7 @@ onUnmounted(() =>
/>
<Meta
name="twitter:site"
:content="(extractTwitterUsername(ExternalLinks.TWITTER) as string)"
:content="extractTwitterUsername(ExternalLinks.TWITTER) as string"
/>
<Meta
v-if="
Expand All @@ -103,9 +103,9 @@ onUnmounted(() =>
platformDetails[SupportedPlatforms.IOS].links.store
"
name="apple-itunes-app"
:content="`app-id=${
extractAppStoreAppId(platformDetails[SupportedPlatforms.IOS].links.store as string)
}`"
:content="`app-id=${extractAppStoreAppId(
platformDetails[SupportedPlatforms.IOS].links.store as string,
)}`"
/>
<Meta
name="twitter:image:src"
Expand Down Expand Up @@ -146,7 +146,7 @@ onUnmounted(() =>
</main>
</template>

<style lang="postcss">
<style>
.page-enter-active,
.page-leave-active {
transition: all 0.2s;
Expand All @@ -164,7 +164,8 @@ onUnmounted(() =>

@font-face {
font-family: "ProximaNova";
src: url("/fonts/ProximaNova-Regular.woff2") format("woff2"),
src:
url("/fonts/ProximaNova-Regular.woff2") format("woff2"),
url("/fonts/ProximaNova-Regular.woff") format("woff");
font-weight: normal;
font-style: normal;
Expand All @@ -173,7 +174,8 @@ onUnmounted(() =>

@font-face {
font-family: "ProximaNova-Italic";
src: url("/fonts/ProximaNova-RegularIt.woff2") format("woff2"),
src:
url("/fonts/ProximaNova-RegularIt.woff2") format("woff2"),
url("/fonts/ProximaNova-RegularIt.woff") format("woff");
font-weight: normal;
font-style: italic;
Expand All @@ -182,7 +184,8 @@ onUnmounted(() =>

@font-face {
font-family: "ProximaNova-Bold";
src: url("/fonts/ProximaNova-Bold.woff2") format("woff2"),
src:
url("/fonts/ProximaNova-Bold.woff2") format("woff2"),
url("/fonts/ProximaNova-Bold.woff") format("woff");
font-weight: bold;
font-style: normal;
Expand Down Expand Up @@ -212,9 +215,11 @@ onUnmounted(() =>
}
</style>

<style lang="postcss" scoped>
<style scoped>
main {
transition: opacity 225ms ease-in-out, filter 225ms ease-in-out;
transition:
opacity 225ms ease-in-out,
filter 225ms ease-in-out;

&.locked,
&.blurred {
Expand Down
2 changes: 1 addition & 1 deletion components/buy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const { t } = useI18n();
</div>
</LayoutWrapper>
</template>
<style lang="postcss" scoped>
<style scoped>
div#exchanges {
display: block;
position: relative;
Expand Down
2 changes: 1 addition & 1 deletion components/content/ProseImg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const refinedSrc = computed(() => {
if (linkType(props.src) === LinkTypes.INTERNAL) {
return withBase(
removeGitbook(props.src),
useRuntimeConfig().public.baseURL
useRuntimeConfig().public.baseURL,
);
}
return removeGitbook(props.src);
Expand Down
155 changes: 155 additions & 0 deletions components/docs/item.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
<template>
<div
ref="scrollSpyContainer"
class="bg-page-radial-gradient-purple flex flex-col-reverse max-w-screen-xl mx-auto pb-10 md:!py-10 lg:!py-12 overflow-x-visible overflow-y-visible md:grid gap-5 md:gap-12 md:grid-cols-12"
>
<article
class="px-3 md:px-4 md:col-span-7 lg:col-span-9 prose max-w-none lg:prose-lg prose-invert prose-img:rounded-xl prose-a:!no-underline prose-a:text-beam-blue prose-h1:uppercase prose-h2:text-2xl prose-h3:text-base prose-h1:text-2xl prose-h1:tracking-[.25em] prose-h1:font-bold prose-h2:text-xl prose-img:shadow-xl"
>
<ContentDoc :path="routeName">
<template #default="{ doc }"
><CustomContentRenderer :value="doc"
/></template>
<template #not-found><h1>404 Not Found</h1></template>
</ContentDoc>
</article>

<aside class="md:col-span-5 lg:col-span-3 md:px-4">
<LayoutLink
class="stick capitalize group font-bold hidden md:block mcontainer py-4 mb-4 text-white/50 hover:text-white/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-[#360061] h-auto focus:ring-beam-purple hover:!bg-[#360061]"
:to="localePath('/docs')"
><div class="justify-center items-center gap-2 flex">
<Icon
class="ltr:rotate-180 block w-3 h-3 text-white group-hover:opacity-100 opacity-60 transition-opacity"
name="layout/arrow-right"
/>
{{ $t("docs.back") }}
</div>
</LayoutLink>
<section class="stick mcontainer">
<LayoutDropdown :always-show="true" :lock="false">
<template #dropdown-button>
<button
:title="t('docs.pagecontent')"
type="button"
class="border-b border-white border-opacity-10 md:hidden py-4 font-bold w-full justify-center items-center gap-2 uppercase flex md:mb-4 group-focus:outline-none group-focus:ring-2 group-focus:ring-offset-2 bg-[#290048] hover:bg-[#360061] focus:bg-[#360061] focus:ring-offset-[#360061] focus:ring-beam-purple text-white/50 hover:text-white/90 transition h-auto"
>
{{ $t("docs.pagecontent") }}
<Icon
class="rotate-90 block w-3 h-3 text-white group-hover:opacity-100 opacity-60 transition-opacity"
name="layout/arrow-right"
/>
</button>
</template>
<template #dropdown-content>
<div class="py-4">
<section class="py-4 md:pt-0 rounded-xl">
<h6>{{ $t("docs.summary") }}</h6>
<li
class="list-none mb-4 pb-4 border-b border-white/20 rtl:pl-5 ltr:pr-5"
>
<DocsNavigationItem
:article="index"
:route-name="routeName"
/>
</li>
<h6>{{ $t("docs.content") }}</h6>
<div
v-for="article in filteredList"
:key="article._path"
class="rtl:pl-5 ltr:pr-5"
>
<li class="list-none">
<DocsNavigationItem
:article="article"
:route-name="routeName"
/>
</li>
</div>
</section>
</div>
</template>
</LayoutDropdown>
</section>
</aside>
</div>
</template>

<script lang="ts" setup>
import { useRoute } from "vue-router";
import type {
ParsedContent,
QueryBuilder,
} from "@nuxt/content/dist/runtime/types/index";

const { t } = useI18n();
const localePath = useLocalePath();
const route = useRoute();
const scrollSpy = useScrollSpy();

const props = defineProps({
routeName: {
type: String,
required: true,
},
currentCategory: {
type: String,
required: true,
},
});

let everythingQuery: QueryBuilder<ParsedContent>;

switch (props.currentCategory) {
case "/docs/changelog":
everythingQuery = queryContent(props.currentCategory).sort({
title: -1,
});
break;
default:
everythingQuery = queryContent(props.currentCategory);
break;
}

const everything = ref(await everythingQuery.find());
const index = ref(
await queryContent(`${props.currentCategory}/readme`).findOne(),
);

if (!(await pageExist(props.routeName))) {
throw createError({ statusCode: 404, statusMessage: "Page not found" });
}

const scrollSpyContainer = ref<HTMLElement | null>(null);
scrollSpy({
target: scrollSpyContainer,
activeClass: "navigation-selected",
offset: 200,
});

const filteredList = computed(() => {
return everything.value.filter((article) => {
if (!article._path) {
return false;
}
const isSameCategoryArticle = isSameCategory(article._path, route);
const isIndexArticle = isIndex(article._path);
return (
!isPageBlacklisted(article._path) &&
isSameCategoryArticle &&
!isIndexArticle
);
});
});
</script>
<style scoped>
h6 {
@apply font-bold text-xs sm:text-base uppercase text-gray-200 mb-2 ltr:ml-4 rtl:mr-4;
}
aside .mcontainer {
@apply transition-colors border rounded-xl border-black border-opacity-30 transition shadow-[0px_0px_0px_1px_rgba(255,255,255,.05)_inset] bg-[#290048];
}
aside .stick {
@apply md:sticky md:h-auto md:top-[100px] md:self-start;
}
</style>
2 changes: 1 addition & 1 deletion components/download/divider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</div>
</div>
</template>
<style lang="postcss" scoped>
<style scoped>
.divider {
@apply flex-grow border-t border-white/5;
}
Expand Down
8 changes: 4 additions & 4 deletions components/download/downloader/item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ import { ref } from "vue";
import {
downloadFile,
EventType,
DownloadEvent,
extractFilenameFromUrl,
} from "@/utils/downloadFile";
import type { DownloadEvent } from "@/utils/downloadFile";

const { localeProperties } = useI18n();

Expand Down Expand Up @@ -201,12 +201,12 @@ async function startDownload() {
props.fileUrl,
props.expectedFileHash,
onDownloadProgress,
abortController.value.signal
abortController.value.signal,
);
finished.value = true;
emitters("download-finished");
} catch (internalError) {
console.error("Error downloading and verifying file:", internalError);
// console.error("Error downloading and verifying file:", internalError);
error.value = internalError as typeof Error;
finished.value = false;
emitters("download-error");
Expand All @@ -218,7 +218,7 @@ async function startDownload() {
}

function abortDownload() {
console.log("Download aborted");
// console.log("Download aborted");
if (abortController.value) {
abortController.value.abort(); // Abort the download
}
Expand Down
Loading