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-react-vscode

v1.0.4

Published

React project generator with preconfigured vscode settings.

Downloads

3

Readme

Installation Guide

Run this to create a new project

npx create-react-vscode <your-project-name>

Setup Guid

This is the guid if you want to recreate this project manually

  1. npm init

  2. installing webpack

    npm i webpack webpack-cli
    npm i webpack-dev-server
  3. installing Dependencies

    npm i react react-dom
  4. Dev Dependencies

    npm i -D style-loader, css-loader
    npm i -D sass sass-loader
    npm i resolve-url-loader html-loader
    npm i -D mini-css-extract-plugin
    npm i -D html-webpack-plugin
    npm i -D clean-webpack-plugin
    npm i babel-loader @babel/core @babel/node @babel/preset-env @babel/preset-react

    Eslint Dependencies

    npm i -D @babel/eslint-parser babel-jest eslint eslint-config-airbnb eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks

    Jest Dependencies

    npm i -D jest babel-jest react-test-renderer -> ject testing library
  5. Eslint configrations

    Add .eslintrc.js file to root

    module.exports = {
    	parser: '@babel/eslint-parser',
    	root: true,
    	env: {
    	  browser: true,
    	  commonjs: true,
    	  es6: true,
    	  node: true,
    	  jest: true,
    	},
    	parserOptions: {
    	  babelOptions: {
    	    presets: ['@babel/preset-react'],
    	  },
    	  sourceType: 'module',
    	},
    	plugins: ['react', 'react-hooks'],
    	extends: [
    	  'eslint:recommended',
    	  'plugin:react/recommended',
    	  'plugin:react-hooks/recommended',
    	  'airbnb',
    	],
    	settings: {
    		react: {
    	      version: 'detect',
    	    },
    	},
    	rules: {
    		'linebreak-style': 0,
    	    'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
    		'react/function-component-definition': [0],
    	},
    };
    
  6. initlial directory structure

    📦create-react-vscode
     ┣ 📂.vscode
     ┃ ┗ 📜settings.json
     ┣ 📂node_modules
     ┣ 📂src
     ┃ ┣ 📂components
     ┃ ┃ ┗ 📜App.js
     ┃ ┣ 📂styles
     ┃ ┃ ┗ 📜main.scss
     ┃ ┣ 📜index.html
     ┃ ┗ 📜index.js
     ┣ 📜.eslintrc.js
     ┣ 📜.gitignore
     ┣ 📜babel.config.js
     ┣ 📜package-lock.json
     ┣ 📜package.json
     ┣ 📜README.md
     ┗ 📜webpack.config.js
  7. Configuring Webpack

    Add .webpack.config.js file to root with these settings

    /* eslint-disable global-require  */
    /* eslint-disable  new-cap */
    
    const path = require('path');
    
    const CURRENT_NPM_TASK = process.env.npm_lifecycle_event;
    const environment = CURRENT_NPM_TASK === 'build' ? 'production' : 'development';
    
    const { CleanWebpackPlugin: cleanWebpack } = require('clean-webpack-plugin');
    
    const plugins = {
    
      miniCssExtract: require('mini-css-extract-plugin'),
      htmlWebpack: require('html-webpack-plugin'),
      cleanWebpack,
    };
    
    const config = {
      entry: './src/index.js',
      output: {
        filename: 'main.[fullhash].js',
        path: path.resolve(__dirname, 'dist'),
      },
      plugins: [new plugins.htmlWebpack({ template: './src/index.html' })],
      devServer: {
        port: 8080,
        static: {
          directory: path.join(__dirname, 'dist'),
        },
        hot: true,
    
      },
      mode: environment,
      module: {
        rules: [
           {
        	test: /\.html$/i,
        	loader: 'html-loader',
        	options: {
        	  // Disables attributes processing
        	  sources: true,
        	},
      	  },
      	  {
      	    test: /\.scss$/,
      	    use: ['style-loader', 'css-loader', 'resolve-url-loader',
      	      {
      	        loader: 'sass-loader',
      	        options: {
      	          sourceMap: true,
      	        },
      	      },
      	    ],
      	  },
          {
            test: /\.css$/,
            use: ['style-loader', 'css-loader'],
          },
          {
            test: /\.m?js$/,
            exclude: /(node_modules|bower_components)/,
            use: {
              loader: 'babel-loader',
            },
          },
        ],
      },
    
    };
    
    if (environment === 'production') {
    // eslint-disable-next-line no-console
      console.log('environment:', environment);
      config.module.rules[0].use[0] = plugins.miniCssExtract.loader;
      config.module.rules[1].use[0] = plugins.miniCssExtract.loader;
      config.plugins.push(
        new plugins.miniCssExtract({ filename: 'main.[fullhash].css' }),
        new plugins.cleanWebpack(),
      );
    }
    
    module.exports = config;
    
  8. Creating npm Scripts for Development

    Add these script in package.json, scripts object,

    "scripts": {
    	"start": "npx webpack-dev-server",
    	"build": "npx webpack",
     	"test": "echo \"Error: no test specified\" && exit 1"
    }