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

Add tutorial for using the comunica packager #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions pages/docs/2_modify/1_getting_started/7_custom_init_packager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: 'Exposing your custom config as an npm package using Comunica Packager'
description: 'Wrap your config in an npm package, and expose a CLI tool and a JavaScript API using the simple Comunica
Packager application.'
---

In this guide, we will yet again wrap our custom config into a new npm package but this time we will be using the
Comunica Packager.

The difference here is that the application will do most of the work for us. This includes the `package.json`,
the CLI tools, the JavaScript API and finally the structure of the engine configuration.

## 1. Open the application and select the Comunica SPARQL preset

Open the application [here](https://comunica.github.io/comunica-packager/) and click on `Import config`. When the
dropdown opens, click on `Comunica SPARQL`.

<img src="/img/select_preset.png" alt="select preset" width="750"/>

## 2. Select the correct set and delete the unnecessary actors

On the left, select the set `sparql-queryoperators` in the `Sets` section. Wait until everything is loaded if necessary
and scroll until you see the actors of type `ActorQueryOperationConstruct` and `ActorQueryOperationDescribeSubject` if
they are not on the screen.

<img src="/img/click_sparql_queryoperators.png" alt="select preset" width="750"/>

Delete each actor respectively by clicking on the close button on the top right of each
actor and subsequently clicking on confirm.

<img src="/img/confirm_delete.png" alt="select preset" width="750"/>

## 3. Export configuration and optionally fill in package information

Now, you are ready to export this configuration. After pressing the `Export config` button in the top bar, a screen will
pop up where you can optionally fill in package information such as the package name and the author. Whenever you're
ready to finish you can press the `Export` button on the pop up screen to download a zip file containing all the
necessary files for this configuration.


<img src="/img/export_config.png" alt="select preset" width="750"/>
Binary file added public/img/click_sparql_queryoperators.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/confirm_delete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/export_config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/select_preset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.