Skip to content

kiroboio/ki-vb-parser

 
 

Repository files navigation

ts-node-starter

The ts-node-starter scaffolding project is a template repository which makes it easy for you to start a new Node.js project with TypeScript.

Using this template, you can build standalone apps, libraries and/or CLI tools. The ts-node-starter setup is configurable and comes with a lot of features included.

Features

  1. Automatic changelog generation powered by generate-changelog
  2. Automatic code & config formatting powered by Lefthook
  3. Automatic dependency updates powered by Dependabot
  4. Code coverage reports powered by Codecov
  5. Config formatting powered by Prettier
  6. Continuous integration pipeline powered by GitHub Actions workflows
  7. Cross-platform compatibility powered by cross-env
  8. Dependency management powered by yarn
  9. Distribution pipeline powered by npm
  10. Static code analysis powered by ESLint
  11. Testing & code coverage powered by Jest
  12. Type checking powered by TypeScript

Usage

Make it your own

  1. Replace all occurrences of "bennycode" with your own username (or organization name)
  2. Replace all occurrences of "ts-node-starter" with your project name (or repository name)
  3. Start writing your code in the "src" directory
  4. Run yarn and be happy! 😊

Build a standalone app

Source Code

If you just want to write and run a Node.js app, checkout "src/start.ts".

References

You can start your application by executing yarn start. If you want to debug your code, run yarn debug (Debug Instructions).

Build a Library

Source Code

If you want to distribute your code as a Node.js library on npm, you can have a look at "src/index.ts". If you build a library, I recommend to always ship an index file from where you export the code of your library for others.

References

In the "package.json" file you will also discover a "main" property which defines the entry point to your library when it gets imported by other developers. The value of the "main" property has to point to the transpiled JavaScript code.

Build a CLI

Source Code

If you want to build a CLI tool for Node.js, you can have a look at "src/cli.ts".

References

In the "package.json" file you will also discover a "bin" property which defines the executable name of your tool and the entry point to its transpiled JavaScript code.

If you don't want to publish a CLI, simply remove the "bin" property and the CLI script.

Conventions

Test Files

I recommend to colocate your test code with your source code by naming your test files *.test.ts.

Changelog Generation

The automatic changelog generation is based on Semantic Commit Messages. Simply use the suggested prefixes in your commit messages to make use of it. For example, if you commit a new feature use the "feat" prefix:

Commit Message

feat: My new feature

Troubleshooting

If you're having trouble with the Git pre-commit hook, then reinstall the hook using the following command:

npx lefthook install -a

Source: Hooks don't run

Important Refactorings

  1. Replaced EditorConfig with Prettier (https://github.com/bennycode/ts-node-starter/commit/2e24f7be5f427c26d6cc8281438a6398a211b75c)
  2. Replaced Jasmine with Jest (https://github.com/bennycode/ts-node-starter/commit/41e9b42bb5b7ca364dbbabf1104955090003d1be)
  3. Replaced action-dependabot-auto-merge with Dependabot & GitHub CLI (https://github.com/bennycode/ts-node-starter/commit/86d5696113c2fb4907a1666e25d1b72d698b06a5)
  4. Replaced husky with Lefthook (https://github.com/bennycode/ts-node-starter/commit/9c4161509acf49e56042383c9ea340f68f248582)
  5. Replaced custom ESLint Config with a Shareable Config (https://github.com/bennycode/ts-node-starter/commit/eef59275e91f6f484f7a917fdd87b09318ebbad3)

Contributors

Benny Neugebauer on Stack Exchange

Panayiotis Lipiridis on Stack Exchange

ki-vb-parser

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.3%
  • JavaScript 0.7%