title |
---|
Developer docs for contributors |
https://github.com/datopian/datahub
Structure:
- examples
- ckan: Example utilizing CKAN as a backend
- dataset-frictionless: Example utilizing a frictionless dataset as an example
- site: the website for the project, with a landing page and the docs
- packages:
- portaljs-components: the library of components for creating a data portal
You can start by checking our issues board.
If you'd like to work on one of the issues you can:
- Comment on the issue to let us know you'd like to work on, so that we can assist you and to make sure no one has started looking into it yet.
- If good to go, fork the main repository.
- Clone the forked repository to your machine.
- Create a feature branch (e.g.
50-update-readme
, where50
is the number of the related issue). - Commit your changes to the feature branch.
- Add changeset file describing the changes. (See section below)
- Push the feature branch to your forked repository.
- Create a Pull Request against the original repository.
- add a short description of the changes included in the PR
- Address review comments if requested by our demanding reviewers 😜.
If you have an idea for improvement, and it doesn't have a corresponding issue yet, simply submit a new one.
Note
Join our Discord channel do discuss existing issues and to ask for help.
Our monorepo is set up with Nx build system. See their official documentation to learn more.
Each project(stuff inside either the packages or examples folder) within this repository has a project.json
file, which defines all targets that can be run on this project.
A target is an action that can be taken on a project. A task is a single target run on a given project.
To run a single target on a given project run:
npx nx <target> <project>
# e.g. npx nx serve ckan
or you can use just:
nx <target> <project>
# e.g. npx nx serve ckan
if you have the nx
binary installed globally in your machine
To run a given target on all projects that define it, run:
npx nx run-many --target=<target>
# e.g. npx nx run-many --target=serve
When you run nx affected --target=<some-target>
, Nx looks at the files you changed (compares current HEAD vs base), and it uses this to figure out the list of projects in the workspace that may be affected by this change. It then runs the run-many command with that list.
npx nx affected --target=<target>
# e.g. npx nx affected --target=serve
# or
# npx nx affected:<target>
# e.g. npx nx affected:serve
To learn more about how Affected works, read this Nx docs page.
Nx uses eslint for code linting and prettier for code formatting. There is a base eslintrc.json
file in the root of this repository that defines global eslint configs. Each project can have its own eslintrc.json
for project-specific eslint confiurations.
To lint the code in a single project:
npx nx lint <project>
# npx nx lint ckan
To lint all projects:
npx nx run-many --target=lint
To check code formatting in selected projects:
npx nx format:check --projects=<array of projects>
# npx nx format:check --projects=ckan,dataset-frictionless
To check code formatting in all projects:
npx nx format:check --all
# or
# npx nx format
To fix code formatting in selected projects:
npx nx format:write --projects=<array projects>
# npx nx format:write --projects=ckan,dataset-frictionless
To fix formatting in all projects:
npx nx format --all
# or
# npx nx format:write --all
To learn more about all the available options for the format command, see format:check and format:write docs pages.
To create a new publishable js library:
nx g @nrwl/next:lib --js --publishable --importPath @portaljs/<library-name>
To create a new next.js app in the examples folder :
nx g @nrwl/next:app <example-name>
To see the graph of dependencies between the projects within this repository, run:
npx nx graph
Nx by default uses local computation cache to store results of the tasks it has run.
The entry point of Nx's confiuration is the nx.json
file in the root of this repository. It defines global configurations as well default configurations for projects targets.
To learn more see this offical docs page.
Each project also has it's own configuration file - project.json
, where you can define and configure it's targets (and more).
To learn more see this offical docs page.
This monorepo is set up with changesets versioning tool. See their github repository to learn more.
Changesets are files that describe the intention of a contributor to bump a version of the package according to their changes. Changeset file holds two key bits of information: a version type (following semver), and change information to be added to a changelog.
In the root directory of the repo, run:
npx changeset
Select the package that has been changed, the semver version that should be bumped with it and a description of your changes. Please make sure to add the most accurate but also concise information.
To learn about semantic versioning standards see this semver doc page.