@modern-js/main-doc 0.0.0-nightly-20240817170640 → 0.0.0-nightly-20240819170736
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/docs/en/apis/app/runtime/web-server/unstable_middleware.mdx +2 -2
- package/docs/zh/apis/app/runtime/web-server/unstable_middleware.mdx +2 -2
- package/package.json +4 -4
- package/rspress.config.ts +1 -1
- package/src/components/ContentCard/index.tsx +1 -1
- package/src/components/FeatureLayout/index.tsx +1 -1
- package/src/components/Footer/index.tsx +2 -2
- package/src/components/ListCard/index.tsx +1 -1
- package/src/components/Sandpack/index.tsx +4 -2
- package/src/components/SecondaryTitle/index.tsx +1 -1
- package/src/i18n/zhCN.ts +1 -1
- package/src/pages/index.tsx +13 -5
@@ -92,7 +92,7 @@ import {
|
|
92
92
|
} from '@modern-js/runtime/server';
|
93
93
|
import type { Vars } from '../shared/index';
|
94
94
|
|
95
|
-
const setPayload:
|
95
|
+
const setPayload: UnstableMiddlewaree<Vars> = async (
|
96
96
|
c: UnstableMiddlewareContext<Vars>,
|
97
97
|
next,
|
98
98
|
) => {
|
@@ -101,7 +101,7 @@ const setPayload: UnstableMiddleware = async (
|
|
101
101
|
await next();
|
102
102
|
};
|
103
103
|
|
104
|
-
export const unstableMiddleware: UnstableMiddleware[] = [setPayload];
|
104
|
+
export const unstableMiddleware: UnstableMiddleware<Vars>[] = [setPayload];
|
105
105
|
```
|
106
106
|
|
107
107
|
```ts title="src/routes/page.data.ts"
|
@@ -91,7 +91,7 @@ import {
|
|
91
91
|
} from '@modern-js/runtime/server';
|
92
92
|
import type { Vars } from '../shared/index';
|
93
93
|
|
94
|
-
const setPayload: UnstableMiddleware = async (
|
94
|
+
const setPayload: UnstableMiddleware<Vars> = async (
|
95
95
|
c: UnstableMiddlewareContext<Vars>,
|
96
96
|
next,
|
97
97
|
) => {
|
@@ -100,7 +100,7 @@ const setPayload: UnstableMiddleware = async (
|
|
100
100
|
await next();
|
101
101
|
};
|
102
102
|
|
103
|
-
export const unstableMiddleware: UnstableMiddleware[] = [setPayload];
|
103
|
+
export const unstableMiddleware: UnstableMiddleware<Vars>[] = [setPayload];
|
104
104
|
```
|
105
105
|
|
106
106
|
```ts title="src/routes/page.data.ts"
|
package/package.json
CHANGED
@@ -15,17 +15,17 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "0.0.0-nightly-
|
18
|
+
"version": "0.0.0-nightly-20240819170736",
|
19
19
|
"publishConfig": {
|
20
20
|
"registry": "https://registry.npmjs.org/",
|
21
21
|
"access": "public",
|
22
22
|
"provenance": true
|
23
23
|
},
|
24
24
|
"dependencies": {
|
25
|
-
"@modern-js/sandpack-react": "0.0.0-nightly-
|
25
|
+
"@modern-js/sandpack-react": "0.0.0-nightly-20240819170736"
|
26
26
|
},
|
27
27
|
"peerDependencies": {
|
28
|
-
"@modern-js/builder-doc": "0.0.0-nightly-
|
28
|
+
"@modern-js/builder-doc": "0.0.0-nightly-20240819170736"
|
29
29
|
},
|
30
30
|
"devDependencies": {
|
31
31
|
"@rspress/shared": "1.27.0",
|
@@ -39,7 +39,7 @@
|
|
39
39
|
"rspress": "1.27.0",
|
40
40
|
"ts-node": "^10.9.1",
|
41
41
|
"typescript": "^5",
|
42
|
-
"@modern-js/builder-doc": "0.0.0-nightly-
|
42
|
+
"@modern-js/builder-doc": "0.0.0-nightly-20240819170736"
|
43
43
|
},
|
44
44
|
"scripts": {
|
45
45
|
"dev": "rspress dev",
|
package/rspress.config.ts
CHANGED
@@ -103,8 +103,8 @@ export default function Footer() {
|
|
103
103
|
},
|
104
104
|
];
|
105
105
|
|
106
|
-
const Links = links.map(
|
107
|
-
<div className={styles.linkWrapper} key={
|
106
|
+
const Links = links.map(linkItem => (
|
107
|
+
<div className={styles.linkWrapper} key={linkItem.title}>
|
108
108
|
<div className={styles.linkTitle}>{linkItem.title}</div>
|
109
109
|
<ul className={styles.items}>
|
110
110
|
{linkItem.items.map((item, key) => (
|
@@ -1,5 +1,7 @@
|
|
1
|
-
import ModernSandpack, {
|
2
|
-
|
1
|
+
import ModernSandpack, {
|
2
|
+
type ModernSandpackProps,
|
3
|
+
} from '@modern-js/sandpack-react';
|
4
|
+
import React, { type PropsWithChildren } from 'react';
|
3
5
|
import { useDark, NoSSR } from 'rspress/runtime';
|
4
6
|
|
5
7
|
import './index.css';
|
package/src/i18n/zhCN.ts
CHANGED
package/src/pages/index.tsx
CHANGED
@@ -56,31 +56,37 @@ export default function Home() {
|
|
56
56
|
|
57
57
|
const features = [
|
58
58
|
{
|
59
|
+
id: 'feature1',
|
59
60
|
title: t('feature1'),
|
60
61
|
href: useUrl('/guides/concept/builder'),
|
61
62
|
desc: t('featureDesc1'),
|
62
63
|
},
|
63
64
|
{
|
65
|
+
id: 'feature2',
|
64
66
|
title: t('feature2'),
|
65
67
|
href: useUrl('/guides/advanced-features/bff/index'),
|
66
68
|
desc: t('featureDesc2'),
|
67
69
|
},
|
68
70
|
{
|
71
|
+
id: 'feature3',
|
69
72
|
title: t('feature3'),
|
70
73
|
href: useUrl('/guides/basic-features/routes'),
|
71
74
|
desc: t('featureDesc3'),
|
72
75
|
},
|
73
76
|
{
|
77
|
+
id: 'feature4',
|
74
78
|
title: t('feature4'),
|
75
79
|
href: useUrl('/guides/advanced-features/ssr'),
|
76
80
|
desc: t('featureDesc4'),
|
77
81
|
},
|
78
82
|
{
|
83
|
+
id: 'feature5',
|
79
84
|
title: t('feature5'),
|
80
85
|
href: useUrl('/guides/basic-features/css'),
|
81
86
|
desc: t('featureDesc5'),
|
82
87
|
},
|
83
88
|
{
|
89
|
+
id: 'feature6',
|
84
90
|
title: t('feature6'),
|
85
91
|
href: useUrl('/configure/app/usage'),
|
86
92
|
desc: t('featureDesc6'),
|
@@ -90,11 +96,13 @@ export default function Home() {
|
|
90
96
|
const lang = useLang();
|
91
97
|
const solutions = [
|
92
98
|
{
|
99
|
+
id: 'framework',
|
93
100
|
title: 'Modern.js Framework',
|
94
101
|
href: useUrl('/guides/get-started/introduction'),
|
95
102
|
desc: t('solutionsDesc1'),
|
96
103
|
},
|
97
104
|
{
|
105
|
+
id: 'module',
|
98
106
|
title: 'Modern.js Module',
|
99
107
|
href: `https://modernjs.dev/module-tools${lang === 'en' ? '/en' : ''}`,
|
100
108
|
desc: t('solutionsDesc2'),
|
@@ -104,7 +112,7 @@ export default function Home() {
|
|
104
112
|
return (
|
105
113
|
<div>
|
106
114
|
<Helmet>
|
107
|
-
<html className="dark"
|
115
|
+
<html className="dark" />
|
108
116
|
<script>window.MODERN_THEME = 'dark';</script>
|
109
117
|
<style type="text/css">{`
|
110
118
|
.rspress-doc-appearance {
|
@@ -117,9 +125,9 @@ export default function Home() {
|
|
117
125
|
<FeatureLayout>
|
118
126
|
<SecondaryTitle>{t('solutions')}</SecondaryTitle>
|
119
127
|
<div className={styles.cardContainer}>
|
120
|
-
{solutions.map(
|
128
|
+
{solutions.map(card => (
|
121
129
|
<ContentCard
|
122
|
-
key={
|
130
|
+
key={card.id}
|
123
131
|
title={card.title}
|
124
132
|
desc={card.desc}
|
125
133
|
href={card.href}
|
@@ -141,9 +149,9 @@ export default function Home() {
|
|
141
149
|
<FeatureLayout>
|
142
150
|
<SecondaryTitle>Modern.js Framework</SecondaryTitle>
|
143
151
|
<div className={styles.cardContainer}>
|
144
|
-
{features.map(
|
152
|
+
{features.map(card => (
|
145
153
|
<ContentCard
|
146
|
-
key={
|
154
|
+
key={card.id}
|
147
155
|
title={card.title}
|
148
156
|
desc={card.desc}
|
149
157
|
href={card.href}
|