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 project layout ref page #6151

Merged
merged 1 commit into from
Aug 26, 2020
Merged

docs: add project layout ref page #6151

merged 1 commit into from
Aug 26, 2020

Conversation

agnes512
Copy link
Contributor

@agnes512 agnes512 commented Aug 19, 2020

Closes #4847. See LB3 version for reference.

image

Checklist

  • DCO (Developer Certificate of Origin) signed in all commits
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

@agnes512 agnes512 force-pushed the pj-layout branch 2 times, most recently from 459ea61 to 12f58c3 Compare August 20, 2020 16:38
Copy link
Contributor Author

@agnes512 agnes512 left a comment

Choose a reason for hiding this comment

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

I am also not sure if the "How to access in code" part is sufficient. Please let me know how I can improve it.

docs/site/Project-layout-reference.md Outdated Show resolved Hide resolved
docs/site/Project-layout-reference.md Outdated Show resolved Hide resolved
Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

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

Nice start! Let's improve few details please.

docs/site/Project-layout-reference.md Outdated Show resolved Hide resolved
</tr>
<tr>
<td><code>/node-modules</code> directory</td>
<td>Contains Node packages as specified as dependencies in <code>package.json</code>. Update with <code>npm install</code>.</td>
Copy link
Member

Choose a reason for hiding this comment

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

Update with npm install

npm install typically does not update dependencies, only install missing ones. npm update is the command to use.

docs/site/Project-layout-reference.md Outdated Show resolved Hide resolved
@agnes512 agnes512 force-pushed the pj-layout branch 2 times, most recently from 3df9d54 to 57c0cf3 Compare August 21, 2020 13:42
@agnes512 agnes512 marked this pull request as ready for review August 21, 2020 13:43
@agnes512 agnes512 requested a review from raymondfeng August 21, 2020 13:43
Copy link
Contributor

@jannyHou jannyHou left a comment

Choose a reason for hiding this comment

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

Nice contents LGTM.
A few suggestions:

  • Should we consider adding the configure files like tsconfig.json, /.vscode?
  • For the code reference, maybe we can link to the todo example? Or add a note before the table saying all the files could be found in todo example.

@agnes512
Copy link
Contributor Author

@jannyHou Added an entry for the tsconfig.json file and links to the Todo example, thanks!

Copy link
Contributor

@jannyHou jannyHou left a comment

Choose a reason for hiding this comment

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

Thanks I love the links! Nitpick: maybe also add link for the folders: controllers/, datasources/, models/, repositories/ for consistency.

Other than ^ LGTM 🚢

these sub-directories:

- `src` - Node application scripts and configuration files.
- `public` - Client JavaScript, HTML, and CSS files.
Copy link
Contributor

Choose a reason for hiding this comment

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

Client side assets (JavaScript, HTML, and CSS) for the default home page.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should mention dist - which contains transpiled JavaScript code generated by npm run build.

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 added dist folder under Top level app directory, PTAL.

directory_. Within this directory the standard LoopBack 4 project structure has
these sub-directories:

- `src` - Node application scripts and configuration files.
Copy link
Contributor

Choose a reason for hiding this comment

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

TypeScript source code

<td>A sub-directory for all repository files. See <a href="Repository.html">Repository</a>.</td>
<td>&nbsp;</td>
</tr>
<tr>
Copy link
Contributor

Choose a reason for hiding this comment

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

Should mention src/__tests__?


LoopBack 4 project files and directories are in the _application root
directory_. Within this directory the standard LoopBack 4 project structure has
these sub-directories:
Copy link
Contributor

Choose a reason for hiding this comment

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

We should mention the project layout was created by lb4 application command and new artifacts can be added by other lb4 commands or manually by application developers.

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 added CLI links to each artifact.

permalink: /doc/en/lb4/Project-layout-reference.html
---

LoopBack 4 project files and directories are in the _application root
Copy link
Contributor

Choose a reason for hiding this comment

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

We have two types of projects:

  • Application project (for LB4 applications)
  • Extension project (for LB4 extension modules)

Should we make it explicit this layout is for LB4 applications?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I can change the title as well if we need another page for extension project.

@agnes512 agnes512 force-pushed the pj-layout branch 2 times, most recently from 0946603 to 5889c94 Compare August 26, 2020 17:11
Copy link
Member

@dhmlau dhmlau left a comment

Choose a reason for hiding this comment

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

Thanks @agnes512. I have a few minor comments.

I'm not sure if we also want to cover files, e.g. dockerfile, vs code related files, that are generated depends the options users select when scaffolding the application. But either way, I'm happy to have this PR land the way it is and iterate on it.

docs/site/Loopback-application-layout-reference.md Outdated Show resolved Hide resolved
docs/site/Loopback-application-layout-reference.md Outdated Show resolved Hide resolved
docs/site/Loopback-application-layout-reference.md Outdated Show resolved Hide resolved
@@ -0,0 +1,129 @@
---
lang: en
title: 'LoopBack 4 Application Layout Reference'
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove Reference?

@agnes512 agnes512 merged commit 79f102c into master Aug 26, 2020
@agnes512 agnes512 deleted the pj-layout branch August 26, 2020 20:28
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.

[Docs] Add "project layout reference" page
5 participants