mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
chore: Resolve eslint errors
This commit is contained in:
parent
3f2e823330
commit
4a50feb5d9
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable no-console */
|
||||||
import { packageOptions } from './common.js';
|
import { packageOptions } from './common.js';
|
||||||
import { execSync } from 'child_process';
|
import { execSync } from 'child_process';
|
||||||
|
|
||||||
@ -5,11 +6,17 @@ const buildType = (packageName: string) => {
|
|||||||
console.log(`Building types for ${packageName}`);
|
console.log(`Building types for ${packageName}`);
|
||||||
try {
|
try {
|
||||||
const out = execSync(`tsc -p ./packages/${packageName}/tsconfig.json --emitDeclarationOnly`);
|
const out = execSync(`tsc -p ./packages/${packageName}/tsconfig.json --emitDeclarationOnly`);
|
||||||
out.length > 0 && console.log(out.toString());
|
if (out.length > 0) {
|
||||||
|
console.log(out.toString());
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
e.stdout.length > 0 && console.error(e.stdout.toString());
|
if (e.stdout.length > 0) {
|
||||||
e.stderr.length > 0 && console.error(e.stderr.toString());
|
console.error(e.stdout.toString());
|
||||||
|
}
|
||||||
|
if (e.stderr.length > 0) {
|
||||||
|
console.error(e.stderr.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -138,3 +138,6 @@ yaxis
|
|||||||
yfunc
|
yfunc
|
||||||
yytext
|
yytext
|
||||||
zenuml
|
zenuml
|
||||||
|
treemap
|
||||||
|
brotli
|
||||||
|
subconfig
|
||||||
|
@ -6,3 +6,4 @@ Nikolay Rozhkov
|
|||||||
Peng Xiao
|
Peng Xiao
|
||||||
subhash-halder
|
subhash-halder
|
||||||
Vinod Sidharth
|
Vinod Sidharth
|
||||||
|
Per Brolin
|
||||||
|
@ -58,6 +58,7 @@ rscratch
|
|||||||
sparkline
|
sparkline
|
||||||
sphinxcontrib
|
sphinxcontrib
|
||||||
ssim
|
ssim
|
||||||
|
shiki
|
||||||
stylis
|
stylis
|
||||||
Swimm
|
Swimm
|
||||||
tsbuildinfo
|
tsbuildinfo
|
||||||
|
@ -2,7 +2,8 @@ import { build } from 'esbuild';
|
|||||||
import { mkdir, writeFile } from 'node:fs/promises';
|
import { mkdir, writeFile } from 'node:fs/promises';
|
||||||
import { packageOptions } from '../.build/common.js';
|
import { packageOptions } from '../.build/common.js';
|
||||||
import { generateLangium } from '../.build/generateLangium.js';
|
import { generateLangium } from '../.build/generateLangium.js';
|
||||||
import { MermaidBuildOptions, defaultOptions, getBuildConfig } from './util.js';
|
import type { MermaidBuildOptions } from './util.js';
|
||||||
|
import { defaultOptions, getBuildConfig } from './util.js';
|
||||||
|
|
||||||
const shouldVisualize = process.argv.includes('--visualize');
|
const shouldVisualize = process.argv.includes('--visualize');
|
||||||
|
|
||||||
@ -35,11 +36,11 @@ const buildPackage = async (entryName: keyof typeof packageOptions) => {
|
|||||||
|
|
||||||
if (shouldVisualize) {
|
if (shouldVisualize) {
|
||||||
for (const { metafile } of results) {
|
for (const { metafile } of results) {
|
||||||
if (!metafile) {
|
if (!metafile?.outputs) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const fileName = Object.keys(metafile.outputs)
|
const fileName = Object.keys(metafile.outputs)
|
||||||
.filter((file) => !file.includes('chunks') && file.endsWith('js'))[0]
|
.find((file) => !file.includes('chunks') && file.endsWith('js'))
|
||||||
.replace('dist/', '');
|
.replace('dist/', '');
|
||||||
// Upload metafile into https://esbuild.github.io/analyze/
|
// Upload metafile into https://esbuild.github.io/analyze/
|
||||||
await writeFile(`stats/${fileName}.meta.json`, JSON.stringify(metafile));
|
await writeFile(`stats/${fileName}.meta.json`, JSON.stringify(metafile));
|
||||||
@ -48,6 +49,7 @@ const buildPackage = async (entryName: keyof typeof packageOptions) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handler = (e) => {
|
const handler = (e) => {
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.error(e);
|
console.error(e);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { readFile } from 'node:fs/promises';
|
import { readFile } from 'node:fs/promises';
|
||||||
import { transformJison } from '../.build/jisonTransformer.js';
|
import { transformJison } from '../.build/jisonTransformer.js';
|
||||||
import { Plugin } from 'esbuild';
|
import type { Plugin } from 'esbuild';
|
||||||
|
|
||||||
export const jisonPlugin: Plugin = {
|
export const jisonPlugin: Plugin = {
|
||||||
name: 'jison',
|
name: 'jison',
|
||||||
|
@ -56,7 +56,7 @@ export const getBuildConfig = (options: MermaidBuildOptions): BuildOptions => {
|
|||||||
const external: string[] = ['require', 'fs', 'path'];
|
const external: string[] = ['require', 'fs', 'path'];
|
||||||
const { name, file, packageName } = packageOptions[entryName];
|
const { name, file, packageName } = packageOptions[entryName];
|
||||||
const outFileName = getFileName(name, options);
|
const outFileName = getFileName(name, options);
|
||||||
let output: BuildOptions = buildOptions({
|
const output: BuildOptions = buildOptions({
|
||||||
absWorkingDir: resolve(__dirname, `../packages/${packageName}`),
|
absWorkingDir: resolve(__dirname, `../packages/${packageName}`),
|
||||||
entryPoints: {
|
entryPoints: {
|
||||||
[outFileName]: `src/${file}`,
|
[outFileName]: `src/${file}`,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { build, InlineConfig, type PluginOption } from 'vite';
|
import type { InlineConfig } from 'vite';
|
||||||
|
import { build, type PluginOption } from 'vite';
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'path';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
import jisonPlugin from './jisonPlugin.js';
|
import jisonPlugin from './jisonPlugin.js';
|
||||||
@ -46,9 +47,10 @@ interface BuildOptions {
|
|||||||
|
|
||||||
export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions): InlineConfig => {
|
export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions): InlineConfig => {
|
||||||
const external: (string | RegExp)[] = ['require', 'fs', 'path'];
|
const external: (string | RegExp)[] = ['require', 'fs', 'path'];
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.log(entryName, packageOptions[entryName]);
|
console.log(entryName, packageOptions[entryName]);
|
||||||
const { name, file, packageName } = packageOptions[entryName];
|
const { name, file, packageName } = packageOptions[entryName];
|
||||||
let output: OutputOptions = [
|
const output: OutputOptions = [
|
||||||
{
|
{
|
||||||
name,
|
name,
|
||||||
format: 'esm',
|
format: 'esm',
|
||||||
@ -83,7 +85,6 @@ export const getBuildConfig = ({ minify, core, watch, entryName }: BuildOptions)
|
|||||||
plugins: [
|
plugins: [
|
||||||
jisonPlugin(),
|
jisonPlugin(),
|
||||||
jsonSchemaPlugin(), // handles `.schema.yaml` files
|
jsonSchemaPlugin(), // handles `.schema.yaml` files
|
||||||
// @ts-expect-error According to the type definitions, rollup plugins are incompatible with vite
|
|
||||||
typescript({ compilerOptions: { declaration: false } }),
|
typescript({ compilerOptions: { declaration: false } }),
|
||||||
istanbul({
|
istanbul({
|
||||||
exclude: ['node_modules', 'test/', '__mocks__', 'generated'],
|
exclude: ['node_modules', 'test/', '__mocks__', 'generated'],
|
||||||
@ -121,10 +122,10 @@ await generateLangium();
|
|||||||
|
|
||||||
if (watch) {
|
if (watch) {
|
||||||
await build(getBuildConfig({ minify: false, watch, core: false, entryName: 'parser' }));
|
await build(getBuildConfig({ minify: false, watch, core: false, entryName: 'parser' }));
|
||||||
build(getBuildConfig({ minify: false, watch, core: false, entryName: 'mermaid' }));
|
void build(getBuildConfig({ minify: false, watch, core: false, entryName: 'mermaid' }));
|
||||||
if (!mermaidOnly) {
|
if (!mermaidOnly) {
|
||||||
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-example-diagram' }));
|
void build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-example-diagram' }));
|
||||||
build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-zenuml' }));
|
void build(getBuildConfig({ minify: false, watch, entryName: 'mermaid-zenuml' }));
|
||||||
}
|
}
|
||||||
} else if (visualize) {
|
} else if (visualize) {
|
||||||
await build(getBuildConfig({ minify: false, watch, core: false, entryName: 'parser' }));
|
await build(getBuildConfig({ minify: false, watch, core: false, entryName: 'parser' }));
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { PluginOption } from 'vite';
|
import type { PluginOption } from 'vite';
|
||||||
import { getDefaults, getSchema, loadSchema } from '../.build/jsonSchema.js';
|
import { getDefaults, getSchema, loadSchema } from '../.build/jsonSchema.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// <reference types="Cypress" />
|
|
||||||
|
|
||||||
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';
|
import { imgSnapshotTest, renderGraph } from '../../helpers/util.ts';
|
||||||
|
|
||||||
context('Sequence diagram', () => {
|
describe('Sequence diagram', () => {
|
||||||
it('should render a sequence diagram with boxes', () => {
|
it('should render a sequence diagram with boxes', () => {
|
||||||
renderGraph(
|
renderGraph(
|
||||||
`
|
`
|
||||||
@ -244,7 +242,7 @@ context('Sequence diagram', () => {
|
|||||||
`
|
`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
context('font settings', () => {
|
describe('font settings', () => {
|
||||||
it('should render different note fonts when configured', () => {
|
it('should render different note fonts when configured', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
@ -341,7 +339,7 @@ context('Sequence diagram', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
context('auth width scaling', () => {
|
describe('auth width scaling', () => {
|
||||||
it('should render long actor descriptions', () => {
|
it('should render long actor descriptions', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
@ -530,7 +528,7 @@ context('Sequence diagram', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
context('background rects', () => {
|
describe('background rects', () => {
|
||||||
it('should render a single and nested rects', () => {
|
it('should render a single and nested rects', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
@ -810,7 +808,7 @@ context('Sequence diagram', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
context('directives', () => {
|
describe('directives', () => {
|
||||||
it('should override config with directive settings', () => {
|
it('should override config with directive settings', () => {
|
||||||
imgSnapshotTest(
|
imgSnapshotTest(
|
||||||
`
|
`
|
||||||
@ -842,7 +840,7 @@ context('Sequence diagram', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
context('links', () => {
|
describe('links', () => {
|
||||||
it('should support actor links', () => {
|
it('should support actor links', () => {
|
||||||
renderGraph(
|
renderGraph(
|
||||||
`
|
`
|
||||||
@ -933,7 +931,7 @@ context('Sequence diagram', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
context('svg size', () => {
|
describe('svg size', () => {
|
||||||
it('should render a sequence diagram when useMaxWidth is true (default)', () => {
|
it('should render a sequence diagram when useMaxWidth is true (default)', () => {
|
||||||
renderGraph(
|
renderGraph(
|
||||||
`
|
`
|
||||||
@ -1012,7 +1010,7 @@ context('Sequence diagram', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
context('render after error', () => {
|
describe('render after error', () => {
|
||||||
it('should render diagram after fixing destroy participant error', () => {
|
it('should render diagram after fixing destroy participant error', () => {
|
||||||
cy.on('uncaught:exception', (err) => {
|
cy.on('uncaught:exception', (err) => {
|
||||||
return false;
|
return false;
|
||||||
|
@ -19,7 +19,14 @@ export default tseslint.config(
|
|||||||
eslint.configs.recommended,
|
eslint.configs.recommended,
|
||||||
...tseslint.configs.recommended,
|
...tseslint.configs.recommended,
|
||||||
{
|
{
|
||||||
ignores: ['**/dist/', '**/node_modules/', '.git/', '**/generated/', '**/coverage/'],
|
ignores: [
|
||||||
|
'**/dist/',
|
||||||
|
'**/node_modules/',
|
||||||
|
'.git/',
|
||||||
|
'**/generated/',
|
||||||
|
'**/coverage/',
|
||||||
|
'packages/mermaid/src/config.type.ts',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
languageOptions: {
|
languageOptions: {
|
||||||
@ -38,6 +45,7 @@ export default tseslint.config(
|
|||||||
...globals.es2020,
|
...globals.es2020,
|
||||||
...globals.jest,
|
...globals.jest,
|
||||||
cy: 'readonly',
|
cy: 'readonly',
|
||||||
|
Cypress: 'readonly',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
||||||
import * as configApi from './config.js';
|
import * as configApi from './config.js';
|
||||||
import type { MermaidConfig } from './config.type.js';
|
import type { MermaidConfig } from './config.type.js';
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable */
|
|
||||||
/**
|
/**
|
||||||
* This file was automatically generated by json-schema-to-typescript.
|
* This file was automatically generated by json-schema-to-typescript.
|
||||||
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
||||||
|
@ -24,8 +24,12 @@ export const drawRect = (element: SVG | Group, rectData: RectData): D3RectElemen
|
|||||||
if (rectData.name) {
|
if (rectData.name) {
|
||||||
rectElement.attr('name', rectData.name);
|
rectElement.attr('name', rectData.name);
|
||||||
}
|
}
|
||||||
rectData.rx !== undefined && rectElement.attr('rx', rectData.rx);
|
if (rectData.rx) {
|
||||||
rectData.ry !== undefined && rectElement.attr('ry', rectData.ry);
|
rectElement.attr('rx', rectData.rx);
|
||||||
|
}
|
||||||
|
if (rectData.ry) {
|
||||||
|
rectElement.attr('ry', rectData.ry);
|
||||||
|
}
|
||||||
|
|
||||||
if (rectData.attrs !== undefined) {
|
if (rectData.attrs !== undefined) {
|
||||||
for (const attrKey in rectData.attrs) {
|
for (const attrKey in rectData.attrs) {
|
||||||
@ -33,7 +37,9 @@ export const drawRect = (element: SVG | Group, rectData: RectData): D3RectElemen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rectData.class !== undefined && rectElement.attr('class', rectData.class);
|
if (rectData.class) {
|
||||||
|
rectElement.attr('class', rectData.class);
|
||||||
|
}
|
||||||
|
|
||||||
return rectElement;
|
return rectElement;
|
||||||
};
|
};
|
||||||
@ -67,7 +73,9 @@ export const drawText = (element: SVG | Group, textData: TextData): D3TextElemen
|
|||||||
textElem.attr('class', 'legend');
|
textElem.attr('class', 'legend');
|
||||||
|
|
||||||
textElem.style('text-anchor', textData.anchor);
|
textElem.style('text-anchor', textData.anchor);
|
||||||
textData.class !== undefined && textElem.attr('class', textData.class);
|
if (textData.class) {
|
||||||
|
textElem.attr('class', textData.class);
|
||||||
|
}
|
||||||
|
|
||||||
const tspan: D3TSpanElement = textElem.append('tspan');
|
const tspan: D3TSpanElement = textElem.append('tspan');
|
||||||
tspan.attr('x', textData.x + textData.textMargin * 2);
|
tspan.attr('x', textData.x + textData.textMargin * 2);
|
||||||
|
@ -109,7 +109,7 @@ describe('when using the ganttDb', function () {
|
|||||||
ganttDb.addTask(taskName2, taskData2);
|
ganttDb.addTask(taskName2, taskData2);
|
||||||
const tasks = ganttDb.getTasks();
|
const tasks = ganttDb.getTasks();
|
||||||
expect(tasks[1].startTime).toEqual(expStartDate2);
|
expect(tasks[1].startTime).toEqual(expStartDate2);
|
||||||
if (!expEndDate2 === undefined) {
|
if (expEndDate2) {
|
||||||
expect(tasks[1].endTime).toEqual(expEndDate2);
|
expect(tasks[1].endTime).toEqual(expEndDate2);
|
||||||
}
|
}
|
||||||
expect(tasks[1].id).toEqual(expId2);
|
expect(tasks[1].id).toEqual(expId2);
|
||||||
|
@ -35,7 +35,7 @@ function getId() {
|
|||||||
// * @param currentCommit
|
// * @param currentCommit
|
||||||
// * @param otherCommit
|
// * @param otherCommit
|
||||||
// */
|
// */
|
||||||
// eslint-disable-next-line @cspell/spellchecker
|
|
||||||
// function isFastForwardable(currentCommit, otherCommit) {
|
// function isFastForwardable(currentCommit, otherCommit) {
|
||||||
// log.debug('Entering isFastForwardable:', currentCommit.id, otherCommit.id);
|
// log.debug('Entering isFastForwardable:', currentCommit.id, otherCommit.id);
|
||||||
// let cnt = 0;
|
// let cnt = 0;
|
||||||
|
@ -5,7 +5,7 @@ import { selectSvgElement } from '../../rendering-util/selectSvgElement.js';
|
|||||||
import { configureSvgSize } from '../../setupGraphViewbox.js';
|
import { configureSvgSize } from '../../setupGraphViewbox.js';
|
||||||
import type { PacketDB, PacketWord } from './types.js';
|
import type { PacketDB, PacketWord } from './types.js';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
const draw: DrawDefinition = (_text, id, _version, diagram: Diagram) => {
|
const draw: DrawDefinition = (_text, id, _version, diagram: Diagram) => {
|
||||||
const db = diagram.db as PacketDB;
|
const db = diagram.db as PacketDB;
|
||||||
const config = db.getConfig();
|
const config = db.getConfig();
|
||||||
|
@ -383,9 +383,11 @@ const drawMessage = async function (diagram, msgModel, lineStartY: number, diagO
|
|||||||
textObj.textMargin = conf.wrapPadding;
|
textObj.textMargin = conf.wrapPadding;
|
||||||
textObj.tspan = false;
|
textObj.tspan = false;
|
||||||
|
|
||||||
hasKatex(textObj.text)
|
if (hasKatex(textObj.text)) {
|
||||||
? await drawKatex(diagram, textObj, { startx, stopx, starty: lineStartY })
|
await drawKatex(diagram, textObj, { startx, stopx, starty: lineStartY });
|
||||||
: drawText(diagram, textObj);
|
} else {
|
||||||
|
drawText(diagram, textObj);
|
||||||
|
}
|
||||||
|
|
||||||
const textWidth = textDims.width;
|
const textWidth = textDims.width;
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import { defineConfig, MarkdownOptions } from 'vitepress';
|
import type { MarkdownOptions } from 'vitepress';
|
||||||
|
import { defineConfig } from 'vitepress';
|
||||||
import { version } from '../../../package.json';
|
import { version } from '../../../package.json';
|
||||||
import MermaidExample from './mermaid-markdown-all.js';
|
import MermaidExample from './mermaid-markdown-all.js';
|
||||||
|
|
||||||
@ -8,6 +9,7 @@ const allMarkdownTransformers: MarkdownOptions = {
|
|||||||
light: 'github-light',
|
light: 'github-light',
|
||||||
dark: 'github-dark',
|
dark: 'github-dark',
|
||||||
},
|
},
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
||||||
config: async (md) => {
|
config: async (md) => {
|
||||||
await MermaidExample(md);
|
await MermaidExample(md);
|
||||||
},
|
},
|
||||||
@ -228,8 +230,6 @@ function sidebarNews() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a string that puts together the pagePage, a '#', then the given id
|
* Return a string that puts together the pagePage, a '#', then the given id
|
||||||
* @param pagePath
|
|
||||||
* @param id
|
|
||||||
* @returns the fully formed path
|
* @returns the fully formed path
|
||||||
*/
|
*/
|
||||||
function pathToId(pagePath: string, id = ''): string {
|
function pathToId(pagePath: string, id = ''): string {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import contributorUsernamesJson from './contributor-names.json';
|
import contributorUsernamesJson from './contributor-names.json';
|
||||||
import { CoreTeam, knut, plainTeamMembers } from './teamMembers.js';
|
import type { CoreTeam } from './teamMembers.js';
|
||||||
|
import { knut, plainTeamMembers } from './teamMembers.js';
|
||||||
|
|
||||||
const contributorUsernames: string[] = contributorUsernamesJson;
|
const contributorUsernames: string[] = contributorUsernamesJson;
|
||||||
|
|
||||||
|
@ -32,11 +32,11 @@ async function fetchAvatars() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
contributors = JSON.parse(await readFile(pathContributors, { encoding: 'utf-8' }));
|
contributors = JSON.parse(await readFile(pathContributors, { encoding: 'utf-8' }));
|
||||||
let avatars = contributors.map((name) => {
|
const avatars = contributors.map((name) =>
|
||||||
download(`https://github.com/${name}.png?size=100`, getAvatarPath(name));
|
download(`https://github.com/${name}.png?size=100`, getAvatarPath(name))
|
||||||
});
|
);
|
||||||
|
|
||||||
await Promise.allSettled(avatars);
|
await Promise.allSettled(avatars);
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchAvatars();
|
void fetchAvatars();
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable no-console */
|
||||||
// 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';
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable @cspell/spellchecker */
|
||||||
export interface Contributor {
|
export interface Contributor {
|
||||||
name: string;
|
name: string;
|
||||||
avatar: string;
|
avatar: string;
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
|
/* eslint-disable no-console */
|
||||||
import DefaultTheme from 'vitepress/theme';
|
import DefaultTheme from 'vitepress/theme';
|
||||||
import './custom.css';
|
import './custom.css';
|
||||||
// @ts-ignore
|
// @ts-ignore Type not available
|
||||||
import Mermaid from './Mermaid.vue';
|
import Mermaid from './Mermaid.vue';
|
||||||
// @ts-ignore
|
// @ts-ignore Type not available
|
||||||
import Contributors from '../components/Contributors.vue';
|
import Contributors from '../components/Contributors.vue';
|
||||||
// @ts-ignore
|
// @ts-ignore Type not available
|
||||||
import HomePage from '../components/HomePage.vue';
|
import HomePage from '../components/HomePage.vue';
|
||||||
// @ts-ignore
|
// @ts-ignore Type not available
|
||||||
import TopBar from '../components/TopBar.vue';
|
import TopBar from '../components/TopBar.vue';
|
||||||
import { getRedirect } from './redirect.js';
|
import { getRedirect } from './redirect.js';
|
||||||
|
// @ts-ignore Type not available
|
||||||
import { h } from 'vue';
|
import { h } from 'vue';
|
||||||
import Theme from 'vitepress/theme';
|
import Theme from 'vitepress/theme';
|
||||||
import '../style/main.css';
|
import '../style/main.css';
|
||||||
|
@ -116,3 +116,5 @@ export const getRedirect = (url: URL): string | undefined => {
|
|||||||
return `${idRedirectMap[path]}.html${id ? `#${id}` : ''}`;
|
return `${idRedirectMap[path]}.html${id ? `#${id}` : ''}`;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// cspell:ignore mermaidapi, breakingchanges, classdiagram, entityrelationshipdiagram, mermaidapi, mermaidcli, gettingstarted, syntaxreference, newdiagram, requirementdiagram, sequencediagram
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
|
@ -33,9 +33,7 @@ const processDirectives = (code: string) => {
|
|||||||
const initDirective = utils.detectInit(code) ?? {};
|
const initDirective = utils.detectInit(code) ?? {};
|
||||||
const wrapDirectives = utils.detectDirective(code, 'wrap');
|
const wrapDirectives = utils.detectDirective(code, 'wrap');
|
||||||
if (Array.isArray(wrapDirectives)) {
|
if (Array.isArray(wrapDirectives)) {
|
||||||
initDirective.wrap = wrapDirectives.some(({ type }) => {
|
initDirective.wrap = wrapDirectives.some(({ type }) => type === 'wrap');
|
||||||
type === 'wrap';
|
|
||||||
});
|
|
||||||
} else if (wrapDirectives?.type === 'wrap') {
|
} else if (wrapDirectives?.type === 'wrap') {
|
||||||
initDirective.wrap = true;
|
initDirective.wrap = true;
|
||||||
}
|
}
|
||||||
|
@ -777,7 +777,7 @@ export const entityDecode = function (html: string): string {
|
|||||||
// Escape HTML before decoding for HTML Entities
|
// Escape HTML before decoding for HTML Entities
|
||||||
html = escape(html).replace(/%26/g, '&').replace(/%23/g, '#').replace(/%3B/g, ';');
|
html = escape(html).replace(/%26/g, '&').replace(/%23/g, '#').replace(/%3B/g, ';');
|
||||||
decoder.innerHTML = html;
|
decoder.innerHTML = html;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
||||||
return unescape(decoder.textContent!);
|
return unescape(decoder.textContent!);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||||
const mermaid = require('mermaid');
|
const mermaid = require('mermaid');
|
||||||
import mindmap from '@mermaid-js/mermaid-mindmap';
|
import mindmap from '@mermaid-js/mermaid-mindmap';
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user