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

[CLI] Improve readme of a new project #4981

Closed
wants to merge 2 commits into from
Closed
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
8 changes: 4 additions & 4 deletions packages/cli/generators/app/templates/public/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/x-icon" href="https://loopback.io/favicon.ico">
<link rel="shortcut icon" type="image/x-icon" href="//loopback.io/favicon.ico">

<style>
h3 {
Expand Down Expand Up @@ -57,15 +57,15 @@
<body>
<div class="info">
<h1><%= project.name %></h1>
<p>Version <%= project.version || '1.0.0' %></p>
<p>Version <%= project.version || '0.0.1' %></p>

<h3>OpenAPI spec: <a href="/openapi.json">/openapi.json</a></h3>
<h3>API Explorer: <a href="/explorer">/explorer</a></h3>
</div>

<footer class="power">
<a href="https://loopback.io" target="_blank">
<img src="https://loopback.io/images/branding/powered-by-loopback/blue/powered-by-loopback-sm.png" />
<a href="//loopback.io" target="_blank">
<img src="//loopback.io/images/branding/powered-by-loopback/blue/powered-by-loopback-sm.png" />
</a>
</footer>
</body>
Expand Down
51 changes: 50 additions & 1 deletion packages/cli/generators/project/templates/README.md.ejs
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
# <%= project.name %>

[![LoopBack](https://github.com/strongloop/loopback-next/raw/master/docs/site/imgs/branding/Powered-by-LoopBack-Badge-(blue)[email protected])](http://loopback.io/)
<% if (project.description) { -%>
> <%= project.description %>
<% } -%>

This project was generated with [Loopback CLI](https://github.com/strongloop/loopback-next/tree/master/packages/cli) version <%= cliVersion %>.
frbuceta marked this conversation as resolved.
Show resolved Hide resolved

## First Steps

### Starting the application

Starting the application is as easy as:

```sh
npm start
```

### Using CLI Commands

Refer to [Command-line interface](https://loopback.io/doc/en/lb4/Command-line-interface.html) for the full list of LoopBack 4 commands.

### Adding Additional Dependencies
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to mention lb4 upgrade to handle project dependency upgrade for newer LB versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is currently documented at this link


Executing CLI commands will automatically update the dependencies in your package.json file and install them.

If you need to install additional dependencies or dev dependencies, do so with

```sh
npm install --save
```

frbuceta marked this conversation as resolved.
Show resolved Hide resolved
or

```sh
npm install --save-dev
```

The commands above will update the dependencies in your package.json file and install them.

## Learn More
frbuceta marked this conversation as resolved.
Show resolved Hide resolved

To learn more about LoopBack 4, please refer to our [documentation](https://loopback.io/doc/en/lb4/). The developer guide can be found [here](https://github.com/strongloop/loopback-next/blob/master/docs/site/DEVELOPING.md).

> We also encourage the community helping each other out!<br />
We encourage the community to help each other out!

## Support
frbuceta marked this conversation as resolved.
Show resolved Hide resolved

For community support, open an issue on [LoopBack repository](https://github.com/strongloop/loopback-next). You can also join the [LoopBack Slack workspace](http://loopbackio.slack.com/) via [this invitation link](https://join.slack.com/t/loopbackio/shared_invite/zt-8lbow73r-SKAKz61Vdao~_rGf91pcsw). We also encourage the community helping each other out!
frbuceta marked this conversation as resolved.
Show resolved Hide resolved

[![LoopBack](https://github.com/strongloop/loopback-next/raw/master/docs/site/imgs/branding/Powered-by-LoopBack-Badge-\(blue\)[email protected])](http://loopback.io/)
2 changes: 1 addition & 1 deletion packages/cli/generators/project/templates/package.json.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "<%= project.name -%>",
"version": "1.0.0",
"version": "0.0.1",
"description": "<%= project.description -%>",
"keywords": [
"loopback-<%= project.projectType -%>",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "<%= project.name -%>",
"version": "1.0.0",
"version": "0.0.1",
"description": "<%= project.description -%>",
"keywords": [
"loopback-<%= project.projectType -%>",
Expand Down
1 change: 1 addition & 0 deletions packages/cli/lib/project-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ module.exports = class ProjectGenerator extends BaseGenerator {
this.destinationPath(''),
{
project: this.projectInfo,
cliVersion,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is cliVersion used in a template?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I am putting a message similar to what Angular says when you create a project with "this has been generated with Loopback CLI version X"

Copy link
Contributor

Choose a reason for hiding this comment

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

Please note we already captures cli version in .yo-rc.json.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know, this that I am putting in the README file only has a visual and informative character. It has no other functionality

Copy link
Contributor

Choose a reason for hiding this comment

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

@frbuceta , thank you for this PR. It is a good idea to add more content to this readme.

},
);

Expand Down