This is a monorepo for all plugins for the Splish Editor created for the E-Learning Website www.serlo.org.
To run the storybook, run the following commands:
yarn
yarn start
After that open http://localhost:9009 in your browser.
To create a new plugin bar
, you can run the plop generator:
yarn
yarn generate bar
After the generator is done add stories for your plugins in demo/__stories__/bar.tsx
plugins/bar-renderer
(the plugin renderer)plugins/bar
with dependency on the renderer (the plugin editing)paths
in tsconfig.json
for @serlo/editor-plugin-bar
paths
in tsconfig.json
for @serlo/editor-plugin-bar-renderer
alias
in demo/.storybook/webpack.config.js
for @serlo/editor-plugin-bar
alias
in demo/.storybook/webpack.config.js
for @serlo/editor-plugin-bar-renderer
editor-plugins-registry/src/index.ts
editor-plugins/src/index.ts
editor-plugins-renderer/src/index.ts
yarn
(so that the two packages get symlinked)yarn format
Lerna is a tool to manage multiple packages in one repository. (In our case the multiple packages are yarn workspaces defined in the package.json
). We want to be able to import every plugin on its own, so we need a tool which links the different packages together.
This is where Lerna comes into play. It automatically resolves local packages in the dependencies and and links them correctly, so they can be imported and handled like any published npm package (e.g without knowledge about the file structure).
Lerna also provides the possibility to run a script in all packages, so lerna run build:watch
executes the build:watch
script in every package, so you don't have to call them all by yourself.