@rsdoctor/docs 0.3.8 → 0.3.9

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.
@@ -1,5 +1,5 @@
1
1
  # Rule Index
2
2
 
3
- import RuleIndex from '@src/components/RuleIndex';
3
+ import RuleIndex from '@components/RuleIndex';
4
4
 
5
5
  <RuleIndex />
package/docs/en/index.md CHANGED
@@ -13,7 +13,7 @@ hero:
13
13
  text: Quick Start
14
14
  link: /guide/start/quick-start
15
15
  image:
16
- src: https://lf3-static.bytednsdoc.com/obj/eden-cn/lognuvj/rsdoctor/logo/rsdoctor.png
16
+ src: https://assets.rspack.dev/rsdoctor/rsdoctor-logo-960x960.png
17
17
  alt: Rsdoctor Logo
18
18
 
19
19
  features:
@@ -1,5 +1,5 @@
1
1
  # Rule Index
2
2
 
3
- import RuleIndex from '@src/components/RuleIndex';
3
+ import RuleIndex from '@components/RuleIndex';
4
4
 
5
5
  <RuleIndex />
package/docs/zh/index.md CHANGED
@@ -13,7 +13,7 @@ hero:
13
13
  text: 快速开始
14
14
  link: /zh/guide/start/quick-start
15
15
  image:
16
- src: https://lf3-static.bytednsdoc.com/obj/eden-cn/lognuvj/rsdoctor/logo/rsdoctor.png
16
+ src: https://assets.rspack.dev/rsdoctor/rsdoctor-logo-960x960.png
17
17
  alt: Rsdoctor Logo
18
18
 
19
19
  features:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsdoctor/docs",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/web-infra-dev/rsdoctor",
@@ -24,18 +24,16 @@
24
24
  "@types/react-dom": "^18",
25
25
  "react": "18.2.0",
26
26
  "react-dom": "18.2.0",
27
- "rsbuild-plugin-google-analytics": "^1.0.0",
28
- "rsbuild-plugin-open-graph": "1.0.0",
27
+ "rsbuild-plugin-google-analytics": "^1.0.1",
28
+ "rsbuild-plugin-open-graph": "^1.0.1",
29
29
  "rspress-plugin-font-open-sans": "^1.0.0",
30
30
  "typescript": "^5.2.2",
31
- "@rsdoctor/types": "0.3.8"
31
+ "@rsdoctor/types": "0.3.9"
32
32
  },
33
33
  "dependencies": {
34
- "framer-motion": "^10.18.0",
35
34
  "react-markdown": "^9.0.1",
36
- "rsfamily-nav-icon": "^1.0.3",
37
- "rspress": "^1.25.1",
38
- "tailwindcss": "^3.4.0"
35
+ "rsfamily-doc-ui": "^1.0.3",
36
+ "rspress": "^1.26.1"
39
37
  },
