Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
component-template
Advanced tools
A React component template for building and publishing reactstrap components
Build, Document, Release & Publish React Components for reactstrap with this Component Template.
This project was bootstrapped with Create React App.
To start using the example npm module component-template
, check out the documentation.
Looking to build your own components? Fork this repo and proceed with the following documentation.
To begin, install dependencies with
npm install
To run a local server with create-react-app
, run:
npm start
A new browser window should open up with the following url: http://localhost:3000
Testing is provided via create-react-app which includes the jest test runner. Enzyme is also added to enable better integration testing of components via mount.
Execute the following command to run tests. Read more about that here.
npm run test
To also see test coverage when running tests, execute the following command:
npm test -- --coverage
Currently the example component shipped in this project is HelloWorld
. To add your own components, replace HelloWorld with your own named component and tests.
/src/components
/src/components/index.js
main
script in package.json will be available at lib/index.js
thanks to the prebuild
taskIncluded in this project are a few scripts to help document, release and publish a react component. Before proceeding, make sure the name
, version
, description
, and repository
in package.json
are updated to properly define your own component.
Once your components are added and tested, use the following steps to release to npm.
First, run the create-release-branch
script locally, which takes 1 argument, the release version. The release version can be a specific semantic version or it accepts patch
, minor
, major
to automatically increment the current release version and update the changelog. After the script is run, a branch will be pushed to the repo.
# RELEASE_VERSION: "1.0.0", patch, minor, major
RELEASE_VERSION=0.2.0
npm run create-release-branch -- $RELEASE_VERSION
With the branch pushed to github, you can now manually create the pr.
First, update the npm task gh-pages
, to set the proper REACT_APP_GH_PAGES_PATH
for your project. Ex: https://reactstrap.github.io/component-template
project would be component-template
. No need for the trailing or leading slash.
Follow the next sections to publish locally or via Travis CI.
With the REACT_APP_GH_PAGES_PATH
path updated, run the deploy-docs
script to compile the production version of your docs and push those changes to the gh-pages
branch of your repo.
npm run deploy-docs
Coming soon
First, be sure to signup for npm if you haven't or run npm login
with your existing credentials.
Next, run the publish-release
task which will pull the latest changes, compile the components, tag the current commit as the version
in packge.json
. push the tags to github and finally will run npm publish
. Check the publish-release script for more info.
npm run publish-release
Feel free to create an issue or PR.
FAQs
A React component template for building and publishing reactstrap components
The npm package component-template receives a total of 0 weekly downloads. As such, component-template popularity was classified as not popular.
We found that component-template demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.