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

Not sure how to build #84

Closed
StoneCypher opened this issue Jun 13, 2022 · 19 comments
Closed

Not sure how to build #84

StoneCypher opened this issue Jun 13, 2022 · 19 comments

Comments

@StoneCypher
Copy link

Want to add a feature for hidden pages, so that I can add a huge list of subpages and not spam the index

First step is to fork, build, and install locally

npm install && npm run build

Oh, there's ... no build. Okay. Let's look at the package. There's a projects:build.

$ 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\typedoc-plugins\tools\typedoc-patcher.js:28:2
    at async E:\projects\typedoc-plugins\tools\typedoc-patcher.js:118:100
    at async Promise.all (index 0)
    at async E:\projects\typedoc-plugins\tools\typedoc-patcher.js:118:31 {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: null,
  expected: true,
  operator: '=='
}

Node.js v17.2.0

Er.

There's no gh action to mimic

Not really sure how to get this to build.

@GerkinDev
Copy link
Member

GerkinDev commented Jun 14, 2022

Hi, yeah, I should complete the readme with a proper how-to.

You need to clone the typedoc submodule. In fact, a couple of files are auto-generated by patching files from the submodule (typically, the javascript index plugin).

So, it should be something like the following

git submodule init --recursive
npm i --workspaces
npm run projects:build

I'll complete the readme with those instructions next time I do an iteration on that repo.

@StoneCypher
Copy link
Author

git submodule init --recursive

Not a thing. Ended up doing git submodule update --init --recursive because StackUnderthink.

 

npm i --workspaces

Works

 

npm run projects:build

No change.

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





john@DESKTOP-26H4050 MINGW64 /e/projects/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

husky - Git hooks installed

up to date, audited 782 packages in 3s

found 0 vulnerabilities





john@DESKTOP-26H4050 MINGW64 /e/projects/typedoc-plugins (main)
$ 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\typedoc-plugins\tools\typedoc-patcher.js:28:2
    at async E:\projects\typedoc-plugins\tools\typedoc-patcher.js:118:100
    at async Promise.all (index 0)
    at async E:\projects\typedoc-plugins\tools\typedoc-patcher.js:118:31 {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: null,
  expected: true,
  operator: '=='
}

Node.js v17.2.0

@GerkinDev
Copy link
Member

Yeah you're right about the command to update submodule, I told you the command as I remembered, but you're absolutely right. Thank you.

That probably means that the file recently changed @ the typedoc level, preventing the patch from being applied correctly. I might be able to take care of this this w-e, and maybe before that. Sry about that

@StoneCypher
Copy link
Author

I'll fix the rest for you if you get that one step 😄

I have an implementation of my feature. It's probably wrong; I haven't been able to try it yet.

I can't push it to Github because this stack has put its own code into the git process with husky hooks, meaning I'm not able to use git until the bug is fixed. (In general, I feel that husky is an extreme mistake on grounds like this, and that github actions is the correct place to do things like that.)

@StoneCypher
Copy link
Author

StoneCypher commented Jun 15, 2022

$ git status
On branch HiddenPages
Your branch is up to date with 'FixScripts'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   package.json
        modified:   packages/plugin-pages/src/plugin.ts
        modified:   packages/plugin-pages/src/theme-plugins/page-tree/a-page-tree-builder.spec.ts
        modified:   packages/plugin-pages/src/theme-plugins/page-tree/a-page-tree-builder.ts


john@DESKTOP-26H4050 MINGW64 /e/projects/typedoc-plugins (HiddenPages)
$ git add . && git commit -m "There is no way to commit"

> @knodes/[email protected] precommit
> npm run projects:patch -- diff && npm run lint -- --cache && npm run projects:build && npm run projects:test -- --onlyChanged && npm run docs


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

Generating patches on

> @knodes/[email protected] lint
> eslint --ignore-path ./.eslintignore '**/?(.)*.?([cm])[tj]s?(x)' "--cache"