40
38
  "scripts": {
41
39
  "dev": "rspress dev",
@@ -1,6 +0,0 @@
1
- .next-steps {
2
- display: flex;
3
- flex-wrap: wrap;
4
- justify-content: space-between;
5
- margin-top: 3rem;
6
- }
@@ -1,7 +0,0 @@
1
- import styles from './NextSteps.module.scss';
2
-
3
- const NextSteps = (props: { children?: React.ReactNode }) => {
4
- return <div className={styles.nextSteps}>{props.children}</div>;
5
- };
6
-
7
- export default NextSteps;
@@ -1,61 +0,0 @@
1
- .root {
2
- margin-top: 64px;
3
-
4
- h2 {
5
- font-size: 23px;
6
- font-weight: 600;
7
- line-height: 1;
8
- margin: 0 0 20px;
9
- color: var(--rp-c-text-1);
10
- transition: color 0.5s;
11
- }
12
-
13
- a {
14
- letter-spacing: -0.01em;
15
- margin-bottom: 1em;
16
- transition: color 0.5s;
17
- margin: 0;
18
- font-size: 15px;
19
- font-weight: 500;
20
- line-height: 2.2;
21
- margin-top: 8px;
22
- color: var(--rp-c-text-code);
23
- opacity: 0.9;
24
- transition: color 0.5s;
25
- word-break: break-all;
26
- }
27
-
28
- a:hover {
29
- transition: color 0.5s;
30
- color: var(--rp-c-brand-dark);
31
- }
32
- }
33
-
34
- .group {
35
- break-inside: avoid;
36
- margin-bottom: 28px;
37
- background-color: var(--rp-c-bg-soft);
38
- border-radius: 12px;
39
- padding: 28px 32px;
40
- transition: background-color 0.5s;
41
- }
42
-
43
- @media (max-width: 768px) {
44
- .root a {
45
- font-size: 14px;
46
- }
47
- }
48
-
49
- @media (min-width: 768px) {
50
- .root {
51
- columns: 2;
52
- min-width: 648px;
53
- }
54
- }
55
-
56
- @media (min-width: 1024px) {
57
- .root {
58
- columns: 3;
59
- min-width: 904px;
60
- }
61
- }
@@ -1,40 +0,0 @@
1
- import { NoSSR } from 'rspress/runtime';
2
- import { useUrl } from '../utils';
3
- import styles from './Overview.module.scss';
4
-
5
- export interface GroupItem {
6
- text: string;
7
- link: string;
8
- }
9
-
10
- export interface Group {
11
- name: string;
12
- items: GroupItem[];
13
- }
14
-
15
- declare const OVERVIEW_GROUPS: Group[];
16
-
17
- export default function Overview() {
18
- const Nodes = OVERVIEW_GROUPS.map((group) => (
19
- <>
20
- <div className={styles.overviewGroups}>
21
- <div className={styles.group}>
22
- <h2>{group.name}</h2>
23
- <ul>
24
- {group.items.map((item) => (
25
- <li key={item.text}>
26
- <a href={useUrl(item.link)}>{item.text}</a>
27
- </li>
28
- ))}
29
- </ul>
30
- </div>
31
- </div>
32
- </>
33
- ));
34
-
35
- return (
36
- <NoSSR>
37
- <div className={styles.root}>{Nodes}</div>
38
- </NoSSR>
39
- );
40
- }
@@ -1,57 +0,0 @@
1
- .container {
2
- display: flex;
3
- justify-content: center;
4
- align-items: flex-start;
5
- }
6
-
7
- .card {
8
- box-sizing: border-box;
9
- margin: 0;
10
- padding: 0;
11
- position: relative;
12
- border-radius: 8px;
13
- border: 1px solid var(--rp-c-divider-light);
14
- margin-right: 24px;
15
- font-size: 14px;
16
- }
17
-
18
- .card-header {
19
- display: flex;
20
- justify-content: space-between;
21
- align-items: center;
22
- padding: 24px;
23
- border-bottom: 1px solid var(--rp-c-divider-light);
24
- height: 55.5px;
25
- overflow: hidden;
26
- font-weight: bold;
27
- }
28
-
29
- .card-body {
30
- padding: 24px;
31
- }
32
-
33
- .list {
34
- width: 320px;
35
- }
36
-
37
- .item {
38
- margin-bottom: 12px;
39
- font-size: 14px;
40
- cursor: pointer;
41
- }
42
-
43
- .content {
44
- margin-right: 0;
45
- min-width: 500px;
46
- }
47
-
48
- .tag {
49
- margin: 0 0.2em;
50
- padding-inline: 0.4em;
51
- padding-block: 0.2em 0.1em;
52
- font-size: 85%;
53
- background: rgba(150, 150, 150, 0.1);
54
- border: 1px solid rgba(100, 100, 100, 0.2);
55
- border-radius: 3px;
56
- font-weight: bold;
57
- }
@@ -1,75 +0,0 @@
1
- import { useState } from 'react';
2
- import ReactMarkdown from 'react-markdown';
3
- import { Rule } from '@rsdoctor/types';
4
- import styles from './RuleIndex.module.scss';
5
- const themeDefault = require('@rspress/core/theme');
6
-
7
- const RuleIndex = () => {
8
- const rules = Object.values(Rule.RuleErrorMap);
9
- const [ruleMessage, setRuleMessage] = useState(rules[0] as Rule.RuleMessage);
10
-
11
- const selectRuleMessage = (message: Rule.RuleMessage) => {
12
- setRuleMessage(message);
13
- };
14
-
15
- return (
16
- <div className={styles.container}>
17
- <div className={`${styles.card} ${styles.list}`}>
18
- <div className={styles['card-header']}>List of the error codes</div>
19
- <div className={styles['card-body']}>
20
- {rules.map((item) => (
21
- <div
22
- className={styles.item}
23
- key={item.code}
24
- onClick={() => selectRuleMessage(item)}
25
- style={{
26
- color:
27
- ruleMessage && item.code === ruleMessage.code
28
- ? 'rgb(24, 144, 255)'
29
- : undefined,
30
- }}
31
- >
32
- <span className={styles.tag}>
33
- <a>{item.code}</a>
34
- </span>
35
- <span>{item.title}</span>
36
- </div>
37
- ))}
38
- </div>
39
- </div>
40
-
41
- {ruleMessage ? (
42
- <div className={`${styles.card} ${styles.content}`}>
43
- <div className={styles['card-header']}>
44
- <div>
45
- <span className={styles.tag}>{ruleMessage.code}</span>
46
- <span>{ruleMessage.title}</span>
47
- </div>
48
- <span className={styles.tag}>{ruleMessage.category}</span>
49
- </div>
50
- <div className={styles['card-body']} style={{ paddingTop: 0 }}>
51
- <ReactMarkdown
52
- components={{
53
- ...themeDefault.getCustomMDXComponent(),
54
- code: (props) => <code {...props} />,
55
- }}
56
- >
57
- {ruleMessage.description}
58
- </ReactMarkdown>
59
- </div>
60
- </div>
61
- ) : (
62
- <div className={`${styles.card} ${styles.content}`}>
63
- <div className={styles['card-header']}>
64
- This page lists all the error codes emitted by the Rsdoctor.
65
- </div>
66
- <div className={styles['card-body']}>
67
- click the error code in left bar to show more details.
68
- </div>
69
- </div>
70
- )}
71
- </div>
72
- );
73
- };
74
-
75
- export default RuleIndex;
@@ -1,32 +0,0 @@
1
- .step {
2
- border: 1px solid var(--rp-c-bg-soft);
3
- background-color: var(--rp-c-bg-soft);
4
- transition:
5
- color 0.5s,
6
- background-color 0.5s;
7
- padding: 28px 36px;
8
- border-radius: 8px;
9
- flex: 0 32%;
10
- font-size: 14px;
11
- font-weight: 500;
12
-
13
- &:hover {
14
- border-color: var(--rp-c-brand);
15
- transition: border-color 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
16
- }
17
- }
18
-
19
- .title {
20
- font-size: 20px;
21
- line-height: 1.4;
22
- letter-spacing: -0.02em;
23
- margin: 0 0 0.75em !important;
24
- display: block;
25
- }
26
-
27
- .description {
28
- margin: 0 !important;
29
- line-height: 1.7 !important;
30
- color: var(--rp-c-text-2);
31
- transition: color 0.5s;
32
- }
@@ -1,13 +0,0 @@
1
- import { useUrl } from '../utils';
2
- import styles from './Step.module.scss';
3
-
4
- const Step = (props: { href: string; title: string; description: string }) => {
5
- return (
6
- <a className={styles.step} href={useUrl(props.href)}>
7
- <p className={styles.title}>{props.title}</p>
8
- <p className={styles.description}>{props.description}</p>
9
- </a>
10
- );
11
- };
12
-
13
- export default Step;
package/src/global.d.ts DELETED
@@ -1,4 +0,0 @@
1
- declare module '*.module.scss' {
2
- const classes: { readonly [key: string]: string };
3
- export default classes;
4
- }
package/src/utils.ts DELETED
@@ -1,9 +0,0 @@
1
- import { useLang, withBase, usePageData } from 'rspress/runtime';
2
-
3
- export function useUrl(url: string) {
4
- const lang = useLang();
5
- const {
6
- siteData: { lang: defaultLang },
7
- } = usePageData();
8
- return withBase(lang === defaultLang ? url : `/${lang}${url}`);
9
- }