ready-to-publish npm package typescript template that uses rollup to bundle the final build
Prerequisites: Proplate
proplate create --template https://github.com/YumeT023/npm-typescript-starter --dest output-dir
- Everything is preconfigured. Feel free to edit them.
- Code Formatter and linter is fully configured using Prettier and Eslint.
- Testing is already set-up using Jest. You can find a sample in src/tests/sample.ts.
- Bundling the build with
Rollup
- Scripts:
-
clean>
Removes the previous build output. -
build>
Builds the project (bundle .ts/.d.ts using rollup)- outputs: mjs and cjs
-
clean>
remove previous build output dist -
build-dts>
Emit declaration only -
clean-dts>
remove temp declaration file -
lint>
Lints the code style issues. -
lint:fix>
Fixes the code style issues. -
test>
Runs all the tests (located insrc/__tests__
) -
format>
Formats your codebase using prettier
-
This template is made so that you don't have to spend your time repeat the same configurations.
remove yarn.lock
if you use npm and use npm
in the command line
-
yarn build
Build the project to get the raw js outputs -
yarn login
Login using your npm account -
yarn publish
Publish the package to npm