generator-typescript-project-generator-by-ridesz
v1.0.14
Published
Re-runnable project generator for TypeScript project generators.
Downloads
117
Readme
Generator TypeScript Project Generator by Ridesz
Re-runnable project generator for TypeScript project generators.
How to start?
Create and clone a GitLab project (https://gitlab.com) then run this in the project folder:
npx generator-typescript-project-generator-by-ridesz@latestHow to continue?
To upgrade and re-run the generator:
npm run project:upgradeMajor version steps can be painfull. Maybe you need to answer some questions. Maybe you need to change some things manually. Please read the console output carefully.
To rerun the generator without upgrade:
npm run project:regenerateOptional arguments
The generator has some optional arguments (you can combine them):
- --verbose: print info level messages too
- --force: overwrite everything without asking confirmation
- --silent: don't ask questions
- --regeneratedFolder: custom name for the regenerative folder
Generated setup
- The version control system is Git
- The repository is GitLab (private runner support, selfhostin is possible, etc.)
- The main language is TypeScript
- EcmaScript module resolution (don't to use commonjs)
- Don't use JavaScript (unless there is no other way)
- The package manager is NPM
- The linter is ESLint and the formatter is Prettier
- The tesing framework is Jest
- Git hooks with Husky and lint-staeged
- Code editor is Visual Studio Code
- And more... (code duplication check, dead code check, circular imports check, etc.)
Generated folder structure
- Source files in the src
- Test files in the test
- Script files in the script (for tools like build, check, etc.)
- Configuration files in the config
- Git ignored report outputs in the report
- A special volatile folder which will be purged and recreated for every generator run (generated by default)
- A few other files in the root (package.json, tsconfig.json, README.md, .gitignore, .gitlab-ci.yml, etc.)
About the re-runnability
There is a special volatile folder. It will be deleted and recreated by every run of the generator. This folder contains recommended project parts granted by the generator and it can change after time.
Other files can be also affected by generator runs: dependencies and scripts in package.json, default values for some files if they are missing (or the target folder is empty), etc.
Starting from an existing project
Not supported. You can try to remove most parts of your project to avoid conflicts, run the generator and bring back carefully what you need with your version control system. But this is not really a recommended way.
Yeoman is under the hood
This generator is just a Yeoman generator (https://yeoman.io/) with extra steps.
You can install it globally and run it with Yeoman. (the generator- prefix missing for reason):
npm i -g generator-typescript-project-generator-by-ridesz@latest && npx yo typescript-project-generator-by-rideszAlternative way with temporary install:
npx --package=yo@latest --package=generator-typescript-project-generator-by-ridesz@latest -c "yo typescript-project-generator-by-ridesz"The global install is required by Yeoman, just like the "generator-" prefix.
About the development
Maybe the easiest way is a global install after your changes:
npm pack && npm i -g ./generator-typescript-project-generator-by-ridesz-1.0.14.tgzThen you can run it in the target project folder:
npx generator-typescript-project-generator-by-rideszThe npm link and npx run yeoman:regenerate were broken for me.
Please be carefull, globally installed variants can cause conflicts.
More info in the backbone project: README_DEV.md