Oops! Something went wrong! :(

ESLint: 8.14.0

No files matching the pattern "'**/?(.)*.?([cm])[tj]s?(x)'" were found.
Please check for typing mistakes in the pattern.

husky - pre-commit hook exited with code 2 (error)

john@DESKTOP-26H4050 MINGW64 /e/projects/typedoc-plugins (HiddenPages)
$ git status
On branch HiddenPages
Your branch is up to date with 'FixScripts'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   package.json
        modified:   packages/plugin-pages/src/plugin.ts
        modified:   packages/plugin-pages/src/theme-plugins/page-tree/a-page-tree-builder.spec.ts
        modified:   packages/plugin-pages/src/theme-plugins/page-tree/a-page-tree-builder.ts

@GerkinDev
Copy link
Member

Go with git commit --no-verify.

@StoneCypher
Copy link
Author

StoneCypher commented Jun 15, 2022

PR #88 will make it so that you do not have to document or explain git submodules or npm workspaces. Once the patch is working again, this should be ready for merge.

PR #89 is the feature I would like to develop. It is currently known to be incorrect and is not ready for merge, but what it does should be generally clear, so if you'd like to see what my goal is, and tell me whether you think it fits, it's at least ready to be looked at. Nice and short.

@GerkinDev
Copy link
Member

GerkinDev commented Jun 19, 2022

Hi,
So, I've started the update & check of the package. The issue you encountered was expected & by design: the javascript index being a replacement of the typedoc built-in plugin, I forced the workflow to follow strictly updates from the typedoc upstream, to avoid releases of new versions not implementing typedoc new features from this plugin.

I had to do this because typedoc does not expose customization of how reflection were mapped in the search index.

I am checking if this override can be dropped, since they recently added the ability to customize search weights from reflection properties.

Please note that this customization originates from another unmaintained project that used this strategy, and the plugin-pages is a fork of it.

More infos tomorrow.

@StoneCypher
Copy link
Author

Great, thanks.

@GerkinDev
Copy link
Member

Well, DUH, I made my scripts for unix-like newlines only. Fix is ready and I'm pushing it

@StoneCypher
Copy link
Author

not sure if i'm looking in the wrong place, but it seems like neither this repo nor the -pages plugin repo, on main or develop, got updated

@GerkinDev
Copy link
Member

GerkinDev commented Jun 25, 2022

Yeah I have a life and my wife was kinda upset I was still working yesterday at 10pm, which I already did up to midnight for 2 weeks in a row. I do as much as I can, sorry.
But I have :

  • a full-time job as a senior fullstack
  • a freelance mission I'm releasing in production for next week
  • my own company project I do everything techy for (front, back, software architecture, db, infrastructure)
  • and a couple of OS projects such as this one.

I know you're of good will and want to bring a nice feature, and I'm glad you want to. But I'm already at full pressure right now.

The build system fix commit is done on my machine. There is just another behavioral commit left to unify behavior across posix & windows. All tests are green, I just have to commit this and push.

I should have the time to do it tonight, after taking care of my family life just a bit.

@StoneCypher
Copy link
Author

ok sorry i was just reacting to "Fix is ready and I'm pushing it," thought maybe it got forgotten

@GerkinDev
Copy link
Member

Well I realized after that comment that there was also inconsistencies between shells in windows VS posix, and quite serious problems in the patching system for windows. I usually avoid that OS as much as I can, so I usually don't have to take those problems into consideration. I do it only for you.

@StoneCypher
Copy link
Author

Well I realized after that comment that there was also inconsistencies between shells in windows VS posix, and quite serious problems in the patching system for windows. I usually avoid that OS as much as I can, so I usually don't have to take those problems into consideration.

If you can show me where your patch is, I'll finish it

 

there was also inconsistencies between shells in windows VS posix

The shell shouldn't be involved on any platform

 

I do it only for you.

I feel like I should remind you that most people are on Windows

GerkinDev added a commit that referenced this issue Jun 25, 2022
@GerkinDev
Copy link
Member

GerkinDev commented Jun 25, 2022

Patch is pushed.
Npm run spawns a subshell.
Unix is majoritary https://insights.stackoverflow.com/survey/2021#section-most-popular-technologies-operating-system

@StoneCypher
Copy link
Author

ty for the patch

@GerkinDev
Copy link
Member

Can I close this issue now ?

@StoneCypher
Copy link
Author

Oh, sorry, thought I did already. Yes, please feel free. My mistake

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

No branches or pull requests

2 participants