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 use new plugin #4

Open
wants to merge 4 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
9 changes: 8 additions & 1 deletion docs/getting_started/basics/exposing_components.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ For example:

By enabling this flag, this module will

* receive a module identifier in the form of `https://linkedsoftwaredependencies.org/bundles/npm/my-plugin`;
* receive a module identifier in the form of `https://linkedsoftwaredependencies.org/bundles/npm/my-plugin`; (`my-plugin` is your package `name`)
* expose its components if `components/components.jsonld` exists;
* expose its context if `components/context.json` exists;
* expose its components and config folder if `components/` or `config/` exist.
Expand All @@ -49,6 +49,13 @@ For instance, the `"lsd:module": true` is typically equivalent to:
If you however want to adapt any of the above default entries,
you can make use of the more advanced options below.

### Advanced: Using a new plugin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, this section talks about injecting components from another package into a given package.

Could you move this section to the end of this file, and create a new section on the same level as "Package.json discovery"? (##) Because it doesn't really fit into the package.json discussion IMO.

I would suggest renaming this section to something like "Injecting plugins across packages".


Project A uses components.js but some functionality is missing or lacking. Creating a Library that implements an interface or extends a class from Project A is an easy way to fix it's shortcomings.

To use this new functionality a new config is required. After copying an existing config it's time to add the new class where needed, also add the Library's context to the config file, something like `https://linkedsoftwaredependencies.org/bundles/npm/my-plugin/^1.0.0/components/context.jsonld`.
Project A needs the new Library as dependency so the new component is found by compenents.js.

### Advanced: Custom module URL

The URL of your module can be defined using `"lsd:module"`:
Expand Down
5 changes: 3 additions & 2 deletions docs/getting_started/basics/workflow_ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ These will be explained in detail in the following sections.

### 1. Setup module and component generation

Using the [`componentsjs-generator`](https://raw.githubusercontent.com/LinkedSoftwareDependencies/Components-Generator.js) tool,
Using the [`componentsjs-generator`](https://github.com/LinkedSoftwareDependencies/Components-Generator.js) tool,
our declarative components from our TypeScript classes.

**1. Install as a dev dependency**
Expand Down Expand Up @@ -62,8 +62,9 @@ Call `componentsjs-generator` as a npm script by adding a `scripts` entry to you

This is only a _recommended_ way of calling `componentsjs-generator`,
you are free to call it in a different way that better suits your pipeline.
By default, `componentsjs-generator` will output generated components into the `components/` directory.

Please refer to the README of [`componentsjs-generator`](https://raw.githubusercontent.com/LinkedSoftwareDependencies/Components-Generator.js)
Please refer to the README of [`componentsjs-generator`](https://github.com/LinkedSoftwareDependencies/Components-Generator.js)
for more details on how to change the default options of this tool.

**4. _(optional)_ Ignore generated components files**
Expand Down