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

create-plume-react-project

v3.1.3

Published

CLI to create Plume React Project

Downloads

717

Readme

Create Plume React Project

React Plume project archetypes that enables to create React with TypeScript projects with dependency injection and the observable pattern to manage the application global state.

Usage

Create a new project in the current folder with:

  • Yarn (more reliable): yarn dlx create-plume-react-project --template admin --projectName admin-vel
  • Or with NPX: npx create-plume-react-project@latest --template admin --projectName admin-vel

Once project is created, it can be started with:

  1. yarn to resolve dependencies
  2. yarn start to start the project

Options

Options are passed using this syntax: npx create-plume-react-project@latest --[optionName] [value] So the template option can be used like this: npx create-plume-react-project@latest --template admin

| Name | Default value | Available values | Description | |-------------------|-------------------------------------------------|-------------------------|-----------------------------------------------------------------------| | template | front | front, admin | The template to use | | projectName | my-project | Any string value | The project name is used for in package.json and index.html files | | verbose | false | true, false | True to display extra debug information during processing | | targetDirectory | Current directory | Any valid absolute path | The path in which the project will be initialized with the template | | templateDirectory | The build/templates directory of the create cli | Any valid absolute path | The path in which templates will be used |

Configuration after project creation

After a project is created using the archetype/template, some additional configurations might be needed.

Sonar

Complete the following properties in sonar-project-frontend.properties file :

# Exemple
sonar.projectKey=project-front-ui
sonar.projectName=My project - front-ui

Gitlab ci

A Gitlab ci file .gitlab-ci.yml is provided in the project. It is pre-configured to run the following jobs:

  • Front UI build or Admin UI build : yarn typescript && yarn eslint
  • SonarQube analyze front UI or SonarQube analyze admin UI : sonar

If the frontend project is used inside a Plume backend project :

  • Copy/paste the content of the gitlab ci file in the backend gitlab ci file
  • Add cd <frontend directory> as the first step of each job
# Exemple
Front UI build:
  ...
  script:
    - cd front-ui
  ...
  
Admin UI build:
  ...
  script:
    - cd front-ui
  ...
  • Remove the frontend gitlab ci file

Handling old browsers

This project is supported only relatively new browsers. But anything that uses a feature that requires at least es2019 should be used sparsely and carefully.

To have a look on advanced features used by the project, it is possible to:

  1. In .eslintrc.js, uncomment the line 'plugin:typescript-compat/recommended'
  2. Run yarn eslint

Errors regarding IE 11 will also be raised, but at least, it enables to have a global view of what features are being used.

Valid features being used are listing in .eslintrc.js in the polyfills part.

A banner is displayed in non-supported browsers. This is configured directly in the root index.html file. index.html uses essential main features detection to choose weather to display the banner in non-supported browsers or not.

Opera Mini is by default not supported though it is used in some regions in the World. To support it, the best way would be to load dynamically fetch and Promise polyfills if these features are not available.

Development

To set up the development environment to work on this create cli:

  1. run yarn
  2. run yarn build
  3. run npm link

Then it is possible to open a new terminal anywhere on the local computer and run: npx create-plume-react-project@latest --template admin --projectName admin-vel

This @latest is important, else an older cached version of the CLI can be used by NPM, see https://github.com/npm/cli/issues/2329 for details.

To test new changes, yarn build should be run.

Templates are fully working projects, so modifications in the templates should be tested at least by running the modified templates.

TODO

  • Propose a command line interface using enquirer to ask the user to set interactively the options
  • Propose module options for the front template like i18n, material, form, session
  • Use chalk instead of doing terminal coloration by hand
  • Use execa or pkg-install to directly install the project