Skip to content

Commit

Permalink
Chore: Rename Git repository to fumadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
fuma-nama committed Jan 27, 2024
1 parent 9534b4a commit 6c5a39a
Show file tree
Hide file tree
Showing 23 changed files with 43 additions and 35 deletions.
10 changes: 10 additions & 0 deletions .changeset/large-llamas-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'fumadocs-contentlayer': patch
'fumadocs-core': patch
'create-fumadocs-app': patch
'fumadocs-mdx': patch
'fumadocs-openapi': patch
'fumadocs-ui': patch
---

Rename Git repository to `fumadocs`
2 changes: 1 addition & 1 deletion apps/docs/app/(home)/docs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function DocsPage(): JSX.Element {
</p>
<div className="mt-4 grid grid-cols-2 gap-4">
<a
href="https://github.com/fuma-nama/next-docs"
href="https://github.com/fuma-nama/fumadocs"
rel="noreferrer noopener"
className={cn(buttonVariants({ size: 'lg' }))}
>
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/app/(home)/showcase/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function Showcase(): JSX.Element {
</p>
<div className="mt-4">
<a
href="https://github.com/fuma-nama/next-docs/discussions/30"
href="https://github.com/fuma-nama/fumadocs/discussions/30"
target="_blank"
rel="noreferrer noopener"
className={cn(buttonVariants())}
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/app/docs/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function Page({ params }: { params: Param }): JSX.Element {
enabled: page.data.toc,
footer: (
<a
href={`https://github.com/fuma-nama/next-docs/blob/main/${path}`}
href={`https://github.com/fuma-nama/fumadocs/blob/main/${path}`}
target="_blank"
rel="noreferrer noopener"
className="inline-flex items-center text-xs text-muted-foreground hover:text-foreground"
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/app/docs/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const layoutOptions: Omit<DocsLayoutProps, 'children'> = {
</>
),
children: <NavChildren />,
githubUrl: 'https://github.com/fuma-nama/next-docs',
githubUrl: 'https://github.com/fuma-nama/fumadocs',
},
sidebar: {
defaultOpenLevel: 0,
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function Footer(): JSX.Element {

<div className="flex flex-row flex-wrap items-center gap-12">
<a
href="https://github.com/fuma-nama/next-docs"
href="https://github.com/fuma-nama/fumadocs"
rel="noreferrer noopener"
className="flex flex-row items-center text-sm text-muted-foreground transition-colors hover:text-accent-foreground"
>
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/components/preview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default {
collapsible
className="rounded-xl bg-background px-4"
>
<Accordion id="what-is-next-docs" title="What is Fumadocs?">
<Accordion id="what-is-fumadocs" title="What is Fumadocs?">
A framework for building documentations
</Accordion>
<Accordion id="ux" title="What do we love?">
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/headless/utils/git-last-edit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { resolve } from 'url';

const time = await getGithubLastEdit({
owner: 'fuma-nama',
repo: 'next-docs',
repo: 'fumadocs',
// example: "content/docs/index.mdx"
path: resolve('content/docs/', page.file.path),
});
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/docs/mdx/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const blogs = loader({
You can customise the options passed to the MDX processor.

```js
const withNextDocs = createMDX({
const withMDX = createMDX({
mdxOptions: {
remarkPlugins: [remarkMath],
// When order matters
Expand All @@ -138,7 +138,7 @@ const withNextDocs = createMDX({
The built-in configuration applies a remark plugin that turns `vfile.data` properties into exports, you can define additional properties to be exported.

```js
const withNextDocs = createMDX({
const withMDX = createMDX({
mdxOptions: {
valueToExport: ['dataName'],
},
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/docs/ui/math.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ Add the remark/rehype plugins you have installed above.
The code might be vary depending on your content source, here is an example for Fumadocs MDX:

```ts
import createNextDocs from 'fumadocs-mdx/config';
import createMDX from 'fumadocs-mdx/config';
import rehypeKatex from 'rehype-katex';
import remarkMath from 'remark-math';

const withNextDocs = createNextDocs({
const withMDX = createMDX({
mdxOptions: {
remarkPlugins: [remarkMath],
// Place it at first so that it won't be changed by rehype-pretty-code
Expand Down
6 changes: 3 additions & 3 deletions examples/next-mdx/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import createNextDocsMDX from 'fumadocs-mdx/config';
import createMDX from 'fumadocs-mdx/config';

const withFumaMDX = createNextDocsMDX();
const withMDX = createMDX();

/** @type {import('next').NextConfig} */
const config = {
reactStrictMode: true,
};

export default withFumaMDX(config);
export default withMDX(config);
2 changes: 1 addition & 1 deletion packages/contentlayer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"Docs"
],
"homepage": "https://fumadocs.vercel.app",
"repository": "github:fuma-nama/next-docs",
"repository": "github:fuma-nama/fumadocs",
"license": "MIT",
"author": "Fuma Nama",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"Docs"
],
"homepage": "https://fumadocs.vercel.app",
"repository": "github:fuma-nama/next-docs",
"repository": "github:fuma-nama/fumadocs",
"license": "MIT",
"author": "Fuma Nama",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/server/git-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type Response = {

export interface GetGithubLastCommitOptions {
/**
* Repository name, like "next-docs"
* Repository name, like "fumadocs"
*/
repo: string;

Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"Docs"
],
"homepage": "https://fumadocs.vercel.app",
"repository": "github:fuma-nama/next-docs",
"repository": "github:fuma-nama/fumadocs",
"license": "MIT",
"author": "Fuma Nama",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-app/template/+content/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This is a Next.js application generated with
[Create Fumadocs](https://github.com/fuma-nama/next-docs).
[Create Fumadocs](https://github.com/fuma-nama/fumadocs).

Run development server:

Expand Down
4 changes: 2 additions & 2 deletions packages/create-app/template/fuma-docs-mdx/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import createNextDocsMDX from 'fumadocs-mdx/config';
import createMDX from 'fumadocs-mdx/config';

const withMDX = createNextDocsMDX();
const withMDX = createMDX();

/** @type {import('next').NextConfig} */
const config = {
Expand Down
2 changes: 1 addition & 1 deletion packages/mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"Docs"
],
"homepage": "https://fumadocs.vercel.app",
"repository": "github:fuma-nama/next-docs",
"repository": "github:fuma-nama/fumadocs",
"license": "MIT",
"author": "Fuma Nama",
"exports": {
Expand Down
10 changes: 4 additions & 6 deletions packages/mdx/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from 'fumadocs-core/mdx-plugins';
import type { PluggableList } from 'unified';
import type { Configuration } from 'webpack';
import { NextDocsWebpackPlugin } from './webpack-plugins/next-docs';
import { MapWebpackPlugin } from './webpack-plugins/map-plugin';
import remarkMdxExport from './mdx-plugins/remark-exports';
import type { LoaderOptions } from './loader';
import type { Options as MDXLoaderOptions } from './loader-mdx';
Expand All @@ -34,7 +34,7 @@ type MDXOptions = Omit<

type ResolvePlugins = PluggableList | ((v: PluggableList) => PluggableList);

interface NextDocsMDXOptions {
export interface CreateMDXOptions {
cwd?: string;

mdxOptions?: MDXOptions;
Expand Down Expand Up @@ -73,7 +73,7 @@ const createMDX =
cwd = process.cwd(),
rootMapPath = './.map.ts',
rootContentPath = './content',
}: NextDocsMDXOptions = {}) =>
}: CreateMDXOptions = {}) =>
(nextConfig: NextConfig = {}) => {
const valueToExport = [
'structuredData',
Expand Down Expand Up @@ -149,9 +149,7 @@ const createMDX =

config.plugins ||= [];

config.plugins.push(
new NextDocsWebpackPlugin({ rootMapFile: _mapPath }),
);
config.plugins.push(new MapWebpackPlugin({ rootMapFile: _mapPath }));

// eslint-disable-next-line @typescript-eslint/no-unsafe-return -- not provided
return nextConfig.webpack?.(config, options) ?? config;
Expand Down
4 changes: 2 additions & 2 deletions packages/mdx/src/loader-mdx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface Options extends ProcessorOptions {
lastModifiedTime?: 'git' | 'none';
}

export interface NextDocsBuildInfo {
interface InternalBuildInfo {
__next_docs?: {
path: string;
/**
Expand Down Expand Up @@ -69,7 +69,7 @@ export default async function loader(
})
.then(
(file) => {
const info = this._module?.buildInfo as NextDocsBuildInfo;
const info = this._module?.buildInfo as InternalBuildInfo;

info.__next_docs = {
path: filePath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ declare const map: Record<string, unknown>
export { map }
`.trim();

export class NextDocsWebpackPlugin {
export class MapWebpackPlugin {
options: Options;

constructor(options: Options) {
this.options = options;
}

apply(compiler: Compiler): void {
const logger = compiler.getInfrastructureLogger(NextDocsWebpackPlugin.name);
const logger = compiler.getInfrastructureLogger(MapWebpackPlugin.name);

compiler.hooks.beforeCompile.tap(NextDocsWebpackPlugin.name, () => {
compiler.hooks.beforeCompile.tap(MapWebpackPlugin.name, () => {
if (firstLoad && !fs.existsSync(this.options.rootMapFile)) {
fs.writeFileSync(this.options.rootMapFile, content);
logger.info('Created map.ts file for you automatically');
Expand Down
2 changes: 1 addition & 1 deletion packages/openapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"Docs"
],
"homepage": "https://fumadocs.vercel.app",
"repository": "github:fuma-nama/next-docs",
"repository": "github:fuma-nama/fumadocs",
"license": "MIT",
"author": "Fuma Nama",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"Docs"
],
"homepage": "https://fumadocs.vercel.app",
"repository": "github:fuma-nama/next-docs",
"repository": "github:fuma-nama/fumadocs",
"license": "MIT",
"author": "Fuma Nama",
"exports": {
Expand Down

0 comments on commit 6c5a39a

Please sign in to comment.