Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: extrace mathjax-render-nextjs package
Signed-off-by: Dup4 <lyuzhi.pan@gmail.com>
- Loading branch information
Showing
14 changed files
with
161 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
examples/mathjax-render-react-example/src/app/reference/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { BuildContext, defineBuildConfig } from "unbuild"; | ||
import { RollupOptions } from "rollup"; | ||
|
||
import postcss from "rollup-plugin-postcss"; | ||
import camelcase from "camelcase"; | ||
|
||
export default defineBuildConfig({ | ||
entries: ["src/index"], | ||
declaration: true, | ||
clean: true, | ||
rollup: { | ||
emitCJS: true, | ||
}, | ||
hooks: { | ||
"rollup:options": (ctx: BuildContext, options: RollupOptions): void => { | ||
options.plugins?.push( | ||
postcss({ | ||
inject: true, | ||
use: ["less"], | ||
namedExports(name) { | ||
return camelcase(name); | ||
}, | ||
}), | ||
); | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"name": "mathjax-render-nextjs", | ||
"version": "0.0.19", | ||
"license": "MIT", | ||
"author": "Dup4 <lyuzhi.pan@gmail.com>", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/Dup4/mathjax-render.git", | ||
"directory": "packages/mathjax-render-nextjs" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/Dup4/mathjax-render/issues" | ||
}, | ||
"homepage": "https://github.com/Dup4/mathjax-render/tree/main/packages/mathjax-render-nextjs#readme", | ||
"main": "./dist/index.mjs", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.cjs", | ||
"import": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts" | ||
} | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
"./dist/index.d.ts" | ||
] | ||
} | ||
}, | ||
"files": [ | ||
"src", | ||
"dist" | ||
], | ||
"scripts": { | ||
"build": "unbuild", | ||
"dev": "unbuild --stub", | ||
"test": "vitest", | ||
"lint:build": "tsc --noEmit", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
"peerDependencies": { | ||
"next": "^13.4.9", | ||
"react": "^17.0.0 || ^18.0.0", | ||
"react-dom": "^17.0.0 || ^18.0.0" | ||
}, | ||
"dependencies": { | ||
"mathjax-render-react": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^18.2.14", | ||
"@types/react-dom": "^18.2.6", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"next": "^13.4.9", | ||
"rollup": "^2.79.1", | ||
"rollup-plugin-postcss": "^4.0.2", | ||
"typescript": "4.7.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./mathjax-node"; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"include": [ | ||
"src", | ||
"typings.d.ts", | ||
], | ||
"compilerOptions": { | ||
"jsx": "react", | ||
"lib": [ | ||
"DOM" | ||
], | ||
"baseUrl": ".", | ||
"paths": { | ||
"@/*": [ | ||
"src/*" | ||
], | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
declare module "*.module.less"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from "./mathjaxNode"; | ||
export * from "./mathjax-node"; |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
.../mathjax-render-react/src/mathjaxNode.tsx → ...mathjax-render-react/src/mathjax-node.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.