Skip to content

Commit 3396991

Browse files
committed
Rename module dsfr-react to @codegouvfr/react-dsfr
1 parent 8112e0b commit 3396991

File tree

24 files changed

+277
-267
lines changed

24 files changed

+277
-267
lines changed

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<p align="center">
2-
<img src="https://github.com/codegouvfr/dsfr-react/releases/download/assets/dsfr-react_repo-card.png">
2+
<img src="https://github.com/codegouvfr/@codegouvfr/react-dsfr/releases/download/assets/@codegouvfr/react-dsfr_repo-card.png">
33
</p>
44
<p align="center">
55
🇫🇷 <i><a href="https://www.systeme-de-design.gouv.fr/">French State Design System</a> React component library</i> 🇫🇷
66
<br>
77
<br>
8-
<a href="https://github.com/codegouvfr/dsfr-react/actions">
9-
<img src="https://github.com/codegouvfr/dsfr-react/workflows/ci/badge.svg?branch=main">
8+
<a href="https://github.com/codegouvfr/react-dsfr/actions">
9+
<img src="https://github.com/codegouvfr/react-dsfr/workflows/ci/badge.svg?branch=main">
1010
</a>
11-
<a href="https://www.npmjs.com/package/dsfr-react">
12-
<img src="https://img.shields.io/npm/v/dsfr-react?logo=npm">
11+
<a href="https://www.npmjs.com/package/@codegouvfr/react-dsfr">
12+
<img src="https://img.shields.io/npm/v/@codegouvfr/react-dsfr?logo=npm">
1313
</a>
14-
<a href="https://bundlephobia.com/package/dsfr-react">
15-
<img src="https://img.shields.io/bundlephobia/minzip/dsfr-react">
14+
<a href="https://bundlephobia.com/package/@codegouvfr/react-dsfr">
15+
<img src="https://img.shields.io/bundlephobia/minzip/@codegouvfr/react-dsfr">
1616
</a>
17-
<a href="https://github.com/codegouvfr/dsfr-react/blob/main/LICENSE">
18-
<img src="https://img.shields.io/npm/l/dsfr-react">
17+
<a href="https://github.com/codegouvfr/react-dsfr/blob/main/LICENSE">
18+
<img src="https://img.shields.io/npm/l/@codegouvfr/react-dsfr">
1919
</a>
2020
</p>
2121
<p align="center">
@@ -28,7 +28,7 @@ This module is a wrapper/compatibility layer for [@gouvfr/dsfr](https://github.c
2828
- [ ] Always in up to date with latest the DSFR evolutions.
2929
Code and Types generated from [`@gouvfr/dsfr`](https://www.npmjs.com/package/@gouvfr/dsfr)`/dist/dsfr.css`.
3030
- [x] Exactly the same look and feel than with [@gouvfr/dsfr](https://www.npmjs.com/package/@gouvfr/dsfr).
31-
- [x] No [white flash when reloading in SSR setup](https://github.com/codegouvfr/dsfr-react/issues/2#issuecomment-1257263480).
31+
- [x] No [white flash when reloading in SSR setup](https://github.com/codegouvfr/@codegouvfr/react-dsfr/issues/2#issuecomment-1257263480).
3232
- [x] No [flash of unstyled text](https://fonts.google.com/knowledge/glossary/fout).
3333
- [x] [Perfect integration with all major React framework: Next.js, Create React App, Vue](https://etalab-2.gitbook.io/dsfr-react/).
3434
- [ ] All [the components](https://www.systeme-de-design.gouv.fr/elements-d-interface) are implemented (0/42)
@@ -47,9 +47,11 @@ This module is a product of [Etalab's Free and open source software pole](https:
4747

4848
# Development
4949

50-
Here are instructions for contributing, if you are looking to **use** `dsfr-react` heads over to the [documentation page](https://etalab-2.gitbook.io/dsfr-react/).
50+
Here are instructions for contributing, if you are looking to **use** `@codegouvfr/react-dsfr` heads over to the [documentation page](https://etalab-2.gitbook.io/dsfr-react/).
5151

5252
```bash
53+
git clone https://github.com/codegouvfr/react-dsfr
54+
cd react-dsfr
5355
yarn
5456
yarn build
5557
npx tsc -w

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "dsfr-react",
2+
"name": "@codegouvfr/react-dsfr",
33
"version": "0.0.4",
44
"description": "French State Design System React component library",
55
"repository": {
66
"type": "git",
7-
"url": "git://github.com/codegouvfr/dsfr-react.git"
7+
"url": "git://github.com/codegouvfr/react-dsfr.git"
88
},
99
"main": "dist/lib/index.js",
1010
"types": "dist/lib/index.d.ts",
@@ -57,7 +57,7 @@
5757
"react",
5858
"typescript"
5959
],
60-
"homepage": "https://github.com/codegouvfr/dsfr-react",
60+
"homepage": "https://github.com/codegouvfr/react-dsfr",
6161
"peerDependencies": {
6262
"@types/react": "^16.0.0 || ^17.0.0 || ^18.0.0",
6363
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"

src/bin/css_to_ts/colorOptions.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
import type { ColorScheme } from "../sharedTypes";
21
import { capitalize } from "tsafe/capitalize";
32
import { id } from "tsafe/id";
43
import css from "css";
54
import { assert } from "tsafe/assert";
6-
import { data_fr_theme } from "../sharedTypes";
75
import { exclude } from "tsafe/exclude";
86
import { multiReplace } from "../tools/multiReplace";
97
import * as crypto from "crypto";
108

9+
export type ColorScheme = "light" | "dark";
10+
export const data_fr_theme = "data-fr-theme";
11+
1112
// https://www.systeme-de-design.gouv.fr/elements-d-interface/fondamentaux-identite-de-l-etat/couleurs-palette
1213

1314
export type Variant = "main" | "sun" | "moon";

src/bin/sharedTypes.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/bin/yarn_link.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,6 @@ execYarnLink({ "cwd": pathJoin(projectDirPath, "dist") });
152152
testAppNames.forEach(testAppName =>
153153
execYarnLink({
154154
"cwd": getTestAppPath(testAppName),
155-
"targetModuleName": "dsfr-react"
155+
"targetModuleName": "@codegouvfr/react-dsfr"
156156
})
157157
);

src/lib/useColorScheme.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ import { createStatefulObservable, useRerenderOnChange } from "./tools/StatefulO
22
import { useConstCallback } from "./tools/powerhooks/useConstCallback";
33
import { assert } from "tsafe/assert";
44
import { isBrowser } from "./tools/isBrowser";
5-
import type { ColorScheme } from "../bin/sharedTypes";
6-
import { data_fr_theme } from "../bin/sharedTypes";
75

8-
export type { ColorScheme };
9-
export { data_fr_theme };
6+
export type ColorScheme = "light" | "dark";
107

8+
export const data_fr_theme = "data-fr-theme";
119
export const data_fr_scheme = "data-fr-scheme";
1210

1311
export const $colorScheme = createStatefulObservable<ColorScheme>(() => "light");

src/test/frameworks/cra/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

2-
This is a test Web App to test the integration of `dsfr-react` with Create React App
2+
This is a test Web App to test the integration of `@codegouvfr/react-dsfr` with Create React App
33
You can run it locally with:
44

55
```bash
6-
git clone https://github.com/codegouvfr/dsfr-react
7-
cd dsfr-react
6+
git clone https://github.com/codegouvfr/react-dsfr
7+
cd react-dsfr
88
yarn
99
yarn build
1010
yarn start_cra

src/test/frameworks/cra/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "dsfr-react-test-app-cra",
2+
"name": "react-dsfr-test-app-cra",
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
66
"react": "18.2.0",
77
"react-dom": "^18.2.0",
88
"react-scripts": "5.0.1",
9-
"dsfr-react": "file:../../../../dist"
9+
"@codegouvfr/react-dsfr": "file:../../../../dist"
1010
},
1111
"devDependencies": {
1212
"@types/node": "^16.7.13",
@@ -19,7 +19,7 @@
1919
"build": "react-scripts build",
2020
"test": "react-scripts test",
2121
"eject": "react-scripts eject",
22-
"copy_dsfr_dist_to_public": "node node_modules/dsfr-react/bin/copy_dsfr_dist_to_public.js",
22+
"copy_dsfr_dist_to_public": "node node_modules/@codegouvfr/react-dsfr/bin/copy_dsfr_dist_to_public.js",
2323
"prestart": "yarn copy_dsfr_dist_to_public",
2424
"prebuild": "yarn copy_dsfr_dist_to_public"
2525
},

src/test/frameworks/cra/src/App.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

2-
import artworkLightSvgUrl from "dsfr-react/dsfr/artwork/light.svg";
3-
import artworkDarkSvgUrl from "dsfr-react/dsfr/artwork/dark.svg";
4-
import artworkSystemSvgUrl from "dsfr-react/dsfr/artwork/system.svg";
5-
import { useColorScheme } from "dsfr-react";
2+
import artworkLightSvgUrl from "@codegouvfr/react-dsfr/dsfr/artwork/light.svg";
3+
import artworkDarkSvgUrl from "@codegouvfr/react-dsfr/dsfr/artwork/dark.svg";
4+
import artworkSystemSvgUrl from "@codegouvfr/react-dsfr/dsfr/artwork/system.svg";
5+
import { useColorScheme } from "@codegouvfr/react-dsfr";
66

77
export function App() {
88

src/test/frameworks/cra/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { StrictMode } from "react";
22
import { createRoot } from "react-dom/client";
3-
import { startDsfrReact } from "dsfr-react";
3+
import { startDsfrReact } from "@codegouvfr/react-dsfr";
44
import { App } from "./App";
55

66
startDsfrReact({

0 commit comments

Comments
 (0)