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

simple-ts-react-ssr-app

v1.0.1

Published

[![Greenkeeper badge](https://badges.greenkeeper.io/Kornil/simple-ts-react-app.svg)](https://greenkeeper.io/)

Downloads

3

Readme

simple-ts-react-ssr-app

Greenkeeper badge

SSR React starter project written in typescript, includes, webpack, babel, jest & enzyme.

Commands

Initialize it locally:

$ npx simple-ts-react-ssr-app myFolder

Will create a copy of the project inside myFolder.


  • npm run start--dev run both server and client dev
  • npm run build build bundle (it is recommended to build the bundle first once started the project to create the initial server.js file)
  • npm start start the project (requires npm run build first)
  • npm run test run tests (both back and front end)
  • npm run type-check run typescript' manual typecheck
  • npm run tslint lint project

Project structure

The boilerplate structure and files are the same as this repo minus the bin folder, everything else is exactly the same.

*root*
|
├── */src/*
│   ├── */assets/* where images and stuff are stored
│   ├── */containers/* react-router jsx pages
│   ├── *App.tsx* main layout
│   ├── *Routes.tsx* front-end routes
│   ├── *index.tsx* javascript entry point
│   ├── */custom-types/* contains custom types
│   │   └── *index.d.ts* only "*.png" for now (to make images import work)
│   ├── *style.scss* styling
│   └── */tests/* contains test environment (Jest + Enzyme)
│       ├── */__mock__/* contains setup to provide a valid path for imports
│       ├── */_tests__/* the actual tests
│       └── *setup.ts* setup for enzyme for react 16
├── *package.json* the whole package.json with every dependency and script, nothing is kept hidden
├── *tslint.json* tslint config
├── *tsconfig.json* typescript config
├── *.babelrc* babel config (polyfills)
├── *webpack.config.js* webpack config, it has a dev and prod environment
├── *index.html* entry point
└── *README.md* this file

Tests

The testing environment is written in Jest and Enzyme. The included tests are very basic and only check the proper render of base components + routes, there are no snapshot tests, I did not feel they were needed being the components really basic, at the first change they would need to be updated, imho setting the wrong approach of "hey tests are broken, let's regenerate snapshots again". While still basic, the default tests are easy to manage and expand, providing a smoother curve into testing with JavaScript and React.

Tslint

This project uses Typescript recommended specs plus Typescript react specs so you can write error-free react and typescript code, if you use Visual Studio Code, you can install tslint from the extension tab to activate this function, other editors just google name of the editor + tslint you will find how to enable it for your editor.

How to contribute

I wrote a small guide on how to contribute and the common etiquette to follow.