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

+findConfigUpwards(rootDir: string): string #122

Open
Antonytm opened this issue Mar 22, 2024 · 3 comments
Open

+findConfigUpwards(rootDir: string): string #122

Antonytm opened this issue Mar 22, 2024 · 3 comments

Comments

@Antonytm
Copy link

I get

[From string (line 3) ]
@startuml
+findConfigUpwards(rootDir: string): string
Syntax Error?

when trying to generate documentation for @sitecore/jss

I assume it might be related to

"extends": "../../tsconfig.json",

in tsconfig.json

@Antonytm
Copy link
Author

Steps to reproduce:

  1. Clone https://github.com/Sitecore/jss/
  2. Install tsplant npm install --global tplant
  3. Run `tplant --input packages/sitecore-jss-nextjs/**/*.ts --output Playground.svg

Expected result: SVG should be generated
Actual result:

This page contains the following errors:
error on line 634 at column 19: XML declaration allowed only at the start of the document
Below is a rendering of the page up to the first error.
[From string (line 3) ]
@startuml
+findConfigUpwards(rootDir: string): string | null
Syntax Error?

@fuhrmanator
Copy link
Contributor

I also have this problem with another project. It is due to a bug (that I fixed in a PR #121 (comment)) where tplant puts functions (which are not UML methods) into the PlantUML (and they appear outside of classes, thus causing PlantUML to crash).

For example, https://github.com/babel/babel/blob/0417c41e5982b8e49477227dc8fc20f16eb61e4c/packages/babel-core/src/config/files/configuration.ts#L212 shows that it's not a method (export function).

I suspect the npm package didn't get built/published properly. I also noticed that tplant -V says 3.1.2, whereas it should have been bumped to 3.1.3 according to the npm package.

I just cloned and built the code from the repo here, and I don't have the problem with functions going into the PlantUML. However, if I run it from the latest npm install tplant, I see the functions there.

@fuhrmanator
Copy link
Contributor

fuhrmanator commented May 27, 2024

It works for me if I install the 3.1.2 3.1.0 version:

npm install -g [email protected]

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