Skip to content

Commit 0fbf3fe

Browse files
committed
remove shadcn, simplify content organization, update gh link and favicon
1 parent 199d91d commit 0fbf3fe

File tree

16 files changed

+78
-1355
lines changed

16 files changed

+78
-1355
lines changed

docs_headless/astro.config.mjs

Lines changed: 32 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import starlight from '@astrojs/starlight';
44
import react from '@astrojs/react';
55
import mdx from '@astrojs/mdx';
66
import tailwindcss from '@tailwindcss/vite';
7-
import starlightSidebarTopics from 'starlight-sidebar-topics';
87
import rehypeCodeGroup from 'rehype-code-group';
98
import expressiveCode from 'astro-expressive-code';
109
import { pluginFullscreen } from 'expressive-code-fullscreen';
@@ -17,97 +16,49 @@ export default defineConfig({
1716
starlight({
1817
title: 'React Admin Headless',
1918
customCss: ['./src/styles/global.css'],
19+
favicon: '/favicon.ico',
2020
social: [
2121
{
2222
icon: 'github',
2323
label: 'GitHub',
24-
href: 'https://github.com/withastro/starlight',
24+
href: 'https://github.com/marmelab/react-admin',
2525
},
2626
],
27-
plugins: [
28-
starlightSidebarTopics([
29-
{
30-
label: 'Shadcn UI',
31-
link: '/shadcn/guides/architecture',
32-
icon: 'open-book',
33-
items: [
34-
{
35-
label: 'Guides & Concepts',
36-
items: [
37-
// Each item here is one entry in the navigation menu.
38-
{
39-
label: 'General Concepts',
40-
slug: 'shadcn/guides/architecture',
41-
},
42-
{
43-
label: 'Data Fetching',
44-
slug: 'shadcn/guides/datafetchingguide',
45-
},
46-
{
47-
label: 'CRUD pages',
48-
slug: 'shadcn/guides/crud',
49-
attrs: {
50-
class: 'flex items-center',
51-
},
52-
badge: {
53-
text: '',
54-
variant: 'default',
55-
class: 'ee-badge',
56-
},
57-
},
58-
],
59-
},
60-
{
61-
label: 'Reference',
62-
autogenerate: {
63-
directory: 'shadcn/reference',
64-
},
65-
},
66-
],
67-
},
68-
{
69-
label: 'Headless',
70-
link: '/headless/guides/architecture',
71-
icon: 'open-book',
72-
items: [
73-
{
74-
label: 'Guides & Concepts',
75-
items: [
76-
// Each item here is one entry in the navigation menu.
77-
{
78-
label: 'General Concepts',
79-
slug: 'headless/guides/architecture',
80-
},
81-
{
82-
label: 'Data Fetching',
83-
slug: 'headless/guides/datafetchingguide',
84-
},
85-
{
86-
label: 'CRUD pages',
87-
slug: 'headless/guides/crud',
88-
attrs: {
89-
class: 'flex items-center',
90-
},
91-
badge: {
92-
text: '',
93-
variant: 'default',
94-
class: 'ee-badge',
95-
},
96-
},
97-
],
27+
sidebar: [
28+
{
29+
label: 'Guides & Concepts',
30+
items: [
31+
// Each item here is one entry in the navigation menu.
32+
{
33+
label: 'General Concepts',
34+
slug: 'guides/architecture',
35+
},
36+
{
37+
label: 'Data Fetching',
38+
slug: 'guides/datafetchingguide',
39+
},
40+
{
41+
label: 'CRUD pages',
42+
slug: 'guides/crud',
43+
attrs: {
44+
class: 'flex items-center',
9845
},
99-
{
100-
label: 'Reference',
101-
autogenerate: {
102-
directory: 'headless/reference',
103-
},
46+
badge: {
47+
text: '',
48+
variant: 'default',
49+
class: 'ee-badge',
10450
},
105-
],
51+
},
52+
],
53+
},
54+
{
55+
label: 'Reference',
56+
autogenerate: {
57+
directory: 'reference',
10658
},
107-
]),
59+
},
10860
],
10961
components: {
110-
// Override the default `SocialIcons` component.
11162
Sidebar: './src/components/CustomSidebar.astro',
11263
},
11364
}),

docs_headless/package.json

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
11
{
2-
"name": "ra-core-doc",
3-
"type": "module",
4-
"version": "0.0.1",
5-
"scripts": {
6-
"dev": "astro dev",
7-
"start": "astro dev",
8-
"build": "astro build",
9-
"preview": "astro preview",
10-
"astro": "astro"
11-
},
12-
"dependencies": {
13-
"@astrojs/mdx": "^4.3.1",
14-
"@astrojs/react": "^4.3.0",
15-
"@astrojs/starlight": "0.35.2",
16-
"@astrojs/starlight-tailwind": "^4.0.1",
17-
"@expressive-code/plugin-collapsible-sections": "^0.41.3",
18-
"@tailwindcss/vite": "^4.1.11",
19-
"@types/react": "^19.1.8",
20-
"@types/react-dom": "^19.1.6",
21-
"astro": "5.12.6",
22-
"astro-expressive-code": "^0.41.3",
23-
"astro-rehype-relative-markdown-links": "^0.18.1",
24-
"expressive-code-fullscreen": "^1.0.0",
25-
"react": "^18.3.1",
26-
"react-dom": "^18.3.1",
27-
"rehype-code-group": "^0.2.4",
28-
"sharp": "^0.34.2",
29-
"starlight-package-managers": "^0.11.0",
30-
"starlight-sidebar-topics": "^0.6.0",
31-
"tailwindcss": "^4.1.11"
32-
},
33-
"devDependencies": {
34-
"prettier": "^3.2.5",
35-
"prettier-plugin-astro": "^0.14.1"
36-
}
2+
"name": "ra-core-doc",
3+
"type": "module",
4+
"version": "0.0.1",
5+
"scripts": {
6+
"dev": "astro dev",
7+
"start": "astro dev",
8+
"build": "astro build",
9+
"preview": "astro preview",
10+
"astro": "astro"
11+
},
12+
"dependencies": {
13+
"@astrojs/mdx": "^4.3.1",
14+
"@astrojs/react": "^4.3.0",
15+
"@astrojs/starlight": "0.35.2",
16+
"@astrojs/starlight-tailwind": "^4.0.1",
17+
"@expressive-code/plugin-collapsible-sections": "^0.41.3",
18+
"@tailwindcss/vite": "^4.1.11",
19+
"@types/react": "^19.1.8",
20+
"@types/react-dom": "^19.1.6",
21+
"astro": "5.12.6",
22+
"astro-expressive-code": "^0.41.3",
23+
"astro-rehype-relative-markdown-links": "^0.18.1",
24+
"expressive-code-fullscreen": "^1.0.0",
25+
"react": "^18.3.1",
26+
"react-dom": "^18.3.1",
27+
"rehype-code-group": "^0.2.4",
28+
"sharp": "^0.34.2",
29+
"starlight-package-managers": "^0.11.0",
30+
"tailwindcss": "^4.1.11"
31+
},
32+
"devDependencies": {
33+
"prettier": "^3.2.5",
34+
"prettier-plugin-astro": "^0.14.1"
35+
}
3736
}

docs_headless/public/favicon.ico

5.3 KB
Binary file not shown.

docs_headless/public/favicon.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs_headless/src/components/CustomSidebar.astro

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import MobileMenuFooter from '@astrojs/starlight/components/MobileMenuFooter.astro';
33
import SidebarPersister from '@astrojs/starlight/components/SidebarPersister.astro';
44
import SidebarSublist from '@astrojs/starlight/components/SidebarSublist.astro';
5-
import StarlightSidebarTopicsSidebar from 'starlight-sidebar-topics/components/Sidebar.astro';
65
76
const { sidebar } = Astro.locals.starlightRoute;
87
---
@@ -23,8 +22,6 @@ const { sidebar } = Astro.locals.starlightRoute;
2322
});
2423
</script>
2524

26-
<StarlightSidebarTopicsSidebar />
27-
2825
<SidebarPersister>
2926
<SidebarSublist sublist={sidebar} />
3027
</SidebarPersister>

docs_headless/src/content/docs/headless/guides/Architecture.md renamed to docs_headless/src/content/docs/guides/Architecture.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ React-admin relies on a several design decisions that structure its codebase.
88

99
React-admin is specifically designed to build [Single-Page Applications (SPA)](https://en.wikipedia.org/wiki/Single-page_application). In a react-admin app, the browser fetches the required HTML, CSS, and JavaScript to render the application only once. Subsequently, data is fetched from APIs through AJAX calls. This is in contrast to traditional web applications, where the browser fetches a new HTML page for each screen.
1010

11-
![SPA lifecycle](../../../../assets/SPA-lifecycle.png)
11+
![SPA lifecycle](../../../assets/SPA-lifecycle.png)
1212

1313
The SPA architecture ensures that react-admin apps are [exceptionally fast](./Features.md#fast), easy to host, and compatible with existing APIs without requiring a dedicated backend.
1414

@@ -58,7 +58,7 @@ The `<Resource>` component allows react-admin to automatically link CRUD pages b
5858

5959
React-admin does not make any assumptions about the specific structure of your API. Instead, it defines its own syntax for data fetching, authentication, internationalization, and preferences. To interact with your API, react-admin relies on adapters called **providers**.
6060

61-
![Providers](../../../../assets/providers.png)
61+
![Providers](../../../assets/providers.png)
6262

6363
For example, to fetch a list of records from the API, you would use the `dataProvider` object as follows:
6464

docs_headless/src/content/docs/shadcn/guides/CRUD.md renamed to docs_headless/src/content/docs/guides/CRUD.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ const App = () => (
414414

415415
Guesser components start by fetching data from the API, analyzing the shape of the response, and then picking up Field and Input components that match the data type. They also dump the generated code in the console to let you start customizing the UI.
416416

417-
![ListGuesser](../../../../assets/tutorial_guessed_list.png)
417+
![ListGuesser](../../../assets/tutorial_guessed_list.png)
418418

419419
Check the following components to learn more about guessers:
420420

docs_headless/src/content/docs/headless/guides/datafetchingguide.mdx renamed to docs_headless/src/content/docs/guides/datafetchingguide.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
title: "Data Fetching"
33
---
4-
import { SuccessCase } from '../../../../../../packages/ra-core/src/dataProvider/useUpdate.optimistic.stories.tsx'
4+
import { SuccessCase } from '../../../../../packages/ra-core/src/dataProvider/useUpdate.optimistic.stories.tsx'
55

66
You can build a react-admin app on top of any API, whether it uses REST, GraphQL, RPC, or even SOAP, regardless of the dialect it uses. This works because react-admin doesn't use `fetch` directly. Instead, it uses a Data Provider object to interface with your API and [React Query](https://tanstack.com/query/v5/docs/react/overview) to handle data fetching.
77

88
## The Data Provider
99

1010
In a react-admin app, you don't write API calls using `fetch` or `axios`. Instead, you communicate with your API through an object called the `dataProvider`.
1111

12-
![Backend agnostic](../../../../assets/data-provider.png)
12+
![Backend agnostic](../../../assets/data-provider.png)
1313

1414
The `dataProvider` exposes a predefined interface that allows react-admin to query any API in a normalized way.
1515

@@ -365,7 +365,7 @@ If a relationship component doesn't fit your specific use case, you can always u
365365

366366
React-admin offers powerful realtime features to help you build collaborative applications based on the Publish / Subscribe (PubSub) pattern. The [Realtime documentation](./Realtime.md) explains how to use them.
367367

368-
These features are part of the [Enterprise Edition](https://react-admin-ee.marmelab.com)<img class="icon" src="/img/premium.svg" alt="React Admin Enterprise Edition icon" />.
368+
These features are part of the [Enterprise Edition](https://react-admin-ee.marmelab.com)<img class="icon" src="/ra-core/img/premium.svg" alt="React Admin Enterprise Edition icon" />.
369369

370370
### Realtime Data Provider
371371

0 commit comments

Comments
 (0)