Skip to content

Commit 601db3f

Browse files
committed
Rename starteReactDsfr to startDsfrReact
1 parent c69ba83 commit 601db3f

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/lib/nextJs.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import React from "react";
22
import Head from "next/head";
33
import type { NextComponentType } from "next";
44
import type { AppProps } from "next/app";
5-
import { startReactDsfr } from "./start";
6-
import type { Params as StartReactDsfrParams } from "./start";
5+
import { startDsfrReact } from "./start";
6+
import type { Params as startDsfrReactParams } from "./start";
77
import { isBrowser } from "./tools/isBrowser";
88
import { objectKeys } from "tsafe/objectKeys";
99
import marianneLightWoff2Url from "../dsfr/fonts/Marianne-Light.woff2";
@@ -34,7 +34,7 @@ const fontUrlByFileBasename = {
3434
"Spectral-ExtraBold": spectralExtraBoldWoff2Url
3535
} as const;
3636

37-
export type Params = StartReactDsfrParams & {
37+
export type Params = startDsfrReactParams & {
3838
/** If not provided no fonts are preloaded.
3939
* Preloading of fonts is only enabled in production.
4040
*/
@@ -45,10 +45,10 @@ export function withDsfr<AppComponent extends NextComponentType<any, any, any>>(
4545
App: AppComponent,
4646
params: Params
4747
): AppComponent {
48-
const { preloadFonts = [], ...startReactDsfrParams } = params;
48+
const { preloadFonts = [], ...startDsfrReactParams } = params;
4949

5050
if (isBrowser) {
51-
startReactDsfr(startReactDsfrParams);
51+
startDsfrReact(startDsfrReactParams);
5252
}
5353
function AppWithDsfr(props: AppProps) {
5454
return (

src/lib/start.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ export type Params = {
1616

1717
let isStarted = false;
1818

19-
export async function startReactDsfr(params: Params) {
19+
export async function startDsfrReact(params: Params) {
2020
const { defaultColorScheme, verbose = false } = params;
2121

2222
assert(
2323
isBrowser,
2424
[
25-
`${symToStr({ startReactDsfr })}() is not supposed`,
25+
`${symToStr({ startDsfrReact })}() is not supposed`,
2626
`to be run on the backed, only in the browser`
2727
].join(" ")
2828
);
2929

30-
assert(!isStarted, `${symToStr({ startReactDsfr })}() should be called only once`);
30+
assert(!isStarted, `${symToStr({ startDsfrReact })}() should be called only once`);
3131

3232
isStarted = true;
3333

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { StrictMode } from "react";
22
import { createRoot } from "react-dom/client";
3-
import { startReactDsfr } from "dsfr-react";
3+
import { startDsfrReact } from "dsfr-react";
44
import { App } from "./App";
55

6-
startReactDsfr({
6+
startDsfrReact({
77
"defaultColorScheme": "system"
88
});
99

src/test/frameworks/vite/src/main.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from "react";
22
import ReactDOM from "react-dom/client";
33
import { App } from "./App";
4-
import { startReactDsfr } from "dsfr-react";
5-
startReactDsfr({ "defaultColorScheme": "system" });
4+
import { startDsfrReact } from "dsfr-react";
5+
startDsfrReact({ "defaultColorScheme": "system" });
66

77
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
88
<React.StrictMode>

0 commit comments

Comments
 (0)