Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
DataPub is a React-based framework for rapidly building modern data publishing flows (esp for CKAN). It provides a variety of core components as well as example apps and flows.
This is a brief summary from https://tech.datopian.com/publish/ -- read that for more detail.
The process of publishing data files and datasets (collections of files).
Specifically, the process of getting your data files stored and described in a data portal or other platform. Usually it involves steps like:
At Datopian we have been building data publishing flows for nearly 15 years both in tools like CKAN and OpenSpending and in custom applications. Our experience has taught us two things:
This indicates the need for a framework -- rather than a single one-size-fits-all application.
create-react-app
and where you can use the full ecosystem of React tooling and componentsComponents include:
To see all the available components visit our Storybook:
https://datopian.github.io/datapub
See the examples
directory.
For other full scale apps using DataPub in the wild see:
There are two ways to get started
examples
directory and then modify itcreate-react-app
Of these two options the former is better when experimenting or for small changes. The latter is better if you are building a more complex application or integrating into an existing application.
In order to add DataPub components into a newly created React application, follow the steps below:
Step 1: create a new react application:
create-react-app datapub-extend
Change directory into datapub-extend and run the application to ensure it was created successfully:
cd datapub-extend
yarn start
Step 2: Install Datapub
yarn add git+https://github.com/datopian/datapub.git
Step 3: In the App.js, initialises your app with the Resource editor
...
export class ResourceEditor extends React.Component {
constructor(props) {
super(props);
this.state = {
datasetId: this.props.config.datasetId,
resourceId: "",
resource: this.props.resource || {},
...
};
}
...
Step 4: Also in App.js, import the components you need. For instance in the code below we import Upload and TableSchema component.
...
import { Upload, TableSchema } from "datapub";
...
Step 5: In the render section of your resource editor, add the Upload and TableSchema components you just imported.
...
<div className="upload-edit-area">
{this.state.resource.schema && (
<TableSchema
schema={this.state.resource.schema}
data={this.state.resource.sample || []}
/>
)}
{!this.state.isResourceEdit ? (
<button disabled={!success} className="btn">
Save and Publish
</button>
) : (
<div className="resource-edit-actions">
<button
type="button"
className="btn btn-delete"
onClick={this.deleteResource}
>
Delete
</button>
<button className="btn">Update</button>
</div>
)}
</div>
...
See the full example with code and explanations here
Install a recent Node version.
First, clone the repo via git:
$ git clone git@github.com:datopian/datapub.git
And then install dependencies with npm.
$ cd datapub
$ npm install
Run the app in the development mode.
$ npm run start
Then open http://localhost:3000/ to view it in the browser.
The page will reload if you make edits.
Storybook is a tool that prepares a development environment for UI components. It allows you to develop and design your graphical interfaces quickly, isolated, and independently. Making it possible to define different states for components, thus documenting their states.
Note: Every push will run GitHub actions to deploy in GitHub pages. You can check online at https://datopian.github.io/datapub
$ npm run storybook
or
$ yarn storybook
$ npm test
or
$ yarn test
To run tests + coverage
$ yarn test:watch
Please make sure to read the CONTRIBUTING.md Guide before making a pull request.
This project is licensed under the MIT License - see the LICENSE file for details
FAQs
Unknown package
The npm package datapub receives a total of 1 weekly downloads. As such, datapub popularity was classified as not popular.
We found that datapub 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.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.