@lexibase/rdx-next 1.0.0-beta.0 → 1.0.0-beta.10

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,214 +1,4 @@
1
- :root {
2
- --rdx-background: #ffffff;
3
- --rdx-foreground: #171717;
4
- --rdx-muted: #666666;
5
- --rdx-border: #e7e7e7;
6
- --rdx-accent: #f5f5f5;
7
- --rdx-link: #0f5ed8;
8
- }
9
-
10
- @media (prefers-color-scheme: dark) {
11
- :root {
12
- --rdx-background: #121212;
13
- --rdx-foreground: #f4f4f5;
14
- --rdx-muted: #a1a1aa;
15
- --rdx-border: #303033;
16
- --rdx-accent: #202022;
17
- --rdx-link: #7bb0ff;
18
- }
19
- }
20
-
21
- * {
22
- box-sizing: border-box;
23
- }
24
-
25
- html,
26
- body {
27
- margin: 0;
28
- min-height: 100%;
29
- }
30
-
31
- body {
32
- background: var(--rdx-background);
33
- color: var(--rdx-foreground);
34
- font-family: Arial, Helvetica, sans-serif;
35
- }
36
-
37
- a {
38
- color: inherit;
39
- }
40
-
41
- .rdx-header {
42
- align-items: center;
43
- border-bottom: 1px solid var(--rdx-border);
44
- display: flex;
45
- height: 60px;
46
- justify-content: space-between;
47
- padding: 0 24px;
48
- }
49
-
50
- .rdx-brand {
51
- font-size: 1.1rem;
52
- font-weight: 700;
53
- text-decoration: none;
54
- }
55
-
56
- .rdx-github-link {
57
- color: var(--rdx-muted);
58
- font-size: 0.9rem;
59
- text-decoration: none;
60
- }
61
-
62
- .rdx-docs-layout {
63
- display: grid;
64
- grid-template-columns: minmax(190px, 250px) minmax(0, 1fr);
65
- min-height: calc(100vh - 60px);
66
- }
67
-
68
- .rdx-sidebar {
69
- border-right: 1px solid var(--rdx-border);
70
- padding: 24px;
71
- }
72
-
73
- .rdx-sidebar-category + .rdx-sidebar-category {
74
- border-top: 1px solid var(--rdx-border);
75
- margin-top: 20px;
76
- padding-top: 20px;
77
- }
78
-
79
- .rdx-sidebar h2 {
80
- color: var(--rdx-muted);
81
- font-size: 0.72rem;
82
- letter-spacing: 0.08em;
83
- margin: 0 0 8px;
84
- text-transform: uppercase;
85
- }
86
-
87
- .rdx-sidebar ul {
88
- list-style: none;
89
- margin: 0;
90
- padding: 0;
91
- }
92
-
93
- .rdx-sidebar a {
94
- border-radius: 6px;
95
- display: block;
96
- font-size: 0.92rem;
97
- padding: 7px 8px;
98
- text-decoration: none;
99
- }
100
-
101
- .rdx-sidebar a:hover,
102
- .rdx-sidebar a.is-active {
103
- background: var(--rdx-accent);
104
- }
105
-
106
- .rdx-sidebar a.is-active {
107
- font-weight: 600;
108
- }
109
-
110
- .rdx-document,
111
- .rdx-empty-state {
112
- margin: 0 auto;
113
- max-width: 860px;
114
- padding: 56px 40px 80px;
115
- width: 100%;
116
- }
117
-
118
- .rdx-document-header {
119
- border-bottom: 1px solid var(--rdx-border);
120
- margin-bottom: 36px;
121
- padding-bottom: 28px;
122
- }
123
-
124
- .rdx-document-header h1,
125
- .rdx-mdx-content h1 {
126
- font-size: clamp(2rem, 5vw, 3rem);
127
- letter-spacing: -0.04em;
128
- line-height: 1.1;
129
- margin: 0;
130
- }
131
-
132
- .rdx-breadcrumb {
133
- color: var(--rdx-muted);
134
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
135
- font-size: 0.8rem;
136
- margin: 0 0 12px;
137
- }
138
-
139
- .rdx-description {
140
- color: var(--rdx-muted);
141
- font-size: 1.05rem;
142
- line-height: 1.6;
143
- margin: 14px 0 0;
144
- }
145
-
146
- .rdx-mdx-content {
147
- font-size: 1rem;
148
- line-height: 1.75;
149
- }
150
-
151
- .rdx-mdx-content h2,
152
- .rdx-mdx-content h3 {
153
- letter-spacing: -0.02em;
154
- line-height: 1.25;
155
- margin: 2.2em 0 0.7em;
156
- }
157
-
158
- .rdx-mdx-content p,
159
- .rdx-mdx-content ul,
160
- .rdx-mdx-content ol {
161
- margin: 1em 0;
162
- }
163
-
164
- .rdx-mdx-content li + li {
165
- margin-top: 0.4em;
166
- }
167
-
168
- .rdx-mdx-content a {
169
- color: var(--rdx-link);
170
- }
171
-
172
- .rdx-mdx-content blockquote {
173
- border-left: 3px solid var(--rdx-border);
174
- color: var(--rdx-muted);
175
- margin: 1.5em 0;
176
- padding-left: 16px;
177
- }
178
-
179
- .rdx-mdx-content code {
180
- background: var(--rdx-accent);
181
- border-radius: 4px;
182
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
183
- font-size: 0.9em;
184
- padding: 0.16em 0.35em;
185
- }
186
-
187
- .rdx-mdx-content pre {
188
- background: var(--rdx-accent);
189
- border: 1px solid var(--rdx-border);
190
- border-radius: 8px;
191
- overflow-x: auto;
192
- padding: 16px;
193
- }
194
-
195
- .rdx-mdx-content pre code {
196
- background: transparent;
197
- padding: 0;
198
- }
199
-
200
- @media (max-width: 720px) {
201
- .rdx-docs-layout {
202
- display: block;
203
- }
204
-
205
- .rdx-sidebar {
206
- border-bottom: 1px solid var(--rdx-border);
207
- border-right: 0;
208
- }
209
-
210
- .rdx-document,
211
- .rdx-empty-state {
212
- padding: 36px 24px 60px;
213
- }
214
- }
1
+ @import '@lexibase/rdx-next/styles.css';
2
+ @source '../../home.{ts,tsx}';
3
+ @source '../../components/**/*.{ts,tsx}';
4
+ @source '../../docs/**/*.mdx';
@@ -0,0 +1,2 @@
1
+ // Next.js loads this global stylesheet for its side effects only.
2
+ export {}
@@ -2,20 +2,25 @@ import type { Metadata } from 'next'
2
2
 
