Data Catalog Components
A set of React components to facilitate the creation of Open Data Catalogs with React.
To develop locally against a working version of the data-catalog-frontend, you will need to do the following steps.
rm -rf node_modules && npm installin the data-catalog-frontend repo.
rm -rf node_modules && npm installin the data-catalog-components repo.
npm linkin this repo (data-catalog-components), this will create a symlink to your global npm registry.
npm link <relative path to dkan frontend>/node_modules/reactin this repo to connect the component library to the frontend's react folder.
npm link @civicactions/data-catalog-componentsin 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.
gatsby developin the data-catalog-frontend repo.
- In this repo, run
npm run lib:watchto work on components or
npm run css:watchto 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:
- Start storybook
npm run storybook
- Comment out
base: '/data-catalog-components'from doczrc.js
npm run docz:servethen visit
- Review exports in index.js
- Increase version in package.json
npm publish --access public
Publish to Github Pages
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
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