Overview:
The @epranka/create-package is a package creation tool that allows users to easily generate packages for JavaScript, JSX, TypeScript, and TSX projects. It offers various features such as interactive package creation, silent mode for automated package generation, package manager selection (yarn or npm), support for different module formats (ES, CJS, UMD), RollUp bundler integration, linting, tests, semantic release, README template with badges, continuous integration with Travis, license selection, and more.
Features:
- Interactive package creation: Users can create packages using an interactive prompt.
- Choices of JS, JSX, TS, TSX: Users can choose the desired language for their packages.
- Silent mode: Users can create packages without user interaction using the –silent option.
- Package manager selection: Users can choose between yarn and npm as their package manager.
- Choices of ES, CJS, UMD modules: Users can select the module format for their packages.
- RollUp bundler: The tool supports RollUp bundler integration for package building.
- Linting: Users can lint their packages using the provided commands.
- Tests: Users can include unit tests for their packages.
- Semantic Release: The tool supports automated semantic releases with customizable options.
- README template with badges: Users can generate a README template with badges.
- Continuous integration with Travis: Users can integrate their packages with Travis for continuous integration.
- License selection: Users can choose among ISC, MIT, or UNLICENSED licenses for their packages.
- epranka/create-package animation: The tool provides an animation for package creation.
Installation:
To install and use the @epranka/create-package tool, follow the steps below:
- Run the following command to install the package globally:
npm install -g @epranka/create-package
- Once the installation is complete, you can use the following command to create packages:
create-package
You will be prompted with questions about the package details. Answer the questions accordingly.
If you choose automated semantic releases, the package generation process may take longer, and you will be prompted for semantic release options.
After the package is generated, the entry point can be found in the ./src/ directory. If unit tests are selected, they will be located in the ./__tests__/ directory.
In the package root directory, you can run the following commands:
- To build the package:
npm run build - To watch changes and build the package:
npm run watch - To lint the package:
npm run lint
- To build the package:
If you want to publish the package, remove the “private” property from the package.json file.
You can also create packages in silent mode without user interaction using the –silent option. Pass package values along with the command. If you choose the –semantic-release option in silent mode, you will have to set it up after the package is created.
For CLI help and more details, refer to the documentation.
Summary:
The @epranka/create-package tool is a versatile package creation tool that allows users to easily generate packages for JavaScript, JSX, TypeScript, and TSX projects. It offers a range of features including interactive package creation, support for multiple module formats, package manager selection, linting, tests, semantic release, continuous integration, and more. With its user-friendly interface, developers can quickly create packages and customize them according to their needs.