Skip to content

Commit 528a72a

Browse files
committed
Rename module react_dsfr to dsfr-react
1 parent 8e11d8c commit 528a72a

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ WIP
77
# Install
88

99
```bash
10-
yarn add react_dsfr
10+
yarn add dsfr-react
1111
```
1212

1313
`package.json` (Optional if you are using Next.js):
@@ -18,7 +18,7 @@ yarn add react_dsfr
1818
}
1919
```
2020

21-
> `update_dsfr_static_resources` is a `bin` script of `react_dsfr` that copies `@gouvfr/dsfr/dist` to `public/dsfr`
21+
> `update_dsfr_static_resources` is a `bin` script of `dsfr-react` that copies `@gouvfr/dsfr/dist` to `public/dsfr`
2222
2323
`.gitignore`:
2424

@@ -60,12 +60,12 @@ If you are using [Create React App](https://create-react-app.dev/) or [Vite](htt
6060
```
6161

6262
> NOTE: If you are using CRA and if you are hosting your app under a subpath (`package.json` -> `"homepage": "https://my-site.gouv/a/sub/path"`) you need to include
63-
> `%PUBLIC_URL%` [like so](https://github.com/codegouvfr/react_dsfr/blob/c13d1066b188a509d5808aa6c87722bedc35f21f/src/test/apps/cra/public/index.html#L10-L21) in the URL.
63+
> `%PUBLIC_URL%` [like so](https://github.com/codegouvfr/dsfr-react/blob/c13d1066b188a509d5808aa6c87722bedc35f21f/src/test/apps/cra/public/index.html#L10-L21) in the URL.
6464
6565
`src/index.tsx`
6666

6767
```diff
68-
+import { startReactDsfr } from "react_dsfr";
68+
+import { startReactDsfr } from "dsfr-react";
6969
+startReactDsfr({ "defaultColorScheme": "system" });
7070
```
7171

@@ -91,17 +91,17 @@ If you are using [Create React App](https://create-react-app.dev/) or [Vite](htt
9191
Create a [`_app.tsx` (or `_app.js`)](https://nextjs.org/docs/advanced-features/custom-app) file:
9292

9393
```tsx
94-
import { withDsfr } from "react_dsfr/lib/nextJs";
94+
import { withDsfr } from "dsfr-react/lib/nextJs";
9595
import DefaultApp from "next/app";
96-
import "react_dsfr/dsfr/dsfr.css";
96+
import "dsfr-react/dsfr/dsfr.css";
9797

9898
export default withDsfr(
9999
DefaultApp, // You can, of course, provide your custom App in place of the default if you have one
100100
{
101101
"defaultColorScheme": "system",
102102
// Preloading fonts prevent from https://fonts.google.com/knowledge/glossary/fout
103-
// Be eco friendly, only preload the fonts variant you actually use,
104-
// you can see in the network tab of your browser dev tools what are
103+
// Be eco friendly, only preload the fonts variant you actually use,
104+
// you can see in the network tab of your browser dev tools what are
105105
// the font varian downloaded initially.
106106
"preloadFonts": ["Marianne-Bold", "Marianne-Regular", "Marianne-Medium"]
107107
}
@@ -135,7 +135,7 @@ Write this instead:
135135

136136
```tsx
137137
// ✅ DO
138-
import artworkDarkSvgUrl from "react_dsfr/dsfr/artwork/dark.svg";
138+
import artworkDarkSvgUrl from "dsfr-react/dsfr/artwork/dark.svg";
139139

140140
<svg>
141141
<use xlinkHref={`${artworkDarkSvgUrl}#artwork-minor`} />
@@ -147,8 +147,8 @@ For example, by default in a Next.js project, you'll get the `.svg` url
147147
this way (Same thing for `.png`, `.ico` and other image format):
148148

149149
```diff
150-
-import artworkDarkSvgUrl from "react_dsfr/dsfr/artwork/dark.svg";
151-
+import artworkDarkSvg from "react_dsfr/dsfr/artwork/dark.svg";
150+
-import artworkDarkSvgUrl from "dsfr-react/dsfr/artwork/dark.svg";
151+
+import artworkDarkSvg from "dsfr-react/dsfr/artwork/dark.svg";
152152

153153
<svg>
154154
- <use xlinkHref={`${artworkDarkSvgUrl}#artwork-minor`} />

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "react_dsfr",
2+
"name": "dsfr-react",
33
"version": "0.0.1",
44
"description": "React implementation of the DSFR",
55
"repository": {
66
"type": "git",
7-
"url": "git://github.com/codegouvfr/react_dsfr.git"
7+
"url": "git://github.com/codegouvfr/dsfr-react.git"
88
},
99
"main": "dist/lib/index.js",
1010
"types": "dist/lib/index.d.ts",
@@ -53,7 +53,7 @@
5353
"react",
5454
"typescript"
5555
],
56-
"homepage": "https://github.com/codegouvfr/react_dsfr",
56+
"homepage": "https://github.com/codegouvfr/dsfr-react",
5757
"peerDependencies": {
5858
"@types/react": "^16.0.0 || ^17.0.0 || ^18.0.0",
5959
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"

0 commit comments

Comments
 (0)