This branch holds the source of the two npm packages of the DatoCMS plugins:
datocms-plugin-sdk2.6.0-next.0 (packages/sdk): the SDK that connects a plugin to DatoCMS.datocms-react-ui3.1.0-next.0 (packages/react-ui): the React components of the plugins.
DatoCMS develops these packages in a private repository, together with the CMS that uses the same components. At each release, a script copies here the files that the npm packages are built from. A check makes sure that the build of this branch is the same, file for file, as the build in the private repository.
Do not edit this branch by hand: the next release replaces it. To propose a change, see Contributing.
The source of datocms-react-ui 2.x is on the branch 2.x. A fix for 2.x goes there, with a pull request to that branch.
Copied from the commit 94507def51cd079b1385f1a891011f233f901fb4 of the private repository.
packages/sdk: the SDK.ARCHITECTURE.mdtells how a plugin talks to DatoCMS, andREADME.mdtells how to try a change in a plugin.packages/react-ui: the component library.entries.mjslists its public entries (datocms-react-ui/Button).src/has the adapter between the components and thectxof a plugin:Canvas,useCtxandContextInspector.bin/builds the output.README.mdis the documentation of the package.packages/ui: the components. The build of react-ui bundles them into the package. Only the modules that react-ui ships are here.
Some comments point to a file of the private repository, such as an AGENTS.md file. These files are not here.
You need Node 24 (see .nvmrc).
npm ci
npm run build # the SDK first, then react-ui: react-ui reads the types of the SDK
npm test
npm run tsc
npm run lintTo try a change in a plugin, pack the build and install the tarball in the plugin:
cd packages/react-ui # or packages/sdk
npm pack
cd ../../../my-plugin
npm install ../path/to/the.tgz- Report a bug or ask for a feature in the issues of this repository.
- Propose a change with a pull request to this branch. Build the branch before you open the pull request: its CI builds it too.
- We do not merge a pull request into this branch, because the next release replaces it. A maintainer applies your commits to the private repository, with you as their author. The pull request closes when a release brings the change here.
- Some files are generated and a change to them does not apply as it is: the files at the root of this branch, the
package.jsonof each package, andpackages/ui/tsconfig.json. Say in the pull request what you need, and a maintainer changes the source.
MIT, see LICENSE.md.