Giter Club home page Giter Club logo

typescript-library-template's Introduction

typescript-library-template

This is a template repository for developing libraries for Browser/Node.js with TypeScript.

How to publish to npm

Step 1

Rewrite the following items in package.json in each folder as appropriate.

  • name
  • description
  • keywords
  • repository
  • author
  • bugs
  • homepage

Step 2

Next, rewrite the signature and number of years in the LICENSE file.

Copyright (c) 20xx your_name

Step3

Rewrite the repo option in Changeset.

"changelog": [
  "@changesets/changelog-github",
  { "repo": "your_name/repository_name" }
],

Also, do not forget to rewrite the title of CHANGELOG.md.

Step4

Implement a great library under the packages folder.
Be sure to provide proper test code so that users of the library can feel comfortable.

Execute the following commands to confirm that the build and test pass successfully.
Be careful not to publish libraries that do not work properly.

$ yarn build
$ yarn test

Step5

Write a description of the library in README.md.

It is also a good idea to create a simple project under the examples directory so that you can check the operation by simply cloning the repository.
It is important to keep the project as simple as possible, as complex projects take time to understand.

Step6

To publish the library to NPM, add the NPM access key with the key NPM_TOKEN to the repository secret.
This will automatically publish the library to NPM when the release workflow is executed.

Step7

The following command can be used to create a patch to update the library version.

$ yarn changeset

When the patch is committed to the main branch, CI will run and create a PR for the release.
Then, simply merge the PR for release and the library will be automatically published to NPM.

typescript-library-template's People

Contributors

karibash avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

bato3 ouyuran

typescript-library-template's Issues

example/tsconfig.json is incorrect

example/tsconfig.json seems to be set up for example to also have its source code in a src folder - this is not the case, thus the tsconfig properties "include": ["src/**/*.ts"] and "rootDir": "src", break.

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.