Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add extension cli note to contributing docs #3793

Merged
merged 3 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.