Skip to content

Commit c915c6e

Browse files
committed
fix(tsdocs): re-enable proper apidocs generation
- added workaround to re-enable generation of packages which use `MixinTarget<Application>` - fixed markdown hyperlinks inside HTML tables see: gettalong/kramdown#822 fixes: #10205 Signed-off-by: Rifa Achrinza <[email protected]>
1 parent a4926b8 commit c915c6e

File tree

9 files changed

+51
-15
lines changed

9 files changed

+51
-15
lines changed

extensions/typeorm/src/typeorm.mixin.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ import {
1515
LifeCycleObserver,
1616
MixinTarget,
1717
} from '@loopback/core';
18+
// `EventEmitter` required to allow tsdoc generation.
19+
// see: https://github.com/loopbackio/loopback-next/issues/10205
20+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
21+
import type {EventEmitter} from 'events';
1822
import debugFactory from 'debug';
1923
import {Connection, ConnectionManager, ConnectionOptions} from 'typeorm';
2024
import {TypeOrmConnectionBooter} from './';

package-lock.json

Lines changed: 25 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/boot/src/mixins/boot.mixin.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ import {
1616
createBindingFromClass,
1717
MixinTarget,
1818
} from '@loopback/core';
19+
// `EventEmitter` required to allow tsdoc generation.
20+
// see: https://github.com/loopbackio/loopback-next/issues/10205
21+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
22+
import type {EventEmitter} from 'events';
1923
import {BootComponent} from '../boot.component';
2024
import {createComponentApplicationBooterBinding} from '../booters/component-application.booter';
2125
import {Bootstrapper} from '../bootstrapper';

packages/express/src/middleware-registry.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import {
1010
Context,
1111
Provider,
1212
} from '@loopback/core';
13+
// `EventEmitter` required to allow tsdoc generation.
14+
// see: https://github.com/loopbackio/loopback-next/issues/10205
15+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
16+
import type {EventEmitter} from 'events';
1317
import {MiddlewareMixin} from './mixins/middleware.mixin';
1418
import {
1519
ExpressMiddlewareFactory,

packages/express/src/mixins/middleware.mixin.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
1+
// Copyright IBM Corp. and LoopBack contributors 2020-2025. All Rights Reserved.
22
// Node module: @loopback/express
33
// This file is licensed under the MIT License.
44
// License text available at https://opensource.org/licenses/MIT
@@ -12,6 +12,10 @@ import {
1212
MixinTarget,
1313
Provider,
1414
} from '@loopback/core';
15+
// `EventEmitter` required to allow tsdoc generation.
16+
// see: https://github.com/loopbackio/loopback-next/issues/10205
17+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
18+
import type {EventEmitter} from 'events';
1519
import {
1620
registerExpressMiddleware,
1721
registerMiddleware,

packages/repository/src/mixins/repository.mixin.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ import {
1414
createBindingFromClass,
1515
MixinTarget,
1616
} from '@loopback/core';
17+
// `EventEmitter` required to allow tsdoc generation.
18+
// see: https://github.com/loopbackio/loopback-next/issues/10205
19+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
20+
import type {EventEmitter} from 'events';
1721
import debugFactory from 'debug';
1822
import {Class} from '../common-types';
1923
import {SchemaMigrationOptions} from '../datasource';

packages/service-proxy/src/mixins/service.mixin.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ import {
1414
Provider,
1515
ServiceOptions,
1616
} from '@loopback/core';
17+
// `EventEmitter` required to allow tsdoc generation.
18+
// see: https://github.com/loopbackio/loopback-next/issues/10205
19+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
20+
import type {EventEmitter} from 'events';
1721

1822
/**
1923
* Interface for classes with `new` operator.

packages/tsdocs/src/monorepo-api-extractor.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,6 @@ export async function runExtractorForMonorepo(options: ExtractorOptions = {}) {
6767
const errors: Record<string, unknown> = {};
6868

6969
for (const pkg of packages) {
70-
// TODO: api-extractor failed to generate apidocs for the repos below.
71-
// Excluding them for now
72-
// https://github.com/loopbackio/loopback-next/issues/10205
73-
if (
74-
pkg.name === '@loopback/typeorm' ||
75-
pkg.name === '@loopback/boot' ||
76-
pkg.name === '@loopback/express' ||
77-
pkg.name === '@loopback/repository' ||
78-
pkg.name === '@loopback/service-proxy'
79-
)
80-
continue;
8170
/* istanbul ignore if */
8271
const err = invokeExtractorForPackage(pkg, options);
8372
if (err != null) {

packages/tsdocs/src/update-api-md-docs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ async function addJekyllMetadata(
8585

8686
const docFile = path.join(apiDocsRoot, f);
8787
let doc = await fs.readFile(docFile, 'utf-8');
88+
doc = doc.replace(/<td>/g, '<td markdown="1">');
8889

8990
const pkgName = name.split('.')[0];
9091
// Calculate the relative uri for the package

0 commit comments

Comments
 (0)