Skip to content

Commit

Permalink
Fix site build
Browse files Browse the repository at this point in the history
  • Loading branch information
ericfennis committed Jun 21, 2024
1 parent 1c6262b commit 117b098
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 56 deletions.
11 changes: 0 additions & 11 deletions docs/.vitepress/data/packageData.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,5 @@
"href": "https://www.npmjs.com/package/lucide-static"
}
]
},
"lucide-flutter": {
"order": 9,
"icon": "flutter",
"shields": [
{
"alt": "flutter",
"src": "https://img.shields.io/pub/v/lucide_icons",
"href": "https://img.shields.io/pub/v/lucide_icons"
}
]
}
}
6 changes: 0 additions & 6 deletions docs/.vitepress/lib/fetchPackages.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { promises as fs, constants } from 'fs';
import path from 'path';
import yaml from 'js-yaml';
import { PackageItem } from '../theme/types';

const fileExist = (filePath) =>
Expand All @@ -27,11 +26,6 @@ const fetchPackages = async (): Promise<PackageItem[]> => {
return JSON.parse(await fs.readFile(jsonFilePath, 'utf-8'));
}

const ymlFilePath = path.resolve(filePath, 'pubspec.yaml');
if (await fileExist(ymlFilePath)) {
return yaml.load(await fs.readFile(ymlFilePath, 'utf-8'));
}

return null;
}),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import fetchPackages from '../../../lib/fetchPackages';
export default {
async load() {
const packages = await fetchPackages();

return {
packages: packages
.filter((p) => p.name in packageData)
.filter((p) => p?.name != null && p.name in packageData)
.map((pData) => ({
...pData,
...packageData[pData.name],
Expand Down
3 changes: 2 additions & 1 deletion docs/.vitepress/theme/components/packages/PackageList.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<script setup lang="ts">
import { data } from './PackageList.data'
import GridSection from '../base/GridSection.vue'
import PackageListItem from "./PackageListItem.vue";</script>
import PackageListItem from "./PackageListItem.vue";
</script>

<template>
<GridSection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const props = defineProps<{
<img v-if="packageData.iconDark" :src="packageData.iconDark" alt="" class="package-icon dark" :class="packageData.iconClass" />
</div>
<div class="package-title">
<h2 class="title">{{ props.packageData.name }}</h2>
<h2 class="title">{{ props.packageData?.name }}</h2>
<a v-for="shield in props.packageData.shields" :href="shield.href" class="package-shield" rel="noreferrer noopener">
<img :src="shield.src" :alt="shield.href" />
</a>
Expand Down
1 change: 0 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
"@vueuse/core": "^10.7.2",
"element-to-path": "^1.2.1",
"fuse.js": "^6.5.3",
"js-yaml": "^4.1.0",
"jszip": "^3.7.0",
"lodash": "^4.17.20",
"lodash-es": "^4.17.21",
Expand Down
56 changes: 21 additions & 35 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 117b098

Please sign in to comment.