Skip to content

Commit

Permalink
docs: add extension cli note to contributing docs (ueberdosis#3793)
Browse files Browse the repository at this point in the history
* docs: add extension cli note to contributing docs

* docs: add notes to CLI

* docs: fix rollup and vite naming
  • Loading branch information
bdbch authored and aliasliao committed May 24, 2023
1 parent 02477d4 commit 99a73ef
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/api/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,10 @@ const editor = new Editor({
})
```

You can easily bootstrap a new extension via our CLI.

```bash
npm init tiptap-extension
```

Learn [more about custom extensions in our guide](/guide/custom-extensions).
8 changes: 7 additions & 1 deletion docs/guide/custom-extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -649,5 +649,11 @@ const CustomExtension = Extension.create({
})
```

## Creating and publishing standalone extensions
If you want to create and publish your own extensions for Tiptap, you can use our CLI tool to bootstrap your project.
Simply run `npm init tiptap-extension` and follow the instructions. The CLI will create a new folder with a pre-configured project for you including a build script running on Rollup.

If you want to test your extension locally, you can run `npm link` in the project folder and then `npm link YOUR_EXTENSION` in your project (for example a Vite app).

## Sharing
When everything is working fine, don’t forget to [share it with the community](https://github.com/ueberdosis/tiptap/issues/819).
When everything is working fine, don’t forget to [share it with the community](https://github.com/ueberdosis/tiptap/issues/819) or in our [awesome-tiptap](https://github.com/ueberdosis/awesome-tiptap) repository.
9 changes: 9 additions & 0 deletions docs/overview/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,14 @@ There is an eslint config that ensures a consistent code style. To check for err
## Testing for errors
Your pull request will automatically execute all our existing tests. Make sure that they all pass, before sending a pull request. Run all tests locally with `$ npm run test` or run single tests (e. g. when writing new ones) with `$ npm run test:open`.

## Creating your own extensions
If you want to create and maintain your own extensions, you can use your `create-tiptap-extension` CLI tool. It will create a new extension boilerplate with all necessary files and the build process. It's as easy as running

```bash
npm init tiptap-extension
```

If you want to let us know about your extension you can give us a hint on [Twitter](https://twitter.com/tiptap_editor) or [Discord](https://discord.gg/WtJ49jGshW).

## Further questions
Any further questions? Create a new issue or discussion in the repository. We’ll get back to you.

0 comments on commit 99a73ef

Please sign in to comment.