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: move documentation into monorepo #1100

Merged
merged 1 commit into from
Mar 12, 2018
Merged

Conversation

kjdelisle
Copy link
Contributor

@kjdelisle kjdelisle commented Mar 7, 2018

Migrate the existing lb4 files under the docs folder of the monorepo

connected to #988

Checklist

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • Related API Documentation was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in packages/example-* were updated

@virkt25
Copy link
Contributor

virkt25 commented Mar 8, 2018

  1. I would like to preserve language folders under docs, so these files should be in docs/en/
  2. Do we have the necessary infrastructure in place for changes made to docs to be propagated to loopback.io automatically? (I'm aware of the scripts we have, but I thought there were still issues to work out?).

@raymondfeng
Copy link
Contributor

Maybe a simple way to propagate docs into loopback.io repo is git submodule

@kjdelisle
Copy link
Contributor Author

I would like to preserve language folders under docs, so these files should be in docs/en/

We already write the docs in English first and then have them translated after the fact. Is that not something we can do in the loopback.io repository? Technically, our doc structure is pages/en/lb4/*, so doing that would ruin the drop-in compatibility of this approach.

By using the docs folder in this way, we can rework the doc site to pull from the docs folder underneath and that would be all we'd need to do. Translation could then subsequently target the pages/en/lb4/* folders and subfolders to find all translatable content.

Do we have the necessary infrastructure in place for changes made to docs to be propagated to loopback.io automatically? (I'm aware of the scripts we have, but I thought there were still issues to work out?).

Gotta start somewhere!

@kjdelisle kjdelisle force-pushed the move-docs-into-monorepo branch 2 times, most recently from 1885fcd to 7974746 Compare March 8, 2018 19:44
@virkt25
Copy link
Contributor

virkt25 commented Mar 8, 2018

I just figured it might be easier for the translations to live in the same place as well.

@raymondfeng I remember looking at git submodules as an option some time ago and it just requires everyone checking out the monorepo to be aware of those commands and running them ... but maybe all we need to do it automate it under the bootstrap script. The PR opens under loopback.io still though right? Is that what we want?

Copy link
Contributor

@shimks shimks left a comment

Choose a reason for hiding this comment

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

There's some missed html to md changes

docs/Concepts.md Outdated
- [**Dependency Injection**](Dependency-injection.md): Technique that separates the construction of dependencies of a class or function from its behavior, to keep the code loosely coupled.
- [**Controller**](Controllers.md): Class that implements operations defined by application’s REST API. It implements an application’s business logic and acts as a bridge between the HTTP/REST API and domain/database models. A Controller operates only on processed input and abstractions of backend services / databases.
- [**Route**](Routes.md): Mapping between your API specification and an Operation (JavaScript implementation). It tells LoopBack which function to invoke() given an HTTP request.
- [**Sequence**](Sequence.md): A stateless grouping of [Actions](Sequence.html#actions) that control how a Server responds to requests.
Copy link
Contributor

Choose a reason for hiding this comment

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

Sequence.md

docs/Concepts.md Outdated
- [**Repository**](Repositories.md): Type of Service that represents a collection of data within a DataSource.
- [**Decorator**](Decorators.md): Enables you to annotate or modify your class declarations and members with metadata.
- **Component**: A package that bundles one or more Loopback extensions.
- See [Using components](Using-components.html) and [Creating components](Creating-components.md) for more information.
Copy link
Contributor

Choose a reason for hiding this comment

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

Using-components.md

});
```

See [Validate your OpenAPI specification](Testing-your-application.html#validate-your-openapi-specification) from [Testing your application](Testing-your-application.md) for more details.
Copy link
Contributor

Choose a reason for hiding this comment

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

.md

rpc-server: A basic RPC server using a made-up protocol.
```

Please follow the instructions in [Install LoopBack4 CLI](Getting-started.html#install-loopback-4-cli) if you don't have `lb4` installed yet.
Copy link
Contributor

Choose a reason for hiding this comment

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

.md

summary:
---

LoopBack 4 is the next generation of the LoopBack framework, with a completely rewritten core foundation and significantly improved programming model. If you're an existing LoopBack user, read [Crafting LoopBack 4](Crafting-LoopBack-4.html) to understand the motivations, strategy, and innovations behind this exciting new version.
Copy link
Contributor

Choose a reason for hiding this comment

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

.md


The idiomatic solution has two parts:

1. The component should define and bind a new [Sequence action](Sequence.html#actions), for example `authentication.actions.authenticate`:
Copy link
Contributor

Choose a reason for hiding this comment

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

.md


More often than not, the component may want to offer different value providers depending on the configuration. For example, a component providing an email API may offer different transports (stub, SMTP, and so on).

Components should use constructor-level [Dependency Injection](Context.html#dependency-injection) to receive the configuration from the application.
Copy link
Contributor

Choose a reason for hiding this comment

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

.md

Model decorator is a Class decorator.
In LoopBack 4, we inherit the model definition format from LoopBack 3,
you can find it in [Model definition JSON file](../lb3/Model-definition-JSON-file.md).
For usage examples, see [Define Models](Repositories.html#define-models)
Copy link
Contributor

Choose a reason for hiding this comment

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

.md

The property decorator defines metadata for a property on a Model definition.
The format of property definitions can be found in [Property definitions](../lb2/Model-definition-JSON-file.html#properties)

For usage examples, see [Define Models](Repositories.html#define-models)
Copy link
Contributor

Choose a reason for hiding this comment

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

.md

This decorator either injects an existing repository or creates a repository
from a model and a datasource.

The injection example can be found in [Repository#controller-configuration](Repositories.html#controller-configuration)
Copy link
Contributor

Choose a reason for hiding this comment

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

.md

The model decorator can be used without any additional parameters, or can be
passed in a
<!-- should be replaced with a lb4 example when possible -->
[ModelDefinitionSyntax](https://loopback.io/doc/en/lb3/Model-definition-JSON-file.html)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not really a part of the issue you're addressing, but can we change the link to (../lb3/Model-definition-JSON-file.html) so that it visits the local page?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already spoke about it, but I'm commenting for posterity.

The lb3 folder won't be present in the monorepo, so the links need to be absolute so that they work both from the repository directly, and from loopback.io.

@kjdelisle kjdelisle force-pushed the move-docs-into-monorepo branch from bef12c7 to 144d226 Compare March 9, 2018 16:47
Copy link
Contributor

@b-admike b-admike left a comment

Choose a reason for hiding this comment

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

👏

Copy link
Contributor

@shimks shimks left a comment

Choose a reason for hiding this comment

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

There's still some links that use relative paths.


The diagram below shows how the Context manages services and their dependencies.

![loopback-ioc](/images/lb4/loopback-ioc.png)
Copy link
Contributor

Choose a reason for hiding this comment

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

Relative path


2. Services can be organized as extension points and extensions. For example, to allow multiple authentication strategies, the `authentication` component can define an extension point as `authentication-manager` and various authentication strategies such as user/password, LDAP, oAuth2 can be contributed to the extension point as extensions. The relation will look like:

![loopback-extension](/images/lb4/loopback-extension.png)
Copy link
Contributor

Choose a reason for hiding this comment

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

Relative path


The interaction between the application context and `UserManagement` component is illustrated below:

![loopback-component](/images/lb4/loopback-component.png)
Copy link
Contributor

Choose a reason for hiding this comment

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

Relative path

@jannyHou
Copy link
Contributor

jannyHou commented Mar 9, 2018

A question may not directly related to this PR, but could affects the PRs afterwards:

By "propagating docs", does it mean we always synchronize the docs in loopback-next/docs and loopback.io bi-directions(loopback.io <--> loopback-next/docs) or just one direction(loopback-next/docs --> loopback.io)?

@virkt25
Copy link
Contributor

virkt25 commented Mar 11, 2018

@jannyHou It should be a one way sync, loopback-next/docs => loopback.io.

Gotta start somewhere!

I agree! And this is a great effort. I guess my concern is along the lines of till we have the synchronization in place, where should the docs changes be made (here or in loopback.io).

@kjdelisle kjdelisle force-pushed the move-docs-into-monorepo branch 2 times, most recently from 893d685 to b08cefc Compare March 12, 2018 17:57
Migrate the existing lb4 files under the docs folder of the monorepo
@kjdelisle
Copy link
Contributor Author

By "propagating docs", does it mean we always synchronize the docs in loopback-next/docs and loopback.io bi-directions(loopback.io <--> loopback-next/docs) or just one direction(loopback-next/docs --> loopback.io)?

Monodirectional, from this repository to loopback.io.

@kjdelisle kjdelisle merged commit e2be3a8 into master Mar 12, 2018
@kjdelisle kjdelisle deleted the move-docs-into-monorepo branch March 12, 2018 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants