@bleedingdev/modern-js-main-doc 3.8.2-ultramodern.9 → 3.8.3-ultramodern.2
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/community/showcase.mdx +4 -5
- package/docs/en/components/init-app.mdx +8 -7
- package/docs/en/components/init-rspack-app.mdx +1 -3
- package/docs/en/components/prerequisites.mdx +1 -1
- package/docs/en/configure/app/bff/effect.mdx +7 -7
- package/docs/en/guides/advanced-features/bff/frameworks.mdx +1 -1
- package/docs/en/guides/basic-features/deploy.mdx +2 -2
- package/docs/en/guides/get-started/quick-start.mdx +1 -1
- package/docs/en/guides/get-started/tech-stack.mdx +1 -1
- package/docs/en/guides/get-started/ultramodern.mdx +123 -38
- package/docs/en/guides/troubleshooting/cli.mdx +1 -1
- package/docs/en/tutorials/examples/csr-auth.mdx +3 -1
- package/docs/zh/community/showcase.mdx +4 -5
- package/docs/zh/components/init-app.mdx +7 -7
- package/docs/zh/components/init-rspack-app.mdx +1 -3
- package/docs/zh/components/prerequisites.mdx +1 -1
- package/docs/zh/configure/app/bff/effect.mdx +7 -7
- package/docs/zh/guides/basic-features/deploy.mdx +2 -2
- package/docs/zh/guides/get-started/quick-start.mdx +1 -1
- package/docs/zh/guides/get-started/tech-stack.mdx +1 -1
- package/docs/zh/guides/get-started/ultramodern.mdx +116 -38
- package/docs/zh/guides/troubleshooting/cli.mdx +1 -1
- package/docs/zh/tutorials/examples/csr-auth.mdx +3 -1
- package/package.json +3 -2
- package/rspress.config.ts +16 -54
- package/src/sandbox/csr-auth/src/routes/Auth-tsx.txt +13 -3
- package/src/sandbox/csr-auth/src/routes/layout-tsx.txt +3 -3
- package/src/sandbox/csr-auth/src/routes/login/page-tsx.txt +7 -3
- package/ultramodern-preset/assets/img/ultramodern-logo-dark.svg +7 -0
- package/ultramodern-preset/assets/img/ultramodern-social-card.png +0 -0
- package/ultramodern-preset/package.json +19 -0
- package/ultramodern-preset/src/index.ts +127 -0
- package/static/img/social-card.svg +0 -12
- /package/{static/img/logo.svg → ultramodern-preset/assets/img/ultramodern-logo-light.svg} +0 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { defineConfig, type UserConfig } from '@rspress/core';
|
|
4
|
+
import { pluginOpenGraph } from 'rsbuild-plugin-open-graph';
|
|
5
|
+
|
|
6
|
+
const siteTitle = 'UltraModern.js 3.0';
|
|
7
|
+
const siteDescription =
|
|
8
|
+
'UltraModern.js 3.0 is a SuperApp framework forked from Modern.js for Effect, TanStack Router, SSR, BFF, and independently deployable Micro Verticals.';
|
|
9
|
+
const socialDescription =
|
|
10
|
+
'A SuperApp framework for Effect, TanStack Router, SSR, BFF, and Micro Verticals.';
|
|
11
|
+
const defaultOrigin = 'https://bleedingdev.github.io';
|
|
12
|
+
const githubUrl = 'https://github.com/BleedingDev/ultramodern.js';
|
|
13
|
+
|
|
14
|
+
export const ultraModernDocsAssets = new URL('../assets/', import.meta.url);
|
|
15
|
+
|
|
16
|
+
export type UltraModernDocsPresetOptions = {
|
|
17
|
+
base?: string;
|
|
18
|
+
origin?: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const normalizeBase = (base = '/') => {
|
|
22
|
+
const trimmed = base.trim();
|
|
23
|
+
const withLeadingSlash = trimmed.startsWith('/') ? trimmed : `/${trimmed}`;
|
|
24
|
+
return withLeadingSlash.endsWith('/')
|
|
25
|
+
? withLeadingSlash
|
|
26
|
+
: `${withLeadingSlash}/`;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const asPublicDirectories = (
|
|
30
|
+
publicDir: NonNullable<
|
|
31
|
+
NonNullable<UserConfig['builderConfig']>['server']
|
|
32
|
+
>['publicDir'],
|
|
33
|
+
) => {
|
|
34
|
+
if (!publicDir) {
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
return Array.isArray(publicDir) ? publicDir : [publicDir];
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const applyUltraModernDocsPreset = (
|
|
41
|
+
config: UserConfig,
|
|
42
|
+
options: UltraModernDocsPresetOptions = {},
|
|
43
|
+
): UserConfig => {
|
|
44
|
+
const base = normalizeBase(options.base ?? process.env.DOCS_BASE);
|
|
45
|
+
const origin = (options.origin ?? process.env.DOCS_ORIGIN ?? defaultOrigin)
|
|
46
|
+
.trim()
|
|
47
|
+
.replace(/\/+$/, '');
|
|
48
|
+
const siteUrl = new URL(base, `${origin || defaultOrigin}/`).toString();
|
|
49
|
+
const publicAsset = (assetPath: string) =>
|
|
50
|
+
`${base}${assetPath.replace(/^\//, '')}`;
|
|
51
|
+
const absoluteAsset = (assetPath: string) =>
|
|
52
|
+
new URL(assetPath.replace(/^\//, ''), siteUrl).toString();
|
|
53
|
+
const builderConfig = config.builderConfig ?? {};
|
|
54
|
+
const server = builderConfig.server ?? {};
|
|
55
|
+
const themeConfig = config.themeConfig ?? {};
|
|
56
|
+
const documentStatic = config.root
|
|
57
|
+
? { name: path.resolve(config.root, '..', 'static') }
|
|
58
|
+
: undefined;
|
|
59
|
+
const presetAssets = { name: fileURLToPath(ultraModernDocsAssets) };
|
|
60
|
+
const publicDirectories = [
|
|
61
|
+
...asPublicDirectories(server.publicDir),
|
|
62
|
+
...(documentStatic ? [documentStatic] : []),
|
|
63
|
+
presetAssets,
|
|
64
|
+
].filter(
|
|
65
|
+
(candidate, index, all) =>
|
|
66
|
+
all.findIndex(entry => entry.name === candidate.name) === index,
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
...config,
|
|
71
|
+
title: siteTitle,
|
|
72
|
+
description: siteDescription,
|
|
73
|
+
base,
|
|
74
|
+
logo: {
|
|
75
|
+
light: publicAsset('/img/ultramodern-logo-light.svg'),
|
|
76
|
+
dark: publicAsset('/img/ultramodern-logo-dark.svg'),
|
|
77
|
+
},
|
|
78
|
+
icon: absoluteAsset('/img/favicon.ico'),
|
|
79
|
+
themeConfig: {
|
|
80
|
+
...themeConfig,
|
|
81
|
+
locales: (themeConfig.locales ?? []).map(locale => ({
|
|
82
|
+
...locale,
|
|
83
|
+
title: siteTitle,
|
|
84
|
+
description: socialDescription,
|
|
85
|
+
})),
|
|
86
|
+
editLink: {
|
|
87
|
+
docRepoBaseUrl: `${githubUrl}/tree/main-ultramodern/packages/document/docs`,
|
|
88
|
+
text: 'Edit this page on GitHub',
|
|
89
|
+
},
|
|
90
|
+
socialLinks: [
|
|
91
|
+
...(themeConfig.socialLinks ?? []).filter(
|
|
92
|
+
link => link.icon !== 'github',
|
|
93
|
+
),
|
|
94
|
+
{ icon: 'github', mode: 'link', content: githubUrl },
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
builderConfig: {
|
|
98
|
+
...builderConfig,
|
|
99
|
+
server: {
|
|
100
|
+
...server,
|
|
101
|
+
publicDir: publicDirectories,
|
|
102
|
+
},
|
|
103
|
+
plugins: [
|
|
104
|
+
...(builderConfig.plugins ?? []).filter(
|
|
105
|
+
plugin => plugin.name !== 'rsbuild-plugin-open-graph',
|
|
106
|
+
),
|
|
107
|
+
pluginOpenGraph({
|
|
108
|
+
title: siteTitle,
|
|
109
|
+
siteName: siteTitle,
|
|
110
|
+
type: 'website',
|
|
111
|
+
url: siteUrl,
|
|
112
|
+
image: absoluteAsset('/img/ultramodern-social-card.png'),
|
|
113
|
+
description: socialDescription,
|
|
114
|
+
twitter: {
|
|
115
|
+
card: 'summary_large_image',
|
|
116
|
+
title: siteTitle,
|
|
117
|
+
image: absoluteAsset('/img/ultramodern-social-card.png'),
|
|
118
|
+
description: socialDescription,
|
|
119
|
+
},
|
|
120
|
+
}),
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export const defineUltraModernConfig = (config: UserConfig): UserConfig =>
|
|
127
|
+
defineConfig(applyUltraModernDocsPreset(config));
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="630" viewBox="0 0 1200 630" role="img" aria-labelledby="title desc">
|
|
2
|
-
<title id="title">UltraModern.js 3.0</title>
|
|
3
|
-
<desc id="desc">A SuperApp framework for Effect, TanStack Router, SSR, BFF, and Micro Verticals.</desc>
|
|
4
|
-
<rect width="1200" height="630" fill="#0f172a"/>
|
|
5
|
-
<path fill="#14b8a6" opacity=".22" d="M0 360c180-92 330-116 498-48 173 70 310 61 480-22 77-38 149-58 222-62v402H0V360z"/>
|
|
6
|
-
<path fill="#38bdf8" opacity=".18" d="M0 438c160-54 316-49 468 15 160 67 337 67 531 0 74-26 141-39 201-40v217H0V438z"/>
|
|
7
|
-
<rect x="86" y="90" width="96" height="96" rx="24" fill="#020617"/>
|
|
8
|
-
<path fill="#14b8a6" d="M111 116h15v35c0 13 7 21 18 21s18-8 18-21v-35h15v35c0 22-13 35-33 35s-33-13-33-35v-35z"/>
|
|
9
|
-
<path fill="#38bdf8" d="M157 116h18v70h-18v-70z"/>
|
|
10
|
-
<text x="86" y="284" fill="#f8fafc" font-family="Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif" font-size="76" font-weight="800">UltraModern.js 3.0</text>
|
|
11
|
-
<text x="90" y="360" fill="#cbd5e1" font-family="Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif" font-size="35" font-weight="500">Effect, TanStack Router, SSR, BFF, and Micro Verticals.</text>
|
|
12
|
-
</svg>
|
|
File without changes
|