Giter VIP home page Giter VIP logo

generator-typescript-package's Introduction

generator-typescript-package

License Build Status NPM Package NPM Downloads Code Coverage semantic-release

An opinionated yeoman generator for TypeScript packages with best practices

NOTE: this project is on life-support, and is subject to change wildly, or not at all. Please reach out by opening an issue if you're interested in helping or taking over maintenance of this project!

Features

Note: there has been no explicit compatibility testing for Windows development-environments

Install

npm install -g generator-typescript-package

Use

Create a directory for the new package, cd inside and generate the package skeleton with

yo typescript-package [--lerna] [--bin]
git commit -m 'Initial commit'

Finally, address each TODO: statement in the generated project.

Options

lerna

default: false

Generate a package in a lerna mono-repo. This package is expected to be built with TypeScript 3.0's build mode.

bin

default: false

Define an executable file under the bin section in the package.json.

Test

Test the generated package

npm test

Integrations

Continuous Integration

GitHub actions runs the .github/workflows/ci.yml action on every pull-request against the master, alpha, or beta branch.

To configure this behavior, customize the invoked npm run-scripts or the GitHub action itself.

Continuous Delivery

GitHub actions runs the .github/workflows/release.yml action on every push to the master, alpha, or beta branch.

This action uses the semantic-release GitHub action to create a new release and publish to npm, which requires the NPM_TOKEN Secret Variable.

Note that pushes to the alpha and beta branch create prereleases.

generator-typescript-package's People

Contributors

343max avatar amchelle avatar dependabot[bot] avatar ericcrosson avatar ericcrosson-bitgo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

generator-typescript-package's Issues

Run typedoc before linking readme

Linking (as is done currently) the readme upon generation doesn't keep it in sync, but after deleting and re-making the link (I suspect its important to run typedoc first) does keep the readme in sync.

Do this automatically so the user doesn't have to

Add inferrable types

    '@typescript-eslint/no-inferrable-types': [
        'error',
        {
            ignoreParameters: true,
            ignoreProperties: true
        },
    ],

Wire-up nodemon

This may be in the form of a nodemon.json

but I want to

nodemon -e 'ts json' -x 'ts-node $* || true'

perhaps as conveniently as a npm run nodemon -- $*

Add option --bin

to create a binary

  • add bin to package.json (probably just a TODO)
  • add shebang to top of src (#!/usr/bin/env node)
  • add local-variable block to bottom of src
/* Local Variables: */
/* mode: typescript */
/* End:             */

Reduce build times on `npm install`

Obvious solution is to build on publish

  • means storing build-artifacts in git repos

worth the tradeoff imo, look for a good example to see how this is done

Handle npm scopes

Changes

  • update install instructions (readme.md)
  • update import instructions (readme.md)
  • update readme badges
  • update package.json with access: public (https://stackoverflow.com/a/43007660/10596482)
  • update package.json with name (should include scope)

Scope should be gleaned from
- [ ] default scope (check npm config)

  • additionally, query user for scope upon invocation to yo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.