npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gouvfr-lasuite/integration

v1.0.2

Published

The `@gouvfr-lasuite/integration` npm package helps services of [La Suite numérique](https://lasuite.numerique.gouv.fr/) with already-made React and HTML templates of common _La Suite_ UIs.

Downloads

2,858

Readme

@gouvfr-lasuite/integration npm package

The @gouvfr-lasuite/integration npm package helps services of La Suite numérique with already-made React and HTML templates of common La Suite UIs.

For now, it helps developers integrate:

  • a La Suite branded homepage
  • the Gaufre ("waffle") button that lets users of a service easily switch between La Suite services.

Usage

npm install @gouvfr-lasuite/integration

If you use React, you can directly consume the exposed React components.

If you use anything else, you can copy and paste content from the HTML templates in the dist/html folder.

CSS is also available. Depending on whether or not you use the DSFR, you can use different CSS files from dist/css.

Precise documentation on usage is available on integration.lasuite.numerique.gouv.fr.

Development

This folder is meant to generate the @gouvfr-lasuite/integration npm package.

It's a vite app.

To start, npm install a first time and copy the example env file: cp .env.example .env. Make sure the API env var targets a running API. If you don't want to use the production one, you can run one locally easily: the API is exposed via the /website server, go check the README there.

Then, run the local dev server with npm run dev.

The main dev file is src/dev/dev.tsx where a small testing React router is used to render the different React components while developing.

Building

Run npm run build to build all the dist/ files which are: React components, CSS files and HTML templates.

Internally, building all of this is a bit different than your usual vite app. We actually use 3 vite configs, and running npm run build runs them all:

React components

The default build generates the React components in es6 and commonjs files with the vite "lib" mode. Everything in src/index.ts is exposed in the generated file.

CSS

The css-config build generates the CSS files. They all go through purgecss. The list of CSS files to generate is in the css vite config.

CSS is rendered like that, and not through the main vite config, because CSS rendering in lib mode doesn't allow us to easily generate multiple CSS files while using the postcss-config.

HTML files

The html-config generates the HTML files.

HTML files are not written by hand: they are generated from the React components. The html vite config checks the src/html.tsx file and renders HTML files for every template listed.