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
Fails to identify name/version due to the presence of an unexpected package.json #2190
Comments
Another solution would be to add a configuration option like This would be preferred and also consistent with Note: in my project there is also a It would be natural to also specify |
It seems reasonable to me to ignore a package.json if there is no name field, should take care of the esm use case. The packageJson option might not be necessary then. |
Sure, the first solution is more automated, but would probably require a bit more effort to implement. |
If this problem was fixed by 63a521c, you can close this issue. |
I leave issues open until the fix has been released - this is a part of 0.24, so isn't out yet |
Here is a suggestion. After playing with typedoc, I realise that we don't necessarily want the version tag from Is it possible more flexible to specify a |
There was also an alternate suggestion to use --packageJson to pass any file path. |
Actually now that I think about it, passing command line arguments( either for packageJson or version) is probably the wrong way philosophically If we are dealing with monorepos. |
Could you elaborate? What might be wrong with command line arguments? |
What I am mentioning should be related to monorepos, particularly the use One "workaround" is to assume that all subpackages share the same version. The default lerna strategy for this is the Fixed/Locked mode but there is alternative strategy called Independent mode. In Independent mode we cannot assume each subpackage share the same version I presume this is a general matter of using npm/yarn workspaces |
Perhaps the other |
@tintinthong, I'm afraid I can't be of much help, I personally split all my projects into separate small, independent repos, with separate CI tests, so I don't encounter the issues you mentioned. |
@Gerrit0 does that make sense? Just a question related. Is there a plugin example that modifies the app state? Since maybe I can write a plugin that does this that changes the behaviour of typedoc a bit |
Basically every plugin modifies some typedoc behavior... a 0.24 completely reworks packages mode so that it effectively runs TypeDoc in each package directory, then merges the results together, so versions in packages/foo/package.json will be correctly applied |
thanks for the clarification. Actually good idea to wait on 0.24 before making any changes. My workaround currently is to fork the |
Search terms
warning name version package.json
Expected Behavior
Pick the name & version from the project
package.json
.Actual Behavior
Tries to get the name and version from
src/package.json
and fails, since in that file there is only atype: module
definition, (required by the dual CommonJS/ES6 module nature of the project).Steps to reproduce the bug
Assuming the entry point is
src/index.ts
, add a minimalsrc/package.json
like:This will confuse
typedoc
, which will no longer be able to identify the name/version:I think that a better strategy would be to iterate to the parent folder and try to read the name/version from there, until the project root is reached.
As a partial workaround, I also added the project name to this short
package.json
, but the version remained undefined.Environment
The text was updated successfully, but these errors were encountered: