-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 CONTRIBUTING, DEVELOPING and VSCODE #977
Conversation
docs/CONTRIBUTING.md
Outdated
7. Open "Tasks" OUTPUT window and verify that compilation error was parsed by VSCode. | ||
|
||
8. Verify that compilation errors are correctly associated with the problematic source code line. | ||
_(2018-02-82: this is does not work now, `tsc` is reporting paths relative to individual package directories.)_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW: this used to work before, I suspect #682 broke it.
The trick is that we need to run tsc
from the root monorepo directory.
Under the hood, we change the current directory to loopback-next root
and call tsc with project configuration from the original package's
tsconfig.build.json. This way tsc error messages contain a path
that's relative to loopback-next project root.
'-p',
// It's important to keep this path relative to rootDir
path.join(packageDir, 'tsconfig.build.json'),
I have some ideas how to fix this (basically introduce a new lb-tsc
argument like -r ../..
that will control the working directory of tsc
), but I prefer to leave such changes out of this documentation-only pull request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good content to prevent regressions but the entire document seems very VSCode oriented and very intensive for any non-VSCode users (I was thinking of going back to SubLime :P).
Looking at most Open Source projects, CONTRIBUTING.md
is a place to walk users through the setup of the repo locally (install, bootstrap, etc.) and commit guidelines, naming conventions, etc. I think we need to have a new doc for VSCODE.md
or something. I don't like a project being so rigorous on maintaining editor config / compatibility because it will deter contributors who may not want to use VSCode / have VSCode.
I think this is something we can look for in Reviews and test ourselves and update if needed. A best practices / guidance doc for this content in a separate file is fine though. Just don't think it should be part of CONTRIBUTING.md
.
Thank you @virkt25 for a thoughtful comment. I fully agree with you I am a long time user of ViM which I still basically for everything except As I was thinking about this a bit more, I agree with your that most of my |
18d77ca
to
72b0bc5
Compare
@virkt25 I reorganized the content and add more details, PTAL again. @strongloop/sq-lb-apex @strongloop/loopback-next This pull request is starting CONTRIBUTING, DEVELOPERS and VSCODE guides, please take a look and let me know if you have any feedback. I'd like to keep the scope of this pull request small please. IMO, an incomplete guide is better than no guide. Let's land something meaningful quickly and then we can incrementally add more content as needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! I’m still reviewing. Posting this since it’s from my phone. Will go over rest on my laptop.
docs/CONTRIBUTING.md
Outdated
@@ -0,0 +1,41 @@ | |||
# Contributing to LoopBack | |||
|
|||
Contributions to Node.js include code, documentation, answering user questions, and advocating for all types of Node.js users. See our official documentation on loopback.io for more information common to all of our GitHub repositories: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Contributing to LoopBack!
docs/CONTRIBUTING.md
Outdated
## [Contributing code](http://loopback.io/doc/en/contrib/code-contrib.html) | ||
|
||
Pull Requests are the way concrete changes are made to the code, documentation | ||
and tools contained in LoopBack repositories. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is on a new line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good!! Just a few suggestions.
docs/CONTRIBUTING.md
Outdated
- [Using Jekyll](http://loopback.io/doc/en/contrib/jekyll_getting_started.html) | ||
- [Authoring pages](http://loopback.io/doc/en/contrib/pages.html) | ||
- [Translations](http://loopback.io/doc/en/contrib/translation.html) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking we might need to add the commit message guidelines to here as well.
e.g. https://loopback.io/doc/en/contrib/git-commit-messages.html
There were quite a number of doc PRs at the end of last year that failed in the commit linter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LoopBack Next uses different rules for commit messages and @bajtos has included details for that in DEVELOPING.md
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the doc PR is in loopback.io, I think the commit message guideline from https://loopback.io/doc/en/contrib/git-commit-messages.html is still valid.
But yes, if it's from one of the READMEs, then it will follow the one in loopback-next.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am going to add a link to that other page too.
[Git commit messages](./DEVELOPING.md#commit-message-guidelines) (Note that other repositories like [strongloop/loopback.io](https://github.com/strongloop/loopback.io) use a different [convention](https://loopback.io/doc/en/contrib/git-commit-messages.html).)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the second thought, I am going to revert the change mentioned in my previous comment and move the link to loopback.io commit message guidelines to the actual text in DEVELOPING.md file. A new commit will come shortly.
docs/CONTRIBUTING.md
Outdated
Pull Requests are the way concrete changes are made to the code, documentation | ||
and tools contained in LoopBack repositories. | ||
|
||
- [Setting up development environment](./DEVELOPING.md#setting-up-development-environment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since most of the links are coming from DEVELOPING.md
, I wonder if we could group them to a category sth like "what you need to know to develop LB". It might be more convenient to the users to go to that link and read rather than going to each link and basically pointing to the same page.
Maybe it's just me...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually like the separate links (even though they are all pointing to the same page).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is my point of view:
- "what you need to know to develop LB" is already grouped in
DEVELOPING.md
. Users wishing to read everything about DEVELOPING in one go can already read that file! - I could shorten this list and replace all items pointing to different sections of DEVELOPING with a single link pointing to that file, but I think that's worse user experience because users cannot quickly jump from CONTRIBUTING to a relevant section in DEVELOPING.
I see two kinds of users:
- Jane would like to learn everything about developing loopback-next in one go. She can open DEVELOPING file and read through it.
- Joe prefers to jump to the code and read only as much as is needed. Links in CONTRIBUTING makes it easier for him to see what different topics are available and choose to read only what's relevant for him.
FWIW, Node.js uses similar approach in their CONTRIBUTING.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
we recommend to do a full reinstall of all npm dependencies: | ||
|
||
```sh | ||
$ npm run clean:lerna && npm run bootstrap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think running just clean with bootstrap is fine. npm run clean && npm run bootstrap
. Any reason to use clean:lerna
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clean:lerna
removes node_modules
files in all package folders (something like rm -rf packages/*/node_modules
).
I vaguely remember having issues with dependency setup that were resolved by removing all node_modules folders.
If this is no longer a problem, then I am happy to change this line as you suggested.
@raymondfeng could you please chime in? AFAICT, clean:lerna
was added by you in f1e59a2, which says:
This change fixes the issue that
npm run release
fails if a new package is added to the monorepo before bootstrap is done. The new package doesn't have dependencies installed yet.
Can we safely assume that clean:lerna
script is needed only for the release process?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clean:lerna
is mostly for release
but it is also helpful in certain situations to force a fresh bootstrap
.
docs/CONTRIBUTING.md
Outdated
Pull Requests are the way concrete changes are made to the code, documentation | ||
and tools contained in LoopBack repositories. | ||
|
||
- [Setting up development environment](./DEVELOPING.md#setting-up-development-environment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually like the separate links (even though they are all pointing to the same page).
docs/DEVELOPING.md
Outdated
TypeScript too. | ||
|
||
- [VisualStudio Code](./VSCODE.md) | ||
- _Missing your favorite IDE/editor here? Pull requests are welcome!_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the second thought, I am going to rewrite and expand the sentence Pull requests are welcome!
, it has built negative connotations over the years.
docs/DEVELOPING.md
Outdated
|
||
#### scope | ||
|
||
The **scope** must be a list of one or more packages contained in this monorepo. Eeach scope name must match a directory name in [packages/](../packages), e.g. `core` or `context`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eeach
woops
72b0bc5
to
3b72ced
Compare
Thank you @virkt25 @dhmlau and @richardpringle for your comments! I have rebase this patch on top of the latest master (50cfbcc) and addressed your comments in 3b72ced. On the second thought, I decided to move LGTY now? |
docs/VSCODE.md
Outdated
7. Open "Tasks" OUTPUT window and verify that compilation error was parsed by VSCode. | ||
|
||
8. Verify that compilation errors are correctly associated with the problematic source code line. | ||
_(2018-02-82: this is does not work now, `tsc` is reporting paths relative to individual package directories.)_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo if 2018-02-82
is a date here. I suggest we link it to an issue, but if it's fixed, we can get rid of this message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix. I opened #1010 to keep track of this bug.
docs/VSCODE.md
Outdated
|
||
#### Refactoring in VS Code | ||
|
||
Verify that refactorings like "rename" will change all places using the renamed entity. Two different scenarios to verify: rename at the place where the entity is defined, rename at the place where the entity is used. (You can e.g. rename `inject` to test.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for beginners saying rename symbol
or F2 might be better than rename.
docs/apidocs.html
Outdated
<h2>LoopBack4 packages (local)</h2> | ||
|
||
<p>Run the following command to (re)build API doc files: | ||
<p><pre><code>$ lerna run build:apidocs</code></pre> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably should use npx lerna run build:apidocs
or add a script to top level package.json.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I have ./node_modules/.bin
in my PATH and my Bash configured to run npx
for commands not found, but I agree that's not something we can rely on in our docs.
FYI : #1005. Feel free to reference it. |
Add a short CONTRIBUTING.md file serving as a collection of links pointing to other documentation. Start a guide for developers in DEVELOPING.md. Describe VS Code setup in VSCODE.md, document steps needed to verify integration with tsc and tslint. Add docs/apidocs.html as an index file pointing to apidoc files of individual monorepo packages.
34ec48f
to
33c93fa
Compare
I'll open a new pull request for that, I really want to get this one merged - it has been in progress for too long to my taste. |
Start a guide for contributors in a place that's recognized by GitHub - add a short CONTRIBUTING.md file serving as a collection of links pointing to other documentation.
Start a guide for developers in DEVELOPING.md.
Describe VS Code setup in VSCODE.md, document steps needed to verify
integration with tsc and tslint.
Add docs/apidocs.html as an index file pointing to apidoc files of individual monorepo packages.
This work is loosely related to #950 and #574. Even though it is not in MVP scope, I think it's very important for us internally, to avoid regressions like the one introduced by #964
I am intentionally not wrapping lines at 80 characters, because this content will be rendered by GitHub and such line-breaks would be preserved in the rendered output.
The text is inspired by the following guides:
Checklist
npm test
passes on your machinepackages/cli
were updatedpackages/example-*
were updated