Skip to content

Commit

Permalink
Core: Remove deprecated export
Browse files Browse the repository at this point in the history
  • Loading branch information
fuma-nama committed Sep 20, 2024
1 parent 352c7a7 commit e45bc67
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 13 deletions.
7 changes: 7 additions & 0 deletions .changeset/angry-bikes-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'fumadocs-core': major
---

**Remove deprecated `fumadocs-core/middleware` export**

**migrate:** Use `fumadocs-core/i18n`.
4 changes: 0 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@
"import": "./dist/link.js",
"types": "./dist/link.d.ts"
},
"./middleware": {
"import": "./dist/middleware.js",
"types": "./dist/middleware.d.ts"
},
"./mdx-plugins": {
"import": "./dist/mdx-plugins/index.js",
"types": "./dist/mdx-plugins/index.d.ts"
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/middleware.ts

This file was deleted.

5 changes: 1 addition & 4 deletions packages/core/src/source/file-system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import {
export interface MetaFile {
file: FileInfo;
format: 'meta';
data: {
// TODO: Merge it into data (major)
data: MetaData;
};
data: MetaData;
}

export interface PageFile {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/source/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ function createOutput(options: LoaderOptions): LoaderOutput<LoaderConfig> {
function fileToMeta<Data = MetaData>(file: MetaFile): Meta<Data> {
return {
file: file.file,
data: file.data.data as Data,
data: file.data as Data,
};
}

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/source/page-tree-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function buildFolderNode(
'page',
);

const metadata = meta?.data.data;
const metadata = meta?.data;
const index = indexFile ? buildFileNode(indexFile, ctx) : undefined;

let children: PageTree.Node[];
Expand Down
1 change: 0 additions & 1 deletion packages/core/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export default defineConfig({
'src/search/server.ts',
'src/search/algolia.ts',
'src/utils/use-on-change.ts',
'src/middleware.ts',
'src/i18n/index.ts',
],
});

0 comments on commit e45bc67

Please sign in to comment.