mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
CLI: Expose installer
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@fumadocs/cli': patch
|
||||
---
|
||||
|
||||
Expose installer
|
||||
@@ -17,12 +17,12 @@
|
||||
"dist/*"
|
||||
],
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"exports": {
|
||||
"./build": {
|
||||
"types": "./dist/build/index.d.ts",
|
||||
"import": "./dist/build/index.js"
|
||||
}
|
||||
"./build": "./dist/build/index.js",
|
||||
"./registry/client": "./dist/registry/client.js",
|
||||
"./registry/installer": "./dist/registry/installer/index.js",
|
||||
"./registry/schema": "./dist/registry/schema.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
||||
@@ -4,7 +4,12 @@ import { createConfigSchema } from './src/config';
|
||||
import { z } from 'zod';
|
||||
|
||||
export default defineConfig({
|
||||
entry: ['./src/index.ts', './src/build/index.ts'],
|
||||
entry: [
|
||||
'./src/index.ts',
|
||||
'./src/registry/{client,schema}.ts',
|
||||
'./src/registry/installer/index.ts',
|
||||
'./src/build/index.ts',
|
||||
],
|
||||
format: 'esm',
|
||||
dts: true,
|
||||
fixedExtension: false,
|
||||
@@ -12,6 +17,10 @@ export default defineConfig({
|
||||
deps: {
|
||||
onlyAllowBundle: [],
|
||||
},
|
||||
exports: {
|
||||
enabled: true,
|
||||
exclude: ['./index'],
|
||||
},
|
||||
async onSuccess() {
|
||||
console.log('JSON schema generated');
|
||||
await fs.mkdir('dist/schema', { recursive: true });
|
||||
|
||||
@@ -4,8 +4,15 @@ import { createContentHighlighter } from '@/search';
|
||||
test('highlight search results', () => {
|
||||
const highlighter = createContentHighlighter('hello world helloworld');
|
||||
|
||||
expect(highlighter.highlightMarkdown('oops hello, world hello! worldhello'))
|
||||
.toMatchInlineSnapshot(`"oops <mark>hello</mark>, <mark>world</mark> <mark>hello</mark>! <mark>world</mark><mark>hello</mark>"`);
|
||||
expect(highlighter.highlightMarkdown('helloworld!!!')).toMatchInlineSnapshot(`"<mark>hello</mark><mark>world</mark>!!!"`);
|
||||
expect(highlighter.highlightMarkdown('wor ld hello')).toMatchInlineSnapshot(`"wor ld <mark>hello</mark>"`);
|
||||
expect(
|
||||
highlighter.highlightMarkdown('oops hello, world hello! worldhello'),
|
||||
).toMatchInlineSnapshot(
|
||||
`"oops <mark>hello</mark>, <mark>world</mark> <mark>hello</mark>! <mark>world</mark><mark>hello</mark>"`,
|
||||
);
|
||||
expect(highlighter.highlightMarkdown('helloworld!!!')).toMatchInlineSnapshot(
|
||||
`"<mark>hello</mark><mark>world</mark>!!!"`,
|
||||
);
|
||||
expect(highlighter.highlightMarkdown('wor ld hello')).toMatchInlineSnapshot(
|
||||
`"wor ld <mark>hello</mark>"`,
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user