mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-16 06:49:31 +02:00
Remove unnecessary dependencies
Co-authored-by: Alois Klink <alois.klink@gmail.com>
This commit is contained in:
@@ -80,7 +80,6 @@
|
|||||||
"mkdocs",
|
"mkdocs",
|
||||||
"mmorel",
|
"mmorel",
|
||||||
"mult",
|
"mult",
|
||||||
"ohmyfetch",
|
|
||||||
"orlandoni",
|
"orlandoni",
|
||||||
"pathe",
|
"pathe",
|
||||||
"pbrolin",
|
"pbrolin",
|
||||||
|
@@ -99,7 +99,6 @@
|
|||||||
"jest": "^29.5.0",
|
"jest": "^29.5.0",
|
||||||
"jison": "^0.4.18",
|
"jison": "^0.4.18",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"ohmyfetch": "^0.4.21",
|
|
||||||
"jsdom": "^21.1.1",
|
"jsdom": "^21.1.1",
|
||||||
"lint-staged": "^13.2.1",
|
"lint-staged": "^13.2.1",
|
||||||
"path-browserify": "^1.0.1",
|
"path-browserify": "^1.0.1",
|
||||||
|
1
packages/mermaid/.gitignore
vendored
1
packages/mermaid/.gitignore
vendored
@@ -3,3 +3,4 @@ src/docs/config/setup
|
|||||||
README.*
|
README.*
|
||||||
src/docs/public/user-avatars/
|
src/docs/public/user-avatars/
|
||||||
src/docs/.vitepress/cache
|
src/docs/.vitepress/cache
|
||||||
|
src/docs/.vitepress/components.d.ts
|
||||||
|
@@ -1,15 +0,0 @@
|
|||||||
/* eslint-disable */
|
|
||||||
/* prettier-ignore */
|
|
||||||
// @ts-nocheck
|
|
||||||
// Generated by unplugin-vue-components
|
|
||||||
// Read more: https://github.com/vuejs/core/pull/3399
|
|
||||||
import '@vue/runtime-core'
|
|
||||||
|
|
||||||
export {};
|
|
||||||
|
|
||||||
declare module '@vue/runtime-core' {
|
|
||||||
export interface GlobalComponents {
|
|
||||||
Contributors: typeof import('./components/Contributors.vue')['default'];
|
|
||||||
HomePage: typeof import('./components/HomePage.vue')['default'];
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,28 +1,28 @@
|
|||||||
import fs from 'fs-extra';
|
import { mkdir, writeFile, readFile } from 'node:fs/promises';
|
||||||
|
import { existsSync } from 'node:fs';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
import { $fetch } from 'ohmyfetch';
|
|
||||||
|
|
||||||
const pathContributors = new URL('../contributor-names.json', import.meta.url);
|
const pathContributors = new URL('../contributor-names.json', import.meta.url);
|
||||||
const getAvatarPath = (name: string) =>
|
const getAvatarPath = (name: string) =>
|
||||||
new URL(`../../public/user-avatars/${name}.png`, import.meta.url);
|
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: URL) {
|
async function download(url: string, fileName: URL) {
|
||||||
if (fs.existsSync(fileName)) return;
|
if (existsSync(fileName)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.log('downloading', fileName);
|
console.log('downloading', fileName);
|
||||||
try {
|
try {
|
||||||
const image = await $fetch(url, { responseType: 'arrayBuffer' });
|
const image = await fetch(url);
|
||||||
await fs.writeFile(fileName, Buffer.from(image));
|
await writeFile(fileName, Buffer.from(await image.arrayBuffer()));
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchAvatars() {
|
async function fetchAvatars() {
|
||||||
await fs.ensureDir(fileURLToPath(new URL('..', getAvatarPath('none'))));
|
await mkdir(fileURLToPath(new URL('..', getAvatarPath('none'))), { recursive: true });
|
||||||
contributors = JSON.parse(await fs.readFile(pathContributors, { encoding: 'utf-8' }));
|
contributors = JSON.parse(await readFile(pathContributors, { encoding: 'utf-8' }));
|
||||||
|
|
||||||
await Promise.allSettled(
|
await Promise.allSettled(
|
||||||
contributors.map((name) =>
|
contributors.map((name) =>
|
||||||
download(`https://github.com/${name}.png?size=100`, getAvatarPath(name))
|
download(`https://github.com/${name}.png?size=100`, getAvatarPath(name))
|
||||||
@@ -30,12 +30,4 @@ async function fetchAvatars() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// async function fetchSponsors() {
|
|
||||||
// await fs.ensureDir(dirSponsors)
|
|
||||||
// await download('https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg', join(dirSponsors, 'antfu.svg'))
|
|
||||||
// await download('https://cdn.jsdelivr.net/gh/patak-dev/static/sponsors.svg', join(dirSponsors, 'patak-dev.svg'))
|
|
||||||
// await download('https://cdn.jsdelivr.net/gh/sheremet-va/static/sponsors.svg', join(dirSponsors, 'sheremet-va.svg'))
|
|
||||||
// }
|
|
||||||
|
|
||||||
fetchAvatars();
|
fetchAvatars();
|
||||||
// fetchSponsors()
|
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
// Adapted from https://github.dev/vitest-dev/vitest/blob/991ff33ab717caee85ef6cbe1c16dc514186b4cc/scripts/update-contributors.ts#L6
|
// Adapted from https://github.dev/vitest-dev/vitest/blob/991ff33ab717caee85ef6cbe1c16dc514186b4cc/scripts/update-contributors.ts#L6
|
||||||
|
|
||||||
import { writeFile } from 'node:fs/promises';
|
import { writeFile } from 'node:fs/promises';
|
||||||
import { $fetch } from 'ohmyfetch';
|
|
||||||
|
|
||||||
const pathContributors = new URL('../contributor-names.json', import.meta.url);
|
const pathContributors = new URL('../contributor-names.json', import.meta.url);
|
||||||
|
|
||||||
@@ -14,16 +13,16 @@ async function fetchContributors() {
|
|||||||
let page = 1;
|
let page = 1;
|
||||||
let data: Contributor[] = [];
|
let data: Contributor[] = [];
|
||||||
do {
|
do {
|
||||||
data =
|
const response = await fetch(
|
||||||
(await $fetch<Contributor[]>(
|
`https://api.github.com/repos/mermaid-js/mermaid/contributors?per_page=100&page=${page}`,
|
||||||
`https://api.github.com/repos/mermaid-js/mermaid/contributors?per_page=100&page=${page}`,
|
{
|
||||||
{
|
method: 'GET',
|
||||||
method: 'get',
|
headers: {
|
||||||
headers: {
|
'content-type': 'application/json',
|
||||||
'content-type': 'application/json',
|
},
|
||||||
},
|
}
|
||||||
}
|
);
|
||||||
)) || [];
|
data = await response.json();
|
||||||
collaborators.push(...data.map((i) => i.login));
|
collaborators.push(...data.map((i) => i.login));
|
||||||
page++;
|
page++;
|
||||||
} while (data.length === 100);
|
} while (data.length === 100);
|
||||||
|
@@ -20,13 +20,11 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@iconify-json/carbon": "^1.1.16",
|
"@iconify-json/carbon": "^1.1.16",
|
||||||
"@types/fs-extra": "^11.0.1",
|
|
||||||
"@unocss/reset": "^0.51.8",
|
"@unocss/reset": "^0.51.8",
|
||||||
"@vite-pwa/vitepress": "^0.0.5",
|
"@vite-pwa/vitepress": "^0.0.5",
|
||||||
"@vitejs/plugin-vue": "^4.2.1",
|
"@vitejs/plugin-vue": "^4.2.1",
|
||||||
"esno": "^0.16.3",
|
"esno": "^0.16.3",
|
||||||
"fast-glob": "^3.2.12",
|
"fast-glob": "^3.2.12",
|
||||||
"fs-extra": "^11.1.1",
|
|
||||||
"https-localhost": "^4.7.1",
|
"https-localhost": "^4.7.1",
|
||||||
"pathe": "^1.1.0",
|
"pathe": "^1.1.0",
|
||||||
"unocss": "^0.51.8",
|
"unocss": "^0.51.8",
|
||||||
|
80
pnpm-lock.yaml
generated
80
pnpm-lock.yaml
generated
@@ -391,9 +391,6 @@ importers:
|
|||||||
'@iconify-json/carbon':
|
'@iconify-json/carbon':
|
||||||
specifier: ^1.1.16
|
specifier: ^1.1.16
|
||||||
version: 1.1.16
|
version: 1.1.16
|
||||||
'@types/fs-extra':
|
|
||||||
specifier: ^11.0.1
|
|
||||||
version: 11.0.1
|
|
||||||
'@unocss/reset':
|
'@unocss/reset':
|
||||||
specifier: ^0.51.8
|
specifier: ^0.51.8
|
||||||
version: 0.51.8
|
version: 0.51.8
|
||||||
@@ -409,70 +406,6 @@ importers:
|
|||||||
fast-glob:
|
fast-glob:
|
||||||
specifier: ^3.2.12
|
specifier: ^3.2.12
|
||||||
version: 3.2.12
|
version: 3.2.12
|
||||||
fs-extra:
|
|
||||||
specifier: ^11.1.1
|
|
||||||
version: 11.1.1
|
|
||||||
https-localhost:
|
|
||||||
specifier: ^4.7.1
|
|
||||||
version: 4.7.1
|
|
||||||
pathe:
|
|
||||||
specifier: ^1.1.0
|
|
||||||
version: 1.1.0
|
|
||||||
unocss:
|
|
||||||
specifier: ^0.51.8
|
|
||||||
version: 0.51.8(postcss@8.4.23)(rollup@2.79.1)(vite@4.3.3)
|
|
||||||
unplugin-vue-components:
|
|
||||||
specifier: ^0.24.1
|
|
||||||
version: 0.24.1(rollup@2.79.1)(vue@3.2.47)
|
|
||||||
vite:
|
|
||||||
specifier: ^4.3.3
|
|
||||||
version: 4.3.3(@types/node@18.16.0)
|
|
||||||
vite-plugin-pwa:
|
|
||||||
specifier: ^0.14.7
|
|
||||||
version: 0.14.7(vite@4.3.3)(workbox-build@6.5.4)(workbox-window@6.5.4)
|
|
||||||
vitepress:
|
|
||||||
specifier: 1.0.0-alpha.74
|
|
||||||
version: 1.0.0-alpha.74(@algolia/client-search@4.14.2)(@types/node@18.16.0)
|
|
||||||
workbox-window:
|
|
||||||
specifier: ^6.5.4
|
|
||||||
version: 6.5.4
|
|
||||||
|
|
||||||
packages/mermaid/src/vitepress:
|
|
||||||
dependencies:
|
|
||||||
'@vueuse/core':
|
|
||||||
specifier: ^10.1.0
|
|
||||||
version: 10.1.0(vue@3.2.47)
|
|
||||||
jiti:
|
|
||||||
specifier: ^1.18.2
|
|
||||||
version: 1.18.2
|
|
||||||
vue:
|
|
||||||
specifier: ^3.2.47
|
|
||||||
version: 3.2.47
|
|
||||||
devDependencies:
|
|
||||||
'@iconify-json/carbon':
|
|
||||||
specifier: ^1.1.16
|
|
||||||
version: 1.1.16
|
|
||||||
'@types/fs-extra':
|
|
||||||
specifier: ^11.0.1
|
|
||||||
version: 11.0.1
|
|
||||||
'@unocss/reset':
|
|
||||||
specifier: ^0.51.8
|
|
||||||
version: 0.51.8
|
|
||||||
'@vite-pwa/vitepress':
|
|
||||||
specifier: ^0.0.5
|
|
||||||
version: 0.0.5(vite-plugin-pwa@0.14.7)
|
|
||||||
'@vitejs/plugin-vue':
|
|
||||||
specifier: ^4.2.1
|
|
||||||
version: 4.2.1(vite@4.3.3)(vue@3.2.47)
|
|
||||||
esno:
|
|
||||||
specifier: ^0.16.3
|
|
||||||
version: 0.16.3
|
|
||||||
fast-glob:
|
|
||||||
specifier: ^3.2.12
|
|
||||||
version: 3.2.12
|
|
||||||
fs-extra:
|
|
||||||
specifier: ^11.1.1
|
|
||||||
version: 11.1.1
|
|
||||||
https-localhost:
|
https-localhost:
|
||||||
specifier: ^4.7.1
|
specifier: ^4.7.1
|
||||||
version: 4.7.1
|
version: 4.7.1
|
||||||
@@ -4181,13 +4114,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-HXwADeHEP4exXkCIwy2n1+i0f1ilP1ETQOH5KDOugjkTFZPntWo0Gr8stZOaebkxsdx+k0X/K6obU/+it07ocg==}
|
resolution: {integrity: sha512-HXwADeHEP4exXkCIwy2n1+i0f1ilP1ETQOH5KDOugjkTFZPntWo0Gr8stZOaebkxsdx+k0X/K6obU/+it07ocg==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@types/fs-extra@11.0.1:
|
|
||||||
resolution: {integrity: sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==}
|
|
||||||
dependencies:
|
|
||||||
'@types/jsonfile': 6.1.1
|
|
||||||
'@types/node': 18.16.0
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/@types/geojson@7946.0.10:
|
/@types/geojson@7946.0.10:
|
||||||
resolution: {integrity: sha512-Nmh0K3iWQJzniTuPRcJn5hxXkfB1T1pgB89SBig5PlJQU5yocazeu4jATJlaA0GYFKWMqDdvYemoSnF2pXgLVA==}
|
resolution: {integrity: sha512-Nmh0K3iWQJzniTuPRcJn5hxXkfB1T1pgB89SBig5PlJQU5yocazeu4jATJlaA0GYFKWMqDdvYemoSnF2pXgLVA==}
|
||||||
dev: true
|
dev: true
|
||||||
@@ -4240,12 +4166,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==}
|
resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@types/jsonfile@6.1.1:
|
|
||||||
resolution: {integrity: sha512-GSgiRCVeapDN+3pqA35IkQwasaCh/0YFH5dEF6S88iDvEn901DjOeH3/QPY+XYP1DFzDZPvIvfeEgk+7br5png==}
|
|
||||||
dependencies:
|
|
||||||
'@types/node': 18.16.0
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/@types/keyv@3.1.4:
|
/@types/keyv@3.1.4:
|
||||||
resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==}
|
resolution: {integrity: sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==}
|
||||||
dependencies:
|
dependencies:
|
||||||
|
Reference in New Issue
Block a user