You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Yeah, I know, globals again. I would also like to use modules, but that's hard to impossible for large existing projects. primefaces/primefaces#12717)
When you have a global script file (without import / export) and a module file that both amend a namspace in the global scope, typedoc seems to consider these as different.
When using the plugin typedoc-plugin-merge-modules, that results in the namespaces not getting merged. But I think the issue is not with the plugin, as it seems to happen even without the plugin. For example:
// base.tsnamespacePrimeFaces{exportinterfaceWindowExtensions{}}interfaceWindowextendsPrimeFaces.WindowExtensions{}// src/a.tsimport"./module.js";// make this a module filedeclare global {namespacePrimeFaces{exportinterfaceWindowExtensions{a: string;}}}// src/b.ts// similar a.ts// src/c.tsnamespacePrimeFaces{exportinterfaceWindowExtensions{c: string;}}// src/d.ts// similar to c.ts// index.tsconsole.log(window.a,window.b,window.c,window.d);
Now when generate docs from that, d/PrimeFaces is marked as a re-export of c/PrimeFaces. But a/PrimeFaces and b/PrimeFaces are not and contain only a and b, respectively. Interestingly enough though, c/PrimeFaces contains all of a, b, c and d.
With typedoc-plugin-merge-modules, that then results in duplicates:
Repro
git clone https://github.com/blutorange/primefaces-js-refactor-test.git
cd primefaces-js-refactor-test/
git checkout demo-typedoc-merge-script-module
yarn install
yarn tsc # note that this compiles, so all interfaces point to the same thing
yarn typedoc --out docs src/index.ts src/a.ts src/b.ts src/c.ts src/d.ts src/module.ts
open docs/index.html
The text was updated successfully, but these errors were encountered:
Search Terms
declaration merging declare global script module
Problem
(Yeah, I know, globals again. I would also like to use modules, but that's hard to impossible for large existing projects. primefaces/primefaces#12717)
When you have a global script file (without import / export) and a module file that both amend a namspace in the global scope, typedoc seems to consider these as different.
When using the plugin
typedoc-plugin-merge-modules
, that results in the namespaces not getting merged. But I think the issue is not with the plugin, as it seems to happen even without the plugin. For example:Now when generate docs from that,
d/PrimeFaces
is marked as a re-export ofc/PrimeFaces
. Buta/PrimeFaces
andb/PrimeFaces
are not and contain onlya
andb
, respectively. Interestingly enough though,c/PrimeFaces
contains all ofa
,b
,c
andd
.With
typedoc-plugin-merge-modules
, that then results in duplicates:Repro
The text was updated successfully, but these errors were encountered: