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

@sidoshi/react-scripts

v1.0.9

Published

Custom Configuration and scripts for Create React App.

Downloads

3

Readme

react-scripts

This is a custom react-scripts package to be used with Create React App. Please refer to its documentation:

This react-scripts package adds some extra features to official react-scripts:

  • Sass support - You can now import sass, scss or css files in js code like this:

    import 'App.sass'

    Note: css files are also processed with node-sass webpack loader. Though that wouldn't cause any problem even if you use plain css.

    Sass files can also import modules from sass directory in src. This is to store reusable varibles like colors and config as shown in template App.sass and index.sass. Example:

    @import "_colors.sass"

    Now this file has access to all variables declared in _colors.sass.

    It is good practice to prefix this files with _ (underscore) like this _colors.sass as files prefixed with _ are not compiled to css by node-sass.

  • Absolute Imports - All direct files under src can be imported with absolute path.

    import App from 'components/App'

    Note: Files in src are given preference over node_modules so it would be better to name your files properly.

    For eg:

    import actions from 'actions'

    If you have a directory or file named actions directly under src than that will be imported instead of actions package you might have downloaded from npm. It would be better to give namespace to files directly under src like prefixing them with _ so you could import like this:

    import actions form '_actions'
  • Prettier out of the box - Prettier is installed and setup by default. Just run:

    npm run format

    All js files under src/ will be formated by prettier. You can obviously edit the format script in package.json if you don't like the default behaviour.

    Note: This will run automatically by precommit hooks before you commit, so you can never commit bad code.

  • Flow built-in - Flow supported by default. Run:

    npm run flow

    Adding flow requires adding some extra configuration and directories. So you may find following extra files in your project.

    .flow/ - Contains stubs for sass imports. You dont have to ever worry about what's in this directory. You can even configure your editor to hide this directory. But this dir is import to your flow config so you have to commit this.

    .flowconfig - Contains flow config. You can change it to suit your needs. By default it contains decent config so you may not need to change it.

    flow-typed/ - Contains lib-defs of your packages. Again you dont have to worry about this dir.

    src/interfaces/ - Empty directory. You can place your flow types (interfaces) here.

    Note: This will run automatically by precommit hooks before you commit, so you can never commit bad code.

    If you are using vscode, set javascript.validate.enabele to false.

  • Git Hooks - If you are creating the app in existing git repo, then git hooks are already setup for you. Before you commit your code will be automatically formatted using prettier and tested using jest and flow, so you can be sure that your code is consistent and bug free. Though if you are not creating the app in an existing git repo, hooks will not be set up. If you want to set it up, you simply need to initialise the repo and run setup_hooks script like this:

    git init
    npm run setup_hooks

    Once you have succesfully run setup_hooks, there is no need for setup_hooks script, So you can remove that script from package.json.

  • Storybook - You get storybook setup for you. Any file ending with .stories.js will be run by storybook. You can use this to build components in isolation and better document your component. Run:

    npm run storybook