-
Notifications
You must be signed in to change notification settings - Fork 23
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(stark-all): improve Stark documentation #429
docs(stark-all): improve Stark documentation #429
Conversation
cc6d0e0
to
3fa9ec7
Compare
3fa9ec7
to
9be0321
Compare
e68a744
to
bbd096f
Compare
@@ -154,7 +154,7 @@ function initializeServer(server, backends) { | |||
* Default Stark request transformations: from Stark API REST specifics into json-server API specifics | |||
* @param req {*} The current request | |||
* @param res {*} The current response | |||
* @param next {Function} Function to call next middleware (should always be called at the end of the current middleware) | |||
* @param next: Function to call next middleware (should always be called at the end of the current middleware) |
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.
For JavaScript files I think we should leave the "{xyz}" types in params and returns, and in fact they are needed. The only place where we should remove them is from Typescript files ;)
export const starkLoginStateName: string = "starkAppInit.starkLogin"; | ||
/** | ||
* URL of the login state of the application |
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.
You can fix the formatting of this comment with Prettier ;)
@@ -1,4 +1,7 @@ | |||
import { TranslateService } from "@ngx-translate/core"; | |||
/** | |||
* _cloneDeep function, used to clone native and primitive types |
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 is no need to comment this kind of functions (all the ones from Lodash), we can simply skip them by just putting @ignore
@@ -131,26 +136,26 @@ export interface StarkApplicationConfig { | |||
|
|||
/** | |||
* Get a back-end by name | |||
* @param name - Name of the back-end object to get | |||
* @param name : Name of the back-end object to get |
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 suggest we use a hyphen (-) instead of a colon (:) before the description of the parameter, so we align to the JSDoc standard says ;) http://usejsdoc.org/tags-param.html
@@ -169,10 +171,20 @@ export class StarkApplicationConfigImpl implements StarkApplicationConfig { | |||
return this.backends; | |||
} | |||
|
|||
/** | |||
* If keepAlive is used in the application, the value of keepAliveDisabled is set to false |
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.
Perhaps this could describe it better:
"Check whether the keepAlive option in the StarkApplicationConfig is disabled"
and the '@returns' would be almost the same
@@ -1,3 +1,6 @@ | |||
/** | |||
* Class used to validate that other classes are not undefined and/or not |
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.
Perhaps this can be like;
"Class containing utils to be used for class validation decorators of the 'class-validator' library"
export interface StarkValidator extends Validator { | ||
/** | ||
* Function that allows the developer to set a minimum and/or maximum of selected items. |
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.
"Validates that the size of the given array is between the minimum and maximum limits defined" ;)
export const starkIsBICValidatorName: string = "starkIsBIC"; | ||
|
||
/** | ||
* @ignore |
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.
Maybe we can move or copy this block to the place where this function is documented, cause this info seems to be important to undertand how this validation works
export const starkIsISINValidatorName: string = "starkIsISIN"; | ||
|
||
/** | ||
* @ignore |
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.
Maybe we can move or copy this block to the place where this function is documented, cause this info seems to be important to undertand how this validation works
starter/src/app/app.module.ts
Outdated
const metadata: any = require("../stark-app-metadata.json"); | ||
|
||
return Deserialize(metadata, StarkApplicationMetadataImpl); | ||
} | ||
|
||
// TODO: where to put this factory function? | ||
/** | ||
* This method can be used to create and retrieve mock data |
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.
formatting...
8323f8c
to
b94ee68
Compare
ac5e4b2
to
7bd4c37
Compare
7bd4c37
to
2f1fda5
Compare
} | ||
], | ||
"jsdoc-format": [true, "check-multiline-start"], | ||
"no-redundant-jsdoc": true |
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 these 3 new rules should be also added to these packages:
- stark-core
- stark-ui
- starter
This is becasue the "npm run lint:all" script that is executed in Travis will lint all those packages separately ;)
export function initializeTranslation(translateService: TranslateService): void { | ||
translateService.addLangs(["en", "fr", "nl"]); | ||
translateService.setDefaultLang("en"); | ||
translateService.use("nl"); | ||
|
||
/** | ||
* The English StarkLocal, composed of the "en" language code |
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: "StarkLocal" => "StarkLocale"
const english: StarkLocale = { languageCode: "en", translations: translationsEn }; | ||
/** | ||
* The French StarkLocal, composed of the "fr" language code |
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: "StarkLocal" => "StarkLocale"
const french: StarkLocale = { languageCode: "fr", translations: translationsFr }; | ||
/** | ||
* The Dutch StarkLocal, composed of the "nl" language code |
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: "StarkLocal" => "StarkLocale"
@@ -1,3 +1,4 @@ | |||
/* tslint:disable */ |
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.
Let's avoid disabling tslint completely because then all rules will be disabled for this file.
So we should just disable those rules that are not needed/relevant in this case.
For example: /* tslint:disable:rule1 rule2 ruleN */
@@ -1566,7 +1565,7 @@ describe("Builder: StarkHttpRequestBuilder", () => { | |||
undefinedField: null // due to Serialize => with undefined returns null | |||
// emptyField: undefined // empty values are omitted | |||
}); | |||
/* tslint:enable */ | |||
/*tslint:disable:completed-docs*/ |
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 you mean this: /* tslint:enable */
which will enable all rules again
@@ -1,7 +1,10 @@ | |||
/* tslint:disable completed-docs*/ |
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.
The correct format is: /* tslint:disable:completed-docs */
otherwise all rules are disabled ;)
@@ -1,11 +1,14 @@ | |||
/* tslint:disable completed-docs*/ |
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.
The correct format is: /* tslint:disable:completed-docs */
otherwise all rules are disabled ;)
@@ -1,8 +1,11 @@ | |||
/* tslint:disable completed-docs*/ |
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.
The correct format is: /* tslint:disable:completed-docs */
otherwise all rules are disabled ;)
@@ -1,10 +1,13 @@ | |||
/* tslint:disable completed-docs*/ |
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.
The correct format is: /* tslint:disable:completed-docs */
otherwise all rules are disabled ;)
@Mallikki Just some small changes to do regarding the disabling of tslint. You can see here the different ways to disable tslint depending on what you need: |
2f1fda5
to
19bbe48
Compare
19bbe48
to
14cb90f
Compare
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Previously, there was not a lot of documentation on the project. Compodoc stated that only 20% of the project was properly documented.
What is the new behavior?
The documentation covers now 94% of the project.
Does this PR introduce a breaking change?
Other information