3
3
  import { RdxLayout } from '@lexibase/rdx-next/runtime'
4
4
 
5
- import config from '../../rdx.config'
5
+ import { getProject } from '../rdx-project'
6
6
 
7
7
  import './globals.css'
8
8
 
9
- export const metadata: Metadata = {
10
- title: {
11
- default: config.title,
12
- template: `%s | ${config.title}`,
13
- },
14
- description: config.description,
9
+ export async function generateMetadata(): Promise<Metadata> {
10
+ const { config } = await getProject()
11
+ return {
12
+ title: { default: config.title, template: `%s | ${config.title}` },
13
+ description: config.description,
14
+ }
15
15
  }
16
16
 
17
- export default function RootLayout({
17
+ export default async function RootLayout({
18
18
  children,
19
19
  }: Readonly<{ children: React.ReactNode }>) {
20
- return <RdxLayout config={config}>{children}</RdxLayout>
20
+ const { config } = await getProject()
21
+ return (
22
+ <RdxLayout config={config} bodyClassName="antialiased">
23
+ {children}
24
+ </RdxLayout>
25
+ )
21
26
  }
@@ -1,5 +1,7 @@
1
- import { redirect } from 'next/navigation'
1
+ import { HomePage } from '@lexibase/rdx-next/runtime'
2
2
 
3
- export default function Home() {
4
- redirect('/docs')
3
+ import { getProject } from '../rdx-project'
4
+
5
+ export default async function Home() {
6
+ return <HomePage project={await getProject()} />
5
7
  }
@@ -0,0 +1,16 @@
1
+ import { getSearchResponse, getSearchSources } from '@lexibase/rdx-next/runtime'
2
+ import { getProject } from '../../../rdx-project'
3
+
4
+ export const dynamic = 'force-static'
5
+ export const dynamicParams = false
6
+
7
+ export async function generateStaticParams() {
8
+ return getSearchSources(await getProject())
9
+ }
10
+
11
+ export async function GET(
12
+ _request: Request,
13
+ { params }: { params: Promise<{ source: string }> }
14
+ ) {
15
+ return getSearchResponse(await getProject(), (await params).source)
16
+ }
@@ -1,9 +1,17 @@
1
+ import { fileURLToPath } from 'node:url'
2
+
1
3
  /** @type {import('next').NextConfig} */
2
4
  const nextConfig = {
3
- experimental: {
4
- externalDir: true,
5
+ agentRules: false,
6
+ turbopack: {
7
+ root: fileURLToPath(new URL('..', import.meta.url)),
5
8
  },
6
- transpilePackages: ['@lexibase/rdx-core', '@lexibase/rdx-next'],
9
+ transpilePackages: [
10
+ '@lexibase/rdx-core',
11
+ '@lexibase/rdx-next',
12
+ '@lexibase/rdx-ui',
13
+ 'next-mdx-remote',
14
+ ],
7
15
  }
8
16
 
9
17
  export default nextConfig
@@ -0,0 +1 @@
1
+ export { default } from '@lexibase/rdx-next/postcss.config'
@@ -0,0 +1,7 @@
1
+ import { createRdxProject } from '@lexibase/rdx-next/runtime'
2
+
3
+ import config from '../rdx.config'
4
+
5
+ export function getProject() {
6
+ return createRdxProject(config)
7
+ }
@@ -1,17 +1,30 @@
1
1
  {
2
2
  "compilerOptions": {
3
+ "rootDir": "..",
4
+ "types": ["node", "react"],
5
+ "allowArbitraryExtensions": true,
6
+ "noUncheckedSideEffectImports": true,
3
7
  "allowJs": true,
4
8
  "esModuleInterop": true,
5
- "jsx": "preserve",
9
+ "incremental": true,
10
+ "isolatedModules": true,
11
+ "jsx": "react-jsx",
6
12
  "lib": ["dom", "dom.iterable", "esnext"],
7
13
  "module": "esnext",
8
14
  "moduleResolution": "bundler",
9
15
  "noEmit": true,
10
16
  "plugins": [{ "name": "next" }],
11
17
  "resolveJsonModule": true,
18
+ "skipLibCheck": true,
12
19
  "strict": true,
13
20
  "target": "esnext"
14
21
  },
15
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
16
- "exclude": ["node_modules"]
22
+ "include": [
23
+ "next-env.d.ts",
24
+ "**/*.ts",
25
+ "**/*.tsx",
26
+ ".next/types/**/*.ts",
27
+ ".next/dev/types/**/*.ts"
28
+ ],
29
+ "exclude": ["node_modules", "public"]
17
30
  }