dev-react-lib v1.0.12
dev-react-lib
A really fast utility to start to develop your library for React and (if you want) publish it!
š» Just write your code without bundlers configurations!
š¦ Essential packages for a fast installation!
š Test your lib directly in your browser thanks to Parcel!
ā”ļø Fast build process thanks to babel!
ā³ Changes and testing in real time!
Table of contents
Status
Quick start
Just by running the command
npx dev-react-lib
When finished, a folder will be created with the name of your project
Enter the folder by running the command:
cd my-new-lib
you have the following directory structure:
./src/lib/index.js - The core of your library
./src/index.html - Served html page to test your library
./src/index.js - Served .js file to test your library
./lib - Finish bundle of your library
Watch
You can start wathing your library file by running the following command:
npm run start
or:
yarn start
Edit
Now try to edit the file:
./src/lib/index.js
Babel will look at the changes and create a bundle in the ./lib folder
Build
npm run build
or:
yarn build
Test
Thanks to Parcel bundler, you can test your library by running the command:
npm run test
or:
yarn test
Parcel will open your browser and will serve your library at
http://localhost:1234
You can edit the served files if you want:
./src/index.html
./src/index.js
Publish
In the package.json of your newly created library it has already been specified that only the library folder must be contained in the package.
You can test the contents of the package before sending it by running the command:
npm pack
or
yarn pack
This command will create a package only the necessary files.
When you are ready, you can publish it just running the command:
npm publish
or
yarn publish
Contributing
If you liked this application and would like to contribute you can do it by buying me a coffee āļø
Copyright and license
Copyright 2022 Gianfilippo Balestriero.
Code released under the MIT License.