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

Generates Filenames with special chars #611

Open
Apollon77 opened this issue May 10, 2024 · 5 comments
Open

Generates Filenames with special chars #611

Apollon77 opened this issue May 10, 2024 · 5 comments
Labels

Comments

@Apollon77
Copy link

What package is the bug related to?

typedoc-plugin-markdown

Describe the issue

I used the 4.0.1 on https://github.com/project-chip/matter.js with the updated config in project-chip/matter.js#875 and got this warning:

Some of the file names contain characters that are not allowed on Windows: 'TlvObject"'. If you commit, it might not be possible to check out the Git repository on Windows.

So it seems he used double quotes in a filename ... in fact I locally then found various files in a directory called " in the namespaces directory

find . -name '"*'
./docs/matter-node-ble.js/-internal-/namespaces/"
./docs/matter-node.js/exports/cluster/-internal-/namespaces/"
./docs/matter-node.js/exports/certificate/-internal-/namespaces/"
./docs/matter-node.js/exports/datatype/-internal-/namespaces/"
./docs/matter-node.js/exports/schema/-internal-/namespaces/"

After that also lookin in the error sof process if found eg

[warning] Failed to resolve link to "MatterSpecification.v10.Core" in comment for ."/Users/ingof/Dev/GitHub/official-matter.js/packages/matter.js/dist/esm/tlv/TlvObject".ObjectSchema.

Something is wrong here and he created a "full path" directory somehow.

The repo told above is a public one, so you can easiely test yourself

TypeDoc configuration

see project-chip/matter.js#875

basically:

"typedocOptions": {
"entryPoints": [...],
"plugin": ["typedoc-plugin-missing-exports", "typedoc-plugin-markdown"],
"excludeExternals": true,
"parametersFormat": "table",
"membersWithOwnFile": ["Class", "Enum", "Interface"],
"out": "..."
}

Expected behavior

No invalid paths/filenames are generated

@tgreyuk
Copy link
Member

tgreyuk commented May 10, 2024

Thanks.

So its included a fullpath in the name because the symbol represents a module that's been imported from the local file system. This is actually the typescript symbol name created when converting the project. Now there is a bug here (which will be fixed) but the fix will be to normalize the name so it doesn't try to create a weird file path.

If you don't want the fullpath in the module name what you can do is to override the module name as follows:

packages/matter.js/src/tlv/TlvObject.ts

Screenshot 2024-05-10 at 14 54 57

@Apollon77
Copy link
Author

Hm ... Why this was no issue before 4.0? How to achieve the same result as in 3.x?

@tgreyuk
Copy link
Member

tgreyuk commented May 10, 2024

Hm ... Why this was no issue before 4.0? How to achieve the same result as in 3.x?

The module name is not a new issue (see output from v3). This is the resolved name from the ts compiler and also what you will see in the default html theme.

Screenshot 2024-05-10 at 16 50 45

As I say - there will be a fix to the file paths coming shortly.

@tgreyuk
Copy link
Member

tgreyuk commented May 15, 2024

Fix to file paths is available in typedoc-plugin-markdown@4.0.2. As previouslly mentioned the file path in the symbol name is not coming from this plugin.

@Apollon77
Copy link
Author

Apollon77 commented May 24, 2024

Ok, thank you! I will verify soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants