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

Using packageNameMapper does not fix the usages of the moved classes #27

Open
Vampire opened this issue Sep 17, 2024 · 0 comments
Open

Comments

@Vampire
Copy link
Contributor

Vampire commented Sep 17, 2024

If you apply this in a try to work-around #26:

diff --git a/test/functional/top-level/lib/index.d.ts b/test/functional/top-level/lib/index.d.ts
index 6f79e05..51223b1 100644
--- a/test/functional/top-level/lib/index.d.ts
+++ b/test/functional/top-level/lib/index.d.ts
@@ -13,6 +13,8 @@ function myFunction2(firstParam: string, secondParam: number): void

 function myFunction2(firstParam: boolean, secondParam: number): void

+function myFunction3(param: foo.MyEnum): void
+
 class MyClass {
     field: boolean
 }
@@ -23,7 +25,9 @@ interface MyInterface {

 type MyTypeAlias = string

-enum MyEnum {
-    FIRST,
-    SECOND,
+namespace foo {
+    enum MyEnum {
+        FIRST,
+        SECOND,
+    }
 }
diff --git a/test/functional/top-level/top-level.test.ts b/test/functional/top-level/top-level.test.ts
index a053b86..c678a27 100644
--- a/test/functional/top-level/top-level.test.ts
+++ b/test/functional/top-level/top-level.test.ts
@@ -4,9 +4,16 @@ testGeneration("top-level", import.meta.url, output => ({
     input: "lib/**",
     output,
     libraryName: "sandbox-top-level",
+    libraryNameOutputPrefix: true,
     granularity: "top-level",
     moduleNameMapper: {
         ".*": "sandbox-top-level"
     },
+    namespaceStrategy: {
+        "foo": "package"
+    },
+    packageNameMapper: {
+        "^foo/": "sandbox/top/level/foo/"
+    },
     verbose: true,
 }))

the myFunction3 still uses foo.MyEnum instead of sandbox.top.level.foo.MyEnum which of course does not compile.

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

1 participant