Skip to content

Commit 38522e8

Browse files
CopilotSoonIter
andcommitted
Changes before error encountered
Co-authored-by: SoonIter <79413249+SoonIter@users.noreply.github.com>
1 parent 6027752 commit 38522e8

File tree

45 files changed

+107
-94
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+107
-94
lines changed

packages/core/src/node/PluginDriver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,15 @@ export class PluginDriver {
212212
.map(plugin => plugin.globalStyles) as string[];
213213
}
214214

215-
_runParallelAsyncHook<H extends RspressPluginHookKeys>(
215+
async _runParallelAsyncHook<H extends RspressPluginHookKeys>(
216216
hookName: H,
217217
...args: Parameters<Required<RspressPlugin>[H]>
218218
): Promise<Awaited<ReturnType<Required<RspressPlugin>[H]>>[]> {
219219
// @ts-expect-error - FIXME: TS is not able to infer the correct type
220220
return Promise.all(
221221
this.#plugins
222222
.filter(plugin => typeof plugin[hookName] === 'function')
223-
.map(plugin =>
223+
.map(async plugin =>
224224
plugin[hookName]!(
225225
// @ts-expect-error - FIXME: TS is not able to infer the correct type
226226
...args,

packages/core/src/node/auto-nav-sidebar/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async function runAutoNavSide(
3535

3636
const walks = versions.length
3737
? await Promise.all(
38-
versions.map(version => {
38+
versions.map(async version => {
3939
return walk(
4040
path.join(config.root!, version),
4141
config.root!,

packages/core/src/node/auto-nav-sidebar/locales.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function combineWalkResult(
2121
);
2222
}
2323

24-
export function processLocales(
24+
export async function processLocales(
2525
langs: string[],
2626
versions: string[],
2727
root: string,
@@ -32,7 +32,7 @@ export function processLocales(
3232
langs.map(async lang => {
3333
const walks = versions.length
3434
? await Promise.all(
35-
versions.map(version => {
35+
versions.map(async version => {
3636
return walk(
3737
path.join(root, version, lang),
3838
root,

packages/core/src/node/auto-nav-sidebar/normalize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ async function metaItemToSidebarItem(
131131
return name !== 'index.md' && i !== 'index.mdx' && i !== 'index';
132132
})
133133
: dirMetaJson
134-
).map(item =>
134+
).map(async item =>
135135
metaItemToSidebarItem(
136136
item,
137137
dirAbsolutePath,

packages/core/src/node/auto-nav-sidebar/walk.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export async function walk(
8181
await Promise.all(
8282
(
8383
await fs.readdir(workDir)
84-
).map(v => {
84+
).map(async v => {
8585
return fs.stat(path.join(workDir, v)).then(s => {
8686
if (s.isDirectory() && v !== 'node_modules') {
8787
return v;

packages/core/src/node/mdx/rehypePlugins/headerAnchor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function create(node: Element): Element {
6464
properties: {
6565
class: 'header-anchor',
6666
ariaHidden: 'true',
67-
href: `#${node.properties!.id}`,
67+
href: `#${node.properties.id}`,
6868
},
6969
children: [
7070
{

packages/core/src/node/mdx/rehypePlugins/transformers/add-title.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function parseTitleFromMeta(meta: string | undefined): string {
66
if (!meta) {
77
return '';
88
}
9-
const kvList = meta.split(' ').filter(Boolean) as string[];
9+
const kvList = meta.split(' ').filter(Boolean);
1010
for (const item of kvList) {
1111
const [k, v = ''] = item.split('=').filter(Boolean);
1212
if (k === 'title' && v.length > 0) {

packages/core/src/node/mdx/remarkPlugins/containerSyntax.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'vitest';
22
import { compile } from '../processor';
33

44
describe('remark-container', async () => {
5-
const process = (source: string) => {
5+
const process = async (source: string) => {
66
return compile({
77
source,
88

packages/core/src/node/route/extractPageData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ async function extractPageData(
190190
options: ExtractPageDataOptions,
191191
): Promise<PageIndexInfo[]> {
192192
const pageData = await Promise.all(
193-
routeService.getRoutes().map(routeMeta => {
193+
routeService.getRoutes().map(async routeMeta => {
194194
return getPageIndexInfoByRoute(routeMeta, options);
195195
}),
196196
);

packages/core/src/node/runtimeModule/siteData/normalizeThemeConfig.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,12 @@ export function normalizeThemeConfig(
167167
}
168168

169169
// Multi version case
170-
return Object.entries<NavItem[]>(nav).reduce(
170+
return Object.entries<NavItem[]>(nav).reduce<Record<string, NavItem[]>>(
171171
(acc, [key, value]) => {
172172
acc[key] = value.map(transformNavItem);
173173
return acc;
174174
},
175-
{} as Record<string, NavItem[]>,
175+
{},
176176
);
177177
};
178178

0 commit comments

Comments
 (0)