diff --git a/.eslintrc.js b/.eslintrc.js index 471377a40..ffe9866a8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -7,11 +7,10 @@ module.exports = { }, plugins: [ 'import', - // 'jsdoc', + 'tsdoc', ], extends: [ '@concepta/eslint-config/nest', - // 'plugin:jsdoc/recommended', ], ignorePatterns: [ 'packages/*/dist/**', @@ -31,23 +30,7 @@ module.exports = { rules: { 'import/no-extraneous-dependencies': 'error', '@darraghor/nestjs-typed/param-decorator-name-matches-route-param': 'off', - // 'jsdoc/require-jsdoc': [ - // 'warn', - // { - // contexts: ['any', 'PropertyDefinition'], - // require: { - // ClassDeclaration: true, - // ClassExpression: true, - // MethodDefinition: true, - // FunctionDeclaration: true, - // FunctionExpression: true, - // }, - // }, - // ], - // 'jsdoc/require-description': ['warn', { contexts: ['any'] }], - // 'jsdoc/require-property-description': ['warn', { contexts: ['any'] }], - // 'jsdoc/require-param-type': 'off', - // 'jsdoc/require-returns': 'off', + 'tsdoc/syntax': 'warn', }, overrides: [ { @@ -62,6 +45,7 @@ module.exports = { rules: { '@darraghor/nestjs-typed/controllers-should-supply-api-tags': 'off', '@darraghor/nestjs-typed/api-method-should-specify-api-response': 'off', + 'tsdoc/syntax': 'off', }, }, ], diff --git a/.gitignore b/.gitignore index c1215e062..c0ad40327 100644 --- a/.gitignore +++ b/.gitignore @@ -107,3 +107,6 @@ dist .idea .DS_Store website/.yarn + +# generated docs +/docs diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 000000000..6cdaab7b7 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +yarn lint diff --git a/README.md b/README.md index ba96aa9db..a1fe0a933 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ -
- -
+![Rockets Logo](https://raw.githubusercontent.com/conceptadev/rockets/main/assets/rockets-icon.svg) # Rockets diff --git a/lerna.json b/lerna.json index f2275edcc..34a8b645e 100644 --- a/lerna.json +++ b/lerna.json @@ -4,5 +4,5 @@ ], "useWorkspaces": true, "npmClient": "yarn", - "version": "4.0.0-alpha.47" + "version": "4.0.0-alpha.48" } diff --git a/package.json b/package.json index 8796f0a83..b872b35cf 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,6 @@ "devDependencies": { "@commitlint/cli": "^16.1.0", "@commitlint/config-conventional": "^16.0.0", - "@compodoc/compodoc": "^1.1.25", "@concepta/eslint-config": "^1.1.4", "@concepta/prettier-config": "^1.1.4", "@darraghor/eslint-plugin-nestjs-typed": "^3.20.5", @@ -30,9 +29,9 @@ "eslint": "^8.6.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.25.4", - "eslint-plugin-jsdoc": "^48.2.7", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^4.0.0", + "eslint-plugin-tsdoc": "^0.3.0", "husky": "^7.0.4", "jest": "27.4.7", "jest-junit": "^13.0.0", @@ -49,11 +48,13 @@ "ts-loader": "^9.2.3", "ts-node": "^10.0.0", "tsconfig-paths": "^3.10.1", + "typedoc": "^0.25.0", + "typedoc-plugin-coverage": "^3.2.0", "typeorm": "^0.3.0", "typescript": "^4.3.5" }, "scripts": { - "clean": "./node_modules/.bin/rimraf packages/*/dist packages/*/tsconfig.tsbuildinfo", + "clean": "./node_modules/.bin/rimraf packages/*/dist packages/*/tsconfig.tsbuildinfo docs", "build": "./node_modules/.bin/tsc --build", "watch": "yarn build && ./node_modules/.bin/tsc --build --watch", "lint": "eslint \"packages/*/src/**/*.{ts,js,json}\"", @@ -66,15 +67,11 @@ "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", "test:e2e": "jest --config ./jest.config-e2e.json --testTimeout 30000", "test:all": "yarn test && yarn test:e2e", - "doc": "rimraf ./documentation && compodoc -p ./tsconfig.doc.json --disablePrivate --disableProtected", - "doc:serve": "yarn doc -s", - "doc:watch": "yarn doc:serve -w", - "doc:cov": "yarn doc --coverageMinimumPerFile 90 --coverageTestThresholdFail false", - "doc:cov:ut": "yarn doc:cov --unitTestCoverage ./coverage/coverage-summary.json", - "doc:ci": "yarn doc:cov:ut --coverageTestThresholdFail true", + "doc": "rimraf ./docs && typedoc", + "doc:cov": "yarn doc --coverageOutputType all", "changelog": "standard-version", "changelog:minor": "standard-version --release-as minor", "changelog:patch": "standard-version --release-as patch", "changelog:major": "standard-version --release-as major" } -} \ No newline at end of file +} diff --git a/packages/nestjs-access-control/package.json b/packages/nestjs-access-control/package.json index 1c444db9c..1b04bbb3a 100644 --- a/packages/nestjs-access-control/package.json +++ b/packages/nestjs-access-control/package.json @@ -1,6 +1,6 @@ { "name": "@concepta/nestjs-access-control", - "version": "4.0.0-alpha.47", + "version": "4.0.0-alpha.48", "description": "Rockets NestJS Access Control", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -12,7 +12,7 @@ "dist/**/!(*.spec|*.e2e-spec|*.fixture).{js,d.ts}" ], "dependencies": { - "@concepta/nestjs-common": "^4.0.0-alpha.47", + "@concepta/nestjs-common": "^4.0.0-alpha.48", "@nestjs/common": "^9.0.0", "@nestjs/config": "^2.2.0", "@nestjs/core": "^9.0.0", diff --git a/packages/nestjs-access-control/src/decorators/access-control-create-many.decorator.ts b/packages/nestjs-access-control/src/decorators/access-control-create-many.decorator.ts index b975aeadf..f14f1f8fb 100644 --- a/packages/nestjs-access-control/src/decorators/access-control-create-many.decorator.ts +++ b/packages/nestjs-access-control/src/decorators/access-control-create-many.decorator.ts @@ -3,7 +3,7 @@ import { AccessControlCreateOne } from './access-control-create-one.decorator'; /** * Create many resource grant shortcut. * - * @param string resource The grant resource. + * @param string - resource The grant resource. */ export const AccessControlCreateMany = (resource: string) => AccessControlCreateOne(resource); diff --git a/packages/nestjs-access-control/src/decorators/access-control-create-one.decorator.ts b/packages/nestjs-access-control/src/decorators/access-control-create-one.decorator.ts index ba0b1156c..8ff6545bc 100644 --- a/packages/nestjs-access-control/src/decorators/access-control-create-one.decorator.ts +++ b/packages/nestjs-access-control/src/decorators/access-control-create-one.decorator.ts @@ -5,8 +5,8 @@ import { applyDecorators } from '@nestjs/common'; /** * Create one resource grant shortcut. * - * @param string resource The grant resource. - * @returns {ReturnTypeimplements EventInterface
@@ -37,15 +34,14 @@ export abstract class Event
/** * Expects return of payload * - * @type {R} - * @private + * @internal */ readonly expectsReturnOf!: R; /** * Event key. * - * @returns {string} The event key string. + * @returns The event key string. */ static get key(): string { return `${EVENT_MODULE_EVENT_KEY_PREFIX}${this.name}`; @@ -54,7 +50,7 @@ export abstract class Event
/** * Event key. * - * @returns {string} The event key string. + * @returns The event key string. */ get key(): string { return `${EVENT_MODULE_EVENT_KEY_PREFIX}${this.constructor.name}`; @@ -68,14 +64,14 @@ export abstract class Event
/** * Constructor * - * @param {EventPayload
} payload Payload to emit when the event is dispatched. + * @param payload - Payload to emit when the event is dispatched. */ constructor(payload?: EventPayload
); /** * Constructor * - * @param {EventPayload
} payload Payload to emit when the event is dispatched. + * @param payload - Payload to emit when the event is dispatched. */ constructor(payload: EventPayload
) { this._payload = payload; @@ -84,7 +80,7 @@ export abstract class Event
/** * Returns payload that was passed to the Event constructor. * - * @returns {EventPayload
} The payload. + * @returns The event payload. */ get payload(): EventPayload
{
return this._payload;
diff --git a/packages/nestjs-event/src/events/interfaces/event-class.interface.ts b/packages/nestjs-event/src/events/interfaces/event-class.interface.ts
index 2c3a6ed7a..13c66d6a4 100644
--- a/packages/nestjs-event/src/events/interfaces/event-class.interface.ts
+++ b/packages/nestjs-event/src/events/interfaces/event-class.interface.ts
@@ -6,7 +6,7 @@ import { EventKeyInterface } from './event-key.interface';
*/
export interface EventClassInterface } event The event being dispatched.
+ * @param event - The event being dispatched.
* @returns boolean Returns true if the event had listeners, false otherwise.
*/
sync (event: EventSyncInterface ): boolean {
@@ -104,8 +104,8 @@ export class EventDispatchService {
* }
* ```
*
- * @param {EventAsyncInterface } event The event being dispatched.
- * @returns {Promise