react-dsfr
GitHubComponentsPlayground
  • πŸ”§Initial setup
  • πŸ”€Integration with routing libs
  • 🦺Class names type safety
  • 🎨Colors
  • 🧩Components
  • β˜‘οΈIcons
  • πŸ’…CSS in JS
  • 🌎Internationalization
  • πŸŒ…Importing assets
  • 🀝MUI integration
  • πŸ•ŠοΈCustom Branding
  • πŸ“–Storybook
  • πŸ“ŠAnalytics
  • πŸ”’Content-Security-Policy
  • πŸ“¦Publishing a NPM modules that depends on react-dsfr
  • πŸ’ŸContributing
Powered by GitBook
LogoLogo

Links

  • GitHub
  • Playground
  • Components

2022-2023 PΓ΄le logiciel libre d'Etalab - MIT license

On this page

Was this helpful?

Edit on GitHub
Export as PDF

Publishing a NPM modules that depends on react-dsfr

PreviousContent-Security-PolicyNextContributing

Last updated 1 year ago

Was this helpful?

You want to publish your own library of components that depends on react-dsfr?

Here is an example:

I recommend starting from ts-ci for any project meant to be published on NPM

The main takeway:

  • Do not add "postinstall": "copy-dsfr-to-public" in your library's package.json. It's the responsability of the host app to do so.

  • If you rely on MUI, @mui/material @emotion/styled and @emotion/react should be peer dependencies as well. You should add those modules as devDependencies.

  • If you use TSS: react-dsfr dosen't need to be a peerDependencies but @emotion/react does, you do not configure the emotion cache in your lib, that's the the responsability of the host app.

. Any app that would use your library would need to explicitely install react-dsfr. .

πŸ“¦
@codegouv/react-dsfr must be a peer dependency of your project
For devloppement purpose, you want to add @codegouvfr/react-dsfr as devDependencies of your project
GitHub - EIG6-Geocommuns/geocommuns-core: Set of shared utilities (hooks and Components) for the geocomuns projectGitHub
A module that depend on react-dsfr and MUI
GitHub - garronej/ts-ci: πŸš€ A starter for TS projects meant to be published on NPM.GitHub
Logo
Logo