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

Implement hidden nodes blind #89

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

StoneCypher
Copy link

@StoneCypher StoneCypher commented Jun 15, 2022

NOT READY FOR MERGE

Please merge #88 first

Some of this PR is actually from parent patch 88, and will disappear when it is merged

This is a blind attempt to implement HIDDEN nodes. It is highly suspect because the author could not build or test the result, and is new to this codebase.

A HIDDEN node is a node which will only render in the page tree if it's currently being viewed. (This behavior is known to currently be incorrect, and will be repaired before merge once buildable.)

The purpose of a HIDDEN node is to allow a category page to include hundreds of pages underneath, and not flood the index on the right. HIDDEN nodes must be found from a listing in another page, or through search.

My personal use case is for the documentation for a state machine library. I want to include more than 200 example state machines, each on their own page, which is prohibitive without a feature like this.

GerkinDev and others added 3 commits May 28, 2022 19:47
…tomatically, and build once on install. Also, stub the standard build call to point to project build. Currently untested due to KnodesCommunity#82
@GerkinDev
Copy link
Member

Please rebase your branch. You should be good to go now

@StoneCypher
Copy link
Author

@GerkinDev - I might be being dense, but, the repo doesn't show a push in the last couple weeks; maybe something didn't get pushed? Or maybe I'm not getting it

@GerkinDev
Copy link
Member

You're supposed to base features on the develop branch, not main. Main is for released code only.

@StoneCypher
Copy link
Author

oh you use git flow, ok, sorry

@StoneCypher
Copy link
Author

Sorry, no, the situation is unchanged, I believe.

Because I am noticably bad at things like rebasing and submodules, I established a new clean setup.

In this order, I:

  • Created a new directory, and worked there
  • Cloned your repo, instead of my own
  • Updated submodules
  • Initialized npm workspaces
  • Switched to your repo's develop branch, not my PR
  • Ran npm install
  • Ran npm run projects:build

The error is the same as previously, I believe.

image

john@DESKTOP-26H4050 MINGW64 /e/projects
$ mkdir tmp-host-copy

john@DESKTOP-26H4050 MINGW64 /e/projects
$ cd tmp-host-copy/

john@DESKTOP-26H4050 MINGW64 /e/projects/tmp-host-copy
$ git clone https://github.com/KnodesCommunity/typedoc-plugins.git
Cloning into 'typedoc-plugins'...
remote: Enumerating objects: 2026, done.
remote: Counting objects: 100% (470/470), done.
remote: Compressing objects: 100% (170/170), done.
Receiving objects: 100% (2026/2026), 1.22 MiB | 3.40 MiB/s, done.ed 1556

Resolving deltas: 100% (1316/1316), done.

john@DESKTOP-26H4050 MINGW64 /e/projects/tmp-host-copy
$ cd typedoc-plugins/

john@DESKTOP-26H4050 MINGW64 /e/projects/tmp-host-copy/typedoc-plugins (main)
$ git submodule update --init --recursive
Submodule 'typedoc' (https://github.com/TypeStrong/typedoc.git) registered for path 'typedoc'
Cloning into 'E:/projects/tmp-host-copy/typedoc-plugins/typedoc'...
Submodule path 'typedoc': checked out 'abed9a64d674c6c3b20284847c024abd5334547b'

john@DESKTOP-26H4050 MINGW64 /e/projects/tmp-host-copy/typedoc-plugins (main)
$ npm i --workspaces

> @knodes/[email protected] prepare
> npm run prepare:husky


> @knodes/[email protected] prepare:husky
> [ -d ./node_modules/husky ] && husky install || true


added 708 packages, and audited 714 packages in 40s

found 0 vulnerabilities

john@DESKTOP-26H4050 MINGW64 /e/projects/tmp-host-copy/typedoc-plugins (main)
$ git checkout develop
Switched to a new branch 'develop'
M       typedoc
Branch 'develop' set up to track remote branch 'develop' from 'origin'.

john@DESKTOP-26H4050 MINGW64 /e/projects/tmp-host-copy/typedoc-plugins (develop)
$ npm install
npm WARN deprecated @types/[email protected]: This is a stub types definition. concurrently provides its own type definitions, so you do not need this installed.
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: Moved to 'npm install @sideway/address'
npm WARN deprecated @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/[email protected]: Switch to 'npm install joi'

> @knodes/[email protected] prepare
> npm run prepare:husky


> @knodes/[email protected] prepare:husky
> [ -d ./node_modules/husky ] && husky install || true

husky - Git hooks installed

added 108 packages, removed 51 packages, changed 182 packages, and audited 771 packages in 32s

found 0 vulnerabilities

john@DESKTOP-26H4050 MINGW64 /e/projects/tmp-host-copy/typedoc-plugins (develop)
$ npm run projects:build

> @knodes/[email protected] projects:build
> npm run projects:patch -- apply && node ./tools/s-projects 'npm run build -- --pretty'


> @knodes/[email protected] projects:patch
> node ./tools/typedoc-patcher --no-stash "apply"

Applying patches from packages/plugin-pages/src/theme-plugins/search/default-pages-javascript-index-plugin.GENERATED.ts.patch
node:internal/process/promises:246
          triggerUncaughtException(err, true /* fromPromise */);
          ^

AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

  assert( match && match[1] )

    at E:\projects\tmp-host-copy\typedoc-plugins\tools\typedoc-patcher.js:28:2
    at async E:\projects\tmp-host-copy\typedoc-plugins\tools\typedoc-patcher.js:123:100
    at async Promise.all (index 0)
    at async E:\projects\tmp-host-copy\typedoc-plugins\tools\typedoc-patcher.js:123:31 {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: null,
  expected: true,
  operator: '=='
}

Node.js v17.2.0

@GerkinDev
Copy link
Member

You've checked out typedoc before checking out the develop branch. So I'm not sure the typedoc submodule is at the expected commit to apply the patch.

So, I totally understand this "patch" thing is a hell. It is indeed. It should be simplified for a while when TypeStrong/typedoc#1953 is resolved, until I need to follow the same pattern on another plugin (and I pray I won't)

@StoneCypher
Copy link
Author

You've checked out typedoc before checking out the develop branch. So I'm not sure the typedoc submodule is at the expected commit to apply the patch.

Wait, the ... the git submodules are different according to branches?

 

So, I totally understand this "patch" thing is a hell.

Honestly it's mostly the submodules that have been causing me trouble

@StoneCypher
Copy link
Author

no, the same build failure happens if i check out develop first

@GerkinDev
Copy link
Member

You've checked out typedoc before checking out the develop branch. So I'm not sure the typedoc submodule is at the expected commit to apply the patch.

Wait, the ... the git submodules are different according to branches?

Yes, it targets the latest typedoc stable release (currently 0.22.17) in order to avoid possibly regressing release as soon as typedoc updates one of the patched files.

Ok this is strange. I'll check on my windows tonight

@StoneCypher
Copy link
Author

ok, that fix appears to work

@GerkinDev
Copy link
Member

Hi there;

I'm finally looking for a way to implement this feature.

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.

2 participants