DEV Community

Discussion on: What are some examples of "productive laziness"?

Collapse
 
fluffynuts profile image
Davyd McColl

I just wrote a cli npm module to bootstrap typescript npm modules (including cli ones). I'd like to add an interactive mode first, but, at some point, I'm going to blog about it here.

It sets up the following:

  • Checks if your desired package name is available
  • Initialize git
  • Initialize package.json
    • What files to include
    • Starting version
    • Author info
  • Setup LICENSE and field in package.json
  • Create skeleton README.md
  • Install dev dependencies:
    • Typescript
    • Jest & ts-jest & expect-even-more-jest
    • Faker
  • Install run-time dependencies:
    • Yargs (for cli apps)
  • NPM scripts
    • build (transpile your .ts to the dist folder with declarations)
    • test
    • lint
    • start (runs your cli app, if you chose the cli route)
    • release ( & beta release when you just want to test something)
  • Seed project files
  • Build to test output

I can go from npx to published cli hello, world app in about 5 minutes (of which at least a minute is creating an empty repo on github)

Why did I do this? Because I wanted to seed 4 TypeScript-based NPM modules, saw a pattern and got mad with the amount of time it takes to do the above by hand. LAZY.

The right kind of lazy gets shit done :D