-
Notifications
You must be signed in to change notification settings - Fork 709
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
cannot use symlinked entry points with 'packages' strategy #2130
Comments
We used to depend on |
My reasoning for using a 3p package is the test coverage and handling of edge cases, which I prioritize over often-of-dubious-impact CVEs. Anyway, I can see it from both angles, so I'll just do what you prefer here. |
Closes TypeStrong#2130 This adds a `followSymlinks` option to the `glob()` function, and enables it when searching for entry points. If `true`, and a symbolic link is encountered, a stat will be taken of the symlink's target. If a dir or file, the symlink is handled like any other dir or file. If a symbolic link itself (symlink to a symlink), we take a stat of the next until we find a dir or file, then handle it. There is a little bit of caching to avoid extra I/O, and protection from recursive symlinks. However, it's possible (though unlikely) that the FS could cause a "max call stack exceeded" exception. If someone runs into this, we can change the implementation to a loop instead of a recursive function. Apologies for blasting the `do..while`. I love a good `do` myself, but splitting out the lambda functions make it untenable.
E2E tests are quasi-blocking on merge & release of TypeStrong/typedoc#2130; it is a huge pain to test without this. - Adds some options to control output - Rename `CommandsReflection` to `ExtensionReflection` due to poor granular control over the display name - Rename the custom "kinds"; add kinds for drivers and plugins (which affects display titles) - Remove namespace from "kinds" for same reason - Refactors, reformatting - Rename entry point from `plugin.ts` to `index.ts` - Update keywords in `package.json` for auto-discovery - Remove cruft from root `typedoc.json` - Update `README.md`
Closes TypeStrong#2130 This adds a `followSymlinks` option to the `glob()` function, and enables it when searching for entry points. If `true`, and a symbolic link is encountered, a stat will be taken of the symlink's target. If a dir or file, the symlink is handled like any other dir or file. If a symbolic link itself (symlink to a symlink), we take a stat of the next until we find a dir or file, then handle it. There is a little bit of caching to avoid extra I/O, and protection from recursive symlinks. However, it's possible (though unlikely) that the FS could cause a "max call stack exceeded" exception. If someone runs into this, we can change the implementation to a loop instead of a recursive function. Apologies for blasting the `do..while`. I love a good `do` myself, but splitting out the lambda functions make it untenable.
E2E tests are quasi-blocking on merge & release of TypeStrong/typedoc#2130; it is a huge pain to test without this. - Adds some options to control output - Rename `CommandsReflection` to `ExtensionReflection` due to poor granular control over the display name - Rename the custom "kinds"; add kinds for drivers and plugins (which affects display titles) - Remove namespace from "kinds" for same reason - Refactors, reformatting - Rename entry point from `plugin.ts` to `index.ts` - Update keywords in `package.json` for auto-discovery - Remove cruft from root `typedoc.json` - Update `README.md` - Update peer dependencies; the other plugins must be peer deps or typedoc will be unable to auto-discover them
E2E tests are quasi-blocking on merge & release of TypeStrong/typedoc#2130; it is a huge pain to test without this. - Adds some options to control output - Rename `CommandsReflection` to `ExtensionReflection` due to poor granular control over the display name - Rename the custom "kinds"; add kinds for drivers and plugins (which affects display titles) - Remove namespace from "kinds" for same reason - Refactors, reformatting - Rename entry point from `plugin.ts` to `index.ts` - Update keywords in `package.json` for auto-discovery - Remove cruft from root `typedoc.json` - Update `README.md` - Update peer dependencies; the other plugins must be peer deps or typedoc will be unable to auto-discover them
E2E tests are quasi-blocking on merge & release of TypeStrong/typedoc#2130; it is a huge pain to test without this. - Adds some options to control output - Rename `CommandsReflection` to `ExtensionReflection` due to poor granular control over the display name - Rename the custom "kinds"; add kinds for drivers and plugins (which affects display titles) - Remove namespace from "kinds" for same reason - Refactors, reformatting - Rename entry point from `plugin.ts` to `index.ts` - Update keywords in `package.json` for auto-discovery - Remove cruft from root `typedoc.json` - Update `README.md` - Update peer dependencies; the other plugins must be peer deps or typedoc will be unable to auto-discover them
E2E tests are quasi-blocking on merge & release of TypeStrong/typedoc#2130; it is a huge pain to test without this. - Adds some options to control output - Rename `CommandsReflection` to `ExtensionReflection` due to poor granular control over the display name - Rename the custom "kinds"; add kinds for drivers and plugins (which affects display titles) - Remove namespace from "kinds" for same reason - Refactors, reformatting - Rename entry point from `plugin.ts` to `index.ts` - Update keywords in `package.json` for auto-discovery - Remove cruft from root `typedoc.json` - Update `README.md` - Update peer dependencies; the other plugins must be peer deps or typedoc will be unable to auto-discover them
E2E tests are quasi-blocking on merge & release of TypeStrong/typedoc#2130; it is a huge pain to test without this. - Adds some options to control output - Rename `CommandsReflection` to `ExtensionReflection` due to poor granular control over the display name - Rename the custom "kinds"; add kinds for drivers and plugins (which affects display titles) - Remove namespace from "kinds" for same reason - Refactors, reformatting - Rename entry point from `plugin.ts` to `index.ts` - Update keywords in `package.json` for auto-discovery - Remove cruft from root `typedoc.json` - Update `README.md` - Update peer dependencies; the other plugins must be peer deps or typedoc will be unable to auto-discover them
Search terms
symlink
Expected Behavior
It should find the entry point in e.g.,
node_modules/foo
whenfoo
is a symlink to a package that contains atsconfig.json
and/or atypedoc.entryPoint
in itspackage.json
Actual Behavior
TypeDoc does not find the entry point.
Steps to reproduce the bug
foo
w/typedoc.json
containing an entry point that is a symlinked package (e.g., vianpm link
).tsconfig.json
and appropriate entry point infoo
entryPointStrategy
topackages
.typedoc --logLevel Verbose
; note that it only finds the entry point fromfoo
.Environment
I would be willing to open a PR to address this, but I'm of the opinion that a battle-tested external library should probably be pulled in rather than add further complexity to the current implementation. What do you think?
The text was updated successfully, but these errors were encountered: