Skip to content

Commit 3b31f69

Browse files
committed
chore(deps): update dependencies.
1 parent cb3c591 commit 3b31f69

File tree

16 files changed

+158
-70
lines changed

16 files changed

+158
-70
lines changed

.husky/pre-commit

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
4-
npx --no-install lint-staged
1+
npx --no-install lint-staged

core/README-zh.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ import scopePluginOptions from '@kkt/scope-plugin-options';
2727
import { LoaderConfOptions, WebpackConfiguration } from 'kkt';
2828
import { mdCodeModulesLoader } from 'markdown-react-code-preview-loader';
2929

30-
export default (conf: WebpackConfiguration, env: 'development' | 'production', options: LoaderConfOptions) => {
30+
export default (
31+
conf: WebpackConfiguration,
32+
env: 'development' | 'production',
33+
options: LoaderConfOptions
34+
) => {
3135
// ....
3236
conf = mdCodeModulesLoader(conf);
3337
// ....
@@ -45,7 +49,11 @@ import { Options } from 'markdown-react-code-preview-loader';
4549
* @param {Options} option Loader Options
4650
* @returns {webpack.Configuration}
4751
* **/
48-
export declare const mdCodeModulesLoader: (config: webpack.Configuration, lang?: string[], option?: Options) => webpack.Configuration;
52+
export declare const mdCodeModulesLoader: (
53+
config: webpack.Configuration,
54+
lang?: string[],
55+
option?: Options
56+
) => webpack.Configuration;
4957
```
5058

5159
**第 ② 种方法,手动添加配置**

core/README.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ import scopePluginOptions from '@kkt/scope-plugin-options';
2727
import { LoaderConfOptions, WebpackConfiguration } from 'kkt';
2828
import { mdCodeModulesLoader } from 'markdown-react-code-preview-loader';
2929

30-
export default (conf: WebpackConfiguration, env: 'development' | 'production', options: LoaderConfOptions) => {
31-
// ....
32-
conf = mdCodeModulesLoader(conf);
33-
// ....
34-
return conf;
30+
export default (
31+
conf: WebpackConfiguration,
32+
env: 'development' | 'production',
33+
options: LoaderConfOptions
34+
) => {
35+
// ....
36+
conf = mdCodeModulesLoader(conf);
37+
// ....
38+
return conf;
3539
};
3640
```
3741

@@ -45,7 +49,11 @@ import { Options } from 'markdown-react-code-preview-loader';
4549
* @param {Options} option Loader Options
4650
* @returns {webpack.Configuration}
4751
* **/
48-
export declare const mdCodeModulesLoader: (config: webpack.Configuration, lang?: string[], option?: Options) => webpack.Configuration;
52+
export declare const mdCodeModulesLoader: (
53+
config: webpack.Configuration,
54+
lang?: string[],
55+
option?: Options
56+
) => webpack.Configuration;
4957
```
5058

5159
**② The second method is to manually add the configuration**
@@ -111,10 +119,16 @@ After adding `loader`, use the method to load `markdown` text in the project pro
111119
```jsx
112120
import mdObj from 'markdown-react-code-preview-loader/README.md';
113121

114-
mdObj.source // => `README.md` raw string text
115-
mdObj.components // => The component index object, the React component converted from the markdown indexed example. (need to configure meta)
116-
mdObj.data // => The component source code index object, the sample source code indexed from markdown. (need to configure meta)
117-
mdObj.headings // => This is the parsed header data
122+
// `README.md` raw string text
123+
mdObj.source
124+
// The component index object, the React component converted from the markdown indexed example.
125+
// (need to configure meta)
126+
mdObj.components
127+
// The component source code index object, the sample source code indexed from markdown.
128+
// (need to configure meta)
129+
mdObj.data
130+
// This is the parsed header data
131+
mdObj.headings
118132
```
119133

120134
```js

core/src/utils/transform.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { transform } from '@babel/standalone';
2-
import { PluginItem } from '@babel/core';
2+
import { type PluginItem } from '@babel/core';
33
import removeImports from 'babel-plugin-transform-remove-imports';
44
import replaceExportDefault from 'babel-plugin-transform-replace-export-default';
5-
import { Options } from '../';
5+
import { type Options } from '../';
66

77
export const getTransformValue = (str: string, filename: string, opts: Options) => {
88
const plugins: PluginItem[] = [...(opts.babelPlugins || [])];

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"version": "2.1.8",
3-
"packages": ["website", "core"]
3+
"packages": ["website", "core", "pkg-example"]
44
}

package.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
},
2424
"workspaces": [
2525
"core",
26+
"pkg-example",
2627
"website"
2728
],
2829
"jest": {
@@ -35,11 +36,13 @@
3536
},
3637
"license": "MIT",
3738
"devDependencies": {
38-
"husky": "~7.0.4",
39-
"lerna": "~4.0.0",
40-
"lint-staged": "~12.3.4",
41-
"prettier": "~2.5.1",
42-
"pretty-quick": "~3.1.3",
43-
"tsbb": "~3.7.0"
39+
"react": "~18.2.0",
40+
"react-dom": "~18.2.0",
41+
"husky": "~9.1.6",
42+
"lerna": "~8.1.8",
43+
"lint-staged": "~15.2.10",
44+
"prettier": "~3.3.3",
45+
"pretty-quick": "~4.0.0",
46+
"tsbb": "^4.4.0"
4447
}
4548
}

pkg-example/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Example
2+
===
3+
4+
```jsx mdx:preview
5+
import React from "react";
6+
import Example from 'pkg-example';
7+
8+
export default function App() {
9+
return (
10+
<div className="container">
11+
<Example />
12+
</div>
13+
);
14+
}
15+
```

pkg-example/package.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "pkg-example",
3+
"version": "1.0.0",
4+
"private": true,
5+
"license": "MIT",
6+
"main": "./cjs/index.js",
7+
"module": "./esm/index.js",
8+
"exports": {
9+
".": {
10+
"require": "./cjs/index.js",
11+
"import": "./esm/index.js"
12+
},
13+
"./README.md": "./README.md"
14+
},
15+
"scripts": {
16+
"watch": "tsbb watch src/*.tsx --use-babel",
17+
"build": "tsbb build src/*.tsx --use-babel"
18+
},
19+
"keywords": [],
20+
"author": "jaywcjlove",
21+
"description": ""
22+
}

pkg-example/src/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import React from 'react';
2+
3+
export default function Test() {
4+
return <div>Test</div>;
5+
}

pkg-example/tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../tsconfig",
3+
"include": ["src"],
4+
"compilerOptions": {
5+
"outDir": "./cjs",
6+
"baseUrl": "."
7+
}
8+
}

0 commit comments

Comments
 (0)