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(stark-all): improve Stark documentation #429

Merged

Conversation

Mallikki
Copy link
Contributor

@Mallikki Mallikki commented Jun 11, 2018

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[x] Documentation content changes
[ ] Other... Please describe:

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?

[ ] Yes
[x] No

Other information

@coveralls
Copy link

coveralls commented Jun 11, 2018

Coverage Status

Coverage remained the same at 94.247% when pulling 14cb90f on Mallikki:feature/documentation into 3bd3eba on NationalBankBelgium:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) to 94.246% when pulling cc6d0e0 on Mallikki:feature/documentation into 0ced55c on NationalBankBelgium:master.

@Mallikki Mallikki force-pushed the feature/documentation branch from cc6d0e0 to 3fa9ec7 Compare June 11, 2018 10:39
@Mallikki Mallikki requested a review from christophercr June 11, 2018 10:40
@Mallikki Mallikki force-pushed the feature/documentation branch from 3fa9ec7 to 9be0321 Compare June 11, 2018 13:35
@Mallikki Mallikki mentioned this pull request Jun 11, 2018
5 tasks
@Mallikki Mallikki force-pushed the feature/documentation branch from e68a744 to bbd096f Compare June 11, 2018 14:19
@@ -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)
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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.
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

formatting...

@Mallikki Mallikki force-pushed the feature/documentation branch 2 times, most recently from 8323f8c to b94ee68 Compare June 12, 2018 15:20
@dsebastien dsebastien added this to the 10.0.0-alpha.3 milestone Jun 12, 2018
@Mallikki Mallikki force-pushed the feature/documentation branch 2 times, most recently from ac5e4b2 to 7bd4c37 Compare June 18, 2018 08:00
@Mallikki Mallikki changed the title docs(core): improved documentation of stark-core docs(core): improved documentation Stark Jun 18, 2018
@Mallikki Mallikki force-pushed the feature/documentation branch from 7bd4c37 to 2f1fda5 Compare June 18, 2018 11:22
}
],
"jsdoc-format": [true, "check-multiline-start"],
"no-redundant-jsdoc": true
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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 */
Copy link
Collaborator

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*/
Copy link
Collaborator

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*/
Copy link
Collaborator

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*/
Copy link
Collaborator

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*/
Copy link
Collaborator

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*/
Copy link
Collaborator

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 ;)

@christophercr
Copy link
Collaborator

@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:
https://palantir.github.io/tslint/usage/rule-flags/

@Mallikki Mallikki force-pushed the feature/documentation branch from 2f1fda5 to 19bbe48 Compare June 19, 2018 12:54
@Mallikki Mallikki force-pushed the feature/documentation branch from 19bbe48 to 14cb90f Compare June 20, 2018 15:22
@christophercr christophercr changed the title docs(core): improved documentation Stark docs(core): improve Stark documentation Jun 21, 2018
@christophercr christophercr changed the title docs(core): improve Stark documentation docs(stark-all): improve Stark documentation Jun 21, 2018
@christophercr christophercr merged commit d93d64b into NationalBankBelgium:master Jun 21, 2018
@Mallikki Mallikki deleted the feature/documentation branch October 16, 2018 13:46
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.

4 participants