Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hugodf/jsdoc-type-d-ts-node-pkg
A Node.js package setup with types.d.ts (TypeScript typings) generated from JSDoc annotations
https://github.com/hugodf/jsdoc-type-d-ts-node-pkg
jsdoc jsdoc-template node-module nodejs typescript-definitions typings
Last synced: 12 days ago
JSON representation
A Node.js package setup with types.d.ts (TypeScript typings) generated from JSDoc annotations
- Host: GitHub
- URL: https://github.com/hugodf/jsdoc-type-d-ts-node-pkg
- Owner: HugoDF
- License: mit
- Created: 2020-05-17T15:03:17.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-02-03T07:21:18.000Z (almost 2 years ago)
- Last Synced: 2024-10-10T12:11:29.160Z (about 1 month ago)
- Topics: jsdoc, jsdoc-template, node-module, nodejs, typescript-definitions, typings
- Language: JavaScript
- Homepage: https://codewithhugo.com/jsdoc-typescript-typings-types-d-ts/
- Size: 1.02 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![test](https://github.com/HugoDF/jsdoc-type-d-ts-node-pkg/workflows/test/badge.svg)
# Node.js module with TypeScript typings (types.d.ts) generated from JSDoc
Example repo for a Node.js module with TypeScript typings ([./types.d.ts](./types.d.ts)) generated from JSDoc annotations.
Project setup, files/directories of interest are [./src/main.js](./src/main.js), [./tests](./tests) and [./types.d.ts](./types.d.ts).
```
├── LICENSE
├── README.md
├── node_modules
│ └── ...
├── package.json
├── src
│ └── main.js
├── tests
│ └── ping.js
├── types.d.ts
└── yarn.lock
```Comes ready to develop with:
- [ava](https://avajs.dev) for testing
- [jsdoc](https://github.com/jsdoc/jsdoc) and [tsd-jsdoc](https://github.com/englercj/tsd-jsdoc) to generate the [./types.d.ts](./types.d.ts) file.
- [xo](https://github.com/xojs/xo#readme) for linting/formatting## Quickstart
Use the GitHub "Template" functionality or clone the repo (take care to remove the `.git` folder in that case).
# Contributing
## Requirements
- Node 12
- Yarn 1.x or npm## Setup
1. Clone the repository
2. Run `yarn` or `npm install` installs all required dependencies.## npm scripts
> Equivalent `npm run ` should also work
- `yarn test` run tests with [ava](https://github.com/avajs/ava).
- `yarn build` will run JSDoc -> TypeScript typing conversion with [jsdoc](https://github.com/jsdoc/jsdoc) and [tsd-jsdoc](https://github.com/englercj/tsd-jsdoc), changes to [./types.d.ts](./types.d.ts) shoud be committed.
- `yarn lint` will lint all of the files with [xo](https://github.com/xojs/xo)
- `yarn format` will run lint with `--fix` option on all the examples files (and tests).# About
This package is maintained by Hugo from [Code with Hugo](https://codewithhugo.com) and [Alpine.js Weekly](https://alpinejs.codewithhugo.com/newsletter).
## Acknowledgments
Special thanks to:
- The developers behind
- [ava](https://avajs.dev)
- [jsdoc](https://github.com/jsdoc/jsdoc)
- [tsd-jsdoc](https://github.com/englercj/tsd-jsdoc)
- [xo](https://github.com/xojs/xo#readme)# LICENSE
Code is licensed under the [MIT License](./LICENSE).