mirror of https://github.com/mermaid-js/mermaid
Fix avatar fetching
parent
9238deaf00
commit
99abd4c31b
|
@ -38,6 +38,7 @@
|
|||
"dompurify",
|
||||
"edgechromium",
|
||||
"elkjs",
|
||||
"esno",
|
||||
"faber",
|
||||
"flatmap",
|
||||
"ftplugin",
|
||||
|
@ -50,10 +51,12 @@
|
|||
"grav",
|
||||
"greywolf",
|
||||
"huynh",
|
||||
"huynhicode",
|
||||
"inkdrop",
|
||||
"jaoude",
|
||||
"jgreywolf",
|
||||
"jison",
|
||||
"jiti",
|
||||
"kaufmann",
|
||||
"khroma",
|
||||
"klemm",
|
||||
|
@ -79,6 +82,7 @@
|
|||
"mult",
|
||||
"ohmyfetch",
|
||||
"orlandoni",
|
||||
"pathe",
|
||||
"pbrolin",
|
||||
"phpbb",
|
||||
"plantuml",
|
||||
|
@ -119,6 +123,7 @@
|
|||
"vinod",
|
||||
"visio",
|
||||
"vitepress",
|
||||
"vueuse",
|
||||
"xlink",
|
||||
"yash"
|
||||
],
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
// generated by unplugin-vue-components
|
||||
// We suggest you to commit this file into source control
|
||||
/* eslint-disable */
|
||||
/* prettier-ignore */
|
||||
// @ts-nocheck
|
||||
// Generated by unplugin-vue-components
|
||||
// Read more: https://github.com/vuejs/core/pull/3399
|
||||
import '@vue/runtime-core'
|
||||
|
||||
|
|
|
@ -5,48 +5,55 @@
|
|||
"tylerlong",
|
||||
"ashishjain0512",
|
||||
"weedySeaDragon",
|
||||
"aloisklink",
|
||||
"mmorel-35",
|
||||
"GDFaber",
|
||||
"aloisklink",
|
||||
"klemmchr",
|
||||
"jgreywolf",
|
||||
"cmmoran",
|
||||
"Yash-Singh1",
|
||||
"IOrlandoni",
|
||||
"raghur",
|
||||
"pbrolin47",
|
||||
"SeanKilleen",
|
||||
"erelling",
|
||||
"spopida",
|
||||
"emersonbottero",
|
||||
"bjowes",
|
||||
"huynhicode",
|
||||
"Andre601",
|
||||
"dbartholomae",
|
||||
"gibson042",
|
||||
"pbrolin47",
|
||||
"chrismoran-bkt",
|
||||
"abzicht",
|
||||
"gwincr11",
|
||||
"mearns",
|
||||
"spier",
|
||||
"BastianZim",
|
||||
"JeremyFunk",
|
||||
"remcohaszing",
|
||||
"Billiam",
|
||||
"devcer",
|
||||
"sagea",
|
||||
"DKurilo",
|
||||
"gijswijs",
|
||||
"timmaffett",
|
||||
"tomperr",
|
||||
"pinghe",
|
||||
"ciekawy",
|
||||
"lexmin0412",
|
||||
"karistom",
|
||||
"koljatm-edeka",
|
||||
"notquiterussell",
|
||||
"spect88",
|
||||
"huynhicode",
|
||||
"oleveau",
|
||||
"ted-marozzi",
|
||||
"dany74q",
|
||||
"johnnywalker",
|
||||
"72636c",
|
||||
"therzka",
|
||||
"fardog",
|
||||
"Mogztter",
|
||||
"ggrossetie",
|
||||
"bollwyvl",
|
||||
"adamwulf",
|
||||
"elliot-nelson",
|
||||
|
@ -56,8 +63,9 @@
|
|||
"flying-sheep",
|
||||
"vallsv",
|
||||
"Xstoudi",
|
||||
"lishid",
|
||||
"arpansaha13",
|
||||
"Some-Dood",
|
||||
"BastiDood",
|
||||
"DanShai",
|
||||
"LarryKlugerDS",
|
||||
"MasonM",
|
||||
|
@ -65,7 +73,6 @@
|
|||
"sechel",
|
||||
"swoyam2609",
|
||||
"abhijeet-pathak",
|
||||
"lishid",
|
||||
"eajenkins",
|
||||
"harshilparmar",
|
||||
"Guy-Adler",
|
||||
|
@ -79,35 +86,42 @@
|
|||
"keenanjt33",
|
||||
"lf-novelt",
|
||||
"faisalarbain",
|
||||
"Will-Low",
|
||||
"cm-wada-yusuke",
|
||||
"ymgch",
|
||||
"yutotnh",
|
||||
"arnaud-zg",
|
||||
"BD103",
|
||||
"Mister-Hope",
|
||||
"Omerr",
|
||||
"Aniket1026",
|
||||
"bish0polis",
|
||||
"CalebUsadi",
|
||||
"gene1wood",
|
||||
"gillesdemey",
|
||||
"jeroen-ekkelkamp",
|
||||
"josh-bouganim-avant",
|
||||
"JoshSharpe",
|
||||
"heyfirst",
|
||||
"knuts-ic",
|
||||
"kshitijsaksena",
|
||||
"loris-intergalactique",
|
||||
"lindseywild",
|
||||
"tmatz",
|
||||
"mahomedalid",
|
||||
"doble-eme",
|
||||
"Mister-Hope",
|
||||
"MrCoder",
|
||||
"pbendersky",
|
||||
"Pr0dt0s",
|
||||
"Rutorai",
|
||||
"ThanasisMpalatsoukas",
|
||||
"thomasleveil",
|
||||
"tomperr",
|
||||
"husa",
|
||||
"abeaton",
|
||||
"anugs",
|
||||
"ginomempin",
|
||||
"lilisha100",
|
||||
"nekikara",
|
||||
"nothingismagick",
|
||||
"phairow",
|
||||
"deining",
|
||||
|
@ -117,17 +131,20 @@
|
|||
"vijay40",
|
||||
"0xflotus",
|
||||
"AndreasVolkmann",
|
||||
"andrew-clarkson",
|
||||
"ashsearle",
|
||||
"bish0polis",
|
||||
"DawMatt",
|
||||
"frankschmitt",
|
||||
"guilhermgonzaga",
|
||||
"ggpasqualino",
|
||||
"hrgui",
|
||||
"IanLee1521",
|
||||
"jbednar",
|
||||
"jdavis61",
|
||||
"jayvdb",
|
||||
"jonabc",
|
||||
"jbronson-sf",
|
||||
"lauraceconi",
|
||||
"lorint",
|
||||
"MindaugasLaganeckas",
|
||||
"u-minor",
|
||||
|
@ -139,29 +156,32 @@
|
|||
"larkinscott",
|
||||
"The-Alchemist",
|
||||
"TomWright",
|
||||
"LeoDog896",
|
||||
"tshepang",
|
||||
"Vrixyz",
|
||||
"sinedied",
|
||||
"yonasb",
|
||||
"Zer0n0mask",
|
||||
"luin",
|
||||
"brookhong",
|
||||
"Jeff-Tian",
|
||||
"edumicse",
|
||||
"eitsupi",
|
||||
"ilmari-lauhakangas",
|
||||
"jasmaa",
|
||||
"sy-records",
|
||||
"uttk",
|
||||
"el-mapache",
|
||||
"bigred8982",
|
||||
"imgss",
|
||||
"Joxtacy",
|
||||
"mrmanc",
|
||||
"riaanduplessis",
|
||||
"sylhare",
|
||||
"vikyaiyer",
|
||||
"CollierCZ",
|
||||
"adutton",
|
||||
"adam-hotait",
|
||||
"ameech",
|
||||
"AielloChan",
|
||||
"AlanHohn",
|
||||
"aledileo",
|
||||
"alexislefebvre",
|
||||
|
@ -185,9 +205,9 @@
|
|||
"Arthaey",
|
||||
"AsaAyers",
|
||||
"bglnelissen",
|
||||
"Barry1",
|
||||
"ben-page",
|
||||
"jawn",
|
||||
"Billiam",
|
||||
"xbojch",
|
||||
"craigmac",
|
||||
"hydrosquall",
|
||||
|
@ -197,13 +217,16 @@
|
|||
"dodoinblue",
|
||||
"ctruelson",
|
||||
"beaudry",
|
||||
"Odogwudozilla",
|
||||
"ct-martin",
|
||||
"Whoeza",
|
||||
"Clint-Chester",
|
||||
"connor4312",
|
||||
"DCsunset",
|
||||
"activus-d",
|
||||
"DanInProgress",
|
||||
"egnor",
|
||||
"cakemanny",
|
||||
"Olshansk",
|
||||
"danielsitnik",
|
||||
"dariuswiles",
|
||||
|
@ -224,9 +247,12 @@
|
|||
"FabAlchemy",
|
||||
"fregante",
|
||||
"filipedeschamps",
|
||||
"fkohrt",
|
||||
"Foo-x",
|
||||
"Frank-Mayer",
|
||||
"l2fprod",
|
||||
"gwatts",
|
||||
"GavinPen",
|
||||
"gnkm",
|
||||
"gjlubbertsen",
|
||||
"guidanoli",
|
||||
|
@ -234,9 +260,11 @@
|
|||
"H3RSKO",
|
||||
"hwine",
|
||||
"HerbCaudill",
|
||||
"LiHowe",
|
||||
"TribalNightOwl",
|
||||
"hugovk",
|
||||
"jolting",
|
||||
"imgss",
|
||||
"ImanimalXI",
|
||||
"ImgBotApp",
|
||||
"imma90",
|
||||
|
@ -258,7 +286,7 @@
|
|||
"jinntrance",
|
||||
"jmelfi",
|
||||
"Qix-",
|
||||
"jmg-duarte",
|
||||
"xuanxu",
|
||||
"kahgoh",
|
||||
"Schweinepriester",
|
||||
"Kaligule",
|
||||
|
@ -269,6 +297,7 @@
|
|||
"kriskhaira",
|
||||
"kale-stew",
|
||||
"Lance-DC",
|
||||
"Valentine14th",
|
||||
"kciter",
|
||||
"zaaath",
|
||||
"manicki",
|
||||
|
@ -287,19 +316,24 @@
|
|||
"ma-zal",
|
||||
"mgaitan",
|
||||
"mapio",
|
||||
"mre",
|
||||
"matteodelabre",
|
||||
"maxArturo",
|
||||
"DavertMik",
|
||||
"mgenereu",
|
||||
"maiermic",
|
||||
"vorburger",
|
||||
"magmax",
|
||||
"quulah",
|
||||
"mbostock",
|
||||
"Crocin",
|
||||
"natasha-jarus",
|
||||
"elv-nate",
|
||||
"NateChurch",
|
||||
"gerardnico",
|
||||
"NitinLodha2812",
|
||||
"Oliboy50",
|
||||
"piradata",
|
||||
"hype09",
|
||||
"pje",
|
||||
"saulgajda",
|
||||
|
@ -310,6 +344,9 @@
|
|||
"reetghosh1",
|
||||
"renanlecaro",
|
||||
"Renfay007",
|
||||
"riaanduplessis",
|
||||
"RobertWeinmeister",
|
||||
"rodja",
|
||||
"wontonst",
|
||||
"RudolfMan",
|
||||
"SlideeScherz",
|
||||
|
@ -332,56 +369,24 @@
|
|||
"commai",
|
||||
"MetalBlueberry",
|
||||
"volkanunsal",
|
||||
"Julez404",
|
||||
"yudenzel",
|
||||
"uskey512",
|
||||
"zakhenry",
|
||||
"abergquist",
|
||||
"JiChao99",
|
||||
"aryandeelwal",
|
||||
"atmikeguo",
|
||||
"avijit1258",
|
||||
"bby-bishopclark",
|
||||
"beriakomal",
|
||||
"Bogay",
|
||||
"bolshoytoster",
|
||||
"chrismetz09",
|
||||
"christopherkade",
|
||||
"tenuki",
|
||||
"dix",
|
||||
"dkkb",
|
||||
"endolith",
|
||||
"eel87",
|
||||
"esphas",
|
||||
"raptor0929",
|
||||
"flywire",
|
||||
"gkchic",
|
||||
"gomlgs",
|
||||
"hikerpig",
|
||||
"hopoverflow",
|
||||
"hughli-git",
|
||||
"ishuen",
|
||||
"it-sec-std",
|
||||
"it0a",
|
||||
"ivan-danilov",
|
||||
"kerwin612",
|
||||
"kuanyi-ng",
|
||||
"laDanz",
|
||||
"lgasp",
|
||||
"mahimas28",
|
||||
"may4everL",
|
||||
"meganemura",
|
||||
"monsterkrampe",
|
||||
"mupple",
|
||||
"mvandermade",
|
||||
"penenkel",
|
||||
"r-a-v-a-s",
|
||||
"ryenus",
|
||||
"alguerocode",
|
||||
"siddhant-tripathy1",
|
||||
"sifb",
|
||||
"silverwind",
|
||||
"wfnuser",
|
||||
"chewnoill",
|
||||
"znxkznxk1030",
|
||||
"zepatrik",
|
||||
"zephyraft",
|
||||
"zwpaper",
|
||||
"hetz"
|
||||
]
|
||||
"eel87"
|
||||
]
|
|
@ -16,7 +16,7 @@ export interface CoreTeam {
|
|||
// required to download avatars from GitHub
|
||||
github: string;
|
||||
twitter?: string;
|
||||
mastodon?: string
|
||||
mastodon?: string;
|
||||
sponsor?: string;
|
||||
website?: string;
|
||||
linkedIn?: string;
|
||||
|
@ -29,35 +29,32 @@ export interface CoreTeam {
|
|||
const contributorNames: string[] = contributorNamesJson;
|
||||
const contributorsAvatars: Record<string, string> = {};
|
||||
|
||||
const getAvatarUrl = (name: string) =>
|
||||
import.meta.hot ? `https://github.com/${name}.png` : `/user-avatars/${name}.png`;
|
||||
|
||||
export const contributors = (contributorNames as string[]).reduce((acc, name) => {
|
||||
contributorsAvatars[name] = getAvatarUrl(name)
|
||||
acc.push({ name, avatar: contributorsAvatars[name] })
|
||||
return acc
|
||||
}, [] as Contributor[])
|
||||
contributorsAvatars[name] = `/user-avatars/${name}.png`;
|
||||
acc.push({ name, avatar: contributorsAvatars[name] });
|
||||
return acc;
|
||||
}, [] as Contributor[]);
|
||||
|
||||
const websiteSVG = {
|
||||
svg: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-globe"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>'
|
||||
}
|
||||
svg: '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-globe"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>',
|
||||
};
|
||||
|
||||
const createLinks = (tm: CoreTeam): CoreTeam => {
|
||||
tm.links = [{ icon: 'github', link: `https://github.com/${tm.github}` }]
|
||||
tm.links = [{ icon: 'github', link: `https://github.com/${tm.github}` }];
|
||||
if (tm.mastodon) {
|
||||
tm.links.push({ icon: 'mastodon', link: tm.mastodon })
|
||||
tm.links.push({ icon: 'mastodon', link: tm.mastodon });
|
||||
}
|
||||
if (tm.twitter) {
|
||||
tm.links.push({ icon: 'twitter', link: `https://twitter.com/${tm.twitter}` })
|
||||
tm.links.push({ icon: 'twitter', link: `https://twitter.com/${tm.twitter}` });
|
||||
}
|
||||
if (tm.website) {
|
||||
tm.links.push({ icon: websiteSVG, link: tm.website })
|
||||
tm.links.push({ icon: websiteSVG, link: tm.website });
|
||||
}
|
||||
if (tm.linkedIn) {
|
||||
tm.links.push({ icon: 'linkedin', link: `https://www.linkedin.com/in/${tm.linkedIn}` })
|
||||
tm.links.push({ icon: 'linkedin', link: `https://www.linkedin.com/in/${tm.linkedIn}` });
|
||||
}
|
||||
return tm
|
||||
}
|
||||
return tm;
|
||||
};
|
||||
|
||||
const plainTeamMembers: CoreTeam[] = [
|
||||
{
|
||||
|
@ -72,13 +69,13 @@ const plainTeamMembers: CoreTeam[] = [
|
|||
github: 'NeilCuzon',
|
||||
avatar: contributorsAvatars.NeilCuzon,
|
||||
name: 'Neil Cuzon',
|
||||
title: 'Developer'
|
||||
title: 'Developer',
|
||||
},
|
||||
{
|
||||
github: 'tylerlong',
|
||||
avatar: contributorsAvatars.tylerlong,
|
||||
name: 'Tyler Liu',
|
||||
title: 'Developer'
|
||||
title: 'Developer',
|
||||
},
|
||||
{
|
||||
github: 'sidharthv96',
|
||||
|
@ -89,20 +86,20 @@ const plainTeamMembers: CoreTeam[] = [
|
|||
mastodon: 'https://techhub.social/@sidv',
|
||||
sponsor: 'https://github.com/sponsors/sidharthv96',
|
||||
linkedIn: 'sidharth-vinod',
|
||||
website: 'https://sidharth.dev'
|
||||
website: 'https://sidharth.dev',
|
||||
},
|
||||
{
|
||||
github: 'ashishjain0512',
|
||||
avatar: contributorsAvatars.ashishjain0512,
|
||||
name: 'Ashish Jain',
|
||||
title: 'Developer'
|
||||
title: 'Developer',
|
||||
},
|
||||
{
|
||||
github: 'mmorel-35',
|
||||
avatar: contributorsAvatars['mmorel-35'],
|
||||
name: 'Matthieu Morel',
|
||||
title: 'Developer',
|
||||
linkedIn: 'matthieumorel35'
|
||||
linkedIn: 'matthieumorel35',
|
||||
},
|
||||
{
|
||||
github: 'aloisklink',
|
||||
|
@ -110,48 +107,54 @@ const plainTeamMembers: CoreTeam[] = [
|
|||
name: 'Alois Klink',
|
||||
title: 'Developer',
|
||||
linkedIn: 'aloisklink',
|
||||
website: 'https://aloisklink.com'
|
||||
website: 'https://aloisklink.com',
|
||||
},
|
||||
{
|
||||
github: 'pbrolin47',
|
||||
avatar: contributorsAvatars.pbrolin47,
|
||||
name: 'Per Brolin',
|
||||
title: 'Developer'
|
||||
title: 'Developer',
|
||||
},
|
||||
{
|
||||
github: 'Yash-Singh1',
|
||||
avatar: contributorsAvatars['Yash-Singh1'],
|
||||
name: 'Yash Singh',
|
||||
title: 'Developer'
|
||||
title: 'Developer',
|
||||
},
|
||||
{
|
||||
github: 'GDFaber',
|
||||
avatar: contributorsAvatars.GDFaber,
|
||||
name: 'Marc Faber',
|
||||
title: 'Developer',
|
||||
linkedIn: 'marc-faber'
|
||||
linkedIn: 'marc-faber',
|
||||
},
|
||||
{
|
||||
github: 'MindaugasLaganeckas',
|
||||
avatar: contributorsAvatars.MindaugasLaganeckas,
|
||||
name: 'Mindaugas Laganeckas',
|
||||
title: 'Developer'
|
||||
title: 'Developer',
|
||||
},
|
||||
{
|
||||
github: 'jgreywolf',
|
||||
avatar: contributorsAvatars.jgreywolf,
|
||||
name: 'Justin Greywolf',
|
||||
title: 'Developer'
|
||||
title: 'Developer',
|
||||
},
|
||||
{
|
||||
github: 'IOrlandoni',
|
||||
avatar: contributorsAvatars.IOrlandoni,
|
||||
name: 'Nacho Orlandoni',
|
||||
title: 'Developer'
|
||||
title: 'Developer',
|
||||
},
|
||||
]
|
||||
{
|
||||
github: 'huynhicode',
|
||||
avatar: contributorsAvatars.huynhicode,
|
||||
name: 'Steph Huynh',
|
||||
title: 'Developer',
|
||||
},
|
||||
];
|
||||
|
||||
const teamMembers = plainTeamMembers.map(tm => createLinks(tm))
|
||||
teamMembers.sort((a, b) => contributorNames.indexOf(a.github) - contributorNames.indexOf(b.github))
|
||||
const teamMembers = plainTeamMembers.map((tm) => createLinks(tm));
|
||||
teamMembers.sort((a, b) => contributorNames.indexOf(a.github) - contributorNames.indexOf(b.github));
|
||||
|
||||
export { teamMembers }
|
||||
export { teamMembers };
|
||||
|
|
|
@ -1,32 +1,33 @@
|
|||
import { join, resolve } from 'pathe'
|
||||
import fs from 'fs-extra'
|
||||
import { $fetch } from 'ohmyfetch'
|
||||
import fs from 'fs-extra';
|
||||
import { fileURLToPath } from 'url';
|
||||
import { $fetch } from 'ohmyfetch';
|
||||
|
||||
const docsDir = resolve(__dirname, '../..')
|
||||
const pathContributors = resolve(docsDir, '.vitepress/contributor-names.json')
|
||||
const dirAvatars = resolve(docsDir, 'public/user-avatars/')
|
||||
const dirSponsors = resolve(docsDir, 'public/sponsors/')
|
||||
const pathContributors = new URL('../contributor-names.json', import.meta.url);
|
||||
const getAvatarPath = (name: string) =>
|
||||
new URL(`../../public/user-avatars/${name}.png`, import.meta.url);
|
||||
// const dirSponsors = resolve(docsDir, 'public/sponsors/')
|
||||
|
||||
let contributors: string[] = []
|
||||
let contributors: string[] = [];
|
||||
|
||||
async function download(url: string, fileName: string) {
|
||||
if (fs.existsSync(fileName))
|
||||
return
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('downloading', fileName)
|
||||
try {
|
||||
const image = await $fetch(url, { responseType: 'arrayBuffer' })
|
||||
await fs.writeFile(fileName, Buffer.from(image))
|
||||
}
|
||||
catch {
|
||||
}
|
||||
async function download(url: string, fileName: URL) {
|
||||
if (fs.existsSync(fileName)) return;
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('downloading', fileName);
|
||||
try {
|
||||
const image = await $fetch(url, { responseType: 'arrayBuffer' });
|
||||
await fs.writeFile(fileName, Buffer.from(image));
|
||||
} catch {}
|
||||
}
|
||||
|
||||
async function fetchAvatars() {
|
||||
await fs.ensureDir(dirAvatars)
|
||||
contributors = JSON.parse(await fs.readFile(pathContributors, { encoding: 'utf-8' }))
|
||||
await fs.ensureDir(fileURLToPath(new URL('..', getAvatarPath('none'))));
|
||||
contributors = JSON.parse(await fs.readFile(pathContributors, { encoding: 'utf-8' }));
|
||||
|
||||
await Promise.all(contributors.map(name => download(`https://github.com/${name}.png?size=100`, join(dirAvatars, `${name}.png`))))
|
||||
await Promise.allSettled(
|
||||
contributors.map((name) =>
|
||||
download(`https://github.com/${name}.png?size=100`, getAvatarPath(name))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// async function fetchSponsors() {
|
||||
|
@ -36,5 +37,5 @@ async function fetchAvatars() {
|
|||
// await download('https://cdn.jsdelivr.net/gh/sheremet-va/static/sponsors.svg', join(dirSponsors, 'sheremet-va.svg'))
|
||||
// }
|
||||
|
||||
fetchAvatars()
|
||||
fetchAvatars();
|
||||
// fetchSponsors()
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
import { writeFile } from 'node:fs/promises';
|
||||
import { $fetch } from 'ohmyfetch';
|
||||
|
||||
const pathContributors = new URL('../contributor-names.json', import.meta.url);
|
||||
|
||||
interface Contributor {
|
||||
login: string;
|
||||
}
|
||||
|
@ -30,11 +32,7 @@ async function fetchContributors() {
|
|||
|
||||
async function generate() {
|
||||
const collaborators = await fetchContributors();
|
||||
await writeFile(
|
||||
'./packages/mermaid/src/docs/.vitepress/contributor-names.json',
|
||||
`${JSON.stringify(collaborators, null, 2)}\n`,
|
||||
'utf8'
|
||||
);
|
||||
await writeFile(pathContributors, JSON.stringify(collaborators, null, 2), 'utf8');
|
||||
}
|
||||
|
||||
void generate();
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"name": "docs",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vitepress --port 3333 --open",
|
||||
"build": "nr prefetch && vitepress build",
|
||||
|
@ -8,28 +9,31 @@
|
|||
"serve": "vitepress serve",
|
||||
"preview-https": "pnpm run build && serve .vitepress/dist",
|
||||
"preview-https-no-prefetch": "pnpm run build-no-prefetch && serve .vitepress/dist",
|
||||
"prefetch": "esno .vitepress/scripts/fetch-avatars.ts"
|
||||
"prefetch": "pnpm run fetch-contributors && pnpm run fetch-avatars",
|
||||
"fetch-avatars": "esno .vitepress/scripts/fetch-avatars.ts",
|
||||
"fetch-contributors": "esno .vitepress/scripts/fetch-contributors.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vueuse/core": "^9.10.0",
|
||||
"jiti": "^1.16.1",
|
||||
"vue": "latest"
|
||||
"@vueuse/core": "^10.1.0",
|
||||
"jiti": "^1.18.2",
|
||||
"vue": "^3.2.47"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@iconify-json/carbon": "^1.1.13",
|
||||
"@unocss/reset": "^0.48.3",
|
||||
"@vite-pwa/vitepress": "^0.0.4",
|
||||
"@vitejs/plugin-vue": "latest",
|
||||
"@iconify-json/carbon": "^1.1.16",
|
||||
"@types/fs-extra": "^11.0.1",
|
||||
"@unocss/reset": "^0.51.8",
|
||||
"@vite-pwa/vitepress": "^0.0.5",
|
||||
"@vitejs/plugin-vue": "^4.2.1",
|
||||
"esno": "^0.16.3",
|
||||
"fast-glob": "^3.2.12",
|
||||
"fs-extra": "^10.1.0",
|
||||
"fs-extra": "^11.1.1",
|
||||
"https-localhost": "^4.7.1",
|
||||
"pathe": "^1.1.0",
|
||||
"unocss": "^0.48.3",
|
||||
"unplugin-vue-components": "^0.22.12",
|
||||
"vite": "^4.1.4",
|
||||
"vite-plugin-pwa": "^0.14.1",
|
||||
"vitepress": "1.0.0-alpha.47",
|
||||
"unocss": "^0.51.8",
|
||||
"unplugin-vue-components": "^0.24.1",
|
||||
"vite": "^4.3.3",
|
||||
"vite-plugin-pwa": "^0.14.7",
|
||||
"vitepress": "1.0.0-alpha.74",
|
||||
"workbox-window": "^6.5.4"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,11 +3,11 @@ import type { PluginOption, Plugin } from 'vite';
|
|||
import path from 'path';
|
||||
// @ts-expect-error This package has an incorrect export map.
|
||||
import { SearchPlugin } from 'vitepress-plugin-search';
|
||||
import fs from 'fs'
|
||||
import Components from 'unplugin-vue-components/vite'
|
||||
import Unocss from 'unocss/vite'
|
||||
import { presetAttributify, presetIcons, presetUno } from 'unocss'
|
||||
import { resolve } from 'pathe'
|
||||
import fs from 'fs';
|
||||
import Components from 'unplugin-vue-components/vite';
|
||||
import Unocss from 'unocss/vite';
|
||||
import { presetAttributify, presetIcons, presetUno } from 'unocss';
|
||||
import { resolve } from 'pathe';
|
||||
|
||||
const virtualModuleId = 'virtual:mermaid-config';
|
||||
const resolvedVirtualModuleId = '\0' + virtualModuleId;
|
||||
|
@ -19,14 +19,19 @@ export default defineConfig({
|
|||
exclude: ['vitepress'],
|
||||
},
|
||||
plugins: [
|
||||
// @ts-ignore This package has an incorrect exports.
|
||||
Components({
|
||||
include: [/\.vue/, /\.md/],
|
||||
dirs: '.vitepress/components',
|
||||
dts: '.vitepress/components.d.ts',
|
||||
}) as Plugin,
|
||||
// @ts-ignore This package has an incorrect exports.
|
||||
Unocss({
|
||||
shortcuts: [
|
||||
['btn', 'px-4 py-1 rounded inline-flex justify-center gap-2 text-white leading-30px children:mya !no-underline cursor-pointer disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50'],
|
||||
[
|
||||
'btn',
|
||||
'px-4 py-1 rounded inline-flex justify-center gap-2 text-white leading-30px children:mya !no-underline cursor-pointer disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50',
|
||||
],
|
||||
],
|
||||
presets: [
|
||||
presetUno({
|
||||
|
@ -80,21 +85,20 @@ export default defineConfig({
|
|||
},
|
||||
});
|
||||
|
||||
|
||||
function IncludesPlugin(): Plugin {
|
||||
return {
|
||||
name: 'include-plugin',
|
||||
enforce: 'pre',
|
||||
transform(code: string, id: string): string | undefined {
|
||||
let changed = false
|
||||
let changed = false;
|
||||
code = code.replace(/\[@@include]\((.*?)\)/, (_: string, url: any): string => {
|
||||
changed = true
|
||||
const full = resolve(id, url)
|
||||
return fs.readFileSync(full, 'utf-8')
|
||||
})
|
||||
changed = true;
|
||||
const full = resolve(id, url);
|
||||
return fs.readFileSync(full, 'utf-8');
|
||||
});
|
||||
if (changed) {
|
||||
return code
|
||||
return code;
|
||||
}
|
||||
},
|
||||
} as Plugin
|
||||
} as Plugin;
|
||||
}
|
||||
|
|
9036
pnpm-lock.yaml
9036
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue