README
Data Catalog Components
A set of React components to facilitate the creation of Open Data Catalogs with React.
Working locally
To develop locally against a working version of the data-catalog-frontend, you will need to do the following steps.
- Run
rm -rf node_modules && npm install
in the data-catalog-frontend repo. - Run
rm -rf node_modules && npm install
in the data-catalog-components repo. - Run
npm link
in this repo (data-catalog-components), this will create a symlink to your global npm registry. - Run
npm link <relative path to dkan frontend>/node_modules/react
in this repo to connect the component library to the frontend's react folder. - Run
npm link @civicactions/data-catalog-components
in the data-catalog-frontend repo. This will make it so when you run npm install it will symlink the node_modules folder to the global symlink instead of downloading the library from npm. - Run
gatsby develop
in the data-catalog-frontend repo. - In this repo, run
npm run lib:watch
to work on components ornpm run css:watch
to work on just CSS changes. Babel will now watch any commands you make to React components in this folder and rebuild the library. When a rebuild happens it will cause the frontend Gatsby development server to rebuild and show your changes.
Viewing the Components
This project utilizes storybook to document the available components.
To see the available components:
- clone this repo
- Install the dependencies with npm:
cd data-catalog-components
npm install
- Start storybook
npm run storybook
Docz preview
- Comment out
base: '/data-catalog-components'
from doczrc.js - Run
npm run docz:serve
then visithttp://localhost:3000
.
Publishing
- Review exports in index.js
- Increase version in package.json
- run
npm login
- run
npm publish --access public
Publish to Github Pages
- run
npm run prepublish; npm run deploy-storybook
Testing Components without Updating NPM Package
To test or use the components from a github branch:
- Create new branch locallly
- Remove
lib
from .gitignore - Run
npm run lib
- Push lib folder and .gitignore to your branch
- Add branch to package.json by running
npm install --save getdkan/data-catalog-components#MY-BRANCH
- Profit