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

Auto submodules, auto workspaces, build on install; support standard build call #87

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@knodes/typedoc-plugins",
"version": "0.22.5",
"version": "0.22.6",
"description": "A monorepo containing all knodes-published TypeDoc plugins",
"license": "MIT",
"private": true,
Expand All @@ -24,6 +24,8 @@
"./packages/*"
],
"scripts": {
"postinstall": "git submodule update --init --recursive && npm i --workspaces && npm run projects:build",
"build": "npm run projects:build",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
"docs": "typedoc",
"format:pkg": "format-package --write",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-pages/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class PagesPlugin extends ABasePlugin {
}

/**
* This method is called after the plugin has been instanciated.
* This method is called after the plugin has been instantiated.
*/
public override initialize(){
const opts = this.pluginOptions.getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ describe( APageTreeBuilder.name, () => {
matchReflection( PageReflection, { name: 'Baz', depth: 0, module: testHost.project, sourceFilePath: 'baz.md', content: 'Baz content', url: 'baz.html' } ),
] );
} );
it( 'should map hidden item', () => {
setVirtualFs( {
'foo.md': 'Foo content'
} );
const out = testHost.mapPagesToReflections( [ { title: 'HIDDEN', source: 'foo.md' } ] );
expect( out ).toHaveLength( 1 );
} );
Copy link
Author

Choose a reason for hiding this comment

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

I find this test extremely suspect, and I doubt it

I have trouble understanding your structure because I'm not clear on what a "reflection" is

Copy link
Member

@GerkinDev GerkinDev Jun 16, 2022

Choose a reason for hiding this comment

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

A refkection is none of my concept : it's directly inherited from typedoc structure, which is a pain in the a**.
Basically any objects in your project, frol the project itself, to const, symboks, type defs, & anything that is output to the docs is a reflection.

it( 'should map page with children', () => {
setVirtualFs( {
'foo.md': 'Foo content',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ export abstract class APageTreeBuilder implements IPageTreeBuilder {
}
this.project.registerReflection( nodeReflection );
this.addNodeToProjectAsChild( nodeReflection );
// strip a hidden node, but *after* adding its source to the project as a child
if( node.title === 'HIDDEN' ){
return node.children ?
this._mapPagesToReflections( node.children, parent, childrenIO ) :
[];
}
Copy link
Author

Choose a reason for hiding this comment

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

I'm genuinely not clear on whether this actually works. Once building works again, I'll go kick it until it plays nice

const children = node.children ?
this._mapPagesToReflections(
node.children,
Expand Down