genera

Sets the basic environment I usually have in my projects

Usage no npm install needed!

<script type="module">
  import genera from 'https://cdn.skypack.dev/genera';
</script>

README

gev

Creating every single Typescript project environment is a real pain. Takes lots of minutes, sufferings and procrastinations to leave it functional and in the way I feel confortable to work with. We know how boring it really is.

Also, having to manage the eslint of each project and not knowing which one I've updated last, also causes some anxiety.

This npx package saves me some good hours of life, so I can watch more videos of cute dogs before I die.

Made it for me and my projects, but can also work really well for you. It's fast, simple and good.

Usage:

npx gev to use the current directory as destination and package name. Directory emptiness will be checked.

or

npx gev <packageName> to create a new directory and use it as the package name. Will check if a directory with same name already exists.

As it accepts scoped package names like npx gev @yourUsername/coolPackage, it is not possible to specify a path in the package name, like ... deep/dir/coolPackage.

It will

  • Check if the package name is valid
  • npm init -y and do some changes on package.json:
    • Set version to 0.1.0, as 1.0.0 on stable release
    • Change main value to dist/index.js
    • Add common scripts
    • Whitelist publish files with "files": ["/dist"]
  • npm i -D typescript [...eslint packages] rimraf
  • Set the .eslintrc and use my @srbrahma/elint-config I've been configuring through some years
  • rimraf as dev dep for cross-platform erasing the dist dir, in clean npm script. Common practice.
  • tsc --init for the latest options
  • Change some tsconfigs (source map, declaration files, outDir=dist, resolveJsonModule etc)
  • Create basic .gitignore, .eslintignore
  • README.md and CHANGELOG.md with template and some initial infos
  • Create src/index.ts

You may want to read each file in src/resources, or just initialize a project to see the final files.

Future

  • --react and --react-native flavors as arguments, for further options to the eslint and tsconfig.

  • Add Paypal donate button to the end of READMEs (or as a badge). Money! It could check if I am the npx caller. Else, maybe shouldn't be a good idea to add that button with my link.

  • Interactive menu to add other badges and the paypal button to the README.

  • typedoc support, with markdown output. I hate writing READMEs!

  • Allow custom setups. It could be something like npx gev -u githubUsername. This could really be a good way for people to have their own environment setup without too much work.

Changelog

Etc

It could use the npm initializer, like npm init gev. But for now I will stick to the npx gev. Shorter!