NPX tool for me to easily scaffold new project, containing TypeScript config for modern ES, eslint with my favorite code style and Jest tests with TS support.
This repository has been archived on 2025-09-14. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
Find a file
2024-04-18 20:55:26 +04:00
src Add tests optionally 2024-04-18 20:55:26 +04:00
test Fix test suite 2022-11-04 19:19:25 +04:00
.eslintrc.cjs Add defaults 2022-11-04 16:46:58 +04:00
.gitignore Fix tests 2022-11-04 18:29:27 +04:00
.swcrc Replace ttsc with swc 2022-11-19 21:55:10 +04:00
babel.config.cjs Transpile TypeScript test files 2022-11-04 19:12:18 +04:00
jest.config.js Transpile TypeScript test files 2022-11-04 19:12:18 +04:00
LICENSE.md Add defaults 2022-11-04 16:46:58 +04:00
package-lock.json Fix vulnerable dependencies 2023-02-02 10:17:50 +04:00
package.json Add tests optionally 2024-04-18 20:55:26 +04:00
README.md Add tests optionally 2024-04-18 20:55:26 +04:00
tsconfig.json Replace ttsc with swc 2022-11-19 21:55:10 +04:00

Scaffold

NPX tool for me to easily scaffold new project, containing TypeScript config for modern ES, eslint with my favorite code style and Jest tests with TS support.

Moreover, this tool was scaffolded with itself! It tests itself automatically with Jest after each build by creating simple test project and testing Jest with Jest's test.

This project is mostly for demonstrating which defaults I use, it is not intended to be used by anyone, simply because everyone has it's own preferences, so don't judge me for using X here. Though I'm still accepting any criticism that may help me improve this setup to work faster and better :)

Size of generated project is just 142 MB with all dependencies

I think there is a better alternatives to some things I use here, so suggest me alternative tools in the Issues tab if you know:

  • Append .js extension to imports during build
    • Currently is done using external @zoltu/typescript-transformer-append-js-extension plugin with ttypescript
  • Build replacing process
    • Currently ./out dir is removed via external del-cli package and then files are copied via cpy-cli which may pose threat with security vulnerabilities. Maybe change to native commands such as rm and cp?
  • Add support for Yarn when installing dependencies

Tool usage

npx @hloth/scaffold project-name --tests

or

git clone https://github.com/VityaSchel/scaffold && cd scaffold && npm i && npm run set && sf project-name

Generated project usage

Project structure

.
├── src
│   ├── .env.ts
│   └── index.ts
├── out
├── test
│   └── index.test.ts
├── .env
├── babel.config.cjs
├── jest.config.js
├── tsconfig.json
├── .swcrc
├── LICENSE.md
├── package.json
└── package-lock.json

Scripts

Build: npm run build Run: npm start or node out/index.js Test (with TypeScript): npm test

Building

Previusly building was done with ttsc which is a postprocessor for Typescript with plugins support. In v1.0.1 it was replaced with esbuild and then swc. swc was faster, so now we're using it.