dumi 2.3.0-beta.8 → 2.3.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/crates/swc_plugin_react_demo.wasm +0 -0
- package/dist/assetParsers/block.d.ts +1 -0
- package/dist/assetParsers/block.js +5 -1
- package/dist/client/theme-api/types.d.ts +5 -0
- package/dist/features/locales.js +4 -0
- package/dist/features/theme/index.js +22 -6
- package/dist/loaders/markdown/transformer/index.d.ts +2 -1
- package/dist/loaders/markdown/transformer/rehypeDemo.d.ts +1 -0
- package/dist/loaders/markdown/transformer/rehypeDemo.js +25 -8
- package/dist/loaders/markdown/transformer/rehypeEnhancedTag.js +12 -2
- package/dist/loaders/markdown/transformer/remarkContainer.js +37 -6
- package/dist/techStacks/utils.d.ts +22 -0
- package/dist/techStacks/utils.js +5 -0
- package/dist/types.d.ts +3 -1
- package/package.json +28 -25
- package/tech-stack-utils.d.ts +4 -2
- package/theme-default/builtins/API/index.d.ts +2 -1
- package/theme-default/builtins/API/index.js +173 -43
- package/theme-default/builtins/API/index.less +47 -0
- package/theme-default/builtins/CodeGroup/index.d.ts +3 -0
- package/theme-default/builtins/CodeGroup/index.js +29 -0
- package/theme-default/builtins/Previewer/index.js +1 -1
- package/theme-default/builtins/SourceCode/index.d.ts +3 -2
- package/theme-default/locales/en-US.json +4 -0
- package/theme-default/locales/zh-CN.json +4 -0
- package/theme-default/slots/PreviewerActions/index.d.ts +6 -1
- package/theme-default/slots/PreviewerActions/index.js +30 -13
- package/theme-default/slots/PreviewerActions/index.less +30 -140
- package/theme-default/slots/Tabs/index.d.ts +6 -0
- package/theme-default/slots/Tabs/index.js +11 -0
- package/theme-default/slots/Tabs/index.less +151 -0
|
File without changes
|
|
@@ -136,12 +136,16 @@ async function parseBlockAsset(opts) {
|
|
|
136
136
|
asset.entry = filename;
|
|
137
137
|
if (frontmatter) {
|
|
138
138
|
file.value = code;
|
|
139
|
-
|
|
139
|
+
asset.dependencies[filename].value = code;
|
|
140
140
|
["description", "title", "snapshot", "keywords"].forEach(
|
|
141
141
|
(key) => {
|
|
142
142
|
asset[key] = frontmatter == null ? void 0 : frontmatter[key];
|
|
143
143
|
}
|
|
144
144
|
);
|
|
145
|
+
["description", "title"].forEach((key) => {
|
|
146
|
+
frontmatter[key] || (frontmatter[key] = frontmatter[`${key}.${opts.fileLocale}`]);
|
|
147
|
+
});
|
|
148
|
+
result.frontmatter = frontmatter;
|
|
145
149
|
}
|
|
146
150
|
}
|
|
147
151
|
if (!isEntryPoint || !opts.entryPointCode) {
|
|
@@ -49,6 +49,10 @@ export interface IPreviewerProps {
|
|
|
49
49
|
* react node of current demo
|
|
50
50
|
*/
|
|
51
51
|
children: ReactNode;
|
|
52
|
+
/**
|
|
53
|
+
* private field, do not use it in your code
|
|
54
|
+
*/
|
|
55
|
+
_live_in_iframe: boolean;
|
|
52
56
|
[key: string]: any;
|
|
53
57
|
}
|
|
54
58
|
export interface IRouteMeta {
|
|
@@ -208,6 +212,7 @@ export interface IThemeConfig {
|
|
|
208
212
|
[key in SocialTypes]?: string;
|
|
209
213
|
};
|
|
210
214
|
editLink?: boolean | string;
|
|
215
|
+
sourceLink?: boolean | string;
|
|
211
216
|
lastUpdated?: boolean;
|
|
212
217
|
[key: string]: any;
|
|
213
218
|
}
|
package/dist/features/locales.js
CHANGED
|
@@ -151,6 +151,10 @@ const LocalesContainer: FC<{ children: ReactNode }> = (props) => {
|
|
|
151
151
|
api.config.themeConfig.editLink
|
|
152
152
|
)};
|
|
153
153
|
|
|
154
|
+
localeMessages['$internal.api.sourceLink'] = ${JSON.stringify(
|
|
155
|
+
api.config.themeConfig.sourceLink
|
|
156
|
+
)};
|
|
157
|
+
|
|
154
158
|
return createIntl({ locale, messages: localeMessages }, cache);
|
|
155
159
|
}, []);
|
|
156
160
|
const [intl, setIntl] = useState(() => getIntl());
|
|
@@ -161,7 +161,7 @@ var theme_default = (api) => {
|
|
|
161
161
|
return memo;
|
|
162
162
|
});
|
|
163
163
|
api.modifyConfig((memo) => {
|
|
164
|
-
var _a, _b;
|
|
164
|
+
var _a, _b, _c;
|
|
165
165
|
if (localThemeData) {
|
|
166
166
|
themeMapKeys.forEach((key) => {
|
|
167
167
|
Object.values(localThemeData[key] || {}).forEach((item) => {
|
|
@@ -180,7 +180,9 @@ var theme_default = (api) => {
|
|
|
180
180
|
import_path.default.resolve(__dirname, "../../client/theme-api")
|
|
181
181
|
);
|
|
182
182
|
const repoUrl = ((_a = api.pkg.repository) == null ? void 0 : _a.url) || api.pkg.repository;
|
|
183
|
-
|
|
183
|
+
const autoEditLink = (((_b = memo.themeConfig) == null ? void 0 : _b.editLink) ?? true) === true;
|
|
184
|
+
const autoSourceLink = (((_c = memo.themeConfig) == null ? void 0 : _c.sourceLink) ?? true) === true;
|
|
185
|
+
if ((autoEditLink || autoSourceLink) && typeof repoUrl === "string") {
|
|
184
186
|
const hostedGitIns = import_hosted_git_info.default.fromUrl(repoUrl);
|
|
185
187
|
let branch = "";
|
|
186
188
|
try {
|
|
@@ -192,10 +194,24 @@ var theme_default = (api) => {
|
|
|
192
194
|
}
|
|
193
195
|
if (hostedGitIns) {
|
|
194
196
|
memo.themeConfig ?? (memo.themeConfig = {});
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
const directory = api.pkg.repository.directory || "";
|
|
198
|
+
if (autoSourceLink) {
|
|
199
|
+
let anchorPrefix = "L";
|
|
200
|
+
if (hostedGitIns.type.includes("bitbucket")) {
|
|
201
|
+
anchorPrefix = "lines-";
|
|
202
|
+
}
|
|
203
|
+
const sourceLinkTemplate = hostedGitIns.browse(
|
|
204
|
+
`${directory}/{fileName}#${anchorPrefix}{line}`,
|
|
205
|
+
{ committish: branch }
|
|
206
|
+
);
|
|
207
|
+
memo.themeConfig.sourceLink = sourceLinkTemplate;
|
|
208
|
+
}
|
|
209
|
+
if (autoEditLink) {
|
|
210
|
+
memo.themeConfig.editLink = `${hostedGitIns.edit(
|
|
211
|
+
`${directory}/{filename}`,
|
|
212
|
+
{ committish: branch }
|
|
213
|
+
)}`;
|
|
214
|
+
}
|
|
199
215
|
}
|
|
200
216
|
}
|
|
201
217
|
return memo;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { IParsedBlockAsset } from "../../../assetParsers/block";
|
|
2
2
|
import type { ILocalesConfig, IRouteMeta } from "../../../client/theme-api/types";
|
|
3
3
|
import type { IApi, IDumiConfig, IDumiTechStack } from "../../../types";
|
|
4
|
+
import { type ResolveOptions } from 'enhanced-resolve';
|
|
4
5
|
import type { IRoute } from 'umi';
|
|
5
6
|
import type { Data } from 'vfile';
|
|
6
7
|
declare module 'hast' {
|
|
@@ -45,7 +46,7 @@ declare module 'vfile' {
|
|
|
45
46
|
export interface IMdTransformerOptions {
|
|
46
47
|
cwd: string;
|
|
47
48
|
fileAbsPath: string;
|
|
48
|
-
alias:
|
|
49
|
+
alias: ResolveOptions['alias'];
|
|
49
50
|
parentAbsPath?: string;
|
|
50
51
|
techStacks: IDumiTechStack[];
|
|
51
52
|
resolve: IDumiConfig['resolve'];
|
|
@@ -5,6 +5,7 @@ import type { IMdTransformerOptions } from '.';
|
|
|
5
5
|
export declare const DEMO_PROP_VALUE_KEY = "$demo-prop-value-key";
|
|
6
6
|
export declare const DUMI_DEMO_TAG = "DumiDemo";
|
|
7
7
|
export declare const DUMI_DEMO_GRID_TAG = "DumiDemoGrid";
|
|
8
|
+
export declare const SKIP_DEMO_PARSE = "pure";
|
|
8
9
|
type IRehypeDemoOptions = Pick<IMdTransformerOptions, 'techStacks' | 'cwd' | 'fileAbsPath' | 'resolve'> & {
|
|
9
10
|
resolver: typeof sync;
|
|
10
11
|
fileLocaleLessPath: string;
|
|
@@ -32,6 +32,7 @@ __export(rehypeDemo_exports, {
|
|
|
32
32
|
DEMO_PROP_VALUE_KEY: () => DEMO_PROP_VALUE_KEY,
|
|
33
33
|
DUMI_DEMO_GRID_TAG: () => DUMI_DEMO_GRID_TAG,
|
|
34
34
|
DUMI_DEMO_TAG: () => DUMI_DEMO_TAG,
|
|
35
|
+
SKIP_DEMO_PARSE: () => SKIP_DEMO_PARSE,
|
|
35
36
|
default: () => rehypeDemo
|
|
36
37
|
});
|
|
37
38
|
module.exports = __toCommonJS(rehypeDemo_exports);
|
|
@@ -48,6 +49,16 @@ var DEMO_NODE_CONTAINER = "$demo-container";
|
|
|
48
49
|
var DEMO_PROP_VALUE_KEY = "$demo-prop-value-key";
|
|
49
50
|
var DUMI_DEMO_TAG = "DumiDemo";
|
|
50
51
|
var DUMI_DEMO_GRID_TAG = "DumiDemoGrid";
|
|
52
|
+
var SKIP_DEMO_PARSE = "pure";
|
|
53
|
+
var ALWAYS_DEMO_PARSE = "demo";
|
|
54
|
+
var skipDemoRE = new RegExp(
|
|
55
|
+
/** 注意前面有空格 ==> */
|
|
56
|
+
` ${SKIP_DEMO_PARSE}`
|
|
57
|
+
);
|
|
58
|
+
var alwaysDemoRE = new RegExp(
|
|
59
|
+
/** 注意前面有空格 ==> */
|
|
60
|
+
` ${ALWAYS_DEMO_PARSE}`
|
|
61
|
+
);
|
|
51
62
|
(async () => {
|
|
52
63
|
({ visit, SKIP, EXIT } = await import("unist-util-visit"));
|
|
53
64
|
({ toString } = await import("hast-util-to-string"));
|
|
@@ -62,14 +73,18 @@ function getCodeLang(node, opts) {
|
|
|
62
73
|
node.properties.src
|
|
63
74
|
);
|
|
64
75
|
lang = import_path.default.extname(node.properties.src).slice(1);
|
|
65
|
-
} else if (
|
|
66
|
-
//
|
|
67
|
-
|
|
68
|
-
|
|
76
|
+
} else if ([
|
|
77
|
+
// 插件开发者可配置 [SKIP_DEMO_PARSE_SIGN] 表示不解析 demo (优先级最高)
|
|
78
|
+
!Object.prototype.hasOwnProperty.call(node.data ?? {}, SKIP_DEMO_PARSE),
|
|
79
|
+
Array.isArray((_b = node.properties) == null ? void 0 : _b.className),
|
|
80
|
+
// 根据用户配置判断 pure 或者 demo
|
|
81
|
+
opts.resolve.codeBlockMode === "passive" ? alwaysDemoRE.test(String((_c = node.data) == null ? void 0 : _c.meta)) : !skipDemoRE.test(String((_d = node.data) == null ? void 0 : _d.meta))
|
|
69
82
|
// active mode (default)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
83
|
+
].every(Boolean)) {
|
|
84
|
+
lang = String(node.properties.className[0]).replace(
|
|
85
|
+
"language-",
|
|
86
|
+
""
|
|
87
|
+
);
|
|
73
88
|
}
|
|
74
89
|
return lang;
|
|
75
90
|
}
|
|
@@ -181,6 +196,7 @@ function rehypeDemo(opts) {
|
|
|
181
196
|
refAtomIds: vFile.data.frontmatter.atomId ? [vFile.data.frontmatter.atomId] : [],
|
|
182
197
|
fileAbsPath: "",
|
|
183
198
|
lang: codeNode.data.lang,
|
|
199
|
+
fileLocale: opts.fileLocale,
|
|
184
200
|
entryPointCode: codeType === "external" ? void 0 : codeValue,
|
|
185
201
|
resolver: opts.resolver,
|
|
186
202
|
techStack
|
|
@@ -364,5 +380,6 @@ function rehypeDemo(opts) {
|
|
|
364
380
|
0 && (module.exports = {
|
|
365
381
|
DEMO_PROP_VALUE_KEY,
|
|
366
382
|
DUMI_DEMO_GRID_TAG,
|
|
367
|
-
DUMI_DEMO_TAG
|
|
383
|
+
DUMI_DEMO_TAG,
|
|
384
|
+
SKIP_DEMO_PARSE
|
|
368
385
|
});
|
|
@@ -40,10 +40,17 @@ var toString;
|
|
|
40
40
|
({ isElement } = await import("hast-util-is-element"));
|
|
41
41
|
({ toString } = await import("hast-util-to-string"));
|
|
42
42
|
})();
|
|
43
|
+
var rawMetaRE = /\[(.+)\]/;
|
|
44
|
+
function rehypeCodeMeta(meta) {
|
|
45
|
+
if (typeof meta !== "string")
|
|
46
|
+
return {};
|
|
47
|
+
const [title] = (rawMetaRE.exec(meta.trim()) || []).slice(1);
|
|
48
|
+
return { title };
|
|
49
|
+
}
|
|
43
50
|
function rehypeEnhancedTag() {
|
|
44
51
|
return async (tree) => {
|
|
45
52
|
visit(tree, "element", (node, i, parent) => {
|
|
46
|
-
var _a, _b, _c, _d;
|
|
53
|
+
var _a, _b, _c, _d, _e;
|
|
47
54
|
if (node.tagName === "pre" && isElement((_a = node.children) == null ? void 0 : _a[0]) && node.children[0].tagName === "code") {
|
|
48
55
|
const className = ((_b = node.children[0].properties) == null ? void 0 : _b.className) || [];
|
|
49
56
|
const lang = (_c = className.join("").match(/language-(\w+)(?:$| )/)) == null ? void 0 : _c[1];
|
|
@@ -51,7 +58,10 @@ function rehypeEnhancedTag() {
|
|
|
51
58
|
parent.children.splice(i, 1, {
|
|
52
59
|
type: "element",
|
|
53
60
|
tagName: "SourceCode",
|
|
54
|
-
properties: {
|
|
61
|
+
properties: {
|
|
62
|
+
...rehypeCodeMeta((_e = node.children[0].data) == null ? void 0 : _e.meta),
|
|
63
|
+
lang
|
|
64
|
+
},
|
|
55
65
|
data: node.children[0].data,
|
|
56
66
|
JSXAttributes: [
|
|
57
67
|
{
|
|
@@ -32,12 +32,19 @@ __export(remarkContainer_exports, {
|
|
|
32
32
|
default: () => remarkContainer
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(remarkContainer_exports);
|
|
35
|
+
var import_rehypeDemo = require("./rehypeDemo");
|
|
35
36
|
var visit;
|
|
36
37
|
var SKIP;
|
|
38
|
+
var CONTINUE;
|
|
37
39
|
var VALID_CONTAINER_TYPES = ["info", "warning", "success", "error"];
|
|
40
|
+
var CODE_GROUP_SPECIFIER = "code-group";
|
|
38
41
|
(async () => {
|
|
39
|
-
({ visit, SKIP } = await import("unist-util-visit"));
|
|
42
|
+
({ visit, SKIP, CONTINUE } = await import("unist-util-visit"));
|
|
40
43
|
})();
|
|
44
|
+
var transformAttributes = (attributes) => Object.entries(attributes ?? {}).reduce(
|
|
45
|
+
(ret, [name, value]) => `${ret} ${value ? `${name}="${value}"` : name}`,
|
|
46
|
+
""
|
|
47
|
+
);
|
|
41
48
|
function remarkContainer() {
|
|
42
49
|
const data = this.data();
|
|
43
50
|
const micromarkExtensions = data.micromarkExtensions.find(
|
|
@@ -47,11 +54,10 @@ function remarkContainer() {
|
|
|
47
54
|
micromarkExtensions.flow["58"].splice(1, 1);
|
|
48
55
|
return (tree) => {
|
|
49
56
|
visit(tree, (node, i, parent) => {
|
|
50
|
-
if (node.type
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
);
|
|
57
|
+
if (node.type !== "containerDirective")
|
|
58
|
+
return CONTINUE;
|
|
59
|
+
if (VALID_CONTAINER_TYPES.includes(node.name)) {
|
|
60
|
+
const attrs = transformAttributes(node.attributes);
|
|
55
61
|
parent.children.splice(
|
|
56
62
|
i,
|
|
57
63
|
1,
|
|
@@ -67,6 +73,31 @@ function remarkContainer() {
|
|
|
67
73
|
);
|
|
68
74
|
return SKIP;
|
|
69
75
|
}
|
|
76
|
+
if (node.name === CODE_GROUP_SPECIFIER) {
|
|
77
|
+
const codeChildren = node.children.filter(({ type }) => type === "code").map((child) => ({
|
|
78
|
+
...child,
|
|
79
|
+
data: {
|
|
80
|
+
...child.data,
|
|
81
|
+
// dumi 默认会编译有关联技术栈的代码块, 标记为不需要编译
|
|
82
|
+
[import_rehypeDemo.SKIP_DEMO_PARSE]: true
|
|
83
|
+
}
|
|
84
|
+
}));
|
|
85
|
+
parent.children.splice(
|
|
86
|
+
i,
|
|
87
|
+
1,
|
|
88
|
+
{
|
|
89
|
+
type: "html",
|
|
90
|
+
value: `<CodeGroup>`,
|
|
91
|
+
position: node.position
|
|
92
|
+
},
|
|
93
|
+
...codeChildren,
|
|
94
|
+
{
|
|
95
|
+
type: "html",
|
|
96
|
+
value: "</CodeGroup>"
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
return SKIP;
|
|
100
|
+
}
|
|
70
101
|
});
|
|
71
102
|
};
|
|
72
103
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ParserConfig } from '@swc/core';
|
|
2
|
+
import { IDumiTechStack } from '../types';
|
|
2
3
|
export { IDumiTechStack, IDumiTechStackOnBlockLoadArgs, IDumiTechStackOnBlockLoadResult, IDumiTechStackRuntimeOpts, } from '../types';
|
|
3
4
|
/**
|
|
4
5
|
* for frameworks like vue , we need to extract the JS fragments in their scripts
|
|
@@ -16,3 +17,24 @@ export interface IWrapDemoWithFnOptions {
|
|
|
16
17
|
* https://github.com/umijs/dumi/blob/master/crates/swc_plugin_react_demo/src/lib.rs#L126
|
|
17
18
|
*/
|
|
18
19
|
export declare function wrapDemoWithFn(code: string, opts: IWrapDemoWithFnOptions): string;
|
|
20
|
+
export type IDefineTechStackOptions = IDumiTechStack;
|
|
21
|
+
/**
|
|
22
|
+
* Define a tech stack
|
|
23
|
+
* @param options techstack options
|
|
24
|
+
* @returns function that returns {@link IDumiTechStack}, can be used to register a techstack
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* const ReactTechStack = defineTechStack({
|
|
28
|
+
* name: 'jsx',
|
|
29
|
+
* isSupported(_, lang) {
|
|
30
|
+
* return ['jsx', 'tsx'].includes(lang);
|
|
31
|
+
* },
|
|
32
|
+
* transformCode() {
|
|
33
|
+
* // ...
|
|
34
|
+
* return '';
|
|
35
|
+
* },
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* api.registerTechStack(() => ReactTechStack);
|
|
39
|
+
*/
|
|
40
|
+
export declare function defineTechStack(options: IDefineTechStackOptions): IDumiTechStack;
|
package/dist/techStacks/utils.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(utils_exports, {
|
|
|
33
33
|
IDumiTechStackOnBlockLoadArgs: () => import_types.IDumiTechStackOnBlockLoadArgs,
|
|
34
34
|
IDumiTechStackOnBlockLoadResult: () => import_types.IDumiTechStackOnBlockLoadResult,
|
|
35
35
|
IDumiTechStackRuntimeOpts: () => import_types.IDumiTechStackRuntimeOpts,
|
|
36
|
+
defineTechStack: () => defineTechStack,
|
|
36
37
|
extractScript: () => extractScript,
|
|
37
38
|
wrapDemoWithFn: () => wrapDemoWithFn
|
|
38
39
|
});
|
|
@@ -74,12 +75,16 @@ function wrapDemoWithFn(code, opts) {
|
|
|
74
75
|
${result.code}
|
|
75
76
|
}`;
|
|
76
77
|
}
|
|
78
|
+
function defineTechStack(options) {
|
|
79
|
+
return options;
|
|
80
|
+
}
|
|
77
81
|
// Annotate the CommonJS export names for ESM import in node:
|
|
78
82
|
0 && (module.exports = {
|
|
79
83
|
IDumiTechStack,
|
|
80
84
|
IDumiTechStackOnBlockLoadArgs,
|
|
81
85
|
IDumiTechStackOnBlockLoadResult,
|
|
82
86
|
IDumiTechStackRuntimeOpts,
|
|
87
|
+
defineTechStack,
|
|
83
88
|
extractScript,
|
|
84
89
|
wrapDemoWithFn
|
|
85
90
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -82,7 +82,9 @@ export declare abstract class IDumiTechStack {
|
|
|
82
82
|
*/
|
|
83
83
|
abstract runtimeOpts?: IDumiTechStackRuntimeOpts;
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
85
|
+
* Is the lang supported by the current tech stack?
|
|
86
|
+
* @param lang
|
|
87
|
+
* @param node hast Element https://github.com/syntax-tree/hast?tab=readme-ov-file#element
|
|
86
88
|
*/
|
|
87
89
|
abstract isSupported(node: Element, lang: string): boolean;
|
|
88
90
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dumi",
|
|
3
|
-
"version": "2.3.0-
|
|
3
|
+
"version": "2.3.0-rc.0",
|
|
4
4
|
"description": "📖 Documentation Generator of React Component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"generator",
|
|
@@ -36,25 +36,6 @@
|
|
|
36
36
|
"tech-stack-utils.js",
|
|
37
37
|
"tech-stack-utils.d.ts"
|
|
38
38
|
],
|
|
39
|
-
"scripts": {
|
|
40
|
-
"build": "father build && npm run build:crates",
|
|
41
|
-
"build:crates": "cargo build --target wasm32-wasi -r --out-dir compiled/crates -Z unstable-options",
|
|
42
|
-
"build:deps": "node scripts/pre-bundle-worker.js && father prebundle",
|
|
43
|
-
"build:suites": "pnpm run --filter=\"./suites/**\" build",
|
|
44
|
-
"dev": "father dev",
|
|
45
|
-
"docs:build": "node ./bin/dumi.js build",
|
|
46
|
-
"docs:dev": "node ./bin/dumi.js dev",
|
|
47
|
-
"docs:sync": "node ./scripts/sync-from-umi.js",
|
|
48
|
-
"format": "prettier --cache --write .",
|
|
49
|
-
"lint": "npm run lint:es && npm run lint:css",
|
|
50
|
-
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
|
51
|
-
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
52
|
-
"prepare": "husky install && npm run build && npm run build:suites && node ./bin/dumi.js setup && npm run docs:sync",
|
|
53
|
-
"prepublishOnly": "npm run build",
|
|
54
|
-
"test": "vitest",
|
|
55
|
-
"vercel:build": "npm run docs:build",
|
|
56
|
-
"vercel:install": "./scripts/vercel-install.sh"
|
|
57
|
-
},
|
|
58
39
|
"commitlint": {
|
|
59
40
|
"extends": [
|
|
60
41
|
"@commitlint/config-conventional"
|
|
@@ -120,8 +101,9 @@
|
|
|
120
101
|
"raw-loader": "^4.0.2",
|
|
121
102
|
"rc-motion": "^2.7.3",
|
|
122
103
|
"rc-tabs": "^12.10.0",
|
|
104
|
+
"rc-tooltip": "^6.1.3",
|
|
123
105
|
"rc-tree": "^5.7.9",
|
|
124
|
-
"rc-util": "^5.
|
|
106
|
+
"rc-util": "^5.38.0",
|
|
125
107
|
"react-copy-to-clipboard": "^5.1.0",
|
|
126
108
|
"react-error-boundary": "^4.0.10",
|
|
127
109
|
"react-intl": "^6.4.4",
|
|
@@ -163,10 +145,11 @@
|
|
|
163
145
|
"@umijs/lint": "^4.0.84",
|
|
164
146
|
"@umijs/plugins": "4.0.32",
|
|
165
147
|
"codesandbox-import-utils": "^2.2.3",
|
|
166
|
-
"dumi-theme-mobile": "workspace:*",
|
|
167
148
|
"eslint": "^8.46.0",
|
|
149
|
+
"esno": "^4.7.0",
|
|
168
150
|
"fast-glob": "^3.3.1",
|
|
169
151
|
"father": "^4.3.0",
|
|
152
|
+
"git-repo-info": "^2.1.1",
|
|
170
153
|
"highlight-words-core": "^1.2.2",
|
|
171
154
|
"husky": "^8.0.3",
|
|
172
155
|
"lint-staged": "^13.2.3",
|
|
@@ -178,7 +161,9 @@
|
|
|
178
161
|
"stylelint": "^15.10.2",
|
|
179
162
|
"ts-node": "^10.9.1",
|
|
180
163
|
"typescript": "~5.0.4",
|
|
181
|
-
"vitest": "^0.33.0"
|
|
164
|
+
"vitest": "^0.33.0",
|
|
165
|
+
"zx": "^7.2.3",
|
|
166
|
+
"dumi-theme-mobile": "2.3.0-rc.0"
|
|
182
167
|
},
|
|
183
168
|
"peerDependencies": {
|
|
184
169
|
"react": ">=16.8",
|
|
@@ -190,5 +175,23 @@
|
|
|
190
175
|
},
|
|
191
176
|
"authors": [
|
|
192
177
|
"Peach <scdzwyxst@gmail.com>"
|
|
193
|
-
]
|
|
194
|
-
|
|
178
|
+
],
|
|
179
|
+
"scripts": {
|
|
180
|
+
"build": "father build && npm run build:crates",
|
|
181
|
+
"build:crates": "cargo build --target wasm32-wasi -r --out-dir compiled/crates -Z unstable-options",
|
|
182
|
+
"build:deps": "node scripts/pre-bundle-worker.js && father prebundle",
|
|
183
|
+
"build:suites": "pnpm run --filter=\"./suites/**\" build",
|
|
184
|
+
"dev": "father dev",
|
|
185
|
+
"docs:build": "node ./bin/dumi.js build",
|
|
186
|
+
"docs:dev": "node ./bin/dumi.js dev",
|
|
187
|
+
"docs:sync": "node ./scripts/sync-from-umi.js",
|
|
188
|
+
"format": "prettier --cache --write .",
|
|
189
|
+
"lint": "npm run lint:es && npm run lint:css",
|
|
190
|
+
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"",
|
|
191
|
+
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
|
192
|
+
"release": "esno scripts/release.ts",
|
|
193
|
+
"test": "vitest",
|
|
194
|
+
"vercel:build": "npm run docs:build",
|
|
195
|
+
"vercel:install": "./scripts/vercel-install.sh"
|
|
196
|
+
}
|
|
197
|
+
}
|
package/tech-stack-utils.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type * as BabelCore from '@umijs/bundler-utils/compiled/@babel/core';
|
|
2
2
|
export {
|
|
3
|
-
IBaseApiParserOptions,
|
|
4
3
|
ILanguageMetaParser,
|
|
5
4
|
IPatchFile,
|
|
6
5
|
} from './dist/assetParsers/BaseParser';
|
|
7
|
-
export {
|
|
6
|
+
export {
|
|
7
|
+
IBaseApiParserOptions,
|
|
8
|
+
createApiParser,
|
|
9
|
+
} from './dist/assetParsers/utils';
|
|
8
10
|
export * from './dist/techStacks/utils';
|
|
9
11
|
export { BabelCore };
|
|
10
12
|
export const babelCore: () => typeof import('@umijs/bundler-utils/compiled/@babel/core');
